LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Which port will the USB scanner send data through?

Solved!
Go to solution

TakeANap,

 

While it's nice to be agreed with the approach I offered, I'll comment on one portion of your reply - you absolutely don't need to "build[s] up a string until a CRLF+some other codebyte comes in".  Just set your barcode scanner to return a termchar (CR seems to be the default when used), and configure your VISA reference to end reads on that defined termchar.  Then in your loop use an outsized charcount into VISA Read, and check for timeout error.

 

Don't mess with "Bytes at Port"!

 

This advice is repeated ad nauseum in these forums, and it's the proper way to handle char-oriented interfaces 100% of the time where you have control over both ends, and 90% even where you don't.  (The other 10% is those places where the sending device uses some multi-character message-encapsulating format, like <DLE><SOH>...<DLE><ETX>).

 

But a virtual COM barcode reader is fully configurable.  Oh, and AIM ID.  If there's any chance you will have different barcode formats presented, it's a great way to know what got scanned.

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 11 of 12
(267 Views)

@DavidBoyd wrote:

TakeANap,

 

While it's nice to be agreed with the approach I offered, I'll comment on one portion of your reply - you absolutely don't need to "build[s] up a string until a CRLF+some other codebyte comes in".  Just set your barcode scanner to return a termchar (CR seems to be the default when used), and configure your VISA reference to end reads on that defined termchar.  Then in your loop use an outsized charcount into VISA Read, and check for timeout error.

 

Of course. I look for the termchar. I sometime use Bytes At Port != 0 when I need to proceed to the receiving part. 

 


But a virtual COM barcode reader is fully configurable.  Oh, and AIM ID.  If there's any chance you will have different barcode formats presented, it's a great way to know what got scanned.

 


Yes. I need to distinguish between two or three different codes. This AIM ID can be useful.  I also have a thought to use the scanner (handheld) to chose between different setups before test. Why not? I can produce the barcode at screen and the operator already hold the scanner because of the stickers on PCB. They can instantly proceed using scanner and scan let say the code for "start test product A" or "Register whatever". Why? They don't need to have the keyboard at a visible spot on the bench. I use TouchScreen monitor and the scanner as normal input devices during production.

 

Thanx for information about this.

0 Kudos
Message 12 of 12
(253 Views)