04-12-2017 03:41 AM
I'm trying to plot a Waveform Graph based on an LVM file.
So far I've managed to convert from the DDT to Waveform, but I can't seem to get it to show on the graph.
X and Y limits automatically adjust according to the values on my file but plot doesn't show.
I tested creating a Waveform Graph via cluster and providing an initial time, but I don't get how to do it directly from the LVM data.
I'm really new to LabView so sorry if this is a newbie mistake.
Thanks in advance!
04-12-2017 03:59 AM - edited 04-12-2017 04:00 AM
04-12-2017 01:01 PM
Thanks a lot!
It shows the plot now, the issue here is the time is not correct, it's showing a different date than the one the measurement file has.
I added another waveform visualizer to view it outside of the loop, and while values seem to be passing correctly, the t0 doesn't seem to be passing at all.
How can I get the t0 from my file to appear on the X axis of the graph?
04-12-2017 02:39 PM
The main issue here is probably more how the file is generated than how to read it. You have a first header describing writer/reader versions, date and time and a second header section for the channel where samples is set to 1, X0 to 0 and delta_X to 1 (wich is probably the default value for Delta_X).
Can you show us how you generated your file.
Ben64
04-12-2017 05:19 PM
Of course, I added the file I used to generate my LVM.
I read the values from an Arduino and show them in a Graph in real-time.
Also while doing this, im saving the values to my LVM file.
Thanks!
04-12-2017 06:27 PM
04-12-2017 07:41 PM
@JulsWlf wrote:
Thanks a lot!
It shows the plot now, the issue here is the time is not correct, it's showing a different date than the one the measurement file has.
I added another waveform visualizer to view it outside of the loop, and while values seem to be passing correctly, the t0 doesn't seem to be passing at all.
How can I get the t0 from my file to appear on the X axis of the graph?
If you right click on the graph, and go to the Scales tab, you'll probably see that 'Ignore waveform time stamp on x-axes' is ticked. If you untick this, you might have better luck.
04-12-2017 08:02 PM
Weird, It's unticked actually, not sure why it isn't using the t0 from my LVM file.
I haven't tried the Binary (TDMS) save yet, since I will get access to the sensor later on to do some more testing, I'm hoping this will work 😞
04-12-2017 09:07 PM
Sorry - got it. So, the relevant point is that the Append Waveforms VI doesn't pay any attention to the time stamp - it just concatenates the waveforms provided dt is the same. You can see this in the detailed help, when it says: "The trigger time of waveform B is ignored."
The shift register is uninitialized in my previous snippet so on subsequent runs it doesn't do exactly what you want anyway. You should change this to use an empty waveform (you can right-click on the left shift register icon and click create constant) and then you need a way to set the t0 according to your first sample.
The simplest way I thought of to do this is simply to check if the loop's 'i' indictor (the iteration number) is equal to zero (there's a primitive for this) and then wire that to a case structure. In the true case, read the t0 of the waveform you create using 'Get Waveform Components', and then use 'Build Waveform' on the waveform wired from the shift register to set t0. Do this before the 'Append Waveform' VI. In the false case, just wire the shift register wire straight through.
04-13-2017 08:24 AM