02-28-2013 08:21 PM
Hello, I am a newbie regarding dynamic user events.
Basically, I want to create a user event that triggers an event structure in a subvi.
To do this, I wire up a "create new user event" and then pass the refnum to my subvi "more info" as seen below. But this piece of code get's stuck in the sub-vi and never leaves :[
here is my subvi below:
I'd greatly appreciate any help :]
02-28-2013 08:36 PM
The sequence can't finish until the subVI finished. And since I see your while loop is set to never end and you are probably not getting your event either, the subVI will never finish. It is probably just a matter of removing the sequnce structure.
03-01-2013 02:10 AM - edited 03-01-2013 02:12 AM
A few additional points:
03-01-2013 02:57 AM
To stop your main vi you will need to provide a mechanism to stop your sub vi.
I would use an additional boolean User Event to do this.
(This could be shared among other subvis).
When the (let's call it) Shutdown event is received, set your subvi while loop control terminal true.
Note: When using this scheme in an exe file, if the subvi front panel is open and you shutdown the main vi, the subvi can remain open. This happened to me using LabVIEW 2010. I had to use a Front Panel Close Method to avoid this issue.
When using the Front Panel Close Method you should first check if the front panel is open or not to avoid an error.