Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple modules same rate is not as requested - CDAQ

Hi, I'm trying to acquire several AI from 4 different modules (9227 current, 9219 12voltages, 9211 temperatures, 9207 pressures) using cdaq 9174 and then using just one module and several AI with USB Daq. I'm already doing the acquisition, but not at the rate I want it to. I'm requesting a rate in daqmx timing vi in the range of 1-10Hz (only one value of course) but when I run my VI it starts with a sample clock of ~1612Hz. Huge amount of data then. I tested each of the modules alone and they to the acquisition at a rate of 1Hz when requested, using several channel of a module has the same result. The problem is when I create a task where I sample all of the AI from the different module. I hope I was clear enough. Well, as a second point but less important, how can I add time stamp when I'm reading multiple channels in the format of array 1d waveform? is it possible? I was using the daqmx measurement logging template (producer-consumer) but it does not do this....I might think tomorrow how to do this, but right now I can't think of a simple way to perform this. I'd really appreciate your help. When setting the virtual channel I overwrote the USBdaq test, so you'll see AI from the same module. The problem is when using the cDAQ and different acq modules. Thanks for your help in advance!!!!
Download All
0 Kudos
Message 1 of 4
(3,893 Views)

Well, how I finally got rid of that problem was inserting a wait function inside the acq loop. I suppose this is not a good practice because my hw goes at 1621Hz (wasted resources), but it was the only immediate solution for this. I'd like to hear your opinion or another way to deal with this. Thanks again.

 

 

Download All
0 Kudos
Message 2 of 4
(3,877 Views)

Hello,

 

Well, firstly you have to keep in mind that it is possible to configure you DAQ device o acquire in different Sample Rates at a Hardware level. Refer to the link below to get more information on that:

 

Can I Sample Different Channels at Different Rates with my Multifunction DAQ device?

 

Sencondly, you've got to learn that your cDAQ chassis (9174) features three AI timing engines and is therefore capable of performing up to three Analog input tasks at different sampling rates. refer to the link below for further information:

 

Specifying Different Sample Rates for Multiple NI CompactDAQ Modules

 

Ultimately and more focused on your code, you should think about using multiple tasks on your code. Each task contain a single timebase configuration, so every channel on that task will use its task timebase. This way, you can set up to 3 different timebases with your HW in 3 diferent tasks. Refer to this Example to see how to use three different tasks in parallel:

 

Concurrent Multiple Sample Rates with cDAQ 9178

 

Read carefully each article I've just sent you and then recode based on that information. You may get it well done!!

 

About the timestamp, acquire the data as "waveform datatype". Refer to the example above to see how to do that.

 

 

I really hope to get an answer from you telling that you made it!

 

Best regards

 

 

Felipe Flores
Technical Support Engineer
National Instruments
0 Kudos
Message 3 of 4
(3,859 Views)

Hi iapetus2001,

 

Each of those modules have specific sampling rates.  The 9227 has a minimum sampling rate of 1612 Hz as found in the manual here: http://www.ni.com/pdf/manuals/375101c.pdf on page 12.

 

Wehn we choose an invalid sampling rate for the 9227 it will coerce up to the nearest valid value.  In the case of your 9227 specifying 1-10 Hz causes it to coerce to 1612 Hz.

 

With all of the modules in the same task the timing will coerce to the same rate for each module in the task.  In cases like the 9219 which only supports up to 100 Hz sampling rates, the returned data is padded with extra data to ensure the arrays are all the same size.

 

If you are looking for specific sampling rates you can decimate or average the data returned from the DAQmx Read VI.

 

I hope that helps!

J Newk
Systems Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,829 Views)