3
SEQUENCE PROGRAM CONFIGURATION AND
EXECUTION CONDITIONS
3.1 Sequence Program
3.1.2 Subroutine programs
3
- 9
1
O
verv
iew
2
Per
fo
rma
nce
S
p
ecifica
tio
n
3
S
equ
en
ce P
ro
g
ra
m
Co
nfig
ura
tio
n a
nd
E
xecut
io
n Co
nd
iti
o
ns
4
I/O N
unb
er
Assig
n
m
e
nt
5
Me
mor
ie
s a
nd
File
s
Ha
nd
led
by CP
U Mo
du
le
6
Func
tions
7
Co
mmu
nic
a
tion
us
in
g
bu
ilt
-i
n E
th
e
rne
t po
rt
s o
f
CP
U mod
u
le
8
Co
mm
un
icatio
n
w
ith
Int
e
lli
ge
nt
Fun
ction
Mo
du
le
3.1.2 Subroutine programs
(1) Definition of subroutine program
A subroutine program is a program section from a pointer (P ) to the REET
instruction.
The subroutine program is executed only when it is called by a subroutine program
call instruction (e.g. CALL(P), FCALL(P)) from the main routine program.
(2) Subroutine program applications
Using a subroutine program as described below reduces the number of program
steps.
• Changing a section, which is executed several times during one scan, to a
subroutine program reduces the number of steps in the whole program.
• Changing a section, which is executed only when a certain condition is satisfied,
to a subroutine program reduces the number of steps in a normally executed
program.