LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Barcode input from scanner issue

Hello guys,

 

there is some strange behavior when using barcode scanner.

When i scan barcode with scanner (Honeywell 1900) to fill string control, sometimes it reads wrong characters.

From 10 times, i have OK readings 8 times, and 2 times NOK readings.

I excluded chance that something is wrong with the scanner, because in Notebook, i scan 100 times without any NOK readings. I tried different angles, distances, etc, everything works perfect in notebook.

I'm scanning barcode with content : 7414795-05

On the other hand, in my block diagram, probe shows something else in NOK case: 7414795-055.

milan87_0-1698924500933.png

From some reason in labview is added one more character.

Seams like labview capture characters from barcode scaner to slow, so last character is repeated, or something similar.

Situation is even worse, if barcode has more characters, let's say 40 or more.

Operating system is Linux OpenSuse and Debian.

 

Notepad:

milan87_1-1698925034327.png

 

Can someone advise, how to overcome this problem. Or any idea. I'm stuck with this.

 

Thanks a lot.

 

 

0 Kudos
Message 1 of 15
(1,509 Views)

Hi milan,

 

how do you read the scanner data?

Does the scanner work in "keyboard emulation" or in "serial communication" mode?

 

I guess it works in "keyboard emulation" aka HID device mode because you verify the scanner data using Notepad…

So how do you place the scanner data into your string?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(1,473 Views)

Hi Gerd,

 

yes it works in keyboard emulation.

''How do you place the scanner data into your string?'' just select string control on front panel, and scan barcode.

 

 

0 Kudos
Message 3 of 15
(1,463 Views)

Hi Milan,

 


@milan87 wrote:

''How do you place the scanner data into your string?'' just select string control on front panel, and scan barcode.


Do you clear the string before "selecting" it?

By "selecting" I guess you talk about "setting key focus", do you?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(1,456 Views)

Yes, control is clear.

Yes, correct key focus is on that string control.

 

0 Kudos
Message 5 of 15
(1,450 Views)

Hi milan,

 


@milan87 wrote:

Yes, control is clear.

Yes, correct key focus is on that string control.

 

From some reason in labview is added one more character.

Seams like labview capture characters from barcode scaner to slow, so last character is repeated, or something similar.

Situation is even worse, if barcode has more characters, let's say 40 or more.

Operating system is Linux OpenSuse and Debian.


So the scanner works in HID mode and "types" keys into any kind of text input.

Notepad/editor accepts the scanner data correctly - and you think LabVIEW does handle keyboard input "too slow" and so it will repeat certain chars?

 

I don't think so: in my experience with several setups using barcode scanners LabVIEW never is the limiting part when handling the scanner data. And I use the same setup of HID-mode scanners typing into string controls.

The only difference I see is the OS as my systems run on Windows10…

 

Can you verify your observation by:

  • start LabVIEW
  • opening a new VI
  • place a string control on the frontpanel and make it as large as possible
  • set the keyfocus to that string control
  • let your barcode scanner scan/type different labels and watch the result…

Do you still see the problem?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(1,434 Views)

Just to be clear and re-emphasize Gerd's point, if you have a string control with a single line visible but the control is set to multiline mode, it can appear empty when in fact the opposite is true.

aputman_0-1698935749689.png

Are you purely scanning into a string control only, no code to manipulate the text in any way (event structure, etc)? 

I can think of no other reason why it would add a character in LabVIEW but not in Notepad. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 15
(1,418 Views)

Hello guys,

 

you have right, when i create separate VI with string control, and key focus, scanner works perfectly.

But still away from solution.

 

I noticed next behavior.

In normal case as i mention, 8 from 10 times is ok.

But, while i trying to debug this issue, i open plenty of different windows, and use probes.

In this case i noticed that error is not just 7414795-055. Now is 7414795-05795-05 and similar examples.

 

How is done in this code.

first, control is clear:

milan87_0-1699007671973.png

Then string is concaneted character by character.

Somehow, value reading from property node should be empty string, but obviously not, even if i clear it first.

milan87_1-1699007781795.png

Then if i add more probes, then i have different outcome:

milan87_2-1699008167673.png

 

I'm using actor framework, but everything is send ok to this block, and here problem occurs. At least i think.

 

 

 

 

 

0 Kudos
Message 8 of 15
(1,363 Views)

Hi milan,

 


@milan87 wrote:

Then string is concaneted character by character.

Somehow, value reading from property node should be empty string, but obviously not, even if i clear it first.


Here's your problem!

  • Why do you need to concat the string char by char?
  • Why do you need so many property nodes?

Why don't you set the string input to "don't update with each char" and "limit to single line"? Most barcode readers are able to add a CR/LF char at the end so you can easily react on "value change" of the string once you received the full barcode string!

 


@milan87 wrote:

you have right, when i create separate VI with string control, and key focus, scanner works perfectly.


So the problem is not the scanner. And the problem is not LabVIEW.

The problem is your specific actor-framework VI as a simple generic VI works as expected…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 15
(1,357 Views)

Ok, understand, but...

Why is a problem, if i have many property nodes?

Also what is problem if i concat char by char?

0 Kudos
Message 10 of 15
(1,349 Views)