LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AI READ Waveform - Reading data from a buffer. Data: TIME - ACCELERATION How to write the TIME in seconds, begining any measurement from t = 0 s??

  Hello, this is Alejandro Palacio, from Trinity College University in Dublin.


     I'm trying to measure acceleration levels using a Capacitive Accelerometer (sensitivity 1000mV/g, measurement range + 3 g pk, frequency range (+ 5%) 0 to 80 Hz, offset voltage (0g)  +500 mVDC) supplied with a DC Power Supplier of a excitation voltage which varies from 16 to 30 VDC. The acceleration levels that I want to measure are those corresponding to an usual urban bus, on a typical trip around the city, in forward/backward direction.  So its frequency is very low (approximately going from 0 m/s2 to 1 m/s2 in 5 seconds).

  The system Accelerometer-Power Supplier is connected to my laptop through a National Instrument Data Acquisition Card model DAQCard-516 (year 1996). To read the data I'm using LabVIEW 7.0.

 
I've built in LabVIEW a small program (as a .VI file) to measure the data, reading the waveform in the screen and at the same time, writing it as an .xml file. The data goes through a buffer, with an initial sampling rate of 1000 scans/second (which can be modified), and then leaving as a WAVEFORM is plotted on a waveform chart. At the same time, it is written in a spreadsheet file. It leaves from the buffer as a waveform, because in the AI READ icon, I have established the Type as "Automatic".

  My problem is that when I open the file (as an .xml or as a .doc) where the data is written, 3 columns appear, from left to right:

1st) Current date: example 07/09/2006

2nd) Current time:   example 14:30:08

3rd) Acceleration level (in g’s): example   -5.661011E-2

   And what I want to obtain both, in the Waveform Chart and in the file, are only 2 columns, the first with the relative time in seconds, beginning from 0, and the acceleration level measured in g’s (but as a floating point type) . For example like this:

    Time (ms)                Acceleration (g’s)

0.001                                                  0.05661011

0.002                                                  0.05661011

0.003                                                  0.05661011

 

And the rest of values.

 

So my questions are the following three:

1)      Do you think this buffer configuration is appropriate for the type of measurement I want to do, or do you suggest me any other better?

2)      What should I change and how, to get the data expressed in the form detailed up? I tried to change the "waveform data" clicking in the AI READ icon, but nothing change in the file

3)      Is possible to place in the Front Panel any tab, where I can write some words while the measurements are being carried on, and those words appear on the right of the 2 columns just at the same time I have written it, in the file? For example on a new column called EVENT. For example:

        Time (ms)                Acceleration (g’s)                  Event

0.001                                                  0.05661011

0.002                                                  0.05661011           Bus stop

0.003                                                  0.05661011


I have attached the .VI file where the Block Diagram and the Front Panel of my system are built, to these email. It's called "Buffer_Alejandro_Palacio.vi".

 Thanks a lot. I look forward to hearing from you. You can e-mail me.

  Best regards.

Alejandro Palacio Alonso
Trinity Centre for Bioengineering
Dept. of Mechanical Engineering
Parsons Building
Trinity College, Dublin 2, Ireland
Phone: (+353) 851003051
e-mail: palacia@tcd.ie
Web: www.tcd.ie/bioengineering/palacio.htm

Postgraduate student at Trinity College University in Dublin
0 Kudos
Message 1 of 2
(2,436 Views)

Hi Alejandro,

Thanks for the post. A few of these things can be achieved by editing the Export Waveforms sub-VI in your VI. I haven't been able to write this in LabVIEW 7.0 for you yet, but I've attached a screenshot to illustrate the changes I think you could make.

1) To adjust the date/time issue, you can generate a timestamp before you enter the main WHILE loop, then within Export Waveforms, subtract this time t0 from each individual waveform to get the time difference from time t0. You can change this to a decimal by using the Format Into String VI before you build the array of strings at the edge of the FOR loop.

2) You can change the format of the Acceleration by using the Number to Decimal String VI rather than the Number to Exponential String VI in the Export Waveforms sub-VI. You need to specify the width of the string you generate to control the number of decimal places you end up with.

3) Finally to place the events into the 3rd column - it may be tricky to generate the comments at exactly the correct place along the waveform. The quickest method to implement would be to have a FOR loop running in parallel with the Data Acquisition, building an array of strings which are empty "" unless you specifically hit a button at which point it will insert your comment into one element of the array. You can then take that array as in input into your Export Waveforms sub-Vi, and concatenate it onto the 2 columns already assembled by the string concatenation function.

I've attached a couple of jpegs which should hopefully illustrate how to achieve some of these. Please have a look, try and implement a few of the ideas and let us know how you get on.

Best wishes,

Mark

Applications Engineer

National Instruments

Download All
0 Kudos
Message 2 of 2
(2,417 Views)