8 - 16 8 - 16
MELSEC-Q
8 MULTITASK PROCESSING
8.5.2 Message ports
It is possible to exchange messages, as if sending letters, between the programs, and
synchronize the executions by making (defining) a message transfer location
(message port) in memory in AD51H-BASIC.
To synchronize the executions via a message port, it is not necessary to consider the
interlocking of the wait status as required by the event control. The wait status is
created automatically.
A
B
Message port
Message port
Are there any
letters for me?
(1) To use message ports
In order to use message ports, the following should first be understood:
• In order to use a message port, it is necessary to open the message port in one
of the BASIC programs in advance. A message port can be opened in any
program. Moreover, the program that opened the message port does not have
to reside in memory.
• The maximum length of a message is 256 bytes.
• Up to a maximum of 32 message ports can be opened in the communication
module. To distinguish each message port, a number from 0 to 31 is assigned
to each message port.
• Each message port can store up to 16 messages asynchronously. Message
data in a message port can be retrieved in the order of transmission (FIFO
method) or in the order of the program priority (priority method). Whether a
message port uses the FIFO method or priority is predefined by the message
port number.
Priority method • • • Message port numbers from 0 to 15
IN
B
A
Low priority
High priority
Program 1
Program 2
2
A
1
B
FIFO method • • • Message port numbers from 16 to 31
B
A
Program 1
Program 2
1
A
2
B
M e s s a g e p o r t b u f f e r
OUT
(1)
(2)
(3)
(14)
(15)
(16)