8 - 7 8 - 7
MELSEC-Q
8 MULTITASK PROCESSING
(2) Execution order of the instructions when the event control is
performed
The following shows the execution order of the instructions when the execution of
the BASIC program is being controlled by the events (execution start, execution
resume). Execute in the order starting from (1).
(a) When synchronizing the execution between BASIC programs
B
B
B
A
A
1) DEF ZEVENT to Defines the event
2) ZEVENT ENABLE to Enables the event to occur
3) ZWAIT EVENT Waiting for the event to occur.
4) ZSIGNAL The event occurs.
Synchronization
BASIC
program (A)
BASIC
program (B)
As shown above, execute steps 1) and 2) in one program and then
generate the event while one of the programs is waiting for the event to
occur. If 4) is executed before 3), the execution cannot be synchronized.
To prevent the generated event from becoming invalid, apply interlock
between programs whose executions are to be synchronized by using an
extension relay of the communication module, etc.
B
B
A
Synchronization
BASIC
program (A)
BASIC
program (B)
B
A
A
Check whether program B will
be waiting for the event or not.
B%=B @(EM,...)
Extension relay of the
communication module
Notifies that it will be waiting
for the event.
B@(EM,...)=1
OK !
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...