LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get data from bar code scanner

I have the barcode scanner (kb-emulation).
I need to get data from it IN shadow loop.
I.e. I have main window where is user interact with the application. And if the user scan code, the data should be checked in DB and another processing.
So, I can't use string control, event structure etc.
Vi from connectivity -> inp dev control has some trouble.
If I set small timeout, I recive dublition simbols, and if I set normat timeout, I can loose data (see screenhots).
And the same time in notepad (emulation of main window) I get normal data.
How can I get correct string data?

scan1.pngscan2.png

Download All
0 Kudos
Message 1 of 32
(7,552 Views)

Hi Artem,

 

get rid of those keyboard functions.

Set key focus on your string control, then scan the barcode.

As the scanner acts as keyboard the scanned chars will by "typed" in the string control.

 

I have main window where is user interact with the application.

Have your user do only one thing at a time: either interact with the app or scan barcodes…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 32
(7,539 Views)

Set key focus on your string control, then scan the barcode.


Impossible.
Here is no string control for barcode.

For example, code will like command. The user scans code and the program executes task.
Scan code and get result = one action
Set focus, scan code and get result = two action.

0 Kudos
Message 3 of 32
(7,518 Views)

Hi Artem,

 

Impossible. Here is no string control for barcode.

Then create a string control. You could even place it outside the bounds of your front panel…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 32
(7,516 Views)

Then create a string control. You could even place it outside the bounds of your front panel…


And how you'll set focus on control exactly before scanning?

 

My task really bigger.
One app (not LabVIEW) controls the system, I can't change it. And this app take data from scanner.
And I need second minimized app (LV). This one will check every code in DB. If code has flag "not tested", the second app must open warning window.

0 Kudos
Message 5 of 32
(7,509 Views)

Hi Artem,

 

And how you'll set focus on control exactly before scanning?

Using a property node of this string control…

 

My task really bigger. One app (not LabVIEW) controls the system, I can't change it. And this app take data from scanner. And I need second minimized app (LV). This one will check every code in DB. If code has flag "not tested", the second app must open warning window.

Then you should explain this right from the beginning!

Why do you want to receive the scanned barcode when it is handled by that "one app (not LabVIEW)"?

Why do you need this barcode when your LV app is reading a database?

How do you communicate between both apps?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 32
(7,505 Views)

We're using a Bar Code Scanner that "talks" to a VISA Port (COM4).  The instructions from the Scanner says that it uses standard Serial Parameters, with 0x04 used as a Termination Character, so we open VISA using these settings.  When a reading is taken, the string that we want is the initial String with an 0x01 character separating fields -- we only want the first field, so we read 100 characters (more than we expect), split the string at 0x01, and return the initial String.  We do this in an Action Engine with three (obvious) Actions -- Open, Read, and Close.  Works just fine.  This Bar Code Reader works for both QR tags and linear Bar Codes.

 

Bob Schor

0 Kudos
Message 7 of 32
(7,484 Views)

Why do you want to receive the scanned barcode when it is handled by that "one app (not LabVIEW)"?

Why do you need this barcode when your LV app is reading a database?


Because I NEED CHECK barcode in DB.
I have no and I can't communication between both apps.

0 Kudos
Message 8 of 32
(7,478 Views)

@Bob_Schor wrote:

We're using a Bar Code Scanner that "talks" to a VISA Port (COM4).  


I work via USB, and scanner in kb-emulation mode. I can't change mode because I can't modify first app

0 Kudos
Message 9 of 32
(7,477 Views)

I'm unsure what you mean by "USB and scanner in kb-emulation mode".  Our scanner is plugged into a USB port, and we treat that USB port as though it was a KeyBoard (which, to me, is kb-emulation).  I'm not sure (as I'm not near that PC) whether we have additional kb-emulation software, or whether MAX just "handles" it for us.  I could check ...

 

Bob Schor

0 Kudos
Message 10 of 32
(7,463 Views)