Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx reserved resources with multi-rate AO

I've been reading this thread recently, which covers some of the issues I need to understand:
 
 
I am running a PCI-6229 with DAQmx and LabVIEW7.1
 
I have Task A with two AO channels (ao0 and ao1), and Task B with a third AO channel (ao2). I would like to write a two-element waveform array to Task A and simultaneously write a waveform to Task B.

I have set the task timing on Task A to "Use Waveform", and wired the appropriate waveform array to the Write function. That works perfectly so far. When I attempt to do the same with Task B (this time using a single waveform input to the write function), the task won't run because the AOSampleClock is reserved for Task A. Fine, I can understand why that is.
 
So my question is really: what is the best way to write simultaneously to different AO tasks at different sample rates? I have the following thoughts:
 
1. In software, resample the signal with the lower sampling rate to a sample rate matching the other signal, and use a common clock at the higher sample rate.
 
2. Use the other clock signals on the DAQ card. Is it possible to use, for example, the AISampleClock with a programmed timebase divisor on AO tasks?
 
3. Use on-demand timing for Task B. How are samples timed in this case relative to the buffer in Task A?
 
4. Use timed while loops.
 
Any advice would be appreciated.
Thanks.
0 Kudos
Message 1 of 4
(3,205 Views)
Hi,
 since you only have one clock hardware for the AO, your absolute best option is to run a second card. You can't pull in an "extra" clock from somewhere, only one clocking rate is possible at any one moment in time.
 
Second best alternative is to resample as you've said to match the rate of the higher output rate task.
The actual AO's are held in one buffer, interleaved so as each "point" goes out, they're updated as a set depending on the number of channels.
 
Using on demand (so software timed) will allow you to do what you need in terms of having two rates, however, the on-demand rate is then software timed, and subject to the jitter the OS will put in, and the lower performance. If it's a static style voltage, then this is OK. If it's a waveform, then it's not practical. Timed while loops allows you to get around this to an extent, however you still have no guarantees that the AO would be at a jitter free rate.
 
Hope that helps
 
Thanks

Sacha Emery
National Instruments (UK)
 
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 4
(3,183 Views)

Thanks for the answer Sacha, that's pretty much what I expected.

1. For my understanding, I assume it is not possible to have different clock rates on the AO tasks because the output is multiplexed on one clock. Is that right?

2. Also, how is a software on demand for static voltage output get interleaved into an AO task consisting of (say) a waveform loop. Is the static voltage output between loops on the buffer? In other words, how on demand is "on demand"?

3. Finally, why are the cards not designed to have multiple input and output tasks clocked at different rates? This would seem to my (inexperienced!) eyes to be a fairly commonplace task. Is it just the usual cost v performance issue? Are there any NI cards that have this functionality?
 
Thanks.
0 Kudos
Message 3 of 4
(3,171 Views)
Hi,

1. Correct. Only one clock source is used to output the analog outputs

2. On demand simply refers to software driven. There's no determinism in this really. When the value reaches the card, it's then output on the next available clock edge, but depending on how your software is running, and what else the PC is up to, then they will all factor in the delay between when your software requests to do the AO and when it actually hits the outside world.

3. About 5 years ago, we stopped production on the AT-AO6 and AT-AO-10 cards, which had the ability to group together channels, and run two clocks (so two groups of channels) at different rates. I can't be 100% sure why we've not produced multi-output rate cards since then, however it's worth bearing a couple of things in mind.

a)Most applications involving control setups, which involve a fixed acquisition to output rate, i.e. your algoritm might involve a loop time in software of 2milliseconds, which involves taking in 3 channels of AI, and after some maths (PID etc) puts out 3 analog outputs. This being done on a point by point basis.

b)Most applications involving two separate output rates are so diverse in the AO update rate, that the complexity of the circuitry on an MIO board would be vast, and most sources on a card are derived from a single clock source (20MHz or 80MHz usually). Since most of the cards (all but the basic ones) have a RTSI connector on them, running and synchronising 2 boards allows much more flexibility in the architecture of the program, and the wiring involved, whereby high change rates on wiring close together can be seen on physically adjacent wires which may have slower rates of change.

We are a customer driven company, and accept requests for features every day on our product suggestion centre, which you can access here :

http://digital.ni.com/public.nsf/allkb/EDA7C01C684ACB6286256FF0000238D5

I can't say we'll implement everyone's ideas, but every suggestion does get read and analysed.

Thanks

Sacha Emery

National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 4 of 4
(3,160 Views)