Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/08/2013 in all areas

  1. Bingo. Sounds like you'll be fine, since this Launcher VI remains reserved for execution as long as the top-level VI remains running. But just to watch out for in the future, here are two places this can get tricky: When shutting down your application: If the top-level loop stops before the clones stop, the Event Ref will go invalid since its lifetime is tied to the top-level loop. Fortunately, the Events API grants immunity against this, because the Event Registration Refnum can have a different lifetime than that of the Event Ref. In your example, the event ref lifetime is tied to the static call chain of the Launcher up to the top-level state machine, while the Event Registration Refnum is tied to the lifetime of the Clone (presumably, if the Clone is calling the Register For Events method). For this reason, it's OK for the top-level loop to send a final "Shutdown" message and then immediately close the Event Ref -- even though the Messenger is now gone, the Mailbox remains valid with the final Shutdown message in its queue. When you're running the Launcher directly from the IDE in order to troubleshoot/develop the clones: If you were to run this VI directly, it would launch the clones, but the User Event references would immediately die as this Launcher is no longer running or reserved for execution. Common misconception -- even though it remains in memory (since the panel remains open), and even though we passed the references to VIs that are currently running, references created by this VI go invalid once the VI finishes execution. One way to circumvent this, is to create a trivlally simple "Debug Launcher" VI that makes a static call to the launcher and remains running until a simple event (shown below):
    1 point
  2. Looking forward to the BBQ. A word of advice from a previous mistake: wear shorts!
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.