Справочник Пользователя для Mitsubishi Electronics QnUCPU

Скачать
Страница из 630
CHAPTER9 DEVICES
9
2
3
4
5
6
7
8
9.
 I
n
te
rnal S
yst
em 
Devices
9.
3.
1  
F
unct
ion
 devic
e
s (
F
X
, F
Y
, F
D
)
9
 
-
 
35
9.3  Internal System Devices
Internal system devices are provided for system operations. 
The allocations and sizes of internal system devices are fixed, and cannot be changed by the user.
9.3.1  Function devices (FX, FY, FD)
(1) Definition
Function devices are used in subroutine programs with argument passing.
Data are read or written between such subroutine programs and calling programs, using function devices.
 When FX0, FY1, and FD2 are used in a subroutine program, and if X0, M0, and D0 are specified with 
a subroutine program call instruction, on/off data of X0 and FY1 are passed to FX0 and M0 respectively, and 
D0 data are passed to FD2.
(2) Applications of function devices
Because a device in each calling program can be determined by using a function device for subroutine programs, 
the same subroutine program can be used without considering other calling programs.
(3) Types of function devices
The following three types of function devices are available.
 • Function input (FX)
 • Function output (FY)
 • Function register (FD)
(a) Function input (FX)
 • The function input is used to pass on/off data to a subroutine program.
 • Bit data specified by a subroutine call instruction with argument passing are fetched into a subroutine 
program and they are used for operations.
 • All bit devices for the CPU module can be used.
Figure 9.44 Application example of function devices
Example
[Calling program]
[Subroutine program]
X0
X0
CALL P0
M0 D0
P0
FX0
MOV FD2
SET
R0
RET
FY1