02-05-2013 07:12 PM
I registered a user event "Set H" in Main VI("MultiMeas 0.0.vi"). This "Set H" event can be generated either by the button "FIELD H" in the main VI, or by a SubVI called by the main VI's Menu-"Experiments->R-H->Traditional". Then the problem is, after I call the SubVI ("test2.vi") through the menu and then close this subVI"test2.vi", I click the button "FIELD H", immediately get an error message. See attached picture and VIs, please.
Thanks,
LV 2012.
WT
02-06-2013 06:02 PM
Hi weitong,
I ran your VI on my computer and did not get the error message; everything worked fine. What version of LabVIEW are you using? And what operating system are you running? Do you have any hardware assiciated with your VI? That error message is for a GPIB connection which I did not see any evidence of in your VI.
02-06-2013 06:39 PM
The first part of the error message is relevant. It says a parameter is invalid at Generate User Event. It does not say which instance of Generate User Event threw the error. I would put Probes on the error out of each instance and also the inputs.
My guess is that somehow one of the user event references has gone invalid before the Generate User Event is called. For example if the stop button is pressed, the lower loop may stop and Unregister for Events could run before Panel Close tries to generate that event. Also the default values at the user event reference output tunnels in the upper case structure guarantee that at least two of the three Destroy User Event calls will occur with invalid references.
Lynn
02-07-2013 06:59 AM
Use error clusters to make sure the unregistering happens before you destroy the events. This looks like a race condition between the two loops. You want to make sure all looops have stopped before destroying events, queues, notifiers, etc.