Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from a single analog channel (part of a task made up of multiple analog channels)

Hi, I've attached a .vi as part of my explanation. In this vi, I make use of analog input channels ai0 and ai1. They're read from at different times, however, I don't want to open/close a task then open/close another task as there will be several of my VI's operating in parallel and due to timing operations in the middle sequence frame, I can't afford to let another copy running in parallel "steal" access to the sample/read mechanism when closing one and opening the next. I can't open two separate tasks at the beginning, then close them at the end, due to the multiplexing characteristics of the sample/read mechanism not allowing this. So, I need to combine the two channels into one task - this is no problem, but is it possible to, as shown in the attached .vi, read from ONLY one channel, then read from ONLY the next? I realise I could just read the two channels, then separate the data later, but this doesn't really suit. Any help would be much appreciated.
0 Kudos
Message 1 of 2
(2,864 Views)
Hi Chris,

I modified your VI into what I think you're trying to accomplish.  I believe that you are wanting each DAQmx Read.vi to only return data from a single channel.  However, since the task is configured for 2 channels, an NChan NSamp instance of the DAQmx Read.vi must be chosen or an error will be returned.  In each frame that the DAQmx Read.vi is called, you can choose which channel's data you actually want to display/store/etc.

Regards,
Andrew W
National Instruments
0 Kudos
Message 2 of 2
(2,848 Views)