I have an analog output card with 8 channels (PXI-4322). This card only supports one output task for all channels.
Usually I distribute the samplerate equally among my signals (4 output signals with 200kSamples/s). Now I need to produce an additional DC signal over the same output card.
For the 4 channel (signals only) I create one AO-Voltage-Basic.vi and write via NChannel_NSamples. But now I have a DC signal which does not have the same samplerate as the signals.
Can I produce signals with different samplerates on the same task?
Or merge two tasks to one? (the 4 signal task with the high samplerate merged with the DC-task and low samplerate)
Solved! Go to Solution.
I will add an example.
I want to merge Task_out and Task_out_2. Since the signals need a higher samplerate than a simple DC signal I do not equally distribute the samples for a constant 1.5V output for the DC.
I don't know your specific device well, but the desktop and PXI DAQ devices I know about won't support 2 distinct AO tasks with different sample rates.
Fortunately, it's pretty easy to generate a constant DC signal at the same sample rate as your other channels -- just build a set of samples the same size as your other channel(s) where all values are your desired DC value. Then include that DC channel in the same task with your other channel(s).
I think I recall that some devices also support the possibility of generating the separate DC voltage in a separate task that never calls DAQmx Timing to set up a sample clock. It would then run in "on-demand" software-timed mode. This might be another approach for you, probably a simpler one if your device supports it.
You can try the 2nd suggestion I gave, where the DC signal is configured as a software-timed on-demand task. If you configure without making a call to DAQmx Timing, no sample clock is configured, and each call to DAQmx Write will do an immediate, software-timed update of the output signal.
I *think* most DAQmx devices will allow multiple software-timed AO tasks to run simultaneously with a single hardware-timed task, as long as no individual channel is used in more than 1 task overall. Give it a try.