03-10-2015 01:32 PM
Hi,
I am using a barcode reader that uses keyboard emulation. The barcode types on the computer the same way a keyboard would. When I open notepad and use the barcode reader to read a barcode, the following meesage is typed:
S/N: 17967
Lin: 0.591%
Ph: 1.32deg
In that exact format. However, when I try use the reader in labview with a string control the format changes. The following meassages are printed instead:
S/N: 17967mn: 0.591%m: 1.32deg
S/N: 17967mn: 0.591%mn: 1.32deg
S/N: 17967mnLin: 0.591%mPh: 1.32deg
S/N: 17967mn: 0.591%m:1.32deg
So the format changes. Sometimes the Lin and Ph are printed other times they are not, spacing in the string changes, and in all cases the carriage return is no longer there.
Could you please let me know what might be causing this. Ideally I would like the message to be read in the same format it is in notepad. My code is attached.
Thanks
03-10-2015 03:31 PM
Try to enable '\' Codes Display so you can see what is going on. i use bar code scanners all the time and they work perfectly fine with a string input. Codes Display will show you spaces, line feeds, and carriage returns. It should never change an ASCII value to something different.
03-12-2015 10:49 AM
Thank you for the reply. I tried doing that and as expected sometimes the printed string included the spaces (indicated by \s) and other times it did not.
03-12-2015 11:03 AM
Then I would consider using a different bar code scanner. I always use Symbol Technologies. There is no reason that a bar code scan should ever be different. If you are using Symbol, there is a bar code you can scan to return the scanner to the factory default settings. See the user manual.
03-12-2015 11:12 AM
Thanks. The scan is the same when I use notepad or word. The format is not consistent with LabVIEW. Any idea why that might be?
03-12-2015 11:21 AM - edited 03-12-2015 11:36 AM
I have no idea and have not seen this issue before. You may want to list the make and model you are using to see if other have seen this issue. What happens if you copy the scanned information in notepad and paste into a LabVIEW string control? Is it the same information?
03-12-2015 11:34 AM
The string is displayed in the correct format when I copy from notepad.
This is the scanner I am using
03-12-2015 12:11 PM
Is there a reason you have a timeout event? You are not doing anything in there. So I would remove the timeout (you can just remove the timeout input or set it to -1).
I'm just thinking that if you set the focus while the scanner is doing its thing is causing the issue you are seeing.