07-24-2008 06:21 PM
07-24-2008 07:02 PM
Have a look at the attached code. Try running it with Highlight Execution turned ON to understand how it works.
Ask any questions in this thread.
R
07-25-2008 01:59 AM
07-25-2008 02:25 AM - edited 07-25-2008 02:26 AM
Your problem is that you are trapped inside an event case. It is not a good idea to run extended code inside event cases, else the event structure cannot service other events.
Why don't you use the outer loop for everything? Now things don't step on each others toes. 😉 What good is an event structure if it cannot react at all times???
07-25-2008 08:32 AM
That's an ingeneous way to use the Timeout, Altenbach.. Simple yet very effective.
It selects -1 as a timeout if you stop calculations, therefore the loop waits until another event before it resumes. Nicely done. You could make a nugget of this example.
The other suggestion I was about to make was to consider an state machine instead, but I think this thread is about learning more on Event Structures..
R
07-25-2008 08:41 AM