LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting a subset of channels to read with DAQmx

Solved!
Go to solution

Hello,

 

I'm using a 32 channel NI9205 analog input module, connected with a NI cDAQ-9174 chassis and LABVIEW 2011.

I have created a task in the Measurement and Automation Explorer which has 16 analog input virtual channels (each one with it's input configuration, scale, calibration, etc..). Inside LABVIEW I open this task to do some data acquisition, but I just want do read some of the 16 channels (user-defined), not all of them, so before the "DAQmx Timing" I put a "DAQmx read node" and I set the ChannelsToRead with the names of the channels I want to read. It seems to work, but when I set the acquisition rate it comes the error.

The acquisition module supports a 250kHz rate (divided by each channel). So, if I set 5 channels to read, for example, it should work with a rate until 50kHz. But everytime I try to use a acquisition rate higher than 15,625kHz (which is 250kHz/16) I get an error which says that the maximum rate is 15,625kHz. Like if I were using the 16 channels of the task, but I'm not.. 

 

Below there is the screenshot of the channels to read and timing configuration.

 

Thanks
Alexandre

0 Kudos
Message 1 of 4
(2,939 Views)

You created a tak in MAX with 16 channels, and I am assuming that you are using that same task to start your daqmx, so you are preallocating channels and hence already divided the data rate 250/16 per channel. Try either creating new task with only 4 channels or just locally choose channels from your daqmx create task, and you should be able to reach max rate per chanel.



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
Message 2 of 4
(2,917 Views)
Solution
Accepted by topic author AlexandrePB

Hello Alexandre and welcome to the forums,

 

As odessy27 said you are not achieving the correct sampling rate as the task is being set-up to read 16 channels; despite you later specifying which channels to actually read.

To keep the configuration settings from your created task in Measurement and Automation Explorer (MAX) I recommend creating Global channels from these. A Global Channel will store your configuration for each physical channel and can be accessed from multiple tasks

 

Create a Global Channel by right clicking the physical channels in your task in MAX then selecting Create Global Channel. .

 

You can drag these across to your block diagram and wire into the task/channels in terminal of a DAQ-mx function as shown in the image below.

 

If you change this to a control by right-clicking>>Change To Control then the channels can be set by the user and the maximum acquisition rate will adjust as expected.

 

Regards

Jamie

 

Jamie Jones
Applications Engineer
National Instruments
Message 3 of 4
(2,897 Views)

Thanks Jamie and Odessy.

 

I've searched a little more and I found these global channels.. I changed my program to use them so now everything is OK.

 

Best Regards

Alexandre

0 Kudos
Message 4 of 4
(2,885 Views)