LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

capture USB keypad input in event structure

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

 

 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 1 of 5
(2,847 Views)

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:

 

Joystick Button Events

 

Ed

Edward Motts
Certified LabVIEW Associate Developer
0 Kudos
Message 2 of 5
(2,829 Views)

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

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 3 of 5
(2,821 Views)

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

Edward Motts
Certified LabVIEW Associate Developer
Message 4 of 5
(2,812 Views)

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

 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 5 of 5
(2,802 Views)