LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get waveform Graph to show plot

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!

Download All
0 Kudos
Message 1 of 11
(4,641 Views)

Each of your waveforms seems to hold only one point, so when you autoindex them they produce an array of separate waveforms. Instead, you can use a shift register and the 'Append Waveform' function to build one long waveform.

 

buildwaveform.png


GCentral
Message 2 of 11
(4,620 Views)

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?

0 Kudos
Message 3 of 11
(4,582 Views)

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

0 Kudos
Message 4 of 11
(4,575 Views)

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!

0 Kudos
Message 5 of 11
(4,565 Views)

I would try saving the data in binary (TDMS) format instead of text (LVM) and change the Read Measurement File accordingly.

 

Ben64

0 Kudos
Message 6 of 11
(4,560 Views)

@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.


GCentral
0 Kudos
Message 7 of 11
(4,555 Views)

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 😞

0 Kudos
Message 8 of 11
(4,551 Views)

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.

 

readt0.png

 

 


GCentral
0 Kudos
Message 9 of 11
(4,544 Views)

Try TDMS

 

using tdms.png

Ben64

0 Kudos
Message 10 of 11
(4,527 Views)