Like Tree3Likes
  • 2 Post By iMalc
  • 1 Post By Click_here

a liitle knowledge about RFID

This is a discussion on a liitle knowledge about RFID within the C Programming forums, part of the General Programming Boards category; I am trying to read from RFID tag from reader-12, but I have no idea what is the first thing ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    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.
    Crossfire and stahta01 like this.
    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,500
    stahta01 likes this.
    Fact - Beethoven wrote his first symphony in C

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

    Code:
    dcb.BaudRate = CBR_57600;     // set the baud rate
    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  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, 09:17 PM
  4. C++ knowledge
    By indranilmuk in forum C++ Programming
    Replies: 8
    Last Post: 08-21-2002, 12:08 PM
  5. need a bit knowledge...
    By xlord in forum C Programming
    Replies: 4
    Last Post: 03-31-2002, 05:16 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21