Click here to Skip to main content
Click here to Skip to main content

UHF RFID Reader Program

By , 15 Apr 2009
 

Introduction

This is a program for a 900 MHz UHF (Ultra High Frequency) RFID (Radio Frequency Identification). This program must have a Samsung Techwin UHF Handheld RFID Reader (VLAC-G1) or a UHF Fixed RFIDReader (VLAC-Alpha) based InpinJ R1000 chipset.

Background

Many people listen to RFID. This technology has numerous possibilities for the distribution industry, food hygiene, air cargo, public library, etc......

This technology is constructed using an RFID Tag, an RFID Reader, and a Service. The RFID Tag is a very low cost product. Several months ago, Hynix Semiconductors said, "We will make 1 cent RFID tag chips." The RFID Reader is more expensive than RFID tags.

However, this might be perfect for any distribution vendor considering applications for low cost of transport and reliability of transport. And, many food companies might consider its application for food safety. For example, an industry vendor might consider changing from 2D barcode technology to RFID technology.

This program will be very useful for RF tag identification.

RFID Tags Structure

The 900MHz RFID Tags is composed of a tag chip and an antenna. The tag chip is based on the ISO 18000-4 spec for automatic data identification specification and ISO-18000-6C specialization for item level management tags. The latest trend is 18000-6C. We call these Gen2 tags.

The detail structure searches the EPC Global standard. These tags are composed of BANK 00 (Reserved Memory), BANK 01 (EPC Memory), BANK 10 (TID), and BANK 11 (User Memory).

  • The BANK 00 (Reserved memory) is composed of a kill password area and an access password area for secure functions.
  • The BANK 01 (EPC memory) is composed of CRC-16 (tag used when protecting certain R=> T, T => R), PC (Protocol control for EPC memory area), and EPC (Electronic Product Code).
  • The BANK 10 (TID memory) is the 8 bit ISO/IEC 15963 allocation class identifier; 11100010 for EPC Global.
  • The BANK 11 (User memory) is the user specification data storage.

How to Read RFID Tags in this Program

This program is composed of RFID Radio (CRFIDRadio) and RFID Radio Management (CRFIDRadioManager) objects.

The CRFIDRadio object is a real command operator. This object has some functions for the Inventory command, Tag Access (Read/BlockRead/Write/BlockWrite/Lock/Kill) commands, and the RFID setting function. And, this object calls the Samsung Techwin RFID Reader API.

The CRFIDRadioManager object is to manage each RFID Radio object. And, this object controls CRFIDRadio objects for command transport.

First, you must create a CRFIDRadioManager:

// Your application header file.
CRFIDRadioManager m_pRFIDRadioManager;
// Your application source file.
m_pRFIDRadioManager = new CRFIDRadioManager();

and connect to RFID Reader device like this:

m_pRFIDRadioManager->SetParnet(CWnd* Object);
if(m_pRFIDRadioManager->Connect() != RFID_STATUS_OK)
{
    // Connection fail process
}
else
{
    // Connection success process
}

This function makes a connection to a CRFIDRadio object. In this state, the CRFIDRadioManager object searches and attaches an RFID Reader device on your accessible RFID Reader using USB, Serial, and TCP/IP interfaces. And, the SetParent function sets the CWnd window for Win32 message returning. This state is a complete reader connection.

Next, you will want identify the RFID tag. Look at the RunInventory function in the CRFIDRadioManager. This function sends tags for the read command to the RFID reader. It creates a thread for the read command.

// Your application
void CMainFrame::OnRfidRunInventory()
{
    pRFIDRadioManager->RunInventory(0, -1);
}
// CRFIDRadioManager
RFID_STATUS CRFIDRadioManager::RunInventory(int nModule, INT32 nCount)
{
    RFID_STATUS status = RFID_STATUS_OK;
    if(m_listRadio.GetCount() > 0)
    {
        POSITION pos = m_listRadio.FindIndex(nModule); // find the radio ojbect
        CRFIDRadio* pRadio = (CRFIDRadio*)m_listRadio.GetAt(pos);
        pRadio->m_nStopCountDown = nCount; // set inventory stop count
        pRadio->m_runStatus = RFID_INVENTORY;
        _oleStartDateTime = COleDateTime::GetCurrentTime();
        Radio->Create(); // create inventory thread
    }
    return status;
}

The packet parameter is the result information from the reader. The base structure is RFID_PACKET_COMMON. For detailed structure information, see the Interface Specification white paper in the Samsung Techwin homepage.

