Sign Up

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?

Comments

Quentin Alldredge This fix makes sense. I have never had a lot of cleanup code in my event handler, but it probably needs to handle that case. If you want you can fork my repo at GitLab and submit a merge request. The better place to submit issues is either on GitLab where the code is hosted, open-source, or on the NI Community page for QControl Enthusiasts. Here are the links to both: https://gitlab.com/QSI_Shared_Code/SharedQControls/QControlToolkit https://forums.ni.com/t5/QControl-Enthusiasts/bd-p/5383?profile.language=en Thank you for the input!
 •  Reply34m
Nora Clark Sorry it took so long to respond. I made code changes and posted the merge request on gitlab. Thanks! Been really enjoying QControls so far
 •  Reply34m

Please sign in to leave a comment.