11 - 461 11 - 461
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Available only in execution mode
ZRESERVE
Instruction
Z RESERVE
• Prohibits other programs from using a resource to which a resource number is assigned.
ZRESERVE <resource number>[,<timeout value>]
Syntax
resource number
• • • •
Specify the number (0 to 31) allocated among the
programmers and assigned to a resource used in a
program.
timeout value
• • • •
Specify the maximum time that is allowed to wait
before prohibiting other programs to use a resource,
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
ZRESERVE 1, "0:0:5:0"
• • • •
Prohibit other programs from using the resource to
which resource number 1 is assigned. A timeout
error is generated if it cannot be prohibited within 5
seconds.
Description
• The ZRESERVE instruction prohibits other programs from using a resource to which a
resource number allocated among the programmers is assigned when the resource is
shared by multiple programs executed at once. A program that executes the ZRESERVE
instruction can obtain the exclusive use of the resource.
• In order to terminate the exclusive use, specify the same resource number as in the
ZRESERVE instruction that prohibited the use, and execute the ZRELEASE instruction.
• The ZRESERVE and ZRELEASE instructions are used as a pair so that other programs
cannot use the resource for a specified time or while the processing involving the resource
is performed.
• The programmers should reach an arrangement in advance for the resources to which
resource numbers are to be assigned. Then they should create programs in such a way
that the ZRESERVE instruction is executed immediately before using the resources and
the ZRELEASE instruction is executed immediately after using it.
• Specify the number assigned to the resource whose use should be prohibited for other
programs in <resource number>.
• If another program has executed the ZRESERVE instruction specifying the same resource
number before a program executes the ZRESERVE instruction, it must wait before
prohibiting the use of the resource from other programs. Specify the maximum time that
the program waits in this case in <timeout value>. The specification should be made in the
following format. (The program execution is stopped while waiting.)
"HH:MM:SS:R"
HH
• • • •
Hours ("0" to "23")
MM
• • • •
Minutes ("0" to "59")
SS
• • • •
Seconds ("0" to "59")
R
• • • •
ms (express 0 to 900 ms
using numbers from "0" to "9")
Содержание 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...