11-11-2008 03:01 PM
Hello,
The vi that I am trying to program, I have 4 analog outputs to my disposal along with some onboard memory that I can use. I successfully was able to create two waveforms out of two of the analog outputs using the onboard memory. I also successfully have been able to output through the other two pointwise. When I try to do these separate tasks at the same time, they conflict and I get an error saying that the resource is already reserved.
The way I'm doing it now is that I have two separate tasks, one for the two waveforms and the other task for the two other analog outs that I want to be able to change. The error indicates that the resource is reserved for the waveform when I try to output through the other two analog outs.
Is there a way to have all four channels in one task yet two of those channels output a waveform from the onboard memory and the other two outputting one value at a time? If so, how? If not, is there a way I can accomplish this task?
Thanks,
Michael Bentley
Solved! Go to Solution.
11-12-2008 04:39 PM
Michael,
This may be possible, depending on which device you are using. What card are you using for your generation?
11-13-2008 11:47 AM
11-14-2008 08:11 AM
Hi
Thanks for your reply.
I think I can the issue here.
For each device you can only have One Analog Input task and One Analog Output task.
This is because the cards only have two clocks, one for input and one for outputs.
For example, to output multiple waveforms you need to create One DAQ task, with X number of channels. Then on the DAQmx read vi you can pass an array of data (data per channel).
Please see example, Cont Gen Voltage Wfm-Int Clk.vi (Help>>Find Example>> Hardware Input/output >>DAQmx>>Voltage...).
I hope this helps.
Kind Regards,
James.
11-14-2008 03:24 PM
Thanks for your comments.
I guess the answer to my question is that with my current hardware, it is impossible to have both using the same clock timer for different things. The solution may be in that I could have the single valued outputs to not use the clock, just to use the program... I'm going to try it and I'll post the results of if it worked or not.
Thank you very much
11-14-2008 04:34 PM
No, that will not work. You CANNOT tell the D/A to use hardware timed output for some channels and not use hardware timed output for other channels. It's a single D/A and you can only program it for one timing mode.
What you might do is combine everything into a single task. If you look at the shipping example called Con Gen Voltage Wfm-Int Clk-Non Regeneration, you will see a single waveform output. You can add another function generator and for the 'single' outputs you want, use the Initialize Array function to create an array the same size but where every element in the array is the same value.
11-20-2008 01:49 PM
11-20-2008 02:13 PM
11-20-2008 10:33 PM
Michael,
The 6229 works as follows:
It has four separate DACs. Each of these DACs can be written to in a engine fashion (I believe you referred to this as pointwise) individually without using any common resources. The 6229 also has one 'timing engine' and one FIFO dedicated to AO. These resources are reserved in a per-task manner. What this means, is that any channels that need to share the same resource must be part of the same DAQmx task. Hardware timed tasks must use the timing engine (and FIFO in 99% of use cases). Since these are scarce resources, all channels using hardware timing must be part of the same task (and use the same sample clock, and both receive data from the same FIFO). The two pointwise channels don't need access to the 'timing engine' or FIFO, and as such have no common resources with other tasks. As such these pointwise channels can both be placed in one task, or they can each have their own task. It's up to you to pick what works best for your application.
I hope that clarifies things,
Dan
11-20-2008 11:15 PM
Oops... Looks like I lost my battle with the spellchecker in that last post. The second sentence should read, "Each of these DACs can be written to in a non-timed fashion (I believe you referred to this as pointwise) individually without using any common resources."
Sorry for any confusion,
Dan