Thread: a liitle knowledge about RFID

  1. #1
    Registered User
    Join Date
    Oct 2009
    Location
    Indonesia
    Posts
    68

    a liitle knowledge about RFID

    I am trying to read from RFID tag from reader-12,
    but I have no idea what is the first thing I must learn..
    must I try serial port first? and how can I get the value from the tag?
    any example or tutorial?
    Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    How To Ask Questions The Smart Way
    Is there anything in your post which enables us to accurately and quickly identify the device that you have?

    > must I try serial port first?
    No idea.
    It would be a waste of time if your device plugs into the USB though.

    > and how can I get the value from the tag?
    *shrug*

    > any example or tutorial?
    ...
    > but I have no idea what is the first thing I must learn..
    The first thing you must learn is how to use a search engine.
    Step 1 - type in the manufacturer (and perhaps model number) of the device you're interested in
    Step 2 - add keywords like "SDK" "programming" "development"
    Step 3 - add keywords like "source code" "examples"
    Sooner or later, you'll stumble into the manufacturers website aimed specifically at developers who want to develop software and solutions using their particular device. It's in THEIR interest that such information is available, since the more people who develop applications for it means more hardware sales for them.

    Having found the right site, download and read every technical note, application note, how-to or anything else which might seem relevant to the problem (and hardware) at hand.

    They may even have a forum such as this, just for helping would-be developers to get up and running.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Would that be this device: https://www.sparkfun.com/products/8419
    I know a lot about RFID as I work with it quite often at my workplace. Heck I can even tell you how they work, and know much of what one needs to know to build a reader.
    But it turns out that you haven't provided much useful information for us to help you.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Indonesia
    Posts
    68
    yeahhh..
    I havent got any idea until now x_x

    I am using visual studio 9..

    Code:
    #include <windows.h>
    #include <stdio.h>
    
    int main(int argc, char *argv[])
    {
       DCB dcb;
       HANDLE hCom;
       BOOL fSuccess;
       char *pcCommPort = "COM2";
    
       hCom = CreateFile( pcCommPort,
    			GENERIC_READ | GENERIC_WRITE,
    			0, // must be opened with exclusive-access
    			NULL, // no security attributes
    			OPEN_EXISTING, // must use OPEN_EXISTING
    			0, // not overlapped I/O
    			NULL // hTemplate must be NULL for comm devices
    			);
    
       if (hCom == INVALID_HANDLE_VALUE) 
       {
           // Handle the error.
           printf ("CreateFile failed with error %d.\n", GetLastError());
           return (1);
       }
    
       // Build on the current configuration, and skip setting the size
       // of the input and output buffers with SetupComm.
    
       fSuccess = GetCommState(hCom, &dcb);
    
       if (!fSuccess) 
       {
          // Handle the error.
          printf ("GetCommState failed with error %d.\n", GetLastError());
          return (2);
       }
    
       // Fill in DCB: 57,600 bps, 8 data bits, no parity, and 1 stop bit.
    
       dcb.BaudRate = CBR_57600;     // set the baud rate
       dcb.ByteSize = 8;             // data size, xmit, and rcv
       dcb.Parity = NOPARITY;        // no parity bit
       dcb.StopBits = ONESTOPBIT;    // one stop bit
    
       fSuccess = SetCommState(hCom, &dcb);
    
       if (!fSuccess) 
       {
          // Handle the error.
          printf ("SetCommState failed with error %d.\n", GetLastError());
          return (3);
       }
    
       printf ("Serial port %s successfully reconfigured.\n", pcCommPort);
       return (0);
    }
    this is the simple code I got when I was searching, but all I got an error
    createfileW cannt conver parameter 1 from 'char *' to 'LPCWSTR'
    Last edited by Kinshara; 01-24-2013 at 05:34 PM.

  5. #5
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Fact - Beethoven wrote his first symphony in C

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    You NEED to set the correct baud rate; not pick one at random!

    Code:
    dcb.BaudRate = CBR_57600;     // set the baud rate
    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  7. #7
    Registered User
    Join Date
    Oct 2009
    Location
    Indonesia
    Posts
    68
    Last edited by Kinshara; 01-25-2013 at 11:56 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading RFID using C
    By anthonyung in forum C Programming
    Replies: 39
    Last Post: 03-09-2011, 09:07 AM
  2. After having a basic knowledge of C...
    By 7h3_0r4c1_3 in forum C Programming
    Replies: 1
    Last Post: 03-03-2011, 08:18 AM
  3. Liitle help with boolean expressions
    By Voyd in forum C++ Programming
    Replies: 2
    Last Post: 05-30-2006, 08:17 PM
  4. C++ knowledge
    By indranilmuk in forum C++ Programming
    Replies: 8
    Last Post: 08-21-2002, 11:08 AM
  5. need a bit knowledge...
    By xlord in forum C Programming
    Replies: 4
    Last Post: 03-31-2002, 05:16 AM