LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reg event callback while loop

Solved!
Go to solution

Hi, I try to put a Reg Event Callback inside a while loop where it has to be refreshing constantly,and I have the next error:

 

"LabVIEW:  (Hex 0x4A5) You cannot register the same event on an object multiple times."

 

If I remove the while loop it works fine, but I need that loop. How do I solve the problem?

 

Thanks

0 Kudos
Message 1 of 6
(4,643 Views)
Solution
Accepted by topic author CarlosSp

Are you registering the event with the same callback VI everytime? You don't need to do this. Once registered, the callback VI will trigger on every event fired.

 

You would only need to re-register the event if you wanted to change to a different callback VI. To do that, you'd first have to call Unregister for Events on the first event registered.

Jarrod S.
National Instruments
Message 2 of 6
(4,630 Views)
You only need to register once, so you can put the Reg Event Callback function outside the loop.  No?
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 6
(4,629 Views)

Oh!! Thank you, I didn't know. Now works fine.

 

Thank you

0 Kudos
Message 4 of 6
(4,622 Views)
Well, now I think I have another problem. In my VI Ref of the callback event, I have an operation of +1 that goes to a property of an activeX so I put the callback in a sequence structure before the while and now doesn't increase in 1 that activeX property.
0 Kudos
Message 5 of 6
(4,618 Views)
Ok, solved. Thank you once again 🙂
Message 6 of 6
(4,615 Views)