Shop OBEX P1 Docs P2 Docs Learn Events
RFID Reader Software (VB.NET) — Parallax Forums

RFID Reader Software (VB.NET)

Chris SavageChris Savage Parallax EngineeringPosts: 14,406
edited 2014-05-19 12:00 in Robotics
Attached is an application created in Visual BASIC 2005 Express which allows a Parallax RFID Reader connected to a PC to read tag data. This application has a small form which allows you to select and open the COM Port for the RFID Reader·and Enable or Disable reading as necessary.· By default the RFID Reader is enabled when the COM Port is opened.· Optionally·you can trigger·a System Beep during each read. ·The Reader is disabled for·1.5 seconds after a read.· This·delay is provided to avoid duplicate reads.· The Reader is then re-enabled.· Once tags are read into the Text Box they can be copied into a database or other application, speeding tag entry.
·
The RFID Reader is connected to the PC using the schematics provided at this link.· The specific schematics are the transistor-based and MAX232 based plans (both use the DTR line for /ENABLE control).· Of course, for those who wish to use our RFID Reader in PC-based applications we will also be releasing a USB version soon.
·
NOTE:· The source code and application attached below is free and open-source but is not supported by Parallax Inc.· I will try to answer the questions I can in this thread, however, I am hoping that those who have the RFID Reader and know VB programming will be able to help create a better community-supported free application.
·
For those that are interested in modifying or enhancing the application, Visual BASIC Express 2008 can be downloaded free from the Microsoft website at http://www.microsoft.com/express/vb/






Copyright (c) 2008 Parallax Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support


Post Edited (Chris Savage (Parallax)) : 5/22/2008 10:06:52 PM GMT
«13456

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-05-22 16:48
    Before I forget I would like to thank our forum members, QuattroRS4 and Unsoundcode for their contributions, including testing. I had not programmed in Visual BASIC in almost 3 years and for a refresher I went through posts on these forums and found examples and suggestions by these two members. I also read Jan Axelson’s article in the April 2008 Nuts & Volts magazine. These sources, plus a few web searches helped provide the code above. It’s pretty amazing what can be accomplished with the Express Editions of Visual BASIC. I have the 2008 edition and am still experimenting. Take care and thanks again guys!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-05-23 19:24
    I’m attaching a couple of screenshots of what the application looks like when running. The first picture is of the application when it is first run. The second one is after the COM Port has been opened. The last one is after reading 4 tags from the sampler kit. Enjoy!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    289 x 291 - 15K
    289 x 291 - 15K
    289 x 291 - 17K
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-05-31 16:34
    Hi Chris, I thought this was a great utility for those that want to connect the RFID directly to a PC. I took your source and added a simple database. I have attached a zip with the executable installer. It was my first run out with a database and it seems to work well. For those wishing to expand on the database functionality Microsoft have a great video series at this link

    http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx?wt.slv=RightRail

    The database keeps a record of who each tag is assigned to and displays it in the log window. It also allows for editing and deleting. In addition to displaying the tag number the string was extended to include the user name and a time stamp to create an attendance record.

    The source (VB solution) is too big a file to upload here but if anyone wants it PM your email and I will forward it.

    If there are any problems or questions please let me know.

    Jeff T.

    EDIT: I forgot to include the setup files in the executable zip so I attached here as setup.zip, extract all files to the same folder.

    Post Edited (Unsoundcode) : 9/5/2009 3:53:57 AM GMT
    421 x 391 - 30K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-02 14:28
    Jeff,

    That is great! It looks pretty simple to use as well. Congratulations on being the first to customize and post something! Out of curiosity, how large is the source files zipped?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-06-02 19:06
    Hi Chris, the source is 5.5Mb. The program also requires you have Microsoft SQL server, if you don't the program should prompt you for a download. The express version is free to download.

    The database is very simple to design if you follow the Microsoft tutorials and requires practically no coding.·After designing the database the tutorial goes on to show you how to connect it to a project. All that I did was to create the database and add it in to your source. The only code that I put there was two short sub routines that check to see if the tag is new. That code has a couple of lines that one might find·of use, it took me a while to figure it out.

    If you would like the source let me know, it also has a search feature now.

    Jeff T.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-02 19:27
    Jeff,

    I would like to see what you have done, especially since you've already done the research and put the time into it. I have an e-mail link to the left. If you could mail it there I would be most appreciative. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • computer guycomputer guy Posts: 1,113
    edited 2008-06-05 12:31
    When I go to compile / debug it wants me to specify a password for the certificate file.
    What is the password?

    Thank you Chris. [noparse]:)[/noparse]

    This looks like a great program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Building Blocks To The Propeller Chip
  • computer guycomputer guy Posts: 1,113
    edited 2008-06-05 13:29
    I got the other to work.

    Can someone please test this program? Thank you smile.gif

    I don't have all the features working but It would be nice to know if I am on the right track and I don't own an RFID reader. smile.gif


    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Building Blocks To The Propeller Chip
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-05 13:51
    Hmmm, password? You’ve got me on that one. I am just trying to get used to VB.net having moved from VB6 which I hadn’t touched in over 3 years. Seems everyone I sent the source code to didn’t have any problems so I’m not sure why it is prompting you. Perhaps Unsoundcode or QuattroRS4 can chime in and offer anything they may know about that? Or anyone for that matter? I can’t tell though if your follow up reply pertains to the password issue or not. Did you get it working? If so, what did you do so others may know?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-06-05 18:09
    Hi CG, I did not have any problems with Chris's source but I have seen what you describe once before. You could try deleting the file from solution explorer that ends with the pfx extension and in the project properties under Signing uncheck Sign the ClickOnce Manifests.

    Did you have the same problem with the code I posted with the database. It uses the original source with Chris's certificate.

    I tried·the CG_RFID·the interface opened but·threw an exception when it received data.

    Jeff T.



    EDIT Chris, forgot to mention I emailed the database source did it get through. I have problems with attachments and my server at times.

    I also uploaded the setup files again as there might have been confusion with them being two seperate files in my previous attachment.

    Post Edited (Unsoundcode) : 6/5/2008 6:17:56 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-05 19:43
    Jeff,

    Yes, I did get the code; sorry…I get so much e-mail that I usually prioritize them by urgency. Sometimes that makes me forget the non-urgent ones for a few days…lol

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • computer guycomputer guy Posts: 1,113
    edited 2008-06-06 07:21
    @Chris
    I just unchecked the "Sign the ClickOnce Manifest" checkbox under project settings->signing.

    @Everyone
    Is there a way I can test my code. I have a spare BS2 laying around and a BOE.
    Could I write a short BS2 program to emulate the RFID reader, perhaps sending random Id's every 10 seconds?


    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Building Blocks To The Propeller Chip
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2008-06-06 09:46
    wrt .. certificate ..

    go to the application properties - look under 'signing' and 'security' and uncheck references to 'Clickonce' manifests .. you can then remove the .pfx file from the assembly..

    for more info have a read about crypt32.lib and crypt32.dll ...and clickonce manifests..

    Rgds,
    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-06-06 14:57
    John thanks for confirming what I was thinking.

    Computer Guy this code will emulate two RFID tags at 10 sec intervals

    main:
    PAUSE 10000
    SEROUT tx,baud,[noparse][[/noparse]10,"1234567890",13]
    PAUSE 10000
    SEROUT tx,baud,[noparse][[/noparse]10,"0987654321",13]
    GOTO main

    Jeff T.
  • computer guycomputer guy Posts: 1,113
    edited 2008-06-08 07:30
    Thank you Jeff, That worked however I did have to turn off the DTR cycle in the VB program.

    Can someone please test this. It works with my BS2 RFID emulator however so does the previous version uploaded, and it didn't work for Jeff.
    Jeff do you have the latest version of the .net framework. perhaps thats why it didn't work?


    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Building Blocks To The Propeller Chip
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-06-09 02:02
    Computer Guy, I installed NET Framework v3.5 and·both programs ran fine.

    The time was formatted better on the second.

    One small thing, a line feed or carriage return is being appended to the Tag ID

    How did you create the database BTW I would be interested to look at your solution.

    Jeff T.
  • computer guycomputer guy Posts: 1,113
    edited 2008-06-09 02:38
    Thank you Jeff.

    I will upload my code sometime today. Have some house work to finish first.

    I am yet to implement a database, however I am using a DataGridView component to display the Tag ID and time data.
    When a tag is scanned I check to see if it exists in the DataGridView (something like)

    For i = 0 to (DataGridView1.RowCount() -1)
        If DataGridView1.Rows.Item(i).Column.Item(0) = Data Then
            newTag = False
            Exit For
        Else
            newTag = True
        End If
    
    If newTag = True
        //enter new data
    Else
        //Update data
    End If
    
    




    Like I said I will upload my code later today.
    Hope that helps.

    Will be adding a database feature later today as well. I am thinking of using XML or MDB.

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Building Blocks To The Propeller Chip
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-09 13:47
    It occurred to me when I saw your post Computer Guy…If you’re using a BASIC Stamp to simulate the RFID Reader, one thing that can happen is that the BASIC Stamp will be reset after every read. This is because the DTR line is also used by the BASIC Stamp to reset it for a programming or identify cycle. The DTR line is used on the RFID Reader (the USB version, particularly) to enable it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • computer guycomputer guy Posts: 1,113
    edited 2008-06-10 06:07
    As promised here is the code.
    More is yet to be added. smile.gif

    @Chris
    Yes, because I don't have an RFID reader and therefore don't understand the operational characteristics as much as most people on this thread it took me a while to realise that the DTR was the cause of the BS2 not functioning properly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Building Blocks To The Propeller Chip
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-10 14:13
    Computer Guy,

    No problem…I think to some degree it’s a learning exercise for us all. I know that the most extensive programs written for this module won’t even be seen by most of us because they’ll be proprietary and used within a company/business.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • computer guycomputer guy Posts: 1,113
    edited 2008-06-12 07:48
    Ok here it is with database support.

    I have also uploaded the source for those interested.

    To enter or edit a name just click on a cell and start typing or press F2. To finish editing click somewhere else or press Enter.

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Building Blocks To The Propeller Chip

    Post Edited (computer guy) : 6/12/2008 7:53:39 AM GMT
  • computer guycomputer guy Posts: 1,113
    edited 2008-06-21 13:42
    Some feedback would be appreciated.
    Also if there are any features that people would like I would be happy to add them. Unless they want to add it themselves smile.gif

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Building Blocks To The Propeller Chip
  • matnosgmatnosg Posts: 7
    edited 2008-09-23 01:09
    Hey peeps.
    First of all i would like to say this forum is awesome.

    Okay, i've downloaded the rfid reader source from the first post.
    When i run the program, there's an error saying the datetimeoffset is not defined.
    I've tried defining it but it still doesnt't work.
    Did i define it wrongly?
    Any idea how i should define it or get around this problem?
    The picture is attached below.

    Thanks in advance. smilewinkgrin.gif
    I'm using Microsoft Visual Studio 2005 by the way.

    Post Edited (matnosg) : 9/23/2008 1:14:25 AM GMT
    1024 x 768 - 131K
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-09-23 01:44
    Hi, I had a similar problem and can't remember the fix at the time. I think·the problem is·something to do with the VB version or NET framework version.

    Anyway here's another way to get around it for now and perhaps introduce a new concept. The line thats giving an error is only a 1.5 second timer so use the following code in place of the error line and in place of the DO..LOOP.

    Dim mytimer As New Stopwatch

    Do Until mytimer.ElapsedMilliseconds > 1500

    mytimer.Start()

    Application.DoEvents()

    Loop

    mytimer.Stop()

    mytimer.Reset()

    Jeff T.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-23 14:18
    Matnosg,

    Which version of VB are you using? If it is prior to 2005 that function may not be defined. See Jeff’s work-around. That section of the code is designed to generate a 1.5 second delay. Feel free to make any changes you like to the code to make it useful for you. You may also post any updates or additions you think others will benefit from. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • feel the beatfeel the beat Posts: 8
    edited 2008-10-17 12:58
    can i use it with Javelin Demo Board ???

    to just read the tag or plz guide me to any way to read the tag by using Javelin Demo Board with serial RFID reader


    Regards
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-17 21:11
    Sure you can use it with the Javelin Demo board. Your options would be to modify the Javelin code to send what the software is expecting or modify the VB application to work with your Javelin code. Either way you’ll want to disable DTR from the application so you’re not resetting your Javelin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • feel the beatfeel the beat Posts: 8
    edited 2008-10-18 17:07
    can you explain more please

    how i can do that because i am really stuck with that [noparse]:)[/noparse]


    regards
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-20 15:41
    I’m unclear as to which option you are looking at…perhaps this would be better posted in the Javelin Forum if you’re not looking to make any changes to the VB software.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • feel the beatfeel the beat Posts: 8
    edited 2008-10-21 08:18
    i meant that i would take the choice that you provide in your post about modify the Javelin code to send what the software is expecting or modify the VB application to work with your Javelin code.

    how that can done do i need to change anything in javlin code and which part ?? thats all and also the same in VB code if i need to change anything

    Thanks a lot for your appreciated and useful help [noparse]:)[/noparse]

    Regards
Sign In or Register to comment.