LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading multiple channels with DAQmx

Solved!
Go to solution

I’m trying to update a VI that was written to read a LVDT and temperature, both of which will be measured as 0-5V. The previous version used some DAQ sample program, that was modified to somehow read the signals.  After the crash of the previous computer, the modified VI was lost forever.  It was suggested to me by NI that I should just redo this part of the VI, because it would be easier than figuring out what the previous user had done. 

  

I’m working with a USB-6008. I use labview DAQmx create channel, and the task goes to a “NChan NSamp 2DBL” DAQmx read.  The data here is read and massaged a bit, and then written to disk and displayed on screen.  

 

My problem is that the VI will only read the 1st physical channel I input. If my physical input channel is Dev2/ai0, the temperature will read, but my LVDT value will be NaN. If the physical input is Dev2/ai1, the temperature will read the LVDT value, and the LVDT will again display NaN. If I use the physical channel input Dev2/ai0:1, both values will show NaN. 

 

The signals check out in Signal Express, so it seems to be more of a software issue. There is another device on Dev1, so that isn't the issue. I’m on Windows 7 with Labview 10.0.1, DAQmx version 9.6. I've attached an image of the block diagram. Thanks in advance for your help.

Message 1 of 9
(8,922 Views)
Solution
Accepted by nht5067

You need to specifiy the timing (sampling rate) and the number of samples per channel.  The NaN probably means that no data was available when you peform the read operation.

 

Something like this:

 

 

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 9
(8,904 Views)

Hello .. 

 

I am using NI DAQ USB 6341.. and wanted to multiplex two ECG signals such as lead I and lead II .. I used I/O physical channels - ai0 and ai1 as my input channels and I dont how to connect this further to my DAQ and other circuit which is while loop. 

 

please help me. 

 

Ashwin.

0 Kudos
Message 3 of 9
(8,599 Views)

The exact syntax is shown in the above image so I don't understand what you are confused about. The DAQmx Read must be one of the NChan types.

0 Kudos
Message 4 of 9
(8,594 Views)

Hi.. Thanks for the reply.. 

 

Can you mention me the icon location of DAQ MX with a symbol in square pulse and task out should be connected to DAQ assistant. 

0 Kudos
Message 5 of 9
(8,582 Views)

I'm sorry but that does not make any sense to me. You use either the DAQ Assistant or the DAQmx functions. If you are using the DAQ Assistant, why do you want to connect anything to it?

0 Kudos
Message 6 of 9
(8,578 Views)

Hi. Sorry I m new to this labview. 

 

I have attached here with the image file. can u suggest me to do the mux of the two signals. 

 

Thankyou

0 Kudos
Message 7 of 9
(8,553 Views)

As Dennis said, either use the DAQmx functions, or use a DAQ assistant.  You can't use both like you are doing in your VI.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

Also, Taking an NI-DAQmx Measurement in LabVIEW

or NI-DAQmx Express VI Tutorial

0 Kudos
Message 8 of 9
(8,549 Views)
You just use a single DAQ Assistant. There are instructions on how to select multiple channels when you first use the assistant. If you did not read the instructions or decided to add channels after it was created, just open the VI and click the Add button at the top of the screen.
0 Kudos
Message 9 of 9
(8,538 Views)