11-01-2016 09:51 AM
I have a question about changing the sampling clock rate when using the digital output
lines to generate signals.
I'm using DAQmxCfgSampClkTiming (TaskHandle taskHandle, const char source[],
float64 rate, int32 activeEdge, int32 sampleMode, uInt64
sampsPerChanToAcquire); to set the sampling clock source for digital signal
generation.
But I found out the parameter float64 rate doesn't really change the sampling
frequency. For example, if I use "100kHzTimebase" for the const char
source[] clock source parameter, no matter what number I specify for float64
rate, the sampling rate is always 100kHz.
I don't understand where I did wrong, and I was wondering what's the easiest
way to change the sampling frequency to an arbitrary number I want.
11-02-2016 02:08 PM
There's a chance this issue is due to using the 100kHz Timebase for your clock source. Try using the internal clock of your device by setting the char to OnboardClock. The timebase is the clock that is divided down to create the AI convert clock, but the sample clock is the clock that actually controls the time interval between samples. Using OnboardClock for an analog input device should default to the correct SampleClock.
Alex C.
Applications Engineer
National Instruments