General
The code section(s) define(s) the process the DFB is to carry out, as a function of the declared parameters.
A DFB may contain several code sections; the number of sections being unlimited.
Programming Languages
To program DFB sections, you can use the following languages:
Instruction List (IL)
Structured Text (ST)
Ladder language (LD)
Functional Block Diagram (FBD)
Defining a Section
A section is defined by:
a symbolic name that identifies the section (maximum of 32 characters)
a validation condition that defines the execution of the section
a comment (maximum of 256 characters)
a protection attribute (no protection, write-protected section, read/write-protected section)
Programming Rules
When executed, a DFB section can only use the parameters you have defined for the function block (input, output and input/output parameters and internal variables).
Consequently, a DFB function block cannot use either the global variables of the application, or the input/output objects, except the system words and bits (%Si, %SWi and %SDi).
A DFB section has maximum access rights (read and write) for its parameters.
Example of Code
The following program provides an example of Structured Text code
