8 - 17 8 - 17
MELSEC-Q
8 MULTITASK PROCESSING
• An error occurs if the total number of messages in all message ports exceeds
64. Fortunately, the total number decreases by one each time a message is
read.
65
STOP
A
D51H
Only 64 messages
can be stored.
• If there are no messages in the specified message port when a program is
trying to read a message from the message port, the operation will wait until a
message is sent to the message port.
• Make an agreement on the following in advance before using a message port.
1) The length of the message input to and output from the message port
(number of bytes)
2) The message port type (FIFO method, priority method)
• When multiple data is combined into one message, it is treated as one data
item on the reading side even if it is written as follows.
MELSECAD51H
Message port
ZMESSAGE PUT 1,A$,B$
Write
ZMESSAGE GET 1,C$
Read
MELSEC
A$
AD51H
B$
MELSECAD51H
C$
This is because message ports do not support delimiters within a message. The
user needs to manage delimiters within a message.
(2) How to use message ports
The following explains message port data, how to input or output messages, and
precautions on inputting/outputting messages.
1) Define a message port.
ZMESSAGE <message port number> LEN=<message length>
BASIC creates a message port in the main memory according to the definition of the message port.
2) Open the message port.
The definition of the message port using the ZMESSAGE instruction
should be performed in one of the programs executed by multitasking
The opening of the message port using the ZMESSAGE OPEN
should be performed in each of the programs executed by multitasking.
ZMESSAGE OPEN <message port number>
Содержание 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...