From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog output of AC and DC signal

Solved!
Go to solution

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)

0 Kudos
Message 1 of 5
(3,098 Views)

I will add an example.

circuit.png

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.

 

0 Kudos
Message 2 of 5
(3,082 Views)
Solution
Accepted by topic author s.h._tech

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.

 

 

-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 3 of 5
(3,046 Views)

I thought so. Seems kind of a waste to generate a signal for DC with the same samplerate as much more complex signals

0 Kudos
Message 4 of 5
(3,041 Views)

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.   

 

 

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