LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When to Close Refnums Used in Input to 'Register Events'

Hi,

 

Can I close a refnum to a control right after registering the event for it or do I need to close it later when I close the 'Event Registration Refnum'?

 

I've attached an example VI (and a picture of it) where it is closed before and after.  I get no run-time errors.

 

Thanks,

Albert

 

LV 2011

 

 

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

Hi Albert,

 

If you read the help file for the Register Events function you will see that when you register a particular event it will stay registered until you unregistered it or your VI stops running. 

 

http://zone.ni.com/reference/en-XX/help/371361H-01/glang/register_events/

 

This is why the Close Reference VI after you register the event does not cause any issues. The second Close Reference VI is unnecessary since you already closed the reference with the first VI.

 

Regards,

 

Josh B

Applications Engineer
National Instruments
Message 2 of 2
(1,901 Views)