Details
Hi, I'm new to the VIPM website, so if this is not the place to discuss this, please let me know.
When calling the Close VI, I've noticed an intermittent error 1556 (invalid reference). It is being thrown because my State Data DVR is closed before I finish running the cleanup code in my Event Handler. My Event Handler attempts to access my State Data after the State Data is closed because the Close Event Handler VI doesn't wait for the Event Handler to finish before returning, and the next VI to run is the Close State Data.VI.
I've implemented a quick fix on my end:
1. Add a Notifier (bool) called "Event Handler Done" to the class private data of Control.lvclass.
2. Add Obtain Notifier in the Initialize Control.VI and bundle it into the class private data.
3. Add Wait on Notifier in the Close Event Handler after the Live Data Queue is released. Wire it to the Notifier in the class data. Add a ten second timeout to the notifier (just in case).
4. Add a Send Notifier in the Event Handler Dispatcher just before the Error Out indicator. Wire it to the Notifier in the class data.
Essentially, this allows the Event Handler Dispatcher to tell the Close Event Handler VI that the Event Handler has been closed.
Does this fix sound about right?
Please sign in to leave a comment.