LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using an NI 9219 analog input and an NI 9237 strain gage at the same time

I have a cDAQ chassis and NI 9237 module that I am using to acquire data from a load cell.  I would also like to acquire an analog voltage signal using an NI 9219 module.  I am able to perform these two measurements in separate vi's very easily, however, when I try to do them at the same time (using a DAQmx Read task inside of a while loop, I get an error. 

 

I suspect that my error has to do with the lower limit sampling rate of the NI 9237 being higher than the upper limit sampling rate of the NI 9219 module.  I have attached a screenshot.  Is this set of measurements possible with the hardware that I have or do I need a module with a higher sampling rate (NI 9239)?  If I increase the sampling rate, it also gives an error.

 

Thanks,

Taylor

Download All
0 Kudos
Message 1 of 6
(3,687 Views)

What model of cDAQ chassis do you have?  Judging by the errors, it should be a 9174/8 or 9188.  You are correct, the minimum sampling rate of the 9237 (1.6kHz) is higher than the max of the 9219 (2Hz or 100Hz).  Just as a note, the 9219 defaults to high resolution mode.  If you want to sample "faster" (it's a relative term) you can set the AI timing mode to high speed to acquire at up to 100Hz. 

 

With the chassis I mentioned above there are multiple AI timing engines so you can run multiple tasks at different rates simultaneously.  The solution is to separate your one task into two.  If you want to synchronize them you can share a start trigger.  There are other factors to take into account, such as the filter delay of the 9237, but that depends on what kind of synchronization you are looking for.

 

In the cDAQ-9172 chassis there is only one timing engine so we allow you to use modules that cannot acquire as fast as other modules.  In that case the slow modules acquire data as fast as they can and return repeated samples in between fresh samples.

0 Kudos
Message 2 of 6
(3,670 Views)

Unfortunately, we have the cDAQ 9172.  With that being the case, can I still split the task into two and just live with the repetitive data for the slower sampling device?

 

 

 

Thanks,
Taylor

0 Kudos
Message 3 of 6
(3,661 Views)

WIth the cDAQ-9172 you'll need to put both modules in the same task and set a sampling rate at least as high as the minimum for the NI 9237. You cannot split it into two tasks--you would get a reservation error because there is only one analog input timing engine.

 

As a side note, valid sample rates for the NI 9237 are 50k/1..31.  If you pick a rate in between two valid values, it will be coerced to the next fastest one.

0 Kudos
Message 4 of 6
(3,644 Views)

When I leave them in the same task and request a higher sampling rate, I get the error shown in the file error2.jpg attached above.  Is there some other way that I should set this up instead of using the while loop?

 

I did try out splitting them to two separate tasks and I did get the reservation error as you said.

0 Kudos
Message 5 of 6
(3,637 Views)

What version of DAQmx are you using?  I tried it out and it worked fine for me with a cDAQ-9172, 9237, 9219 running a simple continuous acquisition at 50kHz and performing the offset nulling calibration.  I think you are having problems with the bridge offset nulling VI.  Since you have non-bridge channels in the task, make sure you set the skipped unsupported channels property.

 

-Edit-

 

Actually, it looks like this was broken in older versions of DAQmx.  I think it should be fixed in 9.1 and newer versions.

0 Kudos
Message 6 of 6
(3,629 Views)