07-11-2017 09:55 AM
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 😄
07-11-2017 10:00 AM - edited 07-11-2017 10:06 AM
Hi Lee,
yes, sure: just add another plot!
07-11-2017 10:02 AM
Property node >>> Plot Images Front
Will let you insert an image in front of the plot.
Ben
07-12-2017 08:55 AM
Hi GerdW,
Thanks for the spoiler 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.
07-12-2017 09:04 AM
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.
07-12-2017 09:07 AM
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.
07-12-2017 09:30 AM - edited 07-12-2017 09:31 AM
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.
07-12-2017 09:47 AM
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)