Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controllers STL Programming 3
3-4
Initial Steps
For an STL pro
g
ram which is to be activated
on the initial power up of the PLC, a tri
gg
er
similar to that shown opposite could be used,
i.e. usin
g
M8002 to drive the settin
g
of the
initial state.
The STL step started in this manner is often
referred to as the initial step. Similarl
y
, the
step activated first for an
y
STL sequence is
also called the initial step.
3.3.3 Terminating an STL Program
Once an STL pro
g
ram has been started the pro
g
rammable controllers CPU will process all fol-
lowin
g
instructions as bein
g
part of that STL pro
g
ram. This means that when a second pro-
g
ram scan is started the normal instructions at the be
g
innin
g
of the pro
g
ram are considered to
be within the STL pro
g
ram. This is obviousl
y
incorrect and the CPU will proceed to identif
y
a
pro
g
rammin
g
error and disable the pro
g
rammable controllers operation.
This scenario ma
y
seem a little stran
g
e but it does make sense when it is considered that the
STL pro
g
ram must return control to the ladder pro
g
ram after STL operation is complete. This
means the last step in an STL pro
g
ram needs to be identified in some wa
y
.
Returning to Standard Ladder
This is achieved b
y
placin
g
a RET or RETurn
instruction as the last instruction in the last
STL step of an STL pro
g
ram block.
This instruction then returns pro
g
rammin
g
con-
trol to the ladder sequence.
STL
S005
M8002
SET S005
X001
X000
X012
X013
Y000
Y011
Y014
STL
S005
M8002
SET S005
X001
X000
X012
X013
Y000
Y011
Y014
RET
Note: The RET instruction can be used to separate STL pro
g
rams into sections, with stan-
dard ladder between each STL pro
g
ram. For displa
y
of STL in SFC st
y
le format the RET
instruction is used to indicate the end of a complete STL pro
g
ram.