LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Permanently monitor the value changes of a string.

Solved!
Go to solution

Hi everyone,

 

I'm looking for a solution to this very question. More info: I have a dialog-type VI with only one text-field, i.e. a string. The user needs to scan a Data-Matrix-Code from a device into this string. The scanner itself works as if the user had typed the code through his keyboard.

Is there a way to notice that the input has been given without need for additional confirmation from the user (pressing the enter button or, for some reason this works as well, clicking anywhere in the window)?

 

The workflow of this process needs to be smooth, hence the registration needs to be automatic.

 

Thanks in advance,

 

Regards,

 

Pedro

0 Kudos
Message 1 of 4
(2,534 Views)

Pedro

 

I have worked with scanners a bit in the past and from what I remember you can set them up one of two ways.  The first as you described when the scanner acts like the keyboard and the second when the scanner acts a comms device.  From what I recall it is better to use it as comms device when trying to automate things.  Providing a model number of the scanner may help with ideas.

 

If you don’t wish to change how the scanner operates is their some additional info about the scanned string you could use a trigger, such as a standard length or termination character.

 

Regards

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 2 of 4
(2,521 Views)
Solution
Accepted by topic author Pedro89

Hi,

 

I just figured out how to do this stuff, that is by activating "update value while typing" for my string. this way labview automatically permanently checks the input and so I can use it as a break condition for my loop.

 

Thanks anyway for your input 🙂

 

Regards,

 

Pedro

0 Kudos
Message 3 of 4
(2,517 Views)

You are absolutly right! you need to look at the behavior of the string.

 

Take the attached code as an example (I use this often for just exaclty the same reason, getting barcode inputs from users)

 

"String" is limited to single line so the value change event fires when the user ends text entry (Either by typing and pressing enter and typing and changing key focus)  Because we do not want to fire a val change event each time a charater is typed I have de-selected update value while typing.

 

There is some additional code in the example to allow the developer to create a prompt and a regex to test the format is as expected.  Default values have been set to demo that feature.

 

Oops- minor edit:  I suppose I shhould show the run button so you can all play with the vi standalone.Smiley Very Happy


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 4
(2,506 Views)