LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubPanel VI not closing correctly

Solved!
Go to solution

The top-level VI creates the reference and passes it into the SubVI which registers for the event. When you want to shutdown the SubVI, you generate the event (on the reference that you passed into the SubVI) from the top-level VI. You only need to create the reference once, but you can generate as many events as you like on the same reference.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 11 of 14
(2,121 Views)

Hi,

 

I tried doing this and with a FGV i either set or get the event. I think I wired it correctly but I have a broken run which tells me that my create event is wire incorrectly. I have an enum wired to it. I did have it working but my computer tripped before it saved. It's driving me crazy and i dont know where my mistake is. Capture.png is where I set the event and capture1.png is where i register and run the enum that was passed. but in capture.png it says that the creat user event is wired incorrectly.

 

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
Download All
0 Kudos
Message 12 of 14
(2,117 Views)
Solution
Accepted by topic author Stephen1995

Ok, you have clearly misunderstood and/or I wasn't clear enough about the different between passing data on a wire and passing a reference on a wire. You pass the event reference wire into the SubVI when you launch it using the ACBR node.

 

I have created an example in LV 2014 which should demonstrate what I mean.

 

The problem with the screenshots you posted is that you only 'set' the reference in the FGV after you generate the user event and after it has been read by the SubVI - this is a dataflow problem. For your solution to work (the FGV is unnecessary if you look at my example), you would need to 'set' the reference in the FGV before you launch the SubVI.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Download All
Message 13 of 14
(2,094 Views)

Thanks for that. I wasn't understanding this fully but understood the wiring to the subVI at least. The code I sent was me trying to replicate code that my supervisor (who is a CLA) had written but the computer tripped and didn't save the VI. Never the less both ways I have working now and I'm going to go with yours to get rid of the FGV. 

 

Thanks again

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 14 of 14
(2,086 Views)