From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Programatically Adding Plots to XY Graph

Hi All,

 

My VI starts by formating the graphs with plot names.  I used the attached property node to setup the plot names and legend formatting iteratively in a for loop.  This worked fine when I was using WF Charts, but when I switched to XY Graphs, I started getting error messages when I tried to format a plot that had not yet been added to the graph.  Is there a way to add plots programatically?  If not, is there another solution to my current problem?


Thanks!

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 1 of 3
(2,370 Views)

Here is the for loop I use that worked fine with charts, but ran into problems with graphs

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 2 of 3
(2,364 Views)

I figured out a solution.  I move the "Active Plot" property node to a separate property node, which I set to run after the first property node in which I set the number of rows in the legend (by connecting the error out connector in the first node to the error in connector in the second).  That way, the plot legend sets the correct number of plots before I try to choose the most recently added plot as the active plot.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
Message 3 of 3
(2,357 Views)