LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a SubVI without providing a reference to the objects inside the SubVI?

Solved!
Go to solution

Hi all,

 

Suppose I have a SubVI that plots Y1 vs. X1 and Y2 vs. X2 on the same XYGraph. See the attachment.

The XYGraph property node is linked to the XYGraph. It sets the line width and point style for each curve on the XYGraph.

 

If I call this SubVI 4 times in another code (to make 4 diferent XYGraphs (XYGraph1, XYGraph2, XYGraph3, XYGraph4, each containing two curves for Y1 vs. X1 and Y2 vs. X2)), 

why would I need to create 4 different references for the 4 different XYGraphs? 

 

The question really is this: if the property node is explicitly linked to the XYGraph in the SubVI, why would the property node need to be updated via a reference if the SubVI is called

multiple times to make multiple XYGraphs? Wouldn't the SubVI take the inputs, plot the curves the XYGraph, update the property nodes and then produce a final XYGraph with

updated properties?

 

0 Kudos
Message 1 of 3
(2,648 Views)
Solution
Accepted by topic author murchak

If this is to be a subVI why do you have a graph on its front panel and manipulating its properties? You need to be manipulating the properties of the graph on the top-level VI's front panel. You see a graph is not a datatype -- it's a display object. All that is passed through terminals to calling VIs is data, and the datatype in this case is an array of clusters containing an array of x-values and an array of y-values.

 

Capture1.PNG

 

If you want to make a subVI that does this operation you have to pass it a reference to the graph you want to manipulate as one of it's input data values.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(2,637 Views)

Thanks. That makes sense.

0 Kudos
Message 3 of 3
(2,585 Views)