
B–61863E–1/06
2. TASK CONTROL FUNCTION
PMC CONTROL SOFTWARE
71
(4) Clearing flags
To clear the event flag image, use the system call, os_clar_flg.
To clear flag 1, for example, specify 0..0001 as the parameter of
os_clar_flg. (This parameter is referred to as a clear message.)
Operation
flag image =
~
clear message & flag image
Image
0..0000111
clear message
0..0000001
Not
AND
New image
0..0110
1..1111110
CAUTION
Clearing the event flag image has no effect on tasks already
placed in the wait state.
“Transition of awaited event flags and the event flag image by signals”
The following gives a sample transition of awaited event flags and the
event flag image by signaling in the pulse and continuous-state modes:
D Waits until all of flags 1 to 8 are signaled.
D Since flag 1 is already set in the event flag image, flag 1 is omitted
from the awaited event flags.
D Signals flags 2 and 3 in the continuous-state mode.
D Releases flags 2 and 3 from the awaited flags.
D Stores the signals of flags 2 and 3 in the event flag image.
D Signals flags 4 and 5 in the pulse mode.
D Releases flags 4 and 5 from the awaited flags.
D These signals are not stored in the event flag image.
D Clears flags 1 and 2 in the event flag image.
D The awaited flags are not affected.
D Signals flags 6 and 7 in the continuous-state mode.
D Releases flags 6 and 7 from the awaited flags.
D Stores the signals of flags 6 and 7 in the event flag image.
D Signals flag 8 in the pulse mode.
D Releases flag 8 from the awaited flags.
D This signal is not stored in the event flag image.
D Since the number of awaited flags becomes 0 (all of flags 1 to 8
have been signaled), the wait state is released.
System call
Parameter
(message)
Awaited
event flag
Event flag
image
os_wait_flg (AND wait)
os_sign_flg
os_puls_flg
os_clar_flg
os_sign_flg
os_puls_flg
11111111
0000010 →
00011000 →
00000011 →
01100000→
10000000→
11111110
↓
11111000
↓
11100000
↓
11100000
↓
10000000
↓
00000000
↓
00000001
↓
00000111
↓
00000111
↓
00000100
↓
01100100
↓
01100100
*1
*2
*3
*4
*5
*6
Releasing the wait state
*1
*2
*3
*4
*5
*6