07-11-2010 09:31 PM
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
07-12-2010 12:23 AM - edited 07-12-2010 12:27 AM
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 😉