LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to wait for a digital input to go high?

I bet the following question is explained somewhere but I don't know how to find it.

 

Is there an optimal way to wait for a digital input to transition from 0 to 1? I mean, other than creating a loop that continously polls the input line is there a better way to wait for the transition? With all the "event driven" capability of CVI I suspect there's a slick way to do this but I don't know how to find it. I'm willing to RTFM if I know where to look.

 

thanks

0 Kudos
Message 1 of 2
(2,617 Views)

Hi,

 

I have never done this, but it looks like it is possible to use the DAQmxRegisterSignalEvent function to assign a function that will be called when a "change detection event" occurs.

 

It works on a task basis, so if I'm not mistaken, you need to put the digital to be tracked into a separate task. 

 

It is not stated if all NI hardware is compatible with this functionality, so try and see if it works for you.

 

Hope this helps,

 

 

Edit: It looks like you have already found the solution by yourself 😉

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 2
(2,609 Views)