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: 

Edit Plot Sub.vi

Solved!
Go to solution

I want to make a sub.vi to handle all of my property nodes that I use to customize my XY Graph, and I have a general question about how I wire it.

Attached is a composite of 2 .vis, the bottom is the expanded view of the Edit Plot sub.vi. 

 

In my main program (represented by the top half) my "Vibration Response Plot" is elsewhere in the .vi, inside a state machine that is inside a producer/consumer.  The Edit Plot .vi will be run either before or after the plot has already been formed, not while it is forming.  (it will not be placed inside the state machine with the actual XY indicator, but outside of it).

 

I wasn't sure how to get the property nodes to reference my plot correctly when using a sub.vi.  What I ended up doing was making an XY graph CONTROL in the sub.vi, and wiring a read-enabled local variable to the input.  (I can't turn the main XY graph in the program into a control because I use the original indicator and a "Build XY Graph" to write to it. 

 

I am concerned about 2 things:

1) if my property nodes will reference the correct plot and change the background, plot color, etc properly in the main .vi

2) if using a local variable as such runs the risk of wiping the main XY graph clean of data, i.e. if the local reads the graph before the data is there, but doesn't execute the sub.vi until after the data is collected, will it reset my graph when it runs through the sub.vi

0 Kudos
Message 1 of 4
(2,268 Views)

Maybe you can't do this?  I.e. put property nodes into a sub.vi?  This one doesn't work either.

0 Kudos
Message 2 of 4
(2,241 Views)
Solution
Accepted by topic author LarsUlrich

You need to create a reference to the XY Graph in the main VI.  Pass this reference to the SubVI and use it to get access to the properties and methods of the graph.  All that you will ever get into and out of terminals like you are doing now is the value.

Message 3 of 4
(2,234 Views)

Thanks a bunch!

0 Kudos
Message 4 of 4
(2,228 Views)