Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 6221 Sample Clock rate

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(2,956 Views)

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

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).
Message 2 of 5
(2,937 Views)

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

0 Kudos
Message 3 of 5
(2,926 Views)
Solution
Accepted by plg

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

National Instruments | Applications Engineer | www.ni.com/support
0 Kudos
Message 4 of 5
(2,920 Views)

Excellent!

 

Many thanks for the confirmation.

0 Kudos
Message 5 of 5
(2,917 Views)