09-10-2015 06:24 AM
Hello,
I am trying to write a VI file to acquire acceleration and temperature at the same time. I am using NI 9234 (7 modules) for acceleration and NI 9213 (all 15 TC channels) for temperature measurement. I am using a producer consumer architecture for the same. I have defined two tasks; one for all the accelerometers and another for all TCs. I am using two queues to write the data into a tdms file.
My problem is that the duration of data acquired for acceleration and temperature does not match. If I leave the "Number of Samples" option in DAQmx Read to default and run the vi for 5 seconds, I get only about 1.1 seconds of data for acceleration and 1.25 for TCs. If I define "Number of Samples" as 1000 for acceleration and 1 for TC, I get the acceleration data for 5 seconds, however, the TC data is acquired only for 3 seconds or so. Is there a way to get both the acceleration and TC data for 5 seconds when I run the program for 5 seconds?
Thanks for your time.
Regards,
Pradeep
Solved! Go to Solution.
09-10-2015 06:34 AM
Why not just use 1 task? I'm pretty sure you can do that with your cDAQ chassis.
09-10-2015 06:38 AM
Hi Prad,
the NI9213 allows for 1S/s in high-resolution mode for all channels. (See manual.)
The NI9234 allows for 1.6kS/s (minimum!) per channel. (See manual.)
Reading the manual is a great source of wisdom… 🙂
So to get 5s of data from both kind of modules you need to read ~8kS from your NI9234 and just 5S from your NI9213.
I would suggest to use two producer loops, one for the TC module, one, for the 9234 modules…
09-10-2015 06:38 AM
Crossrulz,
Thanks for your quick reply.
I tried that. In this case, even temperature is sampled at 25600 S/s while the module is only capable of 75 S/s. I am not sure if the data is meaningful.
-Pradeep
09-10-2015 06:46 AM
GerdW wrote:
So to get 5s of data from both kind of modules you need to read ~8kS from your NI9234 and just 5S from your NI9213.
I would suggest to use two producer loops, one for the TC module, one, for the 9234 modules…
I would probably take it one more step and only have 1 queue for the logging loop. Just add to the cluster an ID so the logging loop knows which channel to write to in the TDMS file.
09-10-2015 08:49 AM
Thank you GerdW and crossrulz. Using two producer loops solved the problem.
-Pradeep