
2. TASK CONTROL FUNCTION
B–61863E–1/06
PMC CONTROL SOFTWARE
68
Event flags are used for synchronization between tasks. In applications,
up to 32 event flags related to certain processing (for example, notifying
other tasks when a task detects an emergency stop signal) are grouped.
This group is referred to as an event group.
A task can be kept in the wait state until an event group equals specific
data.
MSB
31
LSB
0
Flag 1
Flag 32
Event group
All tasks waiting for an event flag are released from the wait state by one
signal.
Event flag
Task A Task B Task C Task D
Signal
Waiting for an event
For event flag control, the following system calls are used:
Function name Description
os_make_flg Creates event flags.
os_delt_flg Deletes event flags.
os_sign_flg Signals event flags (continuous-state mode)
os_wait_flg Waits for event flag signaling
os_clar_flg Clears event flags
os_puls_flg Signals event flags (pulse mode)
CAUTION
Event flags signaled in the continuous-state mode are
stored in the event flag image of the PMC control software.
The stored flags are maintained until they are cleared by the
system call, os_clar_flg.
(1) Creating event flags
Use the system call, os_make_flg, to create event flags. Immediately
after creation, all the flags are in the cleared state.
2.6.4
Intertask
Synchronization
(Event Flags)