07-28-2016 07:33 AM
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.
07-28-2016 10:04 AM
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.
07-29-2016 05:28 AM - edited 07-29-2016 05:29 AM
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.
07-29-2016 05:47 AM
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