Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

setting I/O in a loop

Solved!
Go to solution

I am using several NI digital I/Os. Depending on the state of the control they are on/off and all in a loop ~30-40Hz.

 

What happens to the hardware and CPU usage when I force the output to go ON 40 times a second and it is already ON? I do not know what happens between my soft and the end of the hardware.

My guess would be that nothing - neither the hardware or the CPU is bothered much with the same request but I might be wrong.

 

I am talking about "DAQmx Write" and "SET INHIBIT MOMO.flx" It is run on a NI PXI platform. I kind of want to minimize the CPU usage.

Thanks

0 Kudos
Message 1 of 2
(2,921 Views)
Solution
Accepted by AndyN

Howdy Andy,

 

There is no difference in CPU usage between calling DAQmx Write for "ON, ON, ON, ON, ON, etc..." versus "ON, OFF, ON, OFF, ON, etc..."  Everytime time DAQmx Write is called it sends the new sample to the hardware buffer to be output regardless of what is already there.  DAQmx does not keep track of the current state of your output in software so if you want to prevent DAQmx Write from being called 40 times unnecessarily you will need to implement your own bookkeeping system in software.

 

Regards,

Barron
Applications Engineering
National Instruments
Message 2 of 2
(2,902 Views)