10-27-2003 02:36 PM
10-27-2003
03:03 PM
- last edited on
07-12-2025
10:13 PM
by
Content Cleaner
This is an excellent question, and it's not really a trivial update of your code. You're moving from an older method to something much more efficient, but still quite different.
The "Init" case you used before was not necessarily an event. Therefore, to move into the Event Strcuture paradigm, you will need to rethink your application. The Event Structure, introduced in 6.1 and improved in 7.0, reacts to actual "events" as they occur. That's why you're running into the "non-button" related events issue. For this, you will need to apply User-Defined Events in LV 7. These are events which are not tied to the User Interface.
To learn more about these, I'd start with this Web Event on Demand: Using the Event Structure for More Than Just the User Interface. It describes User-Defined Events and other new types of event programming in LV 7. After watching that (it's about 35 minutes) you should look at the example programs for User-Defined events in LV 7 and read the Upgrade Notes. They do a good job of explaining how to use it. They're certainly an advanced tool and very powerful. Hope this helps out.
10-29-2003
01:36 PM
- last edited on
07-12-2025
10:15 PM
by
Content Cleaner
That info was very helpful. Thanks.
A question on my solution. In it I create a user event called Init
(no pun intended). My event structure is inside a while loop with the
timeout event added. On the first timeout (200 ms), I check the value
of i in the loop and if i == zero, generate my Init event.
My question comes here: Inside my Init event handler I make the calls
to unregister and destroy it, assuming this is good housekeeping as I
don't want to run Init for the remainder of this vi's duration. Is it
safe to unregister and destroy an event within it's own code?
It almost seems a cleaner way to accomplish my goal is with the
dreaded sequence structure. Sequence zero: do my initializing,
Sequence 1: go into event processing loop. Any comments?
JRA wrote in message news:<5065000000050000004A320100-1066448259000@exchange.ni.com>...
> This is an excellent question, and it's not really a trivial update of
> your code. You're moving from an older method to something much more
> efficient, but still quite different.
>
> The "Init" case you used before was not necessarily an event.
> Therefore, to move into the Event Strcuture paradigm, you will need to
> rethink your application. The Event Structure, introduced in 6.1 and
> improved in 7.0, reacts to actual "events" as they occur. That's why
> you're running into the "non-button" related events issue. For this,
> you will need to apply User-Defined Events in LV 7. These are events
> which are not tied to the User Interface.> href="http://digital.ni.com/demo.nsf/websearch/A3F870055350CC3286256D9100637EDE?OpenDocument&node=64300_US">Web
> Event on Demand: Using the Event Structure for More Than Just the User
> Interface
> To learn more about these, I'd start with this
. It describes User-Defined Events and other new types
> of event programming in LV 7. After watching that (it's about 35
> minutes) you should look at the example programs for User-Defined
> events in LV 7 and read the Upgrade Notes. They do a good job of
> explaining how to use it. They're certainly an advanced tool and very
> powerful. Hope this helps out.