8 - 10 8 - 10
MELSEC-Q
8 MULTITASK PROCESSING
(2) Assigning resource numbers to resources
The following explains how to assign resource numbers specified in the
ZRESERVE and ZRELEASE instruction to resources, such as screen or printer,
in order to limit the access to resources.
Assignment of resource numbers to resources is an agreement made between
the programmers before writing programs; there are no instructions for assigning
resources.
For example, make arrangement as follows:
• Before reading and writing data ED0 through ED2, assign 1 as the resource
number for ED0 through ED2, then execute the ZRESERVE instruction.
E D 0
E D 1
E D 2
1
Programmer A
1
Programmer B
• Before reading/writing data to/from the "ABC.NEW" file in drive 0, assign 2 as
the file's resource number, then execute the ZRESERVE instruction.
Programmer A
2
2
Programmer B
MITSUBISHI
MEMORY CARD
A6MEM-512KA-W
"ABC.NEW" file
An example of the steps for assigning resource numbers to resources is shown
below:
(a) List all the resources that will be used in the programs to be executed
simultaneously.
(b) From the resources listed in (a), identify which resources might be used
simultaneously by multiple programs.
(c) From the resources identified in (b), select which resources will have
problems if used simultaneously.
(d) For the resources selected in (c), clarify the breakdown of the resources to
which the resource numbers are assigned, by combining multiple resources
to one resource or by splitting one resource to multiple resources and
treating each of them as one resource.
(e) Assign one of the resource numbers 0 through 63 to each of the resources
clarified in (d). (By arrangement)