08-19-2019 10:32 AM
Hi everyone!
I'm new to LabVIEW. I'm developing real-time system and I'm trying to output 2 array of data in two channels: AO0 and AO1. But I found myself getting into trouble. I don't know exactly how to set up the DAQ channels and write VI. The instruction indicates that the "task/channels in" could support more than one channel but there's only one port?
Here I've solve how to output one array to I just combine two as the data.
08-19-2019 02:51 PM
Yes, DAQmx Write has a mode for multiple channels both in LabVIEW and LabVIEW NXG.
In LabVIEW, I recommend checking out the example provided in: LabVIEW Help menu > Find Examples.. > Hardware Input and Output > DAQmx > Analog Output > Voltage - Continuous Output.vi
You will see how each row of the array is a channel to output. The example uses waveform data (which has inside an array of doubles, as the one you use).
All the best,
08-19-2019 03:03 PM
Thanks. But I think I want to output the data using 2D DBL, not 1D waveform.
Best,
Boyu
08-19-2019 03:42 PM
I recommend reading the help documentation of the function, as it clarifies that use case, too:
data contains a 2D array of samples to write to the task. Each row corresponds to a channel in the task. Each column corresponds to a sample to write to each channel. The order of the channels in the array corresponds to the order in which you add the channels to the task.
All the best,
08-19-2019 03:46 PM
I've read it so I connect the 2D array to the data port in DAQmx write but it turned out with no output signal in the oscilloscope. I'm sorry I don't know why.
08-19-2019 03:52 PM
That's why I recommended the example program, Boyu.
You can use that VI to both check that the card works, and see a working application. From there you can start looking for differences in how the API is used between there and your program, so you can detect where the problem can be.
Moreover, I recommend you make a copy of the example VI, so you can edit it freely and see how it changes its behavior as you move things around. I recommend duplicating it so you can still keep the original one and refer to it later without having to reinstall the driver (to have the original example back).
All the best,