LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw lines on top of multiple XY plot

I would like to look for suggestion or solutions to the following problem. I am currently using LabVIEW 2015 with the Control Design and Simulation module. Currently I am able to generate multiple XY data and plot them on a buffer XY graph in a simulation loop. Is it possible to draw a square similar to image below on top of the regular XY plot? The square should connect the points from each plot say at every t interval of simulation time.

 

An example would be, the simulation loop will generate the circle at run time. At the same time, at every 5s of simulation time, a square is drawn to join the instantaneous point from each plot.

 

Thanks in advance 😄

Picture1.png

0 Kudos
Message 1 of 8
(5,337 Views)

Hi Lee,

 

yes, sure: just add another plot!

Spoiler
Each rectangle consists of 5 points (you need to "close" the rectangle!). You can seperate those 3 rectangles by points of XY=NaN, LabVIEW will not draw these points…
Best regards,
GerdW


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

Property node >>> Plot Images Front

 

Will let you insert an image in front of the plot.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 8
(5,327 Views)

Hi GerdW,

 

Thanks for the spoiler Smiley Happy I get what you trying to say here, drawing a rectangle requires 5 points and separate between rectangles with NaN.

 

However, the buffer XY graph only takes in single XY points per plot at a time, and the rectangle I am trying to join also at the same time. So, how can I store the values so that it will be plotted on the next simulation loop, without the overwrite of new values? Or is there a way to do it all in a single simulation loop? I hope this is not too confusing.

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

I am not familiar with "buffer XY graph". Is this part of the module? Can you show us some code?

 

In any case, if you keep the xy gaph data in a shift register, you can replace or retain any plot at any time.

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

Hi Ben,

 

Thanks for the suggestion. However, in this case, I am actually trying to connect several points of different plots at a specific time instead of plotting image on top of the XY graph.

 

But still, thanks for pointing out this "Plot Images Front" property node, I have learnt something new from you. I quickly ran the Plot Images Property.vi example from Labview to understand this feature.

 

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

Hi Altenbach,

 

Yes, the "buffer XY graph" is part of the control design and simulation module. It is recommended to use this instead of regular Labview XY graph to plot simulation data correctly. More details here http://zone.ni.com/reference/en-XX/help/371894F-01/lvsim/sim_bufferxygraph/

 

Here is a snippet on how I generated the data and plot them using the "buffer XY graph". If I were to use shift register, then there also need to be a way to select the points from which should be plotted at a specific time. Still need some time to think how to use shift register to achieve this.

 

Example Snippet.png

0 Kudos
Message 7 of 8
(5,262 Views)

Thanks. Sorry, I don't have the simulation module, but, so I cannot test.

 

I am sure that you could add more plots by tapping into the pink wire after the buffer VI.

 

(Somehow I think the math could be dramatically simplified by using complex datatype and graphical code. How many times do you need to calculate e.g. the same r*cos(theta) with the same inputs. Once would seem enough. :D)

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