Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Timing Sample Clock samples per channel of 1

I am configuring a multichannel DAQmx task with Finite Samples.  Each channel will acquire points for 1/60 sec in order to reduce 60 Hz noise.  The channels are arranged in the task as 0,0,0,...0, then 1,1,1..1 then 2,2,2,...2 etc instead of 0,1,2,0,1,2...0,1,2 so that multiplexer switching settling is greatly reduced.  When channels are assigned this way, DAQmx needs to have a distinct channel name for each channel.  This means the individual channel has to be listed and repeated in the task once for each acquisition (with an appended unique name).  The channel sequence cannot simply be assigned as 0,1,2 and then the task told to repeat that sequence many times.  This latter approach would result in multiplexer settling issues.  When I set this up for 12 channels, the total time to acquire those 12 channels at 1/60 sec each is 0.2 sec.  With each channel listed in the task the total number of times it is to be sampled in 1/60 sec, that complete channel sequence only needs to be sampled once in order for the total task duration to be 1/60 sec for each channel.  Thus I would like to use DAQmx Timing Sample Clock with samples per channel set to 1.  However, there is a minimum of 2 for samples per channel.  This results in this task then taking 2 samples * 12 channels * 1/60 sec or 0.4 sec.  I would like the total task time to only be 0.2 sec.  Is there any way to accomplish this by acquiring only 1 sample of the channel list ?

0 Kudos
Message 1 of 4
(3,354 Views)

Hi Steve,

 

DAQmx should still honor your AIConv.Rate setting with the default SampTimingType of On Demand. Try removing the call to DAQmx Timing (Sample Clock) and see if it does what you want. Note that "on demand" mode will acquire when you call DAQmx Read, not when you call DAQmx Start. If that doesn't work out, please post which device type and DAQmx version you are using.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 2 of 4
(3,352 Views)

Brad,

 

I recall trying to do something like this previously but ran into an issue I do not recall at the moment.  Something about making a call ended up causing another parameter to get changed that meant an approach could not be done ?

 

I am getting computer crashes when removing the DAQmx Timing (Sample Clock) call with exception in nixsrk.dll

Is it necessary to set a value for AIConv.Rate if only one sample is being done ?  I should use a property node to do that ?

 

My intent was to set up this task and then start it occasionally on a software call to DAQmx Start.  I am using DAQmx Control Task with action of Commit so the task can be restarted quickly. 

See example VI Acq&Graph Voltage-IntClk-SW Trig Restarts.vi

 

I can try to put together an example.

I am using LabVIEW 2012 with DAQmx 9.6 and a USB-6211 or USB-6343 device.

 

Steve

 

0 Kudos
Message 3 of 4
(3,340 Views)

Hi Steve,

 

> I am getting computer crashes when removing the DAQmx Timing (Sample Clock) call with exception in nixsrk.dll

 

That shouldn't happen. If possible, could you find the minidump file (in %SystemRoot%\minidump), upload it to ftp://ftp.ni.com/incoming , and send me a private message with the filename? I'd like to check whether it's in our bug report database and create a CAR (corrective action request) if necessary.

 

> Is it necessary to set a value for AIConv.Rate if only one sample is being done ?  I should use a property node to do that ?

 

It's not absolutely necessary, but I think it makes sense for what you're doing. DAQmx will pick a default convert rate as described in How is the Convert (Channel) Clock Rate Determined in NI-DAQmx and Traditional NI-DAQ?

 

You can use a DAQmx Timing property node to set the AIConv.Rate property, or read back the default value. The KB that I linked has an example.

 

> My intent was to set up this task and then start it occasionally on a software call to DAQmx Start.  I am using DAQmx Control Task with action of Commit so the task can be restarted quickly.

 

For on-demand sampling, the equivalent is to call DAQmx Start once after setting up the task, and then call DAQmx Read whenever you want the device to sample. Each call to DAQmx Read will acquire one sample from each channel (including the repeated channels).

 

> I can try to put together an example.

 

Thanks.

 

> I am using LabVIEW 2012 with DAQmx 9.6 and a USB-6211 or USB-6343 device.

 

 

Does it crash with both devices, or just with the USB-6211?

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 4 of 4
(3,334 Views)