11-05-2012 05:58 PM
Hello,
I am trying to synchronize data output from analog and digital sensors using the NI 9172 (analog) and NI 8452 (digital). I have tried to use a timed loop and and put both a DAQmx read and SPI read vi in there. This allows me to obtain the same number of data points for the analog and digital sensors which is halfway to my goal. I still am having a problem getting the timing to have equal spacing. With that I have a couple of questions related to the VI attached.
1. No matter what value I assign dt in the timed loop (currently assigned 100 ms (i assume)). I have changed this value several times and the loop will run between 0-2 ms as shown in the "Time for Measure (ms)" indicator. Any idea on why the period input to the timed loop is not obeyed?
2. Should I run the analog and digital measurements in their own timed loop and then synchronize them using the Synchronized Timed Structure Starts VI?
3. Is there a way to not use a sample clock for the DAQmx tasks? All I want is to poll the analog signals at each loop iteration which ultimately would be driven by the digital sensors sampling rate. As an aside, the rate specification for the DAQmx sample clock also doesn't seem to obey the input similarly to #1.
I realize the 9172 and 8452 are probably not ideal for this task but it is all I have to work with. Any help is appreciated. Thank you.
11-06-2012 12:47 PM
lgbav8r,
I have a few clarifying questions for you. You said that you are using a 9172 module. The only 9172 I can see is a cDAQ chassis. Can you double check on that module number.
My other question is what is the overall application that you are trying to accomplish? What exactly is it that you are trying to do with each of these modules?
Regards,
Leah
11-06-2012 03:15 PM - edited 11-06-2012 03:16 PM
Hi Leah,
Sorry about the 9172 confussion. I have 2 modules in the 9172 chassis; a 9236 collecting data from strain gages, a 9233 collecting data from 2 analog accelerometers and an impact hammer.
Ultimately I am trying to collect data from analog strain gages, impact hammer, and digital accelerometers across an SPI interface (using the 8452) which are in sync with equal time spacing up to 1 kHz sampling rate. I currently need analog and digital acellerometer data taken at the same time in order to compare the capabilities of the analog and digital accelerometer in further post processing of the signals.
I believe my VI is accomplishing the data collection in sync for the analog and digital sensors. However, I cannot seem to create equivalent time spacing in the data acquisition. The problem seems to be the timed loop is not obeying the input for the period (dt). With a value of 100, I should only be seeing 10 samples / second yet I am seeing over 1000 samples / second.
Hopefully, I cleared things up.
-lgbav8r
Edit: I should also mention that I am using Labview 2009
11-07-2012 09:35 AM
lgbav8r,
I think you might have a misunderstanding of timed loops. You shouldn't ever use a timed loop with DAQmx. Generally, timed loops are only used in a Real-Time environment. To configure timing for DAQmx tasks, you should configure timed acquisition in the DAQmx timing vi, and then read in a while loop. \
Regards,
Leah
11-07-2012 10:41 AM
Ok. That makes sense on the DAQmx. I will switch back to a while loop. I'm still not sure how I would add the 8452 in the mix to be on the same timing as the DAQmx? Should I just include the SPI read command on in the same while loop as the DAQmx read resulting in two separate queues for further processing (like what I have currently)?
11-07-2012 06:07 PM
I have converted the VI back to using a while loop instead of a timed loop and still having issues. I believe what I would like is the 1 sample from each DAQmx channel to go with the 1 sample from the SPI read. However, it seems that the DAQmx is running much faster than the while loop and filling up the buffer with data. This is despite the instructions I give the DAQmx timing VI. I don't want a FIFO type operation from the DAQmx. I need to have 1 to 1 data point acquisition between the analog and digital sensors. I also don't understand why the dt in the measurement file that is written is 0.0005 s (2 kHz). It seems I am unclear on the DAQmx timing commands. Is there any key points I am missing?.
Also, as a side question, I can't seem to apply the timestamp from the DAQmx signal to a signal that is manually created from the digital sensor. Any additional assistance is appreceated. Thank you.
Updated vi is attached.