11 - 436 11 - 436
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Available only in execution mode
ZMESSAGE
Instruction
Z MESSAGE
• Defines a message port.
ZMESSAGE <message port number> LEN=<message length>
Syntax
<message port number>
• • • •
Specify the number of the message port to be
defined.
<message length>
• • • •
Specify the length of the message used in the
message port in byte units (1 to 256).
Examples
ZMESSAGE 1 LEN=128
• • • •
Defines the message port of message port number 1
with the message length of 128 bytes.
Description
• The ZMESSAGE instruction is used to define message ports in the main memory.
Message ports are used to perform communication between programs that operate in
multitask operations.
• It is possible to define up to 32 message ports. <message port number> is used to specify
which of the message ports to be defined.
<message port number> is determined by the types of message port as follows. Select the
type according to the purpose used.
FIFO method • • • Message port numbers 16 to 31
The messages are stored in the message port buffer in the order they are sent to the
message ports.
B
A
Program 1
Program 2
1
A
2
B
Message port buffer
OUT
(1)
(2)
(3)
(14)
(15)
(16)
Priority method • • • Message port numbers 0 to 15
This method retrieves the message sent by the program with the highest priority first,
regardless of the order of data transmission to the message ports.
IN
B
A
Low priority
High priority
Program 1
Program 2
2
A
1
B