9/13/2005
Programming the SMLC
75
CoDeSys - The HomeThenOffset function block
•
The HomeThenOffset function block is written as an
SFC. You can ‘Zoom’ into the function block by
pressing Alt-Enter (or from the Extras|Zoom menu).
•
Writing a function block as an SFC allows you to
easily control a sequential operation. There is usually
only one or two rungs of logic in each step and
operation is easy to debug and modify.
•
Each step can be written in the language that makes
the most sense for that particular operation.
•
We find it useful to structure a sequential operation
function block like a PLCopen function block with an
Execute input and Done and Error outputs.
•
Add whatever other inputs (and outputs) are required
for the operation.
•
The function block remains in the Init step until the
Execute input is true. When the operation is
complete the outputs are set and the function block
remains in the SetOutputs step until the Execute
input goes away.