LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Barcode reader into String control

Good morning everybody
I have four String controls which
contain different data read from Barcode reader.

I wish that after reading 1st information
the focus will skip to the next String control
so the 2nd information ,read from Barcode, will be written to the 2nd string control, and so forth..
(now i press the "TAB" key to skip from one control
to another)

thanks in advance
0 Kudos
Message 1 of 8
(4,195 Views)
israelsze1 wrote:

> Good morning everybody
> I have four String controls which
> contain different data read from Barcode reader.
>
> I wish that after reading 1st information
> the focus will skip to the next String control
> so the 2nd information ,read from Barcode, will be written to the 2nd
> string control, and so forth..
> (now i press the "TAB" key to skip from one control
> to another)

It depends. what is the signal from the reader, that the data for one
field is written and the next one is coming?
Does the reader send a certain value than?
does the Reader simulate keyboard-input?

Many of the "keyboard-readers" can send a cr/lf at the end of the
reading. In this case you could just get the value wit a filter event in
an event structure, and "
replace" it with a tab (the other values you
just wire thru).

Another Idea is, to replace your controls by indicators, read the values
either by a event structure or by another control and wirite the values
programmatically in the indicators. for reading the inidcators you can
just user local variabes for example.

Hope, this helps a bit

Marco Tedaldi
0 Kudos
Message 2 of 8
(4,195 Views)
thanks MArco
my Barcode reader simulates the keyboard
it sends LF after the data characters.

as i understand , you suggest to create
event filter which will analyze the incomming
charaters and add a TAB character at the end, ok?

since i am new to LABV7, can you be more specific
how to do this? perhaps to send me a sample VI
for this..

thanks in advance..
0 Kudos
Message 3 of 8
(4,195 Views)
israelsze1,


Attached below is an example VI that shows how to change the keyfocus when a carriage return (the enter key) is read. This example assumes the bar code reader acts as a keyboard and uses the filter event, "Key Down?".

Hope this helps in your development.

Regards,

Matt F

NOTE: This VI will stop with an error after the 5th press of the enter key. I didn't program the logic to stop when the last control was written to.
0 Kudos
Message 4 of 8
(4,195 Views)
Thanks, it is very helpfull
0 Kudos
Message 5 of 8
(4,195 Views)
dear Matt

i tried your example, a bit later,
the problem is when i type the informatin manually
it works fine, but i "barcode" the information
into the fields (its faster then manually) it doesnt work its "getting crazy"

do you have any idea...
0 Kudos
Message 6 of 8
(4,195 Views)
Have you considered a different approach? Put all incoming data into one string and then use the string functions (Match Pattern, Scan from String, etc.) to parse out the portions of the data into the separate locations.

The user interface and the data acquistion can be put into different loops running at different speeds. The acquisition loop would do nothing except gather data from the barcode reader and pass it to the other loop via a queue or functional (LV2 style) global. If possible do not put it into a front panel control. If it goes to the panel it will run in the UI thread, which may be slowed by other user actions. Put a wait function in each loop to assure time sharing - even a zero ms wait in the acquisition loop forces LabVIEW's
scheduler to let othe loops run occasionally.

Separating acquisition from processing and user interaction is a good way of avoiding many timing problems.

It is also possible that the OS gives priority to some other task resulting in missed data from the barcode reader.

Lynn
0 Kudos
Message 7 of 8
(4,195 Views)
Good idea johnsold.

It may be better to acquire all the data first and then move the data to front panel indicators once all data has been received. The link below may be of some help in string parsing.

Keyword Search: Parse String VI

Message Edited by Molly K on 02-18-2005 11:58 PM

0 Kudos
Message 8 of 8
(4,196 Views)