
2. TASK CONTROL FUNCTION
B–61863E–1/06
PMC CONTROL SOFTWARE
72
“Example of intertask synchronous control using event flags”
The following gives a sample application in which the activation of a
communication task and nonvolatile-memory write task is controlled
using event flags.
Task activation conditions
D The supervisory control task is activated every 16 ms. (Use of the timer
function)
D The screen display task is activated using the CUSTOM function key.
D On the user screen, the communication control task is activated by
pressing the I/O soft key. (Use of an event flag)
D A write to nonvolatile memory is performed during communication
control or in the background when the user screen is displayed. (Use
of an event flag)
Event flag
Supervisory
control
Communication
control
screeen disp;ay
write to nonvolatile
memory
Use of flags
D Before starting screen display, signal flag 1.
D Clear flag 1 by pressing the FUNCTION key.
D Signal flag 2 by pressing the I/O soft key.
D The communication control task waits for an event with flag 2.
D After communication control terminates, clear flag 2.
D The nonvolatile-memory write task enters the OR-wait state with flags
1 and 2.
Screen display flag
Communication
control flag
Event flags
Operation Communcation
control
Screen display Nonvolatile–memory
write
Image
“CUSTOM”
Wait#1 PCMDI Wait Wait#0 or #1 00
Signal#0 01
11
10
00
Signal#1
Clear#0
PCMDI Wait
“I/O”
“SYSTEM”
Clear#1
Wait#0 or #1
Wait#1