LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Multiple DAQmx Read Functions

Solved!
Go to solution

Good afternoon, 

 

I am trying to write multiple output tasks on a single (or two different) waveform graphs using DAQmx read. However, DAQmx read can only read one task. I need both tasks to be read and output to a waveform graph (in future, I will also need to write the measurements to a file). 

 

I have attached the current vi (vi4 - modMD) below along with a picture of the error message (DAQmx Error1) that I keep receiving. 

 

Any assistance would be appreciated. 

 

Best, 

Mike

Download All
0 Kudos
Message 1 of 5
(2,531 Views)

First Check what device you are reading from to make sure it can do what you're asking.
Some C Series Devices , for example, could do this while others can't

 

Next, try reformatting your code to look more like that Here I think that this code might avoid your error.

 

I'm not 100% familiar with DaqMX, but that should get you started

0 Kudos
Message 2 of 5
(2,512 Views)

Thanks ACTE-AGNE!

 

I am using NI PXIe-6124 (a 4 channel, 16-bit, 4 MS/s, Multi-channel DAQ device) with a NI PXIe-1082 (DAQ chassis) and BNC-2110 (terminal block). The link you mentioned does not say anything about S series devices. I did not find the help specific to S series devices (I saw this but I do not know where to find the help.). I will try to learn the code you suggested. I replied here before studying it so that others reading my question will get information about the hardware I am using. 

 

Thanks for your help.

 

 Best,

Mike.

 

0 Kudos
Message 3 of 5
(2,506 Views)
Solution
Accepted by topic author Michael.D

The vi and the block diagram pic you posted don't match.

 

The extra AI task you added in the pic is where the trouble is.  Revert back to the posted vi, and simply add the additional AI channel 3 to the existing AI task.  Use the drop-down channel menu, select "Browse...", then you can use CTRL-click to select multiple channels at once.

 

You'll then need to change the DAQmx Read drop-down menu to choose Multiple Channels, Multiple Samples, & 1D Waveform.  The array of waveforms will go cleanly into the Waveform Graph, I don't know if you might need further work to feed them to the Spectral Measurements express vi.

 

 

-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 4 of 5
(2,494 Views)

Good morning, 

 

I was able to implement the changes you suggested. It works perfectly. 

 

Thank you very much, 

Mike

0 Kudos
Message 5 of 5
(2,453 Views)