LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

aquire data input keyboard

Hi all,

 

 

 

I'm having a problem with the aquire data input function for the keyboard. I can get the VI's to work and detect if my keyboard is pressed, but for some reason the VI thinks that my keyboard is a QWERTY keyboard, while in reality it is a AZERTY. The weird part is that while I'm typing in LabView that it is in AZERTY, so only when I use the aquire data input it changes to QWERTY. Can anyone help me with this? Or does anyone have an eplanation why this happens?

 

 

Jeroen

0 Kudos
Message 1 of 5
(3,436 Views)

Hi Jeroen,

 

Can anyone help me with this? Or does anyone have an eplanation why this happens?

You could start by reading the help for this function!

It clearly states:

keys pressed indicates which keys were pressed when the VI ran. This parameter returns values associated only with US keyboards

 When you use a different keyboard layout you need to convert the result of that function to your layout, using a lookup table could help here.

 

Why do you use this function at all? Why not use an event structure to catch "key press" events?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,419 Views)

Hi GerdW,

 

 

Thanks for the speedy reply and the information! I'm quite new to using labview, and I am going to use it to automate a chemical module. It would be easier to control it with keys in stead of using a mouse to click on all the switches. And after looking around on the internet I found the aquire data input and thought that would be easy to use, but I'm going to check the "key press" event to see if it is easier to use.

 

 

Kind regards,

 

 

Jeroen

0 Kudos
Message 3 of 5
(3,392 Views)

Hi Jeroen,

 

using events is definitely easier, especially when combined with a producer-consumer structure.

No need to poll the keyboard, only react on events generated by the user!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(3,376 Views)

I'm not sure what your application is, but to simplify things some times I just put a string control, and I right click it to set Update While Typing, then when the VI starts set focus to it with a property node.

 

With that in place if you type on the keyboard then it will be seen as a value change even on the event structure.  I've done this in the past where I want to allow a barcode to be scanned, but also to allow the user to type in a number and hit enter.  I then bind the OK button to the return key, so after the barcode is scanned, or after the user types it in and hits enter, the value change on the OK is triggered and the entered string is returned.

 

Of course sometimes this setup doesn't work, and you really do want to just user the Key Down? event on the whole VI, or use the function linked to by GerdW.

0 Kudos
Message 5 of 5
(3,348 Views)