LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to file timing and calculate instantaneous speed.

Hi,
 
I'm currently working on a university project and i've came accross a few stumbling blocks with my program.
 
I am reading in 6 inputs from an experiment (4 pressure signals, 1 load cell and a displacement measuring device). I'm obtaining 100 continuous samples at a rate of 1kHz. The incoming signals are then seperated and I'll convert the voltage signal into the relevant engineering unit once i know the appropriate calibration rates. The signals are then displayed on charts with a 5 second window. Then the signals are grouped together again before being written to file. However in order to control the amount of data written to file I attempted to place the write to file command within a while loop alongwith a 'wait until next ms' but it did not work.
 
Also I have an output denoting the avergae speed of the trolley i'm pulling along (displacement reading / time elapsed). However I wish to display the instantaneous speed ((displacement reading - previous displacement)/ time interval)
 
If anyone has any advice i would be greatly appreciated.
 
I have attached my program if this helps in your understanding of my problem.
 
Thanks.
0 Kudos
Message 1 of 2
(2,572 Views)

Hi grantstephen,

your while loop to save the data will first run if the other loop is stopped. If you want to write the data permanently to the file you have to put the save vi into the other one, or send the data to write, with a queue or notifier to the save loop.

Mike

0 Kudos
Message 2 of 2
(2,562 Views)