01-26-2016 11:20 AM
Hi all,
This is my first post and I am still learning how to use Labview. For my project I wanted to control the DaNI robot with keyboard inputs. I started off searching for example codes and help on forums.
I found the "Monitoring keyboard and Mouse Activity.vi" from available examples in Labview. When I run the VI, the horizontal and vertical mouse positions are recorded but not the keys pressed. On my front panel the "Keys Pressed" array is greyed out and all the values stay at 0 no matter which keys i press (letters, numbers, function keys, number pad etc). I have tried similar VIs from forum posts but I always encounter the same probleme. They keyboard keys don't seem to be registered by Labview.
I attached the example VI in case.
Thanks for any Help!
01-26-2016
11:23 AM
- last edited on
06-10-2025
10:12 AM
by
Content Cleaner
It works for me. It is a polling functionality, so it will miss your key presses if they don't last long enough for an iteration to grab them.
At least we know your keyboard works because you were able to type this out.
Try holding down a key?
If you want to just control the robot when you have the LabVIEW window active, I would suggest you use the LabVIEW event structure functionality. You can trigger an event when the user presses keys and don't have to poll like above. It's much more efficient.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
01-31-2016 07:00 AM
Thanks for your reply. I tried holding the keys down but unfortunately it didn't solve my issue. When I run the VI, the keyboard keys I press aren't registered. I tested and followed the example VI you linked but the same issue happens. I'm working from a university computer but will try on my personal one to see if this changes anything.
I have a rough idea of how to control the robot using event structures for each key. But I can't test the code until I can get Labview to recognise the keyboard inputs.
02-01-2016 09:13 AM
@MortZ wrote:I tested and followed the example VI you linked but the same issue happens. I'm working from a university computer but will try on my personal one to see if this changes anything.
That's strange... Is the event trigger the only thing not working? Are you able to type in a string control?
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'