Reading data from a COM port
I want to get input from a barcode-scanner, which is connected to a CHD cash register, which is connected to a Windows XP PC trough a COM port. I want to read the data from the scanner and the cash register, and send the data to a program, which has a table with items in a shop. And provide a function which removes items, too.
Where should I start? Is there a code in Delphi or Java, that can get that开发者_运维问答 data into a program?
@Demonick, most barcode scanners work is simply as a keyboard interrupt. you need just set the focus of an text control (like an TEdit or TMemo) an will receive the barcode as if it was typed using the keyboard.
Anyway if you need access the com port using delphi you can use the TurboPower Async library or the ComPort Library.
I like TComPort, but if you prefer to write your own code you can also use ReadFile.
There's also comport library from Synapse project: Synaser. I haven't used Synaser, but I have good experiences with Synapse and Synaser should be pretty similar.
精彩评论