LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-Time Multi Plot Waveform Chart

Solved!
Go to solution

Hi,

 

I attached a picture showing a part of my code. What I'm trying to do is to create the exact waveform chart as "Cell Pressures (kPa)" but in real-time x-axis. I created the "waveform" and it's not quite working. The array going to "Y" in "Build Waveform" contains 8 elements and when I run the program, "Waveform" shows all the elements in one plot rather than in 8 different plots in one chart.

 

Can somebody pick where I'm doing wrong?

 

Thanks,

Hoda

0 Kudos
Message 1 of 10
(7,793 Views)

Please look at the attachement, it's a simplified version of what I want to do and the ways I tried but it didn't work.

The Waveform chart shows all f plots but the chart doesn't show real time. 

Waveform 2 and 3 show the real time but they don't show all four plots. 

any help would e much appreciated

0 Kudos
Message 2 of 10
(7,721 Views)

Chart 2.

 

You are turning all 4 elements into an array.  Then putting them into a bundle waveform.  But the first 3 get overwritten by the last Y array bundle.

 

Chart 3.

You are bundling 4 points into a single array, then putting that into the waveform.  So all 4 are combined into one plot.

 

Waveform Chart.

How is that not doing what you want?

 

I recommend you look at the Example Finder for waveform chart to see all the ways you can combine data for a waveform chart.

0 Kudos
Message 3 of 10
(7,717 Views)

Waveform chart doesn't have the component of time. I need to show all the plots in a chart and on real-time

0 Kudos
Message 4 of 10
(7,689 Views)

@Hoda wrote:

Waveform chart doesn't have the component of time. I need to show all the plots in a chart and on real-time


Example_VI_FP.png

go to graph properties,display format tab,choose time "x axis", absolute time

0 Kudos
Message 5 of 10
(7,683 Views)
Solution
Accepted by topic author Hoda

@Hoda wrote:

Waveform chart doesn't have the component of time. I need to show all the plots in a chart and on real-time


Since you are converting from scalar data to a cluster to the chart, there is no information that shows the timing.  It is lacking the T0 initial time and the dT for the time interval,.

 

Outside of your loop wire the current time to the Xscale.Offset property node for the chart.  Since your loop time is 1 second, you don't need to set the dT.  But if it was something else, you'd need to set the XScale.Multiplier property as well.

 

0 Kudos
Message 6 of 10
(7,680 Views)

I came up with some sort of solution to show the waveform chart in the way I want ( chart 2) 

 

RavenFan: 

Your solution seems easier so I tried that (chart 1) but it's always ahead of real time! any idea what is wrong in this chart?

 

0 Kudos
Message 7 of 10
(7,673 Views)

I said to put that bit of code OUTSIDE the loop.  As you have it now, you are updating the offset on every iteration with the current time.  Only read the time once, and update the offset property once before the loop starts.

 

(Same thing for you other chart.  Read the time only once before the loop starts.)

0 Kudos
Message 8 of 10
(7,657 Views)

Dear RavensFan,

 

My mistake ... I put that outside the loop but still it doesn't work the way I want. Look at the picture:

 

 

Waveform Charts.jpg

 

 

 

Download All
0 Kudos
Message 9 of 10
(7,640 Views)

It looks like you've stopped and restarted your VI.  So that is going to change the XScale.offset because you are rerunning that node again.  VI's aren't meant to be stopped and restarted.

 

Don't stop and restart your VI.

0 Kudos
Message 10 of 10
(7,632 Views)