02-21-2011 02:57 PM
Hello guys!
Considering this :
http://zone.ni.com/devzone/cda/epd/p/id/4167
With DAQmx, the sample clock rate (for Analog input and output) can be changed after the start has been called[...]
Hardware Model: PCI-6221 (37-Pin), PCI-6221
Why does it generates me an exception when I try to change a task timing when the task is already started? It works fine on a serie X (6321) but it fails on a 6221.
Test method TestDevices.IODevices.Tasks.AIAOTest.ChangeReadingDelayOfAnInputTask threw exception:
NationalInstruments.DAQmx.DaqException: Specified property cannot be set while the task is running.
Set the property prior to starting the task, or stop the task prior to setting the property.
Property: NationalInstruments.DAQmx.Timing.SampleClockRate
Task Name: _unnamedTask<43>
Status Code: -200557
It is stated in the above document that it's supposed to work on a 6221. Is there something I missed?
Thanks in advance for you enlightenment.
PL
Solved! Go to Solution.
02-22-2011 01:25 PM
I'm afraid that doc is (at least partly) wrong. I haven't done much exploring on recent versions of DAQmx, but I *am* sure that M-series boards did *not* allow a direct change in sample clock rate on a running AI task as of DAQmx 8.0
I'm also sure that such a rate change *was* allowed for AO tasks. Further, it was also quite possible to change an AI sample rate *indirectly* by using a separate continuous pulse train task as the AI task's sample clock.
If it's an AI task throwing the exception, that's expected for M-series boards. It's actually news to me that X-series supports such a feature - cool! If it's an AO task throwing the exception, then I for one am surprised and hopefully someone else can enlighten you further.
-Kevin P
02-22-2011 02:26 PM
Thanks Kevin for your input. That's what I think too, I'm just waiting for an official answer from NI.
It's indeed on an Analog Input task, so I'm experiencing exactly what you are saying.
Have a nice day!
PL
02-22-2011 02:59 PM
Hi plg,
What Kevin said is correct. The sample rate property can be changed during AO tasks but not AI tasks for E, M or S series devices. I'll take a look at the document that you linked and make the appropriate edits. Thanks for bringing that to our attention.
Paul M
02-22-2011 03:09 PM
Excellent!
Many thanks for the confirmation.