Click here to Skip to main content
15,881,735 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a RFID reader which gives output in rs232 and I want to create a task for reading the data whenever a person scans the RFID card can anyone help me with how to create a task for this ?

What I have tried:

Not familiar with the task creation
Posted
Updated 25-Apr-22 12:18pm

Start with the RFID reader manufacturer website: they will have the details - and maybe even sample code - that you need. RS232 is just an unclocked serial link - you need to know the port parameters (baud rate, BPC, stop bits, and parity) before you can even start programming for it, and then you need to know exactly what it sends and when before you can properly understand the data you will receive.

So get that lot, then use an app like Hyperterminal to check that you understand the data before you even think about trying to code anything.
 
Share this answer
 
You need to learn C in depth and than try your luck with RS 232. Than you may send some bits to the controller and get some back.

Start with some video RS 232 tutorial and search for more.

You must also understand threading because that interface is serial and so after sending some commandos you may have to wait for an answer. Here is good overview and some sample code.

PS: I have done this nearly 20 years ago, so believe my experienced tips
 
Share this answer
 
embedded, C, RFID
I have a RFID reader which gives output in rs232 and I want to create a task for reading the data whenever a person scans the RFID card can anyone help me with how to create a task for this ?


1. You want a Thread listen to the reader without blocking your mainprogramm?

You didn't write what operating system you're using, if any. Without an operating system, you have to deal with an interrupt handler. If you have a POSIX compliant system, you can use CreateThread.

2. You only need one Thread to do this, running in a Loop.

3. The parameters required for communication should be in the data sheet. These must be set, otherwise the communication will not work.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900