LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

through subVI generating user event causes error

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

Download All
0 Kudos
Message 1 of 4
(2,468 Views)

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. 

Kurt P
Automated Test Software R&D
0 Kudos
Message 2 of 4
(2,423 Views)

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

0 Kudos
Message 3 of 4
(2,418 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,401 Views)