Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx not displaying readings from multiple channels

Solved!
Go to solution

Hi,

I am trying to acquire temperature readings from 3 consecutive channels using a DAQmx task as shown in the attached pic. 

I have a producer-consumer loop for quick reading and writing of the samples to a file.

 

 

To specify the channels, I have typed into the box wired to the 'physical channel' terminal (not shown in pic) as follows - SC1Mod2/ai2:4.  This is to acquire readings from analog channels 2,3 and 4. The program should then write readings from all 3 channels to a file.

 

The code works perfectly if I am acquiring samples from 1 channel only.

When I try to acquire from multiple channels, I can only see readings on one of the numeric indicators wired to the acquisition task.

 

I would appreciate any inputs on what might be wrong with the code.

 

Thank you.

 

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

The broken wire seen in the pic is a result of adding multiple channels to the acquisition task.  I managed to get around that by specifying a different data type but even with an intact wire, the program doesn't display readings from the remaining 2 channels.

0 Kudos
Message 2 of 5
(3,620 Views)

You need to change your queue data type to be an array of doubles.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(3,604 Views)
Solution
Accepted by topic author kumv10

@kumv10 wrote:

The broken wire seen in the pic is a result of adding multiple channels to the acquisition task.  I managed to get around that by specifying a different data type but even with an intact wire, the program doesn't display readings from the remaining 2 channels.


Instead of using the To Dynamic Data Type and then Split Channels, just use an Index Array to get your three values.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 5
(3,603 Views)

Thanks! Works perfectly.

0 Kudos
Message 5 of 5
(3,589 Views)