11-01-2008 01:22 PM
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
Solved! Go to Solution.
11-02-2008 03:06 PM
any help?
11-02-2008 08:45 PM - edited 11-02-2008 08:48 PM
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.
11-03-2008 12:20 AM
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
11-03-2008 08:32 AM
11-04-2008 02:57 AM
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