LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unregistering User Event stored in shift register generates error 1 if SubVI is executed intermittently

Solved!
Go to solution

Hello,

 

I am trying to understand the behavior of the attached excerpt of a larger functional global vi.

In one state, I am generating a user event and in a later state unregister from teh event and destroy it.

Now, if I run through the whole VI in one step (i.e., Step Through Events? set to FALSE), the VI executes without generating an error. However, if I run the VI intermittently and exit after each loop execution, the vi generates Error 1. Why is this so? Please advise. Thank you.

 

Peter

 

0 Kudos
Message 1 of 3
(2,442 Views)
Solution
Accepted by topic author pbuerki

Why are you registering and unregistering for user events, but you don't have any event structures in your VI that are using them?

 

When you step through events, probaby the event you registered for disappears when your VI stops running.  If you were able to keep your topmost VI running, then the life of the event would persist.

 

The event number still exists within the uninitialized shift register, but it doesn't mean anything anymore once your top level VI stops and you get error 1.

 

If this was truly a functional global VI, you'd have teminals connected to the connector panel in your VI, you'd be calling this as a subVI as part of a main VI, and the event life would persist and you wouldn't have error 1.

Message 2 of 3
(2,436 Views)

Hello RavensFan,

 

Sorry I have not added the terminals and was testing it outside a top level vi. (I had deleted all the code related to firing and processing events.) Once I incorporate the SubVI in a top level vi, it works fine, see attached. The fact that the event number still existed in the shift register threw me off. Thanks for your help.

Peter

0 Kudos
Message 3 of 3
(2,424 Views)