LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read my wave form data back from an LVM file?

Solved!
Go to solution

I collected a waveform and saved it using the LVM file format. I would like to read the waveform back into labview and display it with its timestamp and assigned name. The only way I could read the data back into Labview was to convert it to a number array. I figured if you could write a waveform and save all its data, you should be able to read it back rather easily. I've included my LVM file and two simple programs. The program I'm using is much larger, but these two programs are representative of what I'm trying to accomplish.

 

Thanks

0 Kudos
Message 1 of 8
(5,559 Views)
By using the dynamic data type and sending it to a graph indicator I got the names of the graphs but not the timestamp or data. If I put a probe inside the while loop I can see the information, but I cannot build an array out of it. It wants to convert the dynamic data to a numeric first like what is already done to display the data. I guess this is getting closer(?).
0 Kudos
Message 2 of 8
(5,556 Views)

Hi Knoebel,

To display the waveform data, you'll need to change a couple things.

1. Open the "Convert from Dynamic Data" vi and change the Conversion to have a resulting data type of 1D array of waveform, as this is the datatype you are writing with the "Write To LVM.vi"  Currently you are converting to an array of scalars here, which is why you are losing timestamp data.

2. Open the "Read from Measurement File" express VI and Change the Time Stamps to be Absolute (date and time) rather than relative. 
3. If you want to display the timestamp on the waveform graph, pull up the properties window for the Waveform graph and change the Display Format to be Absolute Time for the X-axis and then check the Scales tab to be sure you have unchecked Ignore waveform timestamp on x-axes

 

After making the change to convert from dynamic data type to 1D array of waveform you can also probe the wire going into the waveform graph to check the t0 and dt values of the waveform as you read from file.

 

Lastly, if you look at the Write to LVM.vi block diagram, you will see a little red coercion dot between the waveform data wire and the Write to Measurement File data input terminal.  It would be better to use the "Convert to Dynamic Data" express VI to make this conversion.

 

Hope this helps!

 

Sherrie 

Message 3 of 8
(5,539 Views)

Thanks Sherrie,

 

Your answer was very thorough. I connected the dynamic data to the build array and it automatically converted it to array of numeric. I just thought that's all I could get. I also didn't know about the graph setup.

 

Thank-you,

Eric

0 Kudos
Message 4 of 8
(5,526 Views)

I guess I was too quick on accepting the solution. When I converted the numeric array to waveform the graph plotted my data and gave the assigned names in the legend. It changed the x axis to time, but not the correct time. The graph is still plotting the numeric data and if I change it to a waveform graph it wont plot at all. Anybody know what I'm missing?

 

Thanks

0 Kudos
Message 5 of 8
(5,511 Views)

Hi Knoebel,

 

It looks to me like the main issue is that you are now building a 2D array of wfm, when really, you only have a 1D array of wfm...sampling from multiple channels, one array per channel.  Graph/Charts cannot display 2D arrays of waveforms, which is why you are getting the coercion dot at the input terminal to the waveform chart.  Right click on the waveform array constant that you are using to initialize the shift register and select Remove Dimension to get rid of one of the dimensions.  Other than that, this is really just a matter of getting the Read from Measurement File vi configured correctly to start reading at the right point in the file.  

 

Sherrie

0 Kudos
Message 6 of 8
(5,491 Views)

If I do that I create a 1D array where all four channels are included. This will not display on the chart. The way version 3 is written, the data displays, the channels show up, but the time stamp doesn't. I'm using the LVM format based on National Instruments trying to get people away from using write to text file vi in while loops. I would like to save my waveform data so I can pull it up at a later date and be able to access it as a text file to include portions in test and calibration reports. Should I be using a different file format to save and read my data or is there a fix to get my time stamps?

 

Thanks

0 Kudos
Message 7 of 8
(5,484 Views)
Solution
Accepted by topic author Knoebel
Eric,

I'm glad that you have something that can work even though it is not ideal.
I am closing this service request but I thought I would let you know that
because of your questions I revised the Knowledge Base article on
timestamps and verified it for accuracy and thought you should know.

How Accurate is the Timestamp of the Waveform Returned by my NI-DAQmx
Device?
http://digital.ni.com/public.nsf/allkb/5D42CCB17A70A06686256DBA007C5EEA?OpenDocument


Regards

Vince Methot
Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(5,362 Views)