LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot data from lvm file

In my application I am creating data logging file where data looks like the following:
 2.958877 19.324750 0.903379 17:30:05\09
 2.958877 19.324750 0.903379 17:30:06\09
 2.958877 19.324750 0.904282 17:30:06\09
 2.969686 19.321536 0.904282 17:30:06\09
 2.969686 19.321536 0.905186 17:30:06\09
 2.969686 19.321536 0.905186 17:30:07\09
 2.969686 19.321536 0.905186 17:30:07\09
 2.980676 19.319421 0.906091 17:30:07\09
 2.980676 19.319421 0.906091 17:30:07\09
 2.980676 19.319421 0.906997 17:30:08\09
 
So 4 columns in total. First 3 are some measurements and the last one is time.
By some reason Write LVM file does not write time correctly instead of time it puts 9999.0000
SO I have created some time stamp and record it as comment(saw it in some example)
But now the question is how to read this file and plot it using the time I have recorded.
 
When i open the file in Read LVM file vi it shows the following(in attachment)
 
My question is: how may I create Preview plots of the data.
0 Kudos
Message 1 of 5
(3,526 Views)
You are going to have to post the code that created the data. I've only done some experiments with the Write to Measurement file but what you does not look correct at all. The default is to have the time in the first column or in a separate column with each channel. As long as you are writing correctly formatted dynamic data or waveform data types, the  time should be correct. When you use the Read From Measurement File, it expects to see it in the same format. If you've created a custom file write, then you need to use a custom file read.
0 Kudos
Message 2 of 5
(3,520 Views)
Ok, here is the last version of the VI I have used.
By some reason when I put default time stamp for one column or for each column it either is with 9999.0000 instea of time or with time and 9999.0000 sometimes instead of time (one in each 4-5 time)
 
Previous versions of the VI did not have this problem, so I added custom ime because i sops to work correctly by some reason.
I have no possibility to test it now as we shipped hardware already.
Is it possible to create viewer of this files using  the time I have added?
0 Kudos
Message 3 of 5
(3,479 Views)

You can't get a correct time in the first column because the first element in the dynamic data type has no time information. The first element is a 1D array that you convert to dynamic data but since the 1D array has no time information, there is no time information after the conversion. You've created a dynamic data type that the Write to Measurement File was never designed to handle.

Yes, you can create your own file reader instead of the Read From Measurement File. You can use the Read From Spreadsheet File to get all of the columns and then you can parse out what you need. You will need to set Read From Spreadsheet to the string type in order to get the time stamps.

0 Kudos
Message 4 of 5
(3,465 Views)

A dynamic data type is an array of waveform data types under the hood.  Knowing this, you can easily add timing information in one of two ways.

  1. Make a waveform containing the correct timing information from your raw array before converting to a dynamic data type
  2. Convert the final dynamic data type to an array of waveforms, index out the first one, change its timing information, replace the original in the array, and convert back to dynamic data type.  If you use the In Place structure, you shouldn't make any copies doing this.

Note that the timing information will always be in the first column (assuming you write the first column) and is always relative to the initial timestamp.  The initial timestamp is given in the header.  This was done for performance and space reasons.  The header also contains the dt value, so the first column is actually not really needed in most cases.

0 Kudos
Message 5 of 5
(3,461 Views)