Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Desired freq / actual freq

Solved!
Go to solution

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);

 

0 Kudos
Message 1 of 6
(4,157 Views)

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...

0 Kudos
Message 2 of 6
(4,151 Views)

 

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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 6
(4,131 Views)

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.

0 Kudos
Message 4 of 6
(4,120 Views)
Solution
Accepted by topic author gdargaud

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,

John Passiak
Message 5 of 6
(4,119 Views)

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.

0 Kudos
Message 6 of 6
(4,097 Views)