Mitsubishi QD51 Programming Manual page 156

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

8 MULTITASK PROCESSING
ZRESERVE:
Requests mutual exclusive control of the resource.
ZRELEASE:
Finishes mutual exclusive control of the resource.
ZRESERVE n
BASIC
program (A)
Request
Use
Device to which
access is limited
(Resource number n)
BASIC
program (B)
8 - 11
(3) Execution order of instructions when limiting access to the
resources
The following describes the execution order of instructions when limiting access
to the resources in the BASIC program.
In use
The privilege to use
the resource is
transferred to program A.
Request
ZRESERVE n
Program B requested to use
the resource but is put into
the wait status because
program A is using the resource.
As shown above, use the resource after executing the ZRESERVE instruction in order
to use the resource assigned to resource number n. Execute the ZRELEASE
instruction in order to finish using the resource.
Care must be taken when each of the programs executed simultaneously uses multiple
resources. If the order of the resource numbers specified by each ZRESERVE
instruction is not handled as arranged, both programs may keep each other from being
able to continue. (Deadlock prevention)
An example of a deadlock is shown next.
Finish
ZRELEASE n
The use of the resource
is finished and
the resource is released.
The privilege to use the resource
is transferred to program B, which
Use
was kept waiting in the meantime.
In use
MELSEC-Q
Finish
ZRELEASE n
8 - 11

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents