03-16-2015 10:26 AM
Hello all,
I'm converting a LabWindows/CVI program from using Traditional NIDAQ to NIDAQmx. One thing I do not see in the NIDAQmx API is the distinction between desired frequencies and actual frequencies used for instance when generating a signal or acquiring one. Does that mean that the hardware can guaranty any frequency within its range (no more internal divider/mutipliers of a base freq) ?
Example with NIDAQ:
DAQ_Set_Clock (Dev, 0, DesiredRate, 0, &ActualRate); WFM_Set_Clock (Dev, 1, 0, DesiredRate, 0, &ActualRate);
Solved! Go to Solution.
03-16-2015 11:01 AM
I also asked a question about doing a non-blocking read with NIDAQmx in the LabWindows forum, but there may be people here more familiar with NIDAQmx...
03-16-2015 01:54 PM
The discretization of sampling frequencies via integer division from a master clock holds just as true in DAQmx as it did under traditional NI-DAQ. As it happens, I only program in LabVIEW so I can't give you specific CVI answers. In LabVIEW there are property nodes that can be used to set (or more literally, "request") or query a sample rate.
Generally, I'd need to query for the rate *after* having tried to set it in order to find out he actual rate. Unlike the excerpt you showed where the actual rate is returned as part of the same call you make to set it, you'll probably have to make a second call to query for the actual rate.
-Kevin P
03-16-2015 04:26 PM
What is your 'actual freq' node called ? (Sorry, I don't program in LV at all so I can't check by myself). I searched for 'Desire' and 'Actual' in nidaqmx.h without success.
03-16-2015 04:27 PM
To configure the sample clock I would suggest calling DAQmxCfgSampClkTiming.
To read back the coerced sample rate I would use DAQmxGetSampClkRate after timing has been configured.
Best Regards,
03-17-2015 06:03 AM
Thanks. I wonder why such an obviously useful and important function is left out of the NIDAQmx FP. I found it by looking at the header file. The FP is not a good source of info on NIDAQmx development if such functions are left out.