Upload
guido
View
34
Download
0
Embed Size (px)
DESCRIPTION
RFID App Development James Peternel Software Engineer Lead. Overview. Developing an RFID application in C# VS 2005 Basic functions and event handlers Focus on IF61 reader. Create Basic Project in C#. Select Windows Application. RFID References. Add RFID class references to your project. - PowerPoint PPT Presentation
Citation preview
Developer Conference 2007
Partnering to Develop Powerful Solutions
RFID App DevelopmentJames Peternel
Software Engineer Lead
Slide 2 Developer Conference 2007
Overview
Developing an RFID application in C# VS 2005Basic functions and event handlersFocus on IF61 reader
Slide 3 Developer Conference 2007
Create Basic Project in C#
Select Windows Application
Slide 4 Developer Conference 2007
RFID References
Add RFID class references to your project
Slide 5 Developer Conference 2007
RFID References
using Intermec.DataCollection.RFID;
Slide 6 Developer Conference 2007
Now lets add the basic features to your app
Create reader objectAdd Event HandlersAdd Tag Handlers
Slide 7 Developer Conference 2007
Create RFID Object
LocalHoststring tConnection = "TCP://" + "127.0.0.1" + ":2189";
Defaultsbrdr = new BRIReader(null, tConnection);
With OptionsRead buffer sizeEvent buffer size
BRIReader.LoggerOptionsAdv LogOp = new BRIReader.LoggerOptionsAdv();LogOp.LogFilePath = ".\\IDLClassDebugLog.txt";LogOp.ShowNonPrintableChars = true;brdr = new BRIReader(this, tConnection, 22000, 2000,LogOp);
Slide 8 Developer Conference 2007
Create Event Handlersprivate 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; }
Slide 9 Developer Conference 2007
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]);}
Slide 10 Developer Conference 2007
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(); } } }
Slide 11 Developer Conference 2007
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 }}
Slide 12 Developer Conference 2007
How to Install App on IF61
Create .zip file with your .exe and any dll files.Create userapp.conf file
AUTOSTART=falseRUNAFTERINSTALL=falseCMDLINE=./ConsoleApplication2.exe
Add userapp.conf file to the .zip fileFor Java you will need to add full path information
Slide 13 Developer Conference 2007
IF61: Network Configuration Menu
Select Common link
Slide 14 Developer Conference 2007
IF61: Network Configuration->Common
Add Syslog Destination (IP or localhost)
Slide 15 Developer Conference 2007
IF61: Network->Services
Make sure you have FTP server enabled
Slide 16 Developer Conference 2007
IF61: Edgeware Applications
Go to Edgeware Applications and select Application Control link
Slide 17 Developer Conference 2007
IF61: Edgeware Applications-> Application Control
Check the Redirect output from user applications to the system log box
Slide 18 Developer Conference 2007
IF61: Edgeware Applications -> Install User Application Select .zip or .tar
file to upload
Slide 19 Developer Conference 2007
IF61: Edgeware Applications -> Application Control
To run your application just click ACTION
Slide 20 Developer Conference 2007
IF61: Edgeware Applications -> Application Control
To update your application, click Uninstall and then install the new zip file
Slide 21 Developer Conference 2007
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.
Slide 22 Developer Conference 2007
Thank you.