08-02-2017 10:20 AM
Hello All,
I will be using 5 RS-232 barcode scanner with RS-232 to USB converters.
I want to read the barcodes/string only when the operator triggers the barcode scanner, i.e. dont want to read the port all the time.
how can I do it ??
Thanks
Solved! Go to Solution.
08-03-2017 04:53 AM
How does this trigger look like?
20 years ago the rs232 scanner where always connected to the PC/controller and just send data when the operator pulled the trigger AND there was a successful scanning. Has that changed?
While you can monitor all 5 serials in parallel , I assume the some ms delay doesn't hurt.
So all you need is one producer loop with an event and 5 registered (bytes at port) events ...
08-03-2017 06:07 PM
James,
I sent you a reply to the PM you sent me. If I have your email address, I'll send you a framework based on what I described in the other forum thread you referenced. It's not that complex, but it does use a few techniques a beginning LabVIEW programmer might stumble over. It's the most elegant solution (IMO) to allow a variable number of barcode readers to all be processed efficiently.
For anyone else following:
VISA reads are fully reentrant and consume almost no CPU while waiting for data to show up. The consuming event structure presumably sleeps (or does other useful work) and gives immediate attention to the arrival of scan data. The code doesn't need to be revisited whether you have two ports or two dozen - that's handled at runtime.
Best regards,
Dave