From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing dynamic data and extract it latter

i want to write a waveform in a file so that in future i can see the saved waveform on the graph dynamically, i mean if i save the dynamic data for 3 hours can i get the data running on the graph for 3 hours in future please help........

0 Kudos
Message 1 of 5
(2,251 Views)

Hi alok123

 

It depends how fast are you getting the data what the sample rate is and how fast you can read the data from the file. If it is not so curious than you can try to read whit the same time you write using Wait until next multiple ms. I don´t know what kind of timing do you use when writing the data but theoreticly, if it is possible to read with the same speed you could get a usable waveform from the file. The problem is how to handle the situation when the reading takes longer than writing. You can also use Elapsed Time to chceck the time of writng and compare whit the time of reading in seconds. If you would like to measure elapsed time in ms you can use Tick count i.e. comparing the start number of thics and the actual number. 

 

Hope it will help.

0 Kudos
Message 2 of 5
(2,235 Views)

Thanks for reply

 

 Let me elaborate the problem.

I am using a PXI system and taking the data from accelerometer at sampling rate of 20k.

Then i am taking FFT of this signal and i want to save FFT Magnitude data.

The task is to show the priviously saved Magnitude data dynamically on graph.

0 Kudos
Message 3 of 5
(2,228 Views)

Saving data at 20kHz for three hours is close to 2GBytes (assuming saving DBL data type), so you probably want to use a binary file format. I would recommend using TDMS.  Each time you create a new data set, write it to a new channel with a unique name.  I would recommend using a timestamp as the name, so you can easily figure out when your data was taken and it is easy to generate the channel name.  Make sure you use enough time resolution in your timestamp name to make them unique.  Alternately, you can use an indexed channel name (e.g. Data0001, Data 0002, etc.).  If you do this, save the timestamp as metadata with each magnitude.  This may make it easier to fetch.

 

Reading the data later is fairly easy.  Fetch the data you want using the channel name or timestamp, depending on how you stored it.  TDMS does support multiple access at the same time, so you can read and write "at the same time."

 

If your data sets are large (megabyte or larger) you may want to take a look at Managing Large Data Sets in LabVIEW.

 

Let us know if you need more information.

0 Kudos
Message 4 of 5
(2,187 Views)

hello DF Gray,

 

sorry for replying so late.

can you please give me a example how to do it.

 

Thanks for reply

0 Kudos
Message 5 of 5
(2,168 Views)