Hemendra Posted January 24, 2018 Share Posted January 24, 2018 HI, am using Barcode Reader having serial output. what protocol I need to use in DAQ? Link to comment Share on other sites More sharing options...
AzeoTech Posted January 24, 2018 Share Posted January 24, 2018 You'll use the NULL protocol, then write a little script to read from the serial port and process the input. Link to comment Share on other sites More sharing options...
Hemendra Posted January 24, 2018 Author Share Posted January 24, 2018 I don't know which script to use, request you to provide it. Link to comment Share on other sites More sharing options...
AzeoTech Posted January 25, 2018 Share Posted January 25, 2018 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 More sharing options...
Hemendra Posted January 25, 2018 Author Share Posted January 25, 2018 it worked. thank you so much. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.