LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read and scale multiple analog input channels

Solved!
Go to solution

Hi

 

I am trying to read data from multiple types of sensors, all with 4-20mA readings. What I am trying to do is have a pressure transducer, a flow meter and an RTD transducer all connected on channels 1, 2 and 3 of my cDAQ using DAQmx. After the channels are scaled, I need to view all the data into a wave chart with the scales on each side identifying pressure, temperature and flow rate. Finally, I need to write this data to a text file. TDMS is fine, but for now I am working with a CSV file.

 

So far I have gotten my VI to read data from one channel, and scale that data correctly. I also have the writing to the file working correctly. However, when I try to scale the second channel, nothing happens or I get an error. Can anyone help me on this? I have an experiment coming up on Monday that needs this so Im a bit short on time. Ive attached what Ive gotten so far (Ive got multiple versions of this VI trying to do this various ways).

 

With regards to accuracy of readings for channel 0, Ive been using a Deadweight tester and a calibrated pressure gauge to see readings. So far these are correct, and I have been able to calibrate other gauges with this interface.

0 Kudos
Message 1 of 7
(5,165 Views)

It looks like you are configuring one channel on the input to the while loop and then trying to index the second channel out of the dynamic data type inside the loop. 

 

Try configuing multiple channels in the left-most operation on your block diagram. 

0 Kudos
Message 2 of 7
(5,152 Views)

Do I just copy and paste the channel configuration and scaling for the number of channels I need? how would I route the task and error lines in parallel?

0 Kudos
Message 3 of 7
(5,146 Views)
Solution
Accepted by TEmran

Easiest and most foolproof way I've found to do this is to configure multiple channels using an Express VI (DAQ assistant) and then right click on the block diagram object and "open fron panel".  Click OK at the warning and you'll be pressented with a working example of a multi-channel configuration.  

 

About the best way to get 90% there when learning DAQ configuration...

Message 4 of 7
(5,144 Views)

@TEmran wrote:

Do I just copy and paste the channel configuration and scaling for the number of channels I need? how would I route the task and error lines in parallel?


Ok. So I copied the AI current DAQmx input three times, and things still look like theyre working. Now how do I duplicate the scales so that each channel has the correct scale?

0 Kudos
Message 5 of 7
(5,141 Views)

@Zwired1 wrote:

Easiest and most foolproof way I've found to do this is to configure multiple channels using an Express VI (DAQ assistant) and then right click on the block diagram object and "open fron panel".  Click OK at the warning and you'll be pressented with a working example of a multi-channel configuration.  

 

About the best way to get 90% there when learning DAQ configuration...


I did that and got most of the way where I wanted. How can I implent averaging for the data? The TDMS file logs about 64k data points which is too many. I only need about 50 or 100 data points. Is there any way to limit the number of samples? Say I want to take data for 3 minutes at 60 samples per minute and an average of 10 data points per second. That would give me 180 data points to work with, but then I can be confident since they were averaged per second. How can I set that up?

 

Also, my waveform chart shows all of the data, but its using the scale on the right. Im trying to view the pressure on the left scale and the temperature on the right scale. Any suggestions for doing that?

0 Kudos
Message 6 of 7
(5,133 Views)

Just fyi, I managed to get something working for the experiment that we needed this working for. Thanks for the help!

0 Kudos
Message 7 of 7
(5,057 Views)