LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cycle through string box?

I want to read serialnumbers[char] in an Array[20]. Therefore I use a StringBox (I have no idea if that is the right way to do that!). I want to read the serialnumbers with a barcodereader. This reader acts like a normal keyboard. My question is now: How do I automaticlly cycle that after the first string is read into the stringbox, I can read the next string without hitting a butten? The barcodereader can generate an Enter or an linefeed, what ever makes an event for LabWindows.
0 Kudos
Message 1 of 2
(2,936 Views)
I'm not sure about this particular barcodereader that you are using, but if it does generate keystrokes just like a keyboard, this would be a perfect way to programmatically interact with your textbox in CVI. For instance, if you set up a callback like the following, you can wait for a key to be pressed when the textbox is selected and check to see if it is the enter key:

int CVICALLBACK TextBoxCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event) {
case EVENT_KEYPRESS:
if (eventData1 == VAL_ENTER_VKEY) {
// Do textbox manipulation here
}
break;
}
return 0;
}

Check out the description of the EVENT_KEYPRES
S event and the constants defined in the user interface library for the various different key codes within the LabWindows/CVI Online help.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
Message 2 of 2
(2,936 Views)