LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

open multiple sub vis from main vi

Solved!
Go to solution

The same one that was listed in [I think] the third post or so.

original.jpg

0 Kudos
Message 21 of 28
(595 Views)

At what point is the error generated?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 22 of 28
(593 Views)

It comes in in the RunVI method.  Like I said before it is fine with highlight execution on but not off...

0 Kudos
Message 23 of 28
(588 Views)

@joedowdle wrote:

[...]  Then as you can see below in the code I have been using to call it - I close the references.  Now I can't figure out why it is still running after doing this.  The front panel of the subVI will not close until it gets out of the while loop and the only things after that are a close front panel method and a close reference.  [...]

 

 


When setting "Auto Dispose Ref" to True, you will not stop the execution of the callee VI by closing the reference in the caller, see Run VI Method docu.

0 Kudos
Message 24 of 28
(579 Views)

I modified it to say false now and I still get the same error.  I guess I didn't quite understand exactly what the "Auto Dispose Ref" function did.  So am I supposed to not close the reference inside the subVI?  I open a reference to itself to alter properties and methods and then close it at the end.

0 Kudos
Message 25 of 28
(575 Views)

@joedowdle wrote:

I modified it to say false now and I still get the same error. 


Me too.

 


@joedowdle wrote:

I guess I didn't quite understand exactly what the "Auto Dispose Ref" function did.  So am I supposed to not close the reference inside the subVI?  I open a reference to itself to alter properties and methods and then close it at the end.


You do not have to close the VI reference in the subVI!

Closing the VI reference in the caller is always a good practice: 

If AutoDisposeRef is true and the RunVI method produces an error (like you see it) closing the reference in the caller is appropriate and recommended.

If AutoDisposeRef is False closing the VI reference in the caller should stop the subVI.  I am unsure why you observe a different behaviour.

0 Kudos
Message 26 of 28
(573 Views)

If you go back to the previous page and look at the code I originally posted, do you think the problem could stem from closing the reference betfore it's done running?  Because I call the subVI and set "Wait Until Done" to false so that the caller VI continues to run.  This subVI that comes up is like a notifier to tell the user something is loading and to wait.

 

If this could be the problem - what could I do to close the reference at the appropriate time (i.e., after the subVI finishes running).

 

Note:  I also removed the close reference VI from the subVI and still had the error.  The only close reference VI's are now in the caller.

0 Kudos
Message 27 of 28
(546 Views)

Well I got it to work.... I moved the second call to that subVI to a slightly different place in my code and it works just fine.  I have no idea what the difference is but it's working now. 

0 Kudos
Message 28 of 28
(544 Views)