From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Making my appliication detect changes on DI channels (NI-USB6501)

Hi,

I would like to do the following with my NI-USB6501 boards: 

- I connect some sort of switch to a channel on the board that I configure as a  DI channel.
- Someone pushes the button (aka switch), 5 volts (for example) is generated on the channel

And this is wher 'im stuck: my applicaton needs to "sense" this change in voltage on the DI channel. I checked all the NIDAQMX functions, and searched the forums, but I didn't find a solution.

I guess my application will need to have an infinite loop in which it checks continuously for changes on the DI line. But: which NIDAQMX function will "sense" the change in voltage input ?

Thanks in advance for your help, once again,

Sander

0 Kudos
Message 1 of 3
(3,048 Views)
If you don't have a board that supports change detection (and yours does not), then as you said, you have to put the DAQmx Read in a loop and check for a change with your code. You don't mention which language you are using but surely there is a 'not equal' function. You have to use this to compare the last acquisition to the previous.
Message 2 of 3
(3,047 Views)
Hi Dennis,

Thanks, this already helps me a lot. Now i know i should be "polling" for changes myself. Thanks a lot.

Sander
0 Kudos
Message 3 of 3
(3,042 Views)