ocr - Serial Port listening in C# -
there loads of questions listening of devices on serial port using c#.
however couldn't find useful application , working.
now code decided use cannot see why not output anything:
namespace serialports { class program { static void main(string[] args) { serialport myport = new serialport();
myport.datareceived += myportdatareceived; myport.portname = "com3"; myport.baudrate = 19200; myport.databits = 7; myport.parity = parity.even; myport.stopbits = stopbits.one; myport.open(); console.readline(); myport.close(); } static void myportdatareceived(object sender, serialdatareceivedeventargs e) { var myport = sender serialport; console.writeline(myport.readline()); } } }
my device ocr passort reader.
i expect string when swipe passport. nothing, no output @ all.
can please me can make output string @ least?
btw know ocr reader working since there app coming outputs data , when use apps test com data code nothing. appreciated!
regards!
Comments
Post a Comment