Developer Conference 2007 RFID App Development James Peternel Software Engineer Lead Partnering to Develop Powerful Solutions Overview Developing an RFID application in C# VS 2005 Basic functions and event handlers Focus on IF61 reader Developer Conference 2007 Slide 2 Create Basic Project in C# Select Windows Application Developer Conference 2007 Slide 3 RFID References Add RFID class references to your project Developer Conference 2007 Slide 4 RFID References using Intermec.DataCollection.RFID; Developer Conference 2007 Slide 5 Now lets add the basic features to your app Create reader object Add Event Handlers Add Tag Handlers Developer Conference 2007 Slide 6 Create RFID Object LocalHost string tConnection = "TCP://" + "127.0.0.1" + ":2189"; Defaults brdr = new BRIReader(null, tConnection); With Options Read buffer size Event buffer size BRIReader.LoggerOptionsAdv LogOp = new BRIReader.LoggerOptionsAdv(); LogOp.LogFilePath = ".\\IDLClassDebugLog.txt"; LogOp.ShowNonPrintableChars = true; brdr = new BRIReader(this, tConnection, 22000, 2000,LogOp); Developer Conference 2007 Slide 7 Create Event Handlers private int AddEventHandlers() { //********************************************************************* // Add the event handler to handle the tag events and trigger pulls. // Not all of these are used but added as samples of what are available. //********************************************************************* try { this.brdr.EventHandlerRadio += new Radio_EventHandlerAdv(brdr_EventHandlerRadio); this.brdr.EventHandlerTag += new Tag_EventHandlerAdv(brdr_EventHandlerTag); this.brdr.EventHandlerGPIO += new GPIO_EventHandlerAdv(Form1_EventHandlerGPIO); } catch { return -1; } return 0; } Developer Conference 2007 Slide 8 Tag Event Handler this.brdr.StartReadingTags(null, "COUNT ANT", BRIReader.TagReportOptions.EVENT); void brdr_EventHandlerTag(object sender, EVTADV_Tag_EventArgs EvtArgs) { //********************************************************************* // This function process any tag that is returned as an event. // This function is in use when you send a READ with REPORT=EVENT //********************************************************************* bool bStatus = false; RspCount = 1; RspMsgList[1] = EvtArgs.DataString.ToString(); bStatus = CheckIfTagIDIsInDBase(RspMsgList[1]); } Developer Conference 2007 Slide 9 Polling For Tags (Report=No) this.brdr.StartReadingTags(null, "COUNT ANT", BRIReader.TagReportOptions.POLL); bStatus = brdr.PollTags(); foreach (Tag tt in brdr.Tags) { RspCount++; RspMsgList[RspCount] = tt.ToString(); if (tt.TagFields.ItemCount > 0) { foreach (TagField tf in tt.TagFields.FieldArray) { RspMsgList[RspCount] += " "; RspMsgList[RspCount] += tf.ToString(); } } } Developer Conference 2007 Slide 10 Add GPIO Event Handler void Form1_EventHandlerGPIO(object sender, EVTADV_GPIO_EventArgs EvtArgs) { //process gpio trigger events if (EvtArgs.TriggerNameString.Equals("ENTER_ON")) { //your code here } else if (EvtArgs.TriggerNameString.Equals("EXIT_ON")) { //your code here } } Developer Conference 2007 Slide 11 How to Install App on IF61 Create .zip file with your .exe and any dll files. Create userapp.conf file AUTOSTART=false RUNAFTERINSTALL=false CMDLINE=./ConsoleApplication2.exe Add userapp.conf file to the .zip file For Java you will need to add full path information Developer Conference 2007 Slide 12 IF61: Network Configuration Menu Select Common link Developer Conference 2007 Slide 13 IF61: Network Configuration->Common Add Syslog Destination (IP or localhost) Developer Conference 2007 Slide 14 IF61: Network->Services Make sure you have FTP server enabled Developer Conference 2007 Slide 15 IF61: Edgeware Applications Go to Edgeware Applications and select Application Control link Developer Conference 2007 Slide 16 IF61: Edgeware Applications-> Application Control Check the Redirect output from user applications to the system log box Developer Conference 2007 Slide 17 IF61: Edgeware Applications -> Install User Application Select .zip or .tar file to upload Developer Conference 2007 Slide 18 IF61: Edgeware Applications -> Application Control To run your application just click ACTION Developer Conference 2007 Slide 19 IF61: Edgeware Applications -> Application Control To update your application, click Uninstall and then install the new zip file Developer Conference 2007 Slide 20 Run app on IF61 Can monitor your application using an app such as KLog.exe or TcpipWin32.exe, both shareware, use at your own risk. Make sure you kill your firewall. It may block this. Developer Conference 2007 Slide 21 Thank you. Developer Conference 2007 Slide 22