01-19-2005 08:14 AM
01-20-2005 04:50 PM
09-28-2007 06:00 PM
Hi all,
While (Condition)
{
<Code>
DAQmxReadAnalogF64 (AIN,1,10.0,DAQmx_Val_GroupByChannel, AnalogIn, 1, &NumberOfSamples,NULL)
<Code>
DAQmxReadDigitalLines (Handle, 1, 10.0, DAQmx_Val_GroupByChannel, &BitValue, 1, &NumberOfSamples, NULL, NULL)
<Code>
DAQmxWriteDigitalLines (handle, 1, 1, 10.0, DAQmx_Val_GroupByChannel, &BitValue, NULL,NULL)
<Code>
DAQmxWriteAnalogF64 (Handle,1,1,10.0,DAQmx_Val_GroupByChannel,&Voltage, NULL, NULL)
<code>
}
All I need is to read only one sample value from the analog and digital In channels and write only one sample value to the analog
and digital out channels.
My application needs to while loop to execute around 1000 times per second. When I run the code I found my while loops executes
around 190 times/second only. (I takes around 6 millisec for one iteration of the while loop).
When i commented all the DAQmx function and hardcoded the values (for my calculations) my entire while loop executes very fast
and it executes around 1050 times/second. (around 0.9 millisec for one iteration of the while loop)
Then I uncommented the all the last three DAQmx functions ie., DAQmxReadDigitalLines, DAQmxWriteDigitalLines, DAQmxWriteAnalogF64
and when i executed the code the loop executed around 500 times/second (around 2 millisec for one iteration of the while loop)
When I uncommented the remaining function DAQmxReadAnalogF64 (The first one) once again the loop execution is around only
190 times/second.(around 6 millisec for one iteration of the while loop)
My question here is what is the execution time for the DAQmxReadAnalogF64. Why there is a big difference int the
execution timing just for the one read function.
Is there anything i can do to improve the execution time of the code.
When I analysed the DAQmx functions i found there is another function called as DAQmxReadRaw.
If I use this function for DAQmxReadAnalogF64 will there be any significant improvement in my exectution time.
I am kind of new to DAQmx drivers. Any help/suggestions would be of great use to me.
Regards,
Sridhar
10-01-2007 03:56 PM