LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

add plots to digital waveform graph programmatically

Hi Guys,

            This might be an easy one but I can't seem to find the right property. I'm adding "Plot Name" values for a each Plot in a Digital Waveform Graph. I select each plot with "Active Plot" property and name it. However if there are already e.g. 7 plots and I try to set eight plot active (i.e. 7 = Active Plot) I get an error cause this eight plot doesn't exist on the graph, and so can't be named.

    How can I add (or indeed remove) plots using property nodes?

    Thanks

 

0 Kudos
Message 1 of 2
(3,265 Views)

Hello,

 

One thing to consider is the actual data the graph is receiving.  Choosing plot 8 in this case is perhaps attempting to choose a plot which doesn't exist in the data, which could be why you're seeing the error.

 

Off the cuff, one thought might be to have the following "steps" take place when you want to add plots:

  • on the appropriate action to create a plot, create a default data set representing that plot
  • package that with your overall graph data so that the new plot exists in the data
  • write that data to the graph, perhaps using the Value Signaling property (via a property node linked to the Graph)
  • trap the graph's Value Change event using an event structure (possibly in a parallel loop) and update the plot name there (much like you are today - using a property node to first set the active plot to <previous value + 1> since you just added a plot, and then set your new plot name)

Not sure what the rest of your application looks like, but hope this helps!

 

Best,
JLS
Sixclear
0 Kudos
Message 2 of 2
(3,231 Views)