LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send path control or reference to path control to sub vi

Hello! I have a question of how to build correct labview structure. I have a path control in my main vi and want to check if it is correct in a sub vi. If not correct, ask the user for a correct one in the sub vi. I see two different options of how to do it and I think no one is realy good.
1. Draw a wire from the path control to the input of the subvi. The answer from the sub vi is connected to a local of the path control. This uses locals that I should not use.
2. Draw a reference from the path control to the input of the sub vi. In the sub vi change the value of the reference if path is not correct. No output is needed. Using reference you do not see where variables changes.
How should I solve a problem like
this?
Please help me!
TJ
0 Kudos
Message 1 of 3
(2,782 Views)
Hello TJ,
It is not obvious how to do this and I don´t really understand the problem.
When do you check the path? Is it after you press a button?
I think the first solution is the simpliest. It is nothing wrong with using Local Variables, sometimes you have to. The problem is mostly that they is not a natural part of the "Dataflow execution" and that they also consume extra memory. If you don´t over-use them they will not cause any troubles.
The second solution might be a little more sofisticated. If you use this one, the path-checking VI can run parallel and chack the path in "real-time". This VI might also be easier to reuse in other parts of the code which is good.
0 Kudos
Message 2 of 3
(2,782 Views)
Thomas Json wrote in message news:<506500000008000000CAD30000-1079395200000@exchange.ni.com>...
> Hello! I have a question of how to build correct labview structure. I
> have a path control in my main vi and want to check if it is correct
> in a sub vi. If not correct, ask the user for a correct one in the sub
> vi. I see two different options of how to do it and I think no one is
> realy good.
> 1. Draw a wire from the path control to the input of the subvi. The
> answer from the sub vi is connected to a local of the path control.
> This uses locals that I should not use.

Local variables are fine. Don't worry about using them.

Paul Cardinale
0 Kudos
Message 3 of 3
(2,782 Views)