8 - 18 8 - 18
MELSEC-Q
8 MULTITASK PROCESSING
3) To write a message to the message port:
ZMESSAGE PUT <message port number>, <transmission data>, • • •
3)' To read a message from the message port:
ZMESSAGE GET <message port number>, <variable where the data read is stored>, • • •
• • • <timeout>
See 2) in (3) for the specification of <timeout>.
4) Close the message port to finish inputting/outputting the message.
ZMESSAGE CLOSE <message port number>
The closed message port can be opened again by the ZMESSAGE OPEN instruction.
5) Delete the message port when finishing using the message port.
ZMESSAGE KILL, <message port number>
Once the message port is deleted, the message port in the main memory is also deleted.
Therefore, it is necessary to define the message port in order to use the message
port specified by <message port number> again.
The deletion of a message port using the ZMESSAGE KILL
instruction should be performed in one of the programs
executed by multitasking.
(3) Execution order of instructions when using a message port
The following shows the execution order of instructions when programs are
exchanging messages and synchronizing their executions through message
ports:
1) The following occurs when program B reads a message after program A
writes the message.
A
A
B
A
B
B
Program B
Program A
1) ZMESSAGE to
ZMESSAGE OPEN to
Prepare and open the
message port.
2) ZMESSAGE PUT to
Write the message.
3) ZMESSAGE GET
Read the message.
ZMESSAGE OPEN to
Open the message
port.
Содержание 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...