21  DEVICES
21.19  Local Device
367
21
When local device is used in subroutine program
Local devices to be used vary depending on whether SM776 (Local device setting at CALL) is turned on or off. Local index 
register to be used is also determined according to the SM776 setting.
 • In terms of on/off setting for SM776, the value (on or off) used when the subroutine call occurs is considered 
to be effective. Therefore when on/off setting for SM776 is switched in the subroutine program, the modified 
value (on or off) is not effective until the next subroutine call occurs.
 • On/off setting for SM776 cannot be specified for each program file because it is enabled for each CPU 
module.
When local device is used in interrupt and other programs
When using a local device for an interrupt program / a fixed scan execution type program / an event execution type program 
triggered by occurrence of an interrupt, turn on SM777 (Local device setting in interrupt programs). The programs will not 
function properly if SM777 is turned off.
For the SIL2 Process CPU and Safety CPU, however, the on/off setting of SM777 does not affect those programs. ( Page 
680 SM777 setting,  Page 558 SM777 setting)
Operation if SM777 turned on in following setting
For local index register, the register of the program file which has been executed before these programs is used regardless of 
the SM777 setting.
SM776 Local device to be used
Off Uses local devices of the program file from which subroutine program is called.
On Uses local devices of the program file into which the subroutine program is stored.
Program name Execution type Local device use/not use
AScanNot Use
BScanUse
CScanUse
X Fixed scan Use
(1) Uses the program X local device.
A
END
C
A
BB
C
END
X
XX
(1) (1) (1)
Execution program
Local device
For X
For B
For C
For X
For C
For X
For B For B
For C