Presentation is loading. Please wait.

Presentation is loading. Please wait.

RFID You Know You Need It Jim Peternel October 29, 2008

Similar presentations


Presentation on theme: "RFID You Know You Need It Jim Peternel October 29, 2008"— Presentation transcript:

1 RFID You Know You Need It Jim Peternel October 29, 2008

2 Intro Learn what you need to know to be able to develop RFID applications.  What Intermec Developer Library tools are available, what languages can you use What you need to write fixed location (as opposed to mobile) RFID applications.

3 Agenda Quick review of tags. Building an RFID Application.
ALE Store and Forward Application RFID Snippets RFID samples and demo applications you can download.

4 TID 4+ Bytes (not necessarily unique)
EPCC1G2 Memory Map Bank 3 UID Optional ? Bytes Bank 2 TID 4+ Bytes (not necessarily unique) Bank 1 Header info Bytes 0-3 EPC Code Bytes 4-15 Bank 0 Kill Password 4 Bytes Access Password 4 Bytes

5 Let’s Develop an Application
Pick your reader (moved to end) Pick your tags (moved to end) Pick your interface Pick your language Get Started

6 Pick Your Interface Intermec Developer Libraries (IDL)
Let Intermec handle the physical layer Ease of code reuse Ease of platform switching PPC2003 WM 5.0 and WM 6.0 Win32 RFID and Bar Code scanning Separate IDL’s Download from

7 Pick Your Interface Basic Reader Interface (BRI)
Simple ASCII interface. No driver dependence. You must handle the physical layer.

8 Pick Your Language Support languages IF61 C# VB .NET Java
Visual Studio 2005 or newer IF61 Linux based reader Supports only Java and C# Uses Windows Mono 2.0 drivers for C#

9 Getting Started Sample code will be in C#. Uses IDL
Java will be very similar. Will show critical code samples for both fixed and mobile readers. Includes bar code examples as well

10 Create Basic Project in C#: Win32
Select Windows Application

11 Create Basic Project in C#: IF61
Select Windows Console Application

12 Create Basic Project in C#: Win Mobile
Select Smart Device -> Device Application

13 Add RFID References Add RFID class references to your project

14 RFID References using Intermec.DataCollection.RFID;

15 IDL You can use built in functions or send BRI commands via the IDL driver. String sRSP = brdr.Execute("W EPCID=H "); String sRSP = brdr.Execute(“R POLL");

16 IDL IDL Debugger Great tool shows you communications between reader and the IDL. Logs information to a text file. Helps us provide you with support. IDLClassDebugLog.txt

17 IDL How to create IDL Debugger object
BRIReader.LoggerOptionsAdv LogOp = new BRIReader.LoggerOptionsAdv(); LogOp.LogFilePath = ".\\IDLClassDebugLog.txt"; LogOp.ShowNonPrintableChars = true; On mobile devices the log file is always placed in the root directory. You cannot change that location.

18 Run Time Reader Enabling on Mobile Devices
For mobile readers you can make sure that the reader is enabled in Intermec Settings using the following commands Try { Intermec.DataCollection.RFID.BasicBRIReader DCEConfig = new BasicBRIReader(null); DCEConfig.Open("TCP:// :2188"); string tt = DCEConfig.Execute("device 1 attrib adminstatus=on"); // BRI ‘device’ command. DCEConfig.Close(); } catch (Exception e) MessageBox.Show("Unable to activate DCE reader connection." + " Verify that the reader is connected and its battery is charged." + " You may not be able to open a reader connection", "DCEConfig.Execute Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);

19 Opening Reader with IDL
When you create the object you are opening the connection to the reader. String tConnection=null; //mobile readers only String tConnection= "TCP://" + " " + ":2189"; //network local host String tConnection= "TCP://" + " " + ":2189"; //network String tConnection=“SERIAL://COM1”; //serial this.brdr = new BRIReader(this, tConnection, 22000, 2000, LogOp); 2200 = reader buffer size 2000 = event queue size

20 IDL Buffers Reader Buffer is used to store tags when you use the following commands: WRITE READ REPORT=DIRECT READ REPORT=NO Event Buffer is used to store all events and also tag data when you use: READ REPORT=EVENT READ REPORT=EVENTALL

21 Reader Command Responses
OK> Command succeeded ERR Invalid command, typo, incorrect parameter, etc.

22 Tag Command Responses RDERR WRERR MEMOVRN PVERR PWERR
Read error (could not complete read) WRERR Write error (could not complete write) MEMOVRN Memory overrun error (exceed max byte in memory bank) PVERR Memory locked or password protected or does not exist PWERR Not enough RF power to execute command

23 Verifying Reader Connection
Mainly on handhelds. You can connect to DCE but not to reader. Send PING command Response is “OK>” String sMsg = brdr.Execute(“PING"); You can also send the VERSION command (VER)

24 Checking Reader Module Information
Version String sMsg = brdr.Execute(“VER"); IM5 RFID Reader Ver 9.22 Basic Reader Interface Version 3.10 FCC 915MHz CC014 Copyright (C) 2008 Intermec Technologies Corp. OK> BRIVER Returns BRI version Basic Reader Interface Version S

25 Setting Attributes Select TAGTYPE Set ANTS
Choose between IDTRIES or IDTIMEOUT Choose between ANTTRIES or ANTTIMEOUT Set SESSION and INITIALQ

26 Setting Attributes String sMsg = brdr.Execute(“ATTRIB IDTRIES=1");
String sMsg = brdr.Execute(“ATTRIB IDTIMEOUT=1OOO"); String sMsg = brdr.Execute(“ATTRIB TAGTYPE=EPCC1G2,ISO6BG2"); String sMsg = brdr.Execute(“ATTRIB SESSION=1"); String sMsg = brdr.Execute(“ATTRIB ANTS=1,2,3,4"); Response is “OK>”

27 Verify Attributes String sMsg = brdr.Execute(“ATTRIB IDTRIES");
Response “ATTRIB IDTRIES=1CRLFOK>” String sMsg = brdr.Execute(“ATTRIB"); Returns list of all attributes

28 ATTRIB SESSION: What are they, when to use?
Valid values 0 to 3 Session = 0 No persistence Best for reading single tags Best for making tags/second measurements Session = 1 Max 5 seconds persistence. With Intermec readers we have found session one provides the most consistent read rates when reading large numbers of tags. Session = 2 and Session = 3 Share the same persistence features. Min persistence time of 2 seconds.

29 Reading Tags Pick your memory bank (0 to 3) Pick your data type
Hex, String, Integer Pick your parameters Basic read command formats: READ HEX(Mem Bank:Start Addr,Length) READ STR(Mem Bank:Start Addr,Length) READ INT(Mem Bank:Start Addr,Length) Start address and length are always in bytes

30 Reading Tags: Memory Banks
EPC ID Memory bank 1, bytes 4-15 Typically 96 bits Can also have lengths 64 bits up to 240 bits Length based on tag manufacturer READ READ REPORT=XXX READ HEX(1:4,12)

31 Reading Tags: Memory Banks
TID Tag ID Memory bank 2, bytes 0 to ??? Manufacturer information READ TAGID READ HEX(2:0,4) READ HEX(2:0,8)

32 Reading Tags: Memory Banks
User Memory Memory bank 3, bytes 0-? Length based on tag manufacturer READ HEX(3:0,100) Password Memory Memory bank 0, bytes 0-? READ HEX(0:0,8)

33 Read/Write Command Parameters
ANT COUNT TIME TAGID EPCID TAGTYPE AFI Read ant count time afi where….

34 Read Mode: When do use what?
REPORT=DIRECT Execute one read then stop Continuous Reading REPORT=NO REPORT=EVENT REPORT=EVENTALL WHY USE THEM? WHEN TO USE THEM?

35 Read Mode: REPORT=DIRECT
Good for reading small number of tags Good for mapping RF Field Returns tag list after command completes Depends on: IDTRIES, ANTTRIES, IDTIMEOUT, ANTTIMEOUT String sMsg = brdr.Execute("R ANT"); Or Bool bStatus = brdr.Read();

36 Read Mode: REPORT=DIRECT
Reading fields and using filters R Hex(3:0,8) ANT where hex(1:4,2)=h0102 String sfilter= “hex(1:4,2)=h0102” String sfields= “Hex(3:0,8) ANT” bStatus = brdr.Read(sfilter, sfields);

37 Read Mode: REPORT=NO Good for reading large number of tags.
Not sure when tag will enter field. Must POLL for tag list. Provides best reading performance. brdr.StartReadingTags(null, "COUNT ANT",BRIReader.TagReportOptions.POLL); OR tMsg = brdr.Execute("R ANT COUNT REPORT=NO");

38 Read Mode: REPORT=NO Must poll for tag list brdr.PollTags();
string sTagID = brdr.Execute("R POLL"); foreach (Tag tt in brdr.Tags) { string sTagID = tt.ToString(); if (tt.TagFields.ItemCount > 0) foreach (TagField tf in tt.TagFields.FieldArray) sTagID += " "; sTagID += tf.ToString(); }

39 Read Mode: Disable Continuous Reading
You must turn off continuous read mode when you are done. brdr.StopReadingTags(); sMsg = brdr.Execute("R STOP");

40 Read Mode: REPORT=EVENT
Good for reading large number of tags. Not sure when tag will enter field. Tags will be returned as events, EVT:TAG H…. Tags will be returned one time only when first seen. Need to add IDL Tag Event handler Only on IF61 Release 2 will the performance equal REPORT=NO

41 Read Mode: REPORT=EVENT
string sMsg = brdr.Execute("R ANT REPORT=EVENT"); sMsg == EVT:TAG H brdr.StartReadingTags(null, “ANT TIME”, 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 string sMsg = EvtArgs.DataString.ToString(); ProcessTagData(sMsg); }

42 Read Mode: REPORT=EVENTALL
NOT good for reading large number of tags. Not sure when tag will enter field. Tags will be returned as events, EVT:TAG H…. Tags will be returned each time they are seen. Good for testing purposes. Warning, you can get over whelmed by tags. brdr.StartReadingTags(null, “ANT TIME”, BRIReader.TagReportOptions.EVENTALL); sMsg = brdr.Execute("R ANT REPORT=EVENTALL");

43 Writing to Tags Must write even number of bytes (2,4,6,…)
Must start write on even memory boundaries (0,2,4,…) String CurrentCMD = “W hex(1:4,6)=h ” try { string sMsg = this.brdr.Execute(CurrentCMD); } catch (BasicReaderException eBRI)

44 Using Triggers If your application requires a motion sensor to tell the reader when to start and stop reading tags you should use triggers. Triggers uses the General Purpose Inputs (GPI) Two types of triggers State Level Edge

45 When To Use Edge Triggers
Trigger “mytrigger” gpioedge 1 1 filter 0 Fires when state changes. Fires only one time. Do not need to use TRIGGERREADY Always set FILTER to zero!

46 Create IDL Event Handlers
There are various IDL event handlers you may want or need to add to your application. If you are just using the BRI interface and not the IDL you will not have access to these useful event handlers.

47 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.EventHandlerRFIDButton += new DCE_BUTTON_EventHandlerAdv(brdr_EventHandlerRFIDButton); this.brdr.EventHandlerRadio += new Radio_EventHandlerAdv(brdr_EventHandlerRadio); this.brdr.EventHandlerTag += new Tag_EventHandlerAdv(brdr_EventHandlerTag); this.brdr.EventHandlerCenterTrigger += new CenterTrigger_EventHandlerAdv(brdr_EventHandlerCenterTrigger); this.brdr.EventHandlerDCE += new DCE_EventHandlerAdv(brdr_EventHandlerDCE); this.brdr.EventHandlerDeviceConnectState += new DCE_DeviceConnectStateEventHandlerAdv(brdr_EventHandlerDeviceConnectState); this.brdr.EventHandlerOverflow += new Overflow_EventHandlerAdv(brdr_EventHandlerOverflow); this.brdr.EventHandlerGPIO += new GPIO_EventHandlerAdv(Form1_EventHandlerGPIO); } catch return -1; return 0;

48 Add Trigger Pull Event Handler
This is only for IP4 and IP30 readers void brdr_EventHandlerCenterTrigger(object sender, EVTADV_CenterTrigger_EventArgs EvtArgs) { //********************************************************************* // This function fires when the center trigger on the IP4 is pulled or released if (bReaderOffLine == true) //irda connection is still asleep after a 700 resume return; } if (EvtArgs.CenterTriggerState.Equals(EVTADV_CenterTrigger_EventArgs.STATE.PULLED)) else if (EvtArgs.CenterTriggerState.Equals(EVTADV_CenterTrigger_EventArgs.STATE.RELEASED))

49 Add Connection State Handler
Only useful for the IP4 and IP30 void brdr_EventHandlerDeviceConnectState(object sender, EVTADV_DeviceConnectStateEventArgs EvtArgs) { //your code here //will come back to this later }

50 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; string sTagData = EvtArgs.DataString.ToString(); //do something with tag data }

51 Polling For Tags (Report=No)
this.brdr.StartReadingTags(null, "COUNT ANT", BRIReader.TagReportOptions.POLL); bStatus = brdr.PollTags(); foreach (Tag tt in brdr.Tags) { string sTagID = tt.ToString(); if (tt.TagFields.ItemCount > 0) foreach (TagField tf in tt.TagFields.FieldArray) sTagID += " "; sTagID += tf.ToString(); }

52 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"))

53 Sleep/Resume management for mobile readers
When the terminal sleeps and then resumes it can take some time before the DCE reestablishes a connection to the IP4/IP30. Monitor for the following events: EVTADV_DeviceConnectStateEventArgs.States.OFFLINE EVTADV_DeviceConnectStateEventArgs.States.RECONNECTING EVTADV_DeviceConnectStateEventArgs.States.CONNECTED

54 Sleep/Resume management on mobile readers
void brdr_EventHandlerDeviceConnectState(object sender, EVTADV_DeviceConnectStateEventArgs EvtArgs) { switch (EvtArgs.DeviceConnectState) case EVTADV_DeviceConnectStateEventArgs.States.OFFLINE: bReaderOffLine = true; bReaderConnecting = false; timer3.Enabled = true; //may check to see if unit never comes back online??? break; case EVTADV_DeviceConnectStateEventArgs.States.RECONNECTING: timer3.Enabled = false; bReaderConnecting = true; case EVTADV_DeviceConnectStateEventArgs.States.CONNECTED: bReaderOffLine = false; }

55 RF Module Events All Platforms IF61 EVT:TRIGGER ExampleTrigger GPIO 15
EVT:RADIO DUTY_CYCLE TIMELEFT xxx EVT:TAG H EVT:THERMAL OVERTEMP <degrees>< EVT:THERMAL NORMAL <degrees> IF61 EVT:RESET

56 RF Module Events Handheld (IM4 based platforms) EVT:BATTERY LOW
Less than 20% charge remaining EVT:BATTERY CHARGED Greater than 80% charge remaining EVT:BATTERY OPERATIONAL 20%-80% charge remaining

57 Add reference to project
Add Bar Code Reference Add reference to project

58 Add Bar Code Reference Add: using Intermec.DataCollection;

59 Adding Bar Code Scanning
Create scanning object //bar code scanner object protected BarcodeReader myBCScanner = new BarcodeReader();

60 Adding Bar Code Scanning
Add bar code scanner object and start thread so we can capture bar code events. myBCScanner.BarcodeRead += new BarcodeReadEventHandler(myBCScanner_BarcodeRead); myBCScanner.ThreadedRead(true); myBCScanner.ScannerEnable = true;

61 Adding Bar Code Scanning
Get Bar Code Data void myBCScanner_BarcodeRead(object sender, BarcodeReadEventArgs bre) { //make sure scanner is off myBCScanner.ScannerOn = false; //display data iBarCodeCount++; PostMessageToListBox1(iBarCodeCount + ". " + bre.strDataBuffer); label1.Text = "Bar Code Count = " + iBarCodeCount; }

62 Thank you.


Download ppt "RFID You Know You Need It Jim Peternel October 29, 2008"

Similar presentations


Ads by Google