BARCODE READER


Hemendra

Recommended Posts

That depends a little on the output of the scanner, but in general the scanners send the scanned value plus a carriage return.  So you would do something like this for a numeric scan:

device.myDevice.purge()
private string datain
while(1)
   try
      datain = device.myDevice.readUntil(13)
      myChannel.addValue(strToDouble(datain))
   catch() // ignore timeout errors as scans are intermittant
   endcatch
   delay(0.1)
endwhile


    

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.