From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two or more plots in one chart every iteration

Solved!
Go to solution

Hi,

 

Is it possible to plot the one iteration multiple data on the waveform char or graph?

Example:

I need to display Temperature set-point (as constant value) and measured temperature on the chart/graph but every iteration. By other word the same way as e.g. I feed a single data e.g.  constant in to waveform chart so that constant line moves every iteration to right side. But I need it for multiple inputs.

 

There is many exampled to do it using arrays, but it requires to create first array and then display it. That is not hat I need.

Is there any option how to do it? Thank you for help.

0 Kudos
Message 1 of 9
(2,655 Views)

Well, without seeing your code so that I can understand what you are doing, I can't really suggest how you can accomplish your goal, but it is certainly possible to plot a "constant signal" (like a threshold) and a "variable signal" on both a Waveform Chart and a Waveform Graph.  If you have, for example, 5 "signals" and 1 "constant", you just create a data structure with 6 components, ordered however it makes sense for you, and plot them together.

 

Bob Schor

0 Kudos
Message 2 of 9
(2,651 Views)

@romiadam wrote:

Is it possible to plot the one iteration multiple data on the waveform char or graph?.


First you need to learn the big difference between a graph and a chart.

 

  • A chart maintains an internal buffer of fixed size, appends the new data, and discards the oldest if it runs out of space. It can have one or many plots, depending on what you wire to it (scalar, numeric cluster, 1D array, 2D array, etc.).
  • A graph displays whatever is currently wired to the input and has no history. If you want to incrementally build a graph, you need to maintain external data structures where you build up the data for redisplay, for example in a shift register or feedback node.

 

Since both accept a huge variety of datatypes (dynamic, waveform, arrays (1D, 2D), clusters for charts, etc. etc.), we cannot give you specific advice unless you show us what you have. Once we see your code, it'll probably take us minutes or less to give you a solution.

 

0 Kudos
Message 3 of 9
(2,640 Views)

Thanks, altenbach  to clarify the differences. Chart with buffer will be good for my purpose, but if using the graph would be easier, I can use even a graph. All what I need to plot the history of a received multiple data.

 

I am vey sorry to not give you full information. I thought it is enough to explain verbally.

 

Ok, so far I have this (Picture 1).

 

And I need to get this (Picture 2), (there are only two inputs, but I will ad more, about 4 or 5)

 

I have tried this (Picture 3), but that is not what I need.

 

More information, if necessary: The PWM duty cycle value and temperature is send from microcontroller via serial cable in to laptop. Using VisaSerial the data are turned in to number (Picture 4) and I need to plot the multiple data (Duty cycle, Temperature, Temp Setpoint, ....) it in to one chart. They will be scaled that they fit on Y axis

 

Thanks again for help.

0 Kudos
Message 4 of 9
(2,610 Views)
Solution
Accepted by topic author romiadam

Hi romiadam,

 

open the context help window, then move the mouse over the chart terminal.

Read the help: it explains how to achieve more than one plot in the chart.

 

You already use the bundle node, which is fine. Now just switch the chart from stacked to default mode…

 

Suggestion:

You seem to use numeric indicators next to the chart, both showing the same value: just make the "digital display" of the chart visible and delete that additional numeric indicator!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(2,608 Views)

.....Now just switch the chart from stacked to default mode…....

 

Excellent. That was so simple. Only one tick. But we need to know where is that tick.

 

....Suggestion:

You seem to use numeric indicators....

Yes that is right. Thanks for that suggestion. It was helpful too.

Thank you very much.

 

Just one more question, (I will try to sort it out myself, but in case if not), is there possibility to define names for charts as e.g. in MSExcel? As I spot the Y axis name has disappeared, what is logical.

0 Kudos
Message 6 of 9
(2,601 Views)
Solution
Accepted by topic author romiadam

@romiadam wrote:

I have tried this (Picture 3), but that is not what I need.


Not sure why you have "stacked plots" enabled, because that's not the default, so undo that (right-click...stack plots). And yes, just show the digital display of the charts.

 

How much history do you want to keep? Default is 1024 points per plot, but you can change that at edit time. Don't make it gigantic, though. Keep it reasonable.

 

I imagine you don't have problems with the scaling, but of course scaling a temperature between 0 and 100% seems questionable. 

 

Let's assume you have three values per iteration. Here are some possibilities and the best depends on the situation. Some are better if the number of plots is not known at edit time.

 

altenbach_0-1584900764969.png

 

0 Kudos
Message 7 of 9
(2,592 Views)
Solution
Accepted by topic author romiadam

@romiadam wrote:

Just one more question, (I will try to sort it out myself, but in case if not), is there possibility to define names for charts as e.g. in MSExcel? As I spot the Y axis name has disappeared, what is logical.


Not sure what you mean by "names".

 

All are just strings and if you can read them from a file, you can write them to their respective property (plot name (make sure to define the active plot first), axis names, legend, etc.) You cannot change the label, so show the caption instead)

 

Here's how to set the plot name, for example.

 

altenbach_0-1584902473088.png

 

 

0 Kudos
Message 8 of 9
(2,585 Views)

altenbach,

 

Not sure why you have "stacked plots" enabled, because that's not the default

In my case it was default. I do not know why.

 

scaling a temperature between 0 and 100% seems questionable.

Temperature can raie upt to 120°C ,taht is not a porblem. Duty cycle is plotted in range 0-100 so that is fine

 

Here are some possibilities

There is currently 500ms iteration time. I can send from microcontroler even 10 values. That looks great. I will try them and will see which is the best.

 

Here's how to set the plot name

Yes, that I was looking for. Perfect.

 

Thank you for help.  This forum is excellent for beginners.

0 Kudos
Message 9 of 9
(2,581 Views)