The CRFIDRadioManager returns the parent CTagInfo object using the SetParent function.

case RFID_PACKET_TYPE_18K6C_INVENTORY:
{
    RFID_PACKET_18K6C_INVENTORY *inv = 
    (RFID_PACKET_18K6C_INVENTORY *)packet;
    /* Calculate the length of the data portion of the packet */
    int length =
    /* The length of the packet beyond the common header */
    (MacToHost16(common->pkt_len)-1) * BYTES_PER_LEN_UNIT -
    /* Add back in the size of the common header */
    (common->flags >> 6);
    if(common->flags & 0x01)
        break;
    int padding_byte = (int)(common->flags & 0xC0);
    POSITION pos = m_listRadio.FindIndex(0);
    CRFIDRadio* pRadio = (CRFIDRadio*)m_listRadio.GetAt(pos);
    if(pRadio->m_runStatus != RFID_INVENTORY)
    {
        CString strTemp = TEXT("Tag ID : ");
        CTagInfo lpTagInfo;// = new CTagInfo();
        lpTagInfo.SetTagMemory(inv->inv_data);
        strTemp += lpTagInfo.GetTagString();
        theApp.m_pMainWnd->SendMessage(WM_TAG_ACCESS, (WPARAM)(LPCTSTR)strTemp, 0);
#ifdef _WIN32_WCE
        if(m_radioBeepMode == RFID_RADIO_BEEP_MODE_ENABLE)
        m_waveBox->Play(0);
#endif
        break;
    }
    // Tag Data Process
    CTagInfo* lpTagInfo = new CTagInfo();
    lpTagInfo->SetTagMemory(inv->inv_data);
    lpTagInfo->SetTagReadCount(inv->count);
    lpTagInfo->SetTagTrialCount(inv->trial_count);
    lpTagInfo->SetTagAntenna(m_nAntenna);
    lpTagInfo->SetTagChannel(m_nChannel);
    lpTagInfo->SetTagRSSI(MacToHost16(inv->rssi));
    lpTagInfo->SetTagLNAGain(MacToHost16(inv->ana_ctrl1));
    lpTagInfo->SetTagReveiveTime(COleDateTime::GetCurrentTime());
ifdef _WIN32_WCE
    if(m_radioBeepMode == RFID_RADIO_BEEP_MODE_ENABLE)
    _waveBox->Play(0);
#endif
    m_pParent->SendMessage(WM_PROCESS_TAG, (WPARAM)lpTagInfo);
    break;
}

The CTagInfo object copies tag information from the RFID Reader. And, the CTagInfo object reconstructs PC, EPC, and other information using the ISO 18000-6C tag type.

I do type cast from the packet parameter to the RFID_PACKET_18K6C_INVENTORY struct. And, I define the inv variance. I check the packet length and the flag for the right packet type. If the packet is right, I make a CTagInfo object for tag information. Finally, I return a CTagInfo object to the parent object using the SendMessage function. The complete source code is available from the download link above.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Youngho Kim
Software Developer
Korea (Republic Of) Korea (Republic Of)
Member
I hope to help your coding processing.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questioncode confusionmemberbhaskar_ams16 Jan '13 - 17:55 
Can this code be implemented using Matlab?
AnswerRe: code confusionmemberYoungho Kim14 Feb '13 - 13:30 
This application supports Windows CE only.
QuestionGood jobmemberPeymanFx15 Jan '13 - 20:03 
That's great.
Thank you Youngho Thumbs Up | :thumbsup:
QuestionI need IU9060 SDKmemberAfshin Hosseini20 Aug '11 - 21:11 
Hi Mr.Kim,
I've bought an IU9060[^] handheld RFID tag reader.
 
Now I wanna write a program in c# and install it on this device which supports Windows CE. But I don't have the required DLL and SDK.
 
Do you have any experience on how to program for this device?
 
By the way I found it's SDK on LS company's website. When I want to Download it, the Website wants me to login. But the problem is that I don't understand Korean and Also Google translator doesn't Translate the web pages. So can you register your-self (in English, Our keyboard doesn't support Korean) and then give me your Username and password, please? Or maybe U'd better to Download the "IU9060 SDK" and Email it to me.
 
Enter the link below and find the "IU9060 SDK" in the Download Table and click on it, then Click on "IU906X.msi" and download it.
 
IU9060 Download link[^]
 
Email: afshin.hoseini@gmail.com
 
Thank you man, Your job is NICE Wink | ;)
Afshin
MIC_R_C

