Duration of the Happened State

You can use an event to flag either a momentary condition or an elapsed condition. A momentary condition is one that is relevant only to the particular process or processes that are already waiting for the condition. An elapsed condition is one that continues to be relevant to other processes in the future.

You can flag a momentary condition by using statements that cause the event and then immediately reset it. An event is immediately reset after being caused if either of the following conditions is true:

  • The event was caused by a cause and reset statement.

  • At least one of the processes waiting on the event used a wait and reset statement.

The program will be easier to understand and maintain if these methods of resetting the event are not mixed. If you use a wait and reset statement, you should use a simple cause statement. If you use a simple wait statement, you should use a cause and reset statement.

You can flag an elapsed condition by using simple cause and wait statements. After the event is caused, it remains in the HAPPENED state. When the elapsed condition ends, a reset statement returns the event to the NOT HAPPENED state.

Note that the use of separate reset statements automatically implies an elapsed condition. Even if the reset statement is the first action executed after a cause or wait statement, a significant interval of time can elapse before the reset statement is executed. Only through the use of wait and reset or cause and reset statements can you flag a truly momentary condition.