02-07-2022 01:08 AM
I have found the attached VI on NI forums itself. I want to use it for my purpose. In this VI XY graph changes the color of newly added data. But when I use property node to configure the point style, first it seems correctly appearing but when the new data comes older plot changes automatically to line. Please run the attached VI for more clarity.
02-07-2022 02:37 PM
Sorry, cannot open LabVIEW 2021, but your build "array" seems to be in concatenate mode, meaning you are always appending the the same plot.
@BhargavRJ wrote:
I have found the attached VI on NI forums itself.
Also, if you found a VI in the forum, it would be polite to give a link!!!
02-08-2022 02:06 AM
Yes, I know I am appending to the same plot, so that I can change the color of point for each for loop.
I have found that VI from the below link, and then I modified it to show only points by setting it to the plot property node. I am attaching that VI for older version of LabVIEW so that anybody can open it. Please have a look at that VI after running it, It is resetting the plot interpolation for history data.
https://forums.ni.com/t5/LabVIEW/XY-Graph-overlay-multi-plot-with-different-colors/m-p/1029623
02-08-2022 03:47 AM
Hi,
With a value of 10 for Number of Plots, you are creating a graph with 100 (10*10) Plots.
Your Plot10 is on the Plot 0 and is a line so it will do like a graphic overwritting of your data.
Delete that build array + the upper dataflow line at the right to get only your new plots.
02-08-2022 03:55 AM
Hi,
Thank you very much for your suggestion, but I want old data also on my XY graph. I just want to see old data as a point only without interpolation. But somehow interpolation line for old data comes automatically.
02-08-2022 04:25 AM
I was really in the wrong, your XY graph array is 10240 elements long for a number of plots of 10.
By changing them one by one you will have your required graph and an error at 5120 iterations as there is no more plots.
Most of theses plots have no data.
This will be quite inefficient and soooooooooooooooooooooooo long.
I don't get what you are saying as "old data" as the 10 plots are there. Can you developp what is those "Old data" ?
02-08-2022 09:44 AM - edited 02-08-2022 10:22 AM
I typically use complex, so see if this can give you some ideas. (I have not studied what's wrong with your code).
Writing the value before defining the plots is typically a good idea, because when starting from scratch, you cannot define properties of plots that don't exist yet. Also note that NaN values are not plotted.
02-08-2022 02:50 PM
@altenbach wrote:
Writing the value before defining the plots is typically a good idea, because when starting from scratch, you cannot define properties of plots that don't exist yet.
This is usually a good idea, but it's not necessary to write the data first to get the number of plots set. You could write the attributes first as long as you set (or verify) the Legend.Plot Minimum value first:
This tells the graph how many plots exist, and can prevent errors indexing Active Plot beyond the Plot Minimum value (-1 of course; you know what I mean).
Note that you can also Read the Plot Minimum value to see how many plots can be configured. This does not mean, however, that there is currently a data value for that many plots, only that the graph is currently capable of holding attributes for that many plots.
02-08-2022 03:43 PM
@rwunderl wrote:
@altenbach wrote:
Writing the value before defining the plots is typically a good idea, because when starting from scratch, you cannot define properties of plots that don't exist yet.
This is usually a good idea, but it's not necessary to write the data first to get the number of plots set. You could write the attributes first as long as you set (or verify) the Legend.Plot Minimum value first:
Thanks. I haven't done any testing to see if LegPlotMin really does define a minimum number of plots data-wise, or is just a cosmetic property of the legend. The help is not really helpful here. 😄
(It looks like you've use LabVIEW for a very, very long time. I still remember when "Attribute nodes" were changed to "Property nodes", decades ago 😄 )
02-08-2022 04:00 PM
You do realize that the property node in the outer loop writes a 1 to each active plot line style property RIGHT? 1 is a line with no points. You probably don't want to write that property if the XY Graph property page settings are set up the way you want the plot to appear all the time.