uCon HomePage
Script Command: EVENT
EVENT {1-8} {operation} [msec timeout]
This command is a wrapper to provide script-level access to
the
Event API in Windows. It provides the script with the ability
to
synchronize between multiple uCon sessions.
Operations:
set | reset | pulse | wait
[timeout]
Example:
Assume two uCon sessions, one waiting for an event from
the other...
Session 1 (waiting on the event):
...
EVENT
1 wait
...
Session 2 (signals the event):
...
EVENT
1 set
...
Notes:
- Up to 8 events (each named uConGlobalEvent_%d internally) can be managed.
- The commands uses
CreateEvent(NULL,TRUE,FALSE,name); thus requiring that the
event be manually reset.
-
Once the event it set by session 2, session 1 will continue execution
of its script.
-
If session 1 waits again, it will immediately return unless the event
was previously reset.
-
The 'pulse' operation can be used to avoid the need to do the manual
reset.
- The
'wait' operation will wait forever if a timeout is not specified;
otherwise the timeout is in milliseconds and the SCR_TIMEOUT shell
variable will be set to TRUE (timeout occurred) or FALSE (timeout did
not occur) depending on the result.
Test script:
Here's a script you can run on two different uCon sessions to get a feel for this...
DIALOG DDLIST EVENT: set reset pulse wait waitt
IF $DIALOG seq set goto EVENT_SET
IF $DIALOG seq reset goto EVENT_RESET
IF $DIALOG seq pulse goto EVENT_PULSE
IF $DIALOG seq wait goto EVENT_WAIT
IF $DIALOG seq waitt goto EVENT_WAITT
ECHO ERROR
EXIT
# EVENT_SET:
EVENT 1 set
EXIT
# EVENT_RESET:
EVENT 1 reset
EXIT
# EVENT_PULSE:
EVENT 1 pulse
EXIT
# EVENT_WAIT
EVENT 1 wait
ECHO WAIT DONE!
EXIT
# EVENT_WAITT
EVENT 1 wait 10000
ECHO SCR_TIMEOUT: $SCR_TIMEOUT
EXIT