PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Timing rate

I am using the DAQmx Timing control in a VI that samples data from a PXI chasis. The sampling mode is set to Finite Samples. The help states that the rate input specifies the sampling rate in samples per channel per second. Increasing this number means more samples per second. It seems to me that increasing the samples per second should reduce the overal time of the process since it is performing more actions per second. However, increasing the rate decreases the loop time of my program. What am I missing here? Am I understanding this wrong, or just implementing this strangely?
0 Kudos
Message 1 of 3
(3,137 Views)
Hello,

You are right that increasing the rate means more samples per second. It means the following: If you keep the finite number of samples to acquire fix, then increasing the rate should decrease your acquisition time. Suppose you are performing acquisition in a loop. If the acquisition time decreases, then the time for a loop iteration will decrease as well.
For example, for an acquisition of 1Hz, if the number of samples to acquire (on the timing VI) is 1000, it means that you will acquire a total of 1000 Samples. Since the rate is 1Hz, it will take you 1000 seconds to acquire all the samples. However, in a loop, you can use the DAQmx Read VI to read part of the total number of samples already available. So for example, if you specify 50 samples to read on the DAQmx VI, every time it is called, it will grab 50 samples from the buffer. If the samples are not available yet, it will wait until they are availble or there is timeout and return.  Now if you have a process in the loop that take more than 50 seconds to comple before you read again, then there will always be at least 50 samples in the buffer from the second iteration. From there on, if you increase the rate, it will just increase the number of samples availble to be read, but it will not necessary make the other process in the loop faster. So the DAQmx Read will always have the 50 samples it needs, but the other process will still take time. So in this case, changing the rate from 1Hz to 100Hz will seem to have no effect on the entire process.
The important thing is to understand what those numbers actually mean.

-Sample per channel  in the timing VI represents the total number of samples to be acquired by the board on each channel of the task.
-Rate represents the rate at which the samples above are acquired
-Sample per channel in the DAQmxRead VI represents the number of samples you want  the VI to grab from the buffer. Those samples have already been acquired and stored on the computer.

Hope this clears it all

0 Kudos
Message 2 of 3
(3,132 Views)
Thanks so much for you help. That makes a lot of sense.
0 Kudos
Message 3 of 3
(3,126 Views)