11 - 54 11 - 54
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
DEF ZEVENT
Instruction
DEFine Z EVENT
• Defines an event for synchronizing execution between the programs.
• Defines an event by the expansion relay (EM) of the communication module.
DEF ZEVENT (event number)
DEF ZEVENT (event number), <device>
event number
• • • •
Specify a number that represents the event defined
by this instruction.
Syntax
device
• • • •
Specify a communication module’s expansion relay
(EM) that generates an event by turning ON.
DEF ZEVENT 1
• • • •
Defines an event as event number 1 that is
generated by the ZSIGNAL instruction in order to
synchronize between the programs.
Examples
DEF ZEVENT 3, “EM0001”
• • • •
Defines an event, which is generated when the
communication module’s expansion relay EM0001 is
turned ON, as event number 3.
Description
• Defines various events that are used for multitask operations.
• An event is a signal for controlling another BASIC program from a BASIC program.
Definition of an event generated by the ZSIGNAL instruction
• Defines an event for synchronizing execution with another BASIC program. In this case,
specify only <event number> and do not specify <device>.
Program A
ZSIGNAL 1
Program B
ZWAIT EVENT 1
Event occurs
(Resume execution)
DEF ZEVENT 1
ZEVENT ENABLE 1
2)
2)
1)
1)
1) and 2) indicate the range
of execution during the same
period of time when two
programs are running
concurrently.
• Events generated by the ZSIGNAL instruction are generated only by the ZSIGNAL
instruction. After defined by the DEF ZEVENT instruction, this event is used for resuming
execution of a BASIC program that is waiting for the event, after enabling this event by the
ZEVENT instruction and executing the ZSIGNAL instruction.
Содержание 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...