Seamless Integration Solution of RFID System

With the development of techniques of Internet of Things, RFID is more and more widely applied in various industry sections. However, there are thousands of already built applications in various industries. To integrate RFID to those existed applications will take a huge amount of effort and investment. Further, to upgrade existing software applications may break down terminal users’ existing business or affect their business processing logic. Providing a feasible solution for RFID integration will significantly speed up the spreading of RFID product, and will also help the system end users adapting to the system upgrading. The article is to analysis the interface of RFID products and tries to find out a seamless integration method for integrating RFID product to existing software applications which support barcode technique right now.


Introduction
The application history of Radio Frequency Identification technique can be traced back to the Second World War (1) .However, the application of RFID is not spread until 1990s due to the restriction of manufacture technique and the unacceptable high cost for commercialize.Accompanied with bloom of IT industry from 1990s, the RFID technology got a big development, and finally at the start of new century it started to appear in people's everyday life-in library, in airport, at post station, in production line, parking area etc.
Comparing with barcode and matrix code, the advantage of RFID is obvious from security, adaptability and information capacity (2) .Due to the characteristic of air interface, RFID reader needs neither to scan the tags with light nor to touch the tags with any physical parts such as magnetic head.Furthermore, it is easy to enclose RFID chip and antenna in insulated material such as plastic, rubber etc.
For such a reason, it is much easier for RFID tags to endurance the harsh working environment such as humidity, struggling temperature, dusted and caustic environment etc.Among various types of RFID tags, the passive RFID tags have already been widely applied in various industries due to its low cost and small size.
However, for those industries, where RFID is applied, there are already a huge amount of applications already build and applied for many years.People have paid a lot of effort to familiar with the applications which they operated every day, and companies have paid a lot of training cost to cultivate their employees.Thus, in the foreseeable future it is not possible to abandon all the existing software applications to build brand ones.To upgrade existing so that is can be integrated with RFID system will need a huge amount of development working hours and thousands of millions of dollars; thus, cannot be finished years.To find a compromise integration solution so that RFID system can be integrated to existing software applications with limited development effort and acceptable performance is the requirement of market.

Identification Technology and Interface Analysis
So far RFID tags are applied to replace barcode labels and matrix code labels in industries (3) .To integrate RFID system to existing software applications where barcodes and matrix codes are applied right now, a straight forward method is to analysis interfaces of barcode reader and matrix code reader.

Identification Technology and Interface Analysis
Despite the different outlooks between barcode and matrix code, the working principles of them are similar, as Mattew Brockly introduced in his article [4] .Let's take barcode as example, as shown in figure1: Figure 1 shows an ISBN code, which is well standardized and accepted world widely for publishing items.The code is composed of an array of black (sometimes other colors) and white bars.The patterns of the bars are applied for encoding the numbers from 0 to 9. When a beam of laser scan across the barcode from one side to the other, the reflection can be parsed and represented as a list of rectangular wave due to the different reflection coefficients of various colors.The processer of barcode reader can interpret the rectangular wave as a list of numbers according barcode standard and return the interpreted data to connected devices such as PC, PDA etc.
According to the above description, the transmission of barcode data relays on interfaces which connect barcode reader and host devices such as PC or PDA.The communication methods of popular barcode readers sold in the market include serial port (RS232 and RS485), USB port, Bluetooth, and PS/2 port.When Bluetooth and USB are applied, the input interface is either converted to PS/2 port or to virtual serial port.And the majority of handhold barcode readers refer PS/2 as input interface (5) .

Working Principle and Interfaces of RFID Reader
A complete set of RFID system includes reader, antenna and RFID tag.According to the energy source, RFID tags can be categorized as active and passive (6) .Active RFID tag has a battery attached to it, as while the passive RFID tag has only chip surrounded by antenna.Since there is no power attached to the tag, all the power consumed by passive tag is from the inducted current.When RFID reader publishes a command via attached antenna, the antenna of RFID tag will be inducted and the inducted current will provide all the energy consumed by the tag during the whole communication period (7) .
It is always the RFID reader initiate the communication.First, reader publishes a command via RFID antenna, by sending radio waves.Second, when RFID tags reside in RFID antenna's working zone are inducted and weaken up, they will report their tag IDs to reader (serial number with ISO15693).Third, reader collected the tags IDs, user can send request to specific tags, such as memory accessing command or write AFI commands etc., based on tags' IDs.Once the reader finished the data collection, it can transmit the data to connected host devices such as PC.
The majority interfaces to PC (or other host devices) supported by most of the RFID readers on market includes USB, serial port, and Wi-Fi.Once USB is applied, normally manufacture will develop drivers to make it as a virtual serial port.Some manufactures, i.e.FEIG and TAGSYS RFID, provide Software Development Kit (SDK); while others, i.e.OMRON, provide an application protocol which will be referred when user try to communicate with RFID reader via standard interface such as RS232.

Idea behind Interface Conversion
According to the analysis in chapter 2.1 and chapter 2.2, it is obvious the connection methods of barcode reader and RFID reader are similar; the main difference comes from the data transformation method.A straight forward method to replace barcode reader with RFID reader is to provide a solution to convert the input interface of RFID reader so that it can be viewed by system as a barcode reader.
To get the implement the "conversion" method, based on the analysis in chapter 2.1, there are two types of interfaces conversion work required.1. Convert barcode reader input method to PS2 barcode reader input, so that the RFID system can be integrated into the existing system without any modification to applications.2. Emulate barcode reader serial port input so that the RFID system integration is transparent to existing applications.The first method can be applied by writing local software.The second method relays on middle ware.

The implementation of interface conversion
As analyzed in chapter 2.3, it is required to resolve the two types of interfaces conversion.This chapter will discuss the implantation details for making the conversions.

Emulate PS2 barcode reader with RFID Reader
The original design purpose of PS2 interface was for mouse input and keyboard input.Since the data represented by barcode is very simple (normally just numbers and letters), it is quite obvious that the input from barcode reader are designed as keyboard input events, especially for those handheld barcode readers.
RFID reader can replace barcode reader transparently once it can support PS2 input interface and transform the ID information stored inside RFID tag to PS2 interface as keyboard input.
Windows SDK provides a system function named SendInput, as described below, to send keyboard and mouse input programly.
According to the description from Microsoft MSDN (8) , the function involves 3 parameters, as explained below: nInput：The number of structures in the pInput array pInputs：An array of input structures.Each structure represents an event to be inserted into the keyboard or mouse input stream.
cbSize：The size, in bytes, of an input structure.If cbSize is not size of an input structure, the function fails.
The function provides an easy way for sending keyboard events from program.Once program received the item ID from RFID reader, it can send the ID as keyboard input by calling the function.
Microsoft .NET platform provides an even easier method to reach the same result.It provides a class named SendKeys to encapsulate the underline implementations.With Linux operating system, xlib defined a similar function named XsendEvent.

Emulate Serial Port Barcode Reader with RFID Reader
Since a give serial port can be opened by only one instance with a given time (9) , it is not very straight forward to emulate serial port input with only one box.There do exist spywares and sniffer wares that allow the monitoring to serial port.However, it is much more stable, safe and easier for installation if a third part is involved.
Figure 2 shows the conversion solution by using a conversion PC: Figure 2 Once RFID reader transfer the data to conversion PC, the conversion PC will convert the data to the original barcode reader input format and deliver the converted data to the workstation, where the application is running, via serial port.Since the information delivered to applications running on workstation, the RFID reader is attached to the system just as the original attached barcode reader, thus the integration can be realized seamlessly.

Case Study of PS2 Interface Conversion
The study case is a real project from Crisplant A/S (the former FKI Logistex), where I worked from 2007 to 2011.The project was to integrate Medio LP101 RFID reader manufactured by TAGSYS RFID to Hamburg City Libraries' existing Library Management System, which attached to PS2 interfaced barcode readers before.The users include 32 sub-libraries of Hamburg City Libraries and the Teacher's Library of Hamburg.
The Library Management Systems applied by the 32 sub-libraries are same systems and the Teacher' Library has its own specialized Library Management System.Library Management System is an application package, which includes a group of desktop applications and several web applications.Thus to integrate the RFID reader directly to existing software is time and cost consuming.Further, the direct integration requires the source code of existing applications, thus requires the cross enterprise cooperation, which is very difficult and sometimes almost impossible.
According to marketing research, all the applications applied by those 33 libraries had optical barcode scanner attached to workstations via PS2 port.Based on this feature, the project group decided to finalize the RFID system integration by emulating the keyboard input.
In this project, Crisplant took .NET as running environment and took C# as development language.
TAGSYS RFID provided a group of DLLs which defined a programming interface in Windows SDK style.Thus, it was required to develop an adepter which can convert the Widows SDK fashion functions to a group of .NET visible static methods via Platform Invocation technology.After then on, the client program can easily access information stored in RFID tags via the predefined static methods.
To avoid the conversion application from hugging the active window, it was designed as background running Windows service.And the reading start/stop command was controlled via hot keys, which can be registered and

Conclusions
To reduce the difficulty and cost of system upgrading and customer training, sometimes special engineering methods are expected.The article provides a transitional method for RFID system integrating.Typical the integration with design pattern (such as Adapter, Proxy etc) has its own advantage from software architecture point of view.However, due to the restrictions of cost, time to market etc. the article provided method can be considered as a effective market adaptable RFID system integration method.

Figure 1
Figure 1 unregistered by RegisterHotKey provided by Windows SDK.By taking the above solution, Crispplant finally closed the project in 15 weeks (from Match 2008 to July 2008), including market investigation, installation and customer training.