3 - 66 3 - 66
MELSEC-Q
3 SPECIFICATIONS
3.13.2 Sharing equipment (Resources) by multitasking
If use of resources is shared by BASIC programs, the same resources cannot be used
by multiple BASIC programs at the same time.
Exclusive control of resources is a way of making it impossible for another BASIC
program to use resources while one BASIC program is using them.
This exclusive control of resources must in the end be decided and implemented by
fellow programmers.
If this problem is not decided by the fellow program creators and therefore not provided
for, exclusive control of resources cannot be implemented.
Exclusive control of resources is accomplished by the following commands.
• ZRESERVE : Requests exclusive control of a resource.
• ZRELEASE : Ends exclusive control of a resource.
ZRESERVE
(Requests mutual
exclusive control of
the resource)
Used by
Task 1
Resource
Resume
Stop for using
resources
Pro
ram execution status Pro
ram execution statusResources usa
e status
Task2
ZRELEASE
(Finishes mutual
exclusive control
of the resource)
ZRESERVE
(Requests mutual
exclusive control of
the resource)
ZRELEASE
(Finishes mutual
exclusive control
of the resource)
Program Program
Executing
Executing
Task1
Executing
Stop
Not used
Not used
Used by
Task 2
REMARK
Resources are said to be all the hardware and software that can be used by a
BASIC program. For example, the screen, printer, files, disks or memory, etc.