QuestionPlease Help Me Mr Kimmemberjalalsavber19 Aug '11 - 5:41 
Dear Mr Kim
Please Help Me
H0w Read Tag RFID with HandhelD???????????? D'Oh! | :doh:
i Need Dll Handheld(win CE)With C#
or
Please Sample COde with C#
GeneralMy vote of 4memberSikindar11 Apr '11 - 15:16 
It's good
GeneralMy vote of 5memberfitr14n18 Oct '10 - 7:55 
Thank's For Articel Big Grin | :-D
GeneralRe: My vote of 5memberYoungho Kim3 Jan '11 - 4:23 
Thanks too.
GeneralRFID C# Librarymemberochaves5 Jan '10 - 11:23 
Hi Youngho.
 
I'm trying to develope a software for reading tags with a Samsung VLAC G1 with Visual 2008 compact C#... but I didn't find a RFID SDK with the libraries. I found this page http://www.samsungtechwin.com/prd/pro_down_pop_list.asp?cat_biz=RFD&prj_uid=699&pro_uid=4047&dow_flg=SOW[^] with the URP_sk010_Platform_SDK, but I didn't find the rfid_library.h or rfid_packets.h... do you know where can I find these libraries?... Exist libraries for C# ? I really appreciate your help. Thanks!
 
Orlando Chaves From Colombia
GeneralRe: RFID C# LibrarymemberYoungho Kim5 Jan '10 - 12:17 
Hi, ochaves.
 
Happy new year!
 
Did you have download Platform SDK from Samsung Techwin homepage?
It's just setting the platform enviroment for Visual Studio for URP-SK010.
 
If you delveped, you should download C# Application from Samsung Techwin.
This file include PC install file. You will find setup.exe.
First, you install this file to your hard disk.
Next, you will find the samples folder from your installation path.
Finally, At this folder. you will find the rfid folder and rfid sub folder like a include and lib folder.
 
ps. This file include developer samples for .NET CF and C++.
GeneralRe: RFID C# Librarymemberochaves6 Jan '10 - 4:18 
Happy new year too!! Big Grin | :-D
 
Thanks for your help, I installed the SDK on a Win XP PC (it don't install on vista OMG | :OMG: ) and works!.
 
Now... when I was trying to compile and run the example app, it show me "Can't find PInvoke DLL 'rfid.dll'" on the Samsung VLAC G1 Device.
 
I think that I lacked install the library on the device.. but I didn't find this installer. Do you know where can I find it?.. Thanks Again!! Thumbs Up | :thumbsup:
 
Orlando Chaves
GeneralRe: RFID C# LibrarymemberYoungho Kim6 Jan '10 - 13:31 
Hi, ochaves.
 
Look at the RFID icon on desktop screen of Windows CE. The RFID icon could be seen your sight,
Already, you have a rfid.dll. It's location path is \Windows\rfid.dll.
 
But, The RFID icon does not exist. You have to install rfid setup.exe.
At that time, It's installed on your Windows CE using ActiveSync.
GeneralRe: RFID C# LibrarymemberYoungho Kim28 Apr '11 - 18:20 
Thanks your attention!
 
yes. setup.exe file does not see the RFID icon from your desktop.
Because, This setup is PC installation file. And next step, your mobile connect to your pc.
 
The ActiveSync check your mobile device.
At that time, The ActiveSync popup dialog for Mobile Device installtion.
This dialog check rfid mobile application. And The RFID software install your device.
 
Last step, Check your software intallation complete on your device.
Is exist \\Program Files\Samsung\RFID path? and Check your RFID.exe file.
GeneralRFIDmemberabhishek amar22 Nov '09 - 3:13 
Kindly send me as much as information about the device,Samsung techwin UHF Reader Handheld,(VLAC-G1) and the (VLAC-alpha).
Please send me the specification about the device and whether it supports the WinCE 5.0/6.0 mobile platforms or not.The range of the device will also help and the source code in C.
 
Warm Regards,
 
Abhishek Amar.
India.
GeneralRe: RFIDmemberYoungho Kim27 Nov '09 - 19:49 
Hi, Abhishek Amar.
 
This device model is Samsung UHF RFID Handheld Terminal (URP-SXX10)
 
This device has more peripheral devices like a 1D barcode device, wireless lan (802.11.b/g), bluetooth 1.2 and UHF RFID(860 ~ 960 MHz).
This device adopted Microsoft Windows CE 5.0 operating system for user fridendly interface.
So, This operating system support C/C++ API and .NET CF API(Compact Framework 2.0) Application developeing enviroment.
 
To additional, Ths watertight and protection against dust certification satisfy IP-65 Spec.
And RFID device certify to FCC(US), ETSI (Europe), Korea (MIC), Japan (TELEC), China (CCC) Spec.
And Tag identification distance is very long from minimum 3 meters to maximum 5 meter, using Alien M tag.
 
But, this device just 1D barcode support. The most part of industry has adopted 2D barcode system.
I hope to this device change this weakly point for customer.
 
Are you OK for this information?
 
Best Regards,
Youngho Kim from Korea.
Questionrfid UHF Fixed Reader SRU-FK0100memberjflee15 Oct '09 - 5:44 
hi i am using the Samsung Techwin UHF Fixed Reader SRU-FK0100. It seems that they don't have library file for java but they have library file for c# but there aren't any manual to explain it, can you maybe help shed some light on c# for UHF Fixed Reader SRU-FK0100 or let me know where can i get the library file for java. Their don't have it on their support site
Thanks Smile | :)
AnswerRe: rfid UHF Fixed Reader SRU-FK0100memberYoungho Kim15 Oct '09 - 13:33 
Dear jflee!
 
Today! I read your question from codeproect. Are you live in U.S?
How to get the sru-fk0100 model for UHF RFID. That does not support US frequency channel.
 
I will support the java library with javadoc. The javadoc is manual for java developer.
But, this model do not exist C# library for Microsoft .NET Framework.
If you want to develope application using C#.
 
you have to wrapped up ocx component using native method or C++ .NET wrapped up ocx component.
At the time, it will makes .NET Object file for Microsoft .NET framework.
 
If you want to java library, you send to me your e-mail address.
GeneralRe: rfid UHF Fixed Reader SRU-FK0100memberjflee16 Oct '09 - 6:45 
Thanks, i've replied directly to your email. my email is jiafuh@gmail.com
GeneralRe: rfid UHF Fixed Reader SRU-FK0100memberYoungho Kim18 Oct '09 - 14:11 
I do not send to your e-mail (jiafuh@gmail.com)
This e-mail retun to me mail delivery notification error.
 
I talk to me another e-mail address.
GeneralRe: rfid UHF Fixed Reader SRU-FK0100memberjflee18 Oct '09 - 16:04 
Hi you can try to send to towerfox@hotmail.com or jiafuh.lee@yourparttime.com
Thanks
GeneralRe: rfid UHF Fixed Reader SRU-FK0100memberjflee4 Feb '10 - 16:36 
Hi
 
For the SRU FK0100 reader in java, i'm trying to get the reader data by using the function public void responseEventReceived (Event resEvent) at the function,
 
public void responseEventReceived (Event resEvent), how to get the resEvent? I can't invoke the function because I don't know how get the value for resEvent
 
I've been searching the api manual for java, but couldn't find any. Hope you can help.
Thanks
Questionrfidmemberabhishek4128198819 Aug '09 - 6:01 
dear sir....
 

im a student working on rfid attendance system.......
 

will these codings help me out in any way......
 
plz help me out as i need codings in c or cpp
AnswerRe: rfidmemberMember 84540819 Aug '09 - 13:29 
Hi.
 
This cpp coding make the windows ce operating system. And it dependent to samsung techwin UHF handheld RFID reader.
So, you have to find samsung techwin rfid device at http://www.samsungtechwin.com/prd/link/rfd/rfid_sum.asp?cat_biz=RFD[^]
 
The other case, If you have a other rfid product, you should use rfid middleware like oracle edge mobile sdk.
http://e-docs.bea.com/rfid/mobile_sdk/docs10/prog/sdk_overview.html[^]
 
Are you clear about your question?
GeneralRe: rfidmemberabhishek4128198820 Aug '09 - 6:52 
sir,
 
i am a tudent in india.
 
i am making an rfid based attendance system as my final year project for engineering.....
 
i want the coding in c or cpp.......
 
so if u can help me it would be gr8
GeneralRe: rfidmemberYoungho Kim29 Aug '09 - 5:47 
hello!
 
What is gr8?
I don't know gr8?
 
you could be talk about gr8?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 15 Apr 2009
Article Copyright 2009 by Youngho Kim
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid