Hi all,
I want to buy a VM110N board but I have some questions.
My case:
I want to place 2 buttons in a Production environment and want to connect those buttons to the analog input of the board and connect the USB port to the Server.
When the button is pressed I want to capture the “PRESSED” event in my custom application to start a function on the server to print a file to a printer.
Is this the board I need for this case?
Is there a “Pressed” event in the DLL or do I have to poll the port with a Timer?
Thanks for the feedback!
I am not sure why you would use the analog inputs for buttons. If your buttons are like normally open switches, then the digital inputs should be entirely suitable for your application.
For the VM110N the underlying USB HID protocol is actually polling. The card is only sending an HID report with the current settings after being sent a command in an HID output packet. To get the fastest possible reaction time I would call the corresponding DLL function in a loop inside of a background worker (thread). The background worker would maintain local variables with the last known state and generate an application event when detecting a change. One input function call to the DLL takes about 2ms because USB has a limitation of a maximum of 1 transaction/packet per millisecond. If you don’t want to bother with threads and opt for polling with a timer instead, then keep in mind that longer timer intervals mean longer times within which the button can get pressed and released again without your software detecting the press first. To avoid that case you probably want to use a short debounce configuration on the first two digital inputs and monitor their counter value instead of the actual ON/OFF state. The firmware of the VM110N only maintains counters for the first two digital inputs.
There are other ways than using the counters, like using a 555 timer, to guarantee that the signal from a push button lasts a minimum length.
Regards,
Jan
Thanks for the info!
- Do I need a external source for this to work? Or is the USB power enough?
- Is the lenght of the cable to the button a issue? +20m? (interference,lowering power,…)
If I’m sure about this I’m going to order it.