01-12-2011 06:05 AM
I am building a monitoring system for a client in LabVIEW 2010, with an NI PXI system, and he wishes to use a USB keypad to enter short cut commands; If he hits "1" change this setting, "2" skip to next step, etc.
Hoping someone can point me to an example of using the event structure to capture keypad input. Also, if anyone has done this, anything to watch out for: some keypads require a driver, others do not, any suggestions will be appreciated.
thanx
lmd2
01-12-2011 09:21 AM
Imd2,
Which part of the task is giving you problems? Reading the keypad, or triggering the events?
I posted a question about a month ago about triggering events with button presses on a USB joystick, and I learned a great deal from the responses:
Ed
01-12-2011 09:57 AM
Hi Ed -
thanx for the response
I haven't gotten the keypad yet, and haven't written any code for that functionality yet, so it is not a matter of "Which part of the task is giving you problems? Reading the keypad, or triggering the events? " Basically I am doing a bit of research so that when I do start developing I don't go off in the wrong direction. Reading through your Joystick thread tells me to skip the event structure and poll the keypad input - that's good to know.
let me ask you this, the joystick drivers in your code, are they supplied by the joystick manufacturer, or on some NI palate, or did you develop them?
lmd2
01-12-2011 10:12 AM
Imd2,
The joystick functions I used are standard LV stuff-- on the "Connectivity" pallet, in the "Input Device Control" subpallet.
And I didn't mean to steer you away from the event structure. Some of replies questioned whether it was needed, but for my particular application it really was needed.
In the full VI, I ended up using events for the button presses, but reading the joystick axes directly.
Ed
01-12-2011 11:11 AM
Thanx Ed
just checked out the sub-palete- there are keyboard drivers, not sure if they'll work with a keypad (subset) - I'll call NI about that.
Since my consumer loop is queue driven, doesn't matter if I enqueue the keycode from the event structure or a seperate polling while loop, the consumer loop won't know the difference, but it is a drag to tie up resources polling - I don't see any advantage to polling and then triggering an event; guess I'll use a seperate while loop to enqueue the keypad inputs, and use a functional global to tell the loop when to start polling, and when to stop polling (the functionality is only applicable for some segments of the test).
thanks for all your insights
lmd2