LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading / recording Accelerometer data using DAQ

Solved!
Go to solution

Hello,

I’m having a problem reading the accelerometer data. The first picture below shows how I have my DAQ declared. The values that I'm reading from the current 9203, voltage 9205 are just fine but I want a read and record 9000 data points for the accelerometers. You will notice that for the 9234 Accelerometer I have it set to voltage instead of the accelerometer setting this is because when I set it to accelerometer I just get noise no real value and task manager could not fix the problem either. You’ll also notice that the sample clock is at rate of 51200 for all the current, voltage and accelerometer data is there a better way to declare these and if so please explain? I had them declared independently before but the DAQ could only handle three inputs at a time so that’s why I combined them into one task. So originally for read vi for the accelerometers I was using analog, multiple channels, single sample, 1D DBL and it was producing 300 points a minute due in part that I have a 200 ms sleep to sink up the timing in the program, which is ok for the rest of the data but not the accelerometers. So I changed the polymorphic vi  to analog, multiple channels, multiple samples, 2D DBL. and I added 9000 to the "number of samples per channel" to the DAQ read vi. The second pictures below is my Accelerometers data write vi, where only 4 and 5 in the index are being used because that’s the location for the two accelerometers. Is 2D the correct approach or should I stick with 1D? When it writes the file however even with me changing it from 1D to 2D it still only gives me 300 points a minute. How do I fix this problem? I’m using a Compact DAQ cDAQ-9178 with modules 9203, 9205, 9234.

 

daq_1.JPG

ACC_WRITE.JPG 

 

Thanks for your time,

 SteelTiki

0 Kudos
Message 1 of 2
(4,701 Views)
Solution
Accepted by topic author Steeltiki

Hi Steeltiki,

 

Let me try to answer the questions you have:

 

-You can use an Acceleration Task for the 9234.  It will bring in +/-5V, which scales to acceleration accordingly to the sensitivity settings you enter in the setup, and according to the sensitivity of the accelerometer.  Double check you are specifying everything correctly.  For example, a 10mV/g sensitivity would correspond to an input range of +/-500g. 

 

-You have the same sample clock for all three DAQmx channels you create because they are all in the same task.  However, you can change this if you would like because the 9178 chassis you are using has 3 Analog Input Timing Engines, which allows for 3 different analog input tasks with different rates.  You will most likely want 1 task per module. 

 

-If you have multiple channels in the task, with multiple samples per channel, you will need a 2-D read, which makes sense.  1 row for each channel, and one column for each sample to be read.  In your case, it is a 6 Row by 9000 column array.

 

-Also, you are indexing out each channel, and then just taking out the first value from the array, so it makes sense you are getting this many values.  You need to remove the second index array to increase the number of samples.

 

Does this help?

 

Best,

Adam
Academic Product Manager
National Intruments
0 Kudos
Message 2 of 2
(4,678 Views)