08-14-2016 08:05 PM
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.
Solved! Go to Solution.
08-14-2016 08:06 PM
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.
08-15-2016 05:05 AM
You need to change your queue data type to be an array of doubles.
08-15-2016 05:06 AM
@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.
08-15-2016 02:13 PM
Thanks! Works perfectly.