Arduino barcode reader with c#

Can you help me? I am a beginner, I have a small project that I want to realize. the idea is to be able to connect a barcode reader to Arduino and when I make a scan on a barcode, this code should be displayed on a LCD screen and at the same time should be displayed in a textbox of an application C # on my PC. When the code is displayed in the textbox it must automatically generates an action to Arduino to open a door. I do not want to send this code by clicking a button, I want it to be sent automatically when it displayed in textbox. i want to have an idea about the mechanism how this can be realized. how to communniicate between the PC and the LCD connected to Arduino and how to get the information displayed on this LCD to display it in the textbox? and what kind of data I need to send and receive? Is the communication in real time or i have to program Arduino away from my c# application. And thank you very much

The arduino communicates with the pc by using Serial.print or Serial.write commands. As far as your c# code is concerned, the fact that there's an arduino involved is irrelevant. It's all about reading and writing of the serial port.

The event handlers for text boxes implemented in c# on a PC are hardly a topic for an arduino forum any more than if you wanted us to write some javascript to send ajax commands to php server that can execute cgi scripts that run a daemon tthat use postscript methods to open an odbc driver to embed SQL in SOAP that then telnets to an ftp server written in VAX fortran imlemented on a sunspark workstation over a VPN connection. You'll have to research that bit yourself.

KenF: The arduino communicates with the pc by using Serial.print or Serial.write commands. As far as your c# code is concerned, the fact that there's an arduino involved is irrelevant. It's all about reading and writing of the serial port.

The event handlers for text boxes implemented in c# on a PC are hardly a topic for an arduino forum any more than if you wanted us to write some javascript to send ajax commands to php server that can execute cgi scripts that run a daemon tthat use postscript methods to open an odbc driver to embed SQL in SOAP that then telnets to an ftp server written in VAX fortran imlemented on a sunspark workstation over a VPN connection. You'll have to research that bit yourself.

thank you for you replay. is that means that is possible to do this project with this senario?

I think it sounds highly plausible as a project to use c# to monitor the serial port to get the output from your arduino. It also sounds likely that c# would be able to update a textbox on the screen.

Unfortunately c# is one of the few programming languages that I've heard of but never used. I've never been in any situation where it seemed more relevant than something else at my disposal. I may look into it one day, but probably not.

KenF: I think it sounds highly plausible as a project to use c# to monitor the serial port to get the output from your arduino. It also sounds likely that c# would be able to update a textbox on the screen.

Unfortunately c# is one of the few programming languages that I've heard of but never used. I've never been in any situation where it seemed more relevant than something else at my disposal. I may look into it one day, but probably not.

KenF , your replay helped me, thank you. i will buy these devices and try to realise this project. i have some knoledges in java and c# but i m confused with the mecanism how to send and retrieve data to and from arduino with c# because i dont know what are the methods and which can do this

If the arduino reads the barcode and controls the door(s), what part does the PC play? i.e. why send the barcode to the PC and back before opening the door?

Take a look at the .net SerialPort class. Just be aware that you’ll have to parse what ever data flows between PC and arduino yourself - the arduino in particular will just send & receive character data - it’s up to you to make sense of it.

wildbill: If the arduino reads the barcode and controls the door(s), what part does the PC play? i.e. why send the barcode to the PC and back before opening the door?

Take a look at the .net SerialPort class. Just be aware that you'll have to parse what ever data flows between PC and arduino yourself - the arduino in particular will just send & receive character data - it's up to you to make sense of it.

Thank you wildbill

because i want to search if this barcode exists in the database in my PC, and after this i want that every barcode scanned by the barcode reader will be checked if it exist in the database or not. if exists i will communicate again with arduino to open the door and at the same time i use the form of C# to show some information about the barcode(because this barcode is given to persons, everyone want to enter or exit the door he must scan). I think it is clear now the idea.