8 - 8 8 - 8
MELSEC-Q
8 MULTITASK PROCESSING
8.3 To Use Devices (Resources) in Multitasking (Mutual Exclusive Control of Resources)
Resources refer to all of the hardware and software that can be used by the programs.
For example, they could be screens, printers, files, disks, optional boards, memory,
etc. When these devices are used in multiple programs being executed, some of them
can be grouped into one resource, or split into pieces to treat each of the pieces as a
single resource.
Example
EM200
EM299
• •
EM0
EM199
• • • • • • •
EM300
EM1023
• • • • • • • • • • •
Text screen
+
To split one resource into pieces and treat each of the pieces as a single resource
(Extension relays of the communication module EM0 through EM1023)
Keyboard
Mutual exclusive control of a resource means limiting access to that certain resource.
While one program is using a certain resource, other programs are prevented from
using the resource when multiple programs are executed simultaneously. This section
explains how to limit access to the specified resource to one program at a time while
multiple programs are being executed.
• Example of exclusive control of a printer
P
e
rm
ission
P
e
rm
ission
System program
ZRESERVE 1
BASIC
program (A)
BASIC
program (B)
ZRESERVE 1
Two programs request
to use the printer.
Please wait
The program that made the request
first gets to use the printer.
The program that made the request
later has to wait.
After the program that made the request
first finishes using the printer,
the program that made the request
later gets to use the printer.
Here you go
Thank you
BASIC
program (A)
System program
ZRESERVE 1
BASIC
program (B)
BASIC
program (B)
BASIC
program (A)
System program
ZRESERVE 1