11 - 440 11 - 440
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Available only in execution mode
ZMESSAGE GET
Instruction
ZMESSAGE GET
• Reads messages from message ports.
ZMESSAGE GET <message port number>, <variable name> • • • [TIMEOUT <timeout
value>]
Syntax
<message port number>
• • • •
Specify the number of the message port from which
the message is to be read.
<variable name>
• • • •
Specify the variable to which the message read is to
be assigned.
<timeout value>
• • • •
Specify the maximum time to wait for a message to
be written in the format "HH:MM:SS:R."
HH: Hours
MM: Minutes
SS: Seconds
R: 100 ms
(0 to 23)
(0 to 59)
(0 to 59)
(express 0 to 900 ms using the
numbers from 0 to 9)
Examples
ZMESSAGE GET 1, AS
• • • •
Reads character data from the message port with
message port number 1 and assigns it to AS.
ZMESSAGE GET 16, A%
TIMEOUT "0:1:0:0"
• • • •
Reads numeric data from the message port with
message port number 16 and assigns it to A%. If the
message is not written in one minute, a timeout error
occurs.
Description
• The ZMESSAGE GET instruction is used to read messages written in a message port. If
no messages have been written in the message port, the program execution is halted and
the program waits for a message to be written.
• Specify the number of the message port from which the message is to be read in
<message port number>.
• Specify the variable to which messages read from message ports are to be assigned in
<variable name>.
The type of the messages in the message ports and the type of the variable specified in
<variable name> must match.
• Store dummy data for a greater number of bytes than the message length in the variable specified
in <variable name>, before executing the ZMESSAGE GET instruction as shown below.
If such dummy data has not been stored in advance, an error occurs when the ZMESSAGE GET
instruction is executed.
Numeric variable %=0, !=0, #=0
Character variable S=SPACE$(255)
• Always define an array variable specified as <variable name> using the DIM instruction,
even if the number of elements used is less than 10. If it is not defined using the DIM instruction,
an error occurs at the execution of the ZMESSAGE GET instruction
(usually, an array with 10 or fewer elements can be used without defining it using the DIM 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...