LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Events in classes LabVIEW 8.6

Solved!
Go to solution

i have class with some member (counter of something)

and i want to generate a user event when this member has specific values.

 

currently i manage to generate the event only if i register the event of the class

in the Top Vi that use this class

 

can i register the event inside the class itself, let say inside the initilize vi that i ave for the this class ?

 

thanks

 

 

0 Kudos
Message 1 of 6
(3,849 Views)

any help?

0 Kudos
Message 2 of 6
(3,821 Views)

The question is a little confusing. You can register for the event anywhere you like, but somewhere you pretty much need to have an Event Structure in a running VI waiting for that event to occur.

 

What should be aware of these events? Class members

 

P.S. On second reading, it seems you might just be asking if you can register the event in a class VI, instead of having to register it in the top-level VI. If that's the case, then yes you can. Just have the Register for Events function inside the Initialize VI of your class and have it output the Event Registration Refnum corresponding to your event.

Message Edited by Jarrod S. on 11-02-2008 08:48 PM
Jarrod S.
National Instruments
0 Kudos
Message 3 of 6
(3,810 Views)

Dear Jarod,

 

Thanks for your reply.

 

your second reading is what i need.

to register the event inside the inilitilize Vi and offcurse i need the event structure on the top level vi that is running.

but i still dont know if i do it as i should.

i register the event in the top level vi, and connect its event registration ref to Global Variable from the same type

then the 'Write member' vi of the class is using the generate event vi in order to pupulate the event to the top level vi that us running.

 

its look to me not clean programming

 

do you have a vi for example ?

 

thanks

 

Mor

 

 

 

0 Kudos
Message 4 of 6
(3,796 Views)
Solution
Accepted by topic author M0Reng
Here's an example. Register the event in the Initialize VI, and close it in the Shut Down VI. Example saved in LV85.
Jarrod S.
National Instruments
Message 5 of 6
(3,770 Views)

Dear Jarrod ,

 

This is EXCATLY what i look for.

 

Its clean, nice programming, i miss the reference to the user events and thats why its didnt work for me when i try to implement that.

 

bravo!

 

many Thanks

 

Regards

 

Moti

 

 

0 Kudos
Message 6 of 6
(3,741 Views)