LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help with DAQ in Labview

Solved!
Go to solution

Hi,

I am new to the LabView programming so I would require some guidance from you guys.....My purpose of using the labview is to calculate the dynamic mass or apparent mass of the seated human subject on a rigid seat. The dynamic mass is calculated as the ratio of cross spectrum between force and acceleartion signal to that of autospectrum of the base acceleration signal which in labview can be done using the FRF function. I have attcahed the VI tht I have created in order to calculate the FRF and the auto spectrum for force and base acceleration. Number of samples = 1024, rate = 100 Hz and teh acquistion mode is continuous for the DAQ. The signals aquired have been filtered using a low pass filter with cut off frequency = 25 Hz as my range of frequency interest is from 0.5-20 Hz. the number of averages =6, averaging mode = RMS averaging, weighting mode = linear. this basically the set up that I have been using for my experimentation. Now coming to my questions....I would like to record teh time signal for both force and base accleration for doing some post processing how do I do that in Labview? I mean here that how can i get two coulmns of data were one column is for the time and the next one is for the force(or acceleration) data, with my setting I will have 6000 samples for the 6 averages.

For teh preliminary tests, I used a rigid seat to aquire the Force and base acceleration signal into the Labview DAQ. the phase in this case should be approx. zero but the phase response with teh VI gives me different a value around 180 degrees. I would also like to state that for some of teh iteration the value goes to zero but after 6 averages it shows me phase of around 180 degrees. Iwould like to have some comments of this aspect also.

 

Thanks and regards,

Suresh

0 Kudos
Message 1 of 15
(2,948 Views)

Hi!

I'm not very sure I understood what you wanted to ask.......maybe you can point it out a little clearer for me.

 

But maybe the following helps:

 

Labview stores its signals as y-Values with a discrete system for the time axis.

You got your starting time t0 and a deltaT.

For getting a signal of your sample times there are a lot of solutions

e.g.

 

array of sample times.png 

 

Still I'm not sure if this is what you wanted.

 

If you want to get a frequency information vs. time you got to use the ShortTimeFourierTransform...

 

Greets CR

 

 

 

0 Kudos
Message 2 of 15
(2,922 Views)

Hi,

 

Thanks for input and sorry for not being very clear with my problem....actually what I want to do is  write the force vs time data in spreadsheet as well as base acceleration vs time data. I have tried to do that in my VI as you can see in the top I have converted the dynamic data into single waveformfor channel 0, which corresponds to the force, and then I have connected it to the write to spreadsheet vi using auto indexing. By using this method I do get the force data but I get 6 columns of datas with each column having 1000 rows therefore in total 6000 samples which is right. however, I would like to have two coulmns of data one for time and the other for force. how to get this is my question??? i hopei am clear this time around.....

 

Thanks and regards,

Suresh

 

 

0 Kudos
Message 3 of 15
(2,900 Views)
You are getting 6 columns because it looks like the loop stops after 6 averages completed (hence a waveform array with 6 elements) and you are not getting any time information because the function you used (Write to Spreadsheet) is not capable of extracting it from a waveform data type. Instead of auto-indexing, you will want to append the latest waveform to the previous so that you have a single waveform type that exits the loop and you will want to use something like Export Waveforms to Spreadsheet File.
0 Kudos
Message 4 of 15
(2,896 Views)

Hi Dennis,

 

Thanks for ur input. I tried to modify my VI according to ur given direction but still it shows data for only 10.23 secs which just the one segement of data. I would like to have the full 60 secs of data. i am attaching the modified VI as well as teh results in text format.

 

Thanks and regards,

Suresh

Download All
0 Kudos
Message 5 of 15
(2,876 Views)
But now you are sending only the very last waveform array out of the loop. Like I said, you will have to append the last to the previous. You can try putting the Append Waveform function inside a for loop and use a shift register. I can't run your VI to test since I don't have the sound and vibration toolkit.
0 Kudos
Message 6 of 15
(2,871 Views)
That's because your DAQ assistant express VI is set up for 1024 samples at a 100 Hz rate.   Do the math, you get 10.24 seconds of data.
0 Kudos
Message 7 of 15
(2,869 Views)

Hi Dennis,

 

If I am understanding you correctly then you want me to use the append waveform vi where you have two inputs as waveform A and waveform B. the waveform B is appended to the last of waveform A. I am right???? Can you write an example for my case if its possible.....

 

Thanks and regards,

Suresh

0 Kudos
Message 8 of 15
(2,850 Views)

Hi Ravens,

I did my maths thts why I wrote that its just gives me the result of last segment.....as you might have noticed that I am using 6 averages so each segment for 10.24 secs corresponds to 1024 samples and therefore for 60 secs total sample will be around 6000. What I want is to record the 6000 samples over the total time. I hope you got my point.

 

Thanks,

Suresh 

0 Kudos
Message 9 of 15
(2,849 Views)

I believe Dennis has the correct answer for you.  When I opened the VI, it did not show the while loop because it was just outside the borders of the window.  All I saw was the code inside the loop.

 

If you want 60000 samples divided by 100 Hz for 60 seconds of data, why not make your sampling rate 1 kHZ instead of 1.024 kHz?  You may want to use a For loop instead of a while loop since your number of iterations is predetermined.  With the conditional for loops in the more recent LabVIEW versions, you can show a stop terminal on that so that you can stop it early in the event of an error.

0 Kudos
Message 10 of 15
(2,840 Views)