11-02-2023 06:37 AM
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.
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:
Can someone advise, how to overcome this problem. Or any idea. I'm stuck with this.
Thanks a lot.
11-02-2023 08:07 AM - edited 11-02-2023 08:09 AM
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?
11-02-2023 08:32 AM
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.
11-02-2023 08:49 AM
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?
11-02-2023 08:54 AM
Yes, control is clear.
Yes, correct key focus is on that string control.
11-02-2023 09:27 AM
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:
Do you still see the problem?
11-02-2023 09:45 AM
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.
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.
11-03-2023 05:46 AM
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:
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.
Then if i add more probes, then i have different outcome:
I'm using actor framework, but everything is send ok to this block, and here problem occurs. At least i think.
11-03-2023 05:58 AM
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 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…
11-03-2023 06:22 AM
Ok, understand, but...
Why is a problem, if i have many property nodes?
Also what is problem if i concat char by char?