Always Executed Code
PLCnext Engineer allows to add one PreExecute and one PostExecute worksheet to each SFC function block. The PreExecute worksheet is always processed before executing the FB, the PostExecute is always executed afterwards.
For that purpose, the appropriate context menu items are available on the SFC folder in the COMPONENTS area. After adding such a worksheet, it is available in the 'AlwaysExecutes' subfolder under the SFC FB folder.
The code can be programmed in ST, FBD/LD and NOLD.
In the code, local variables can be declared and access is possible to the input variables, output and InOut variables of the SFC function block as well as to its methods.
Note
The PreExecute and PostExecute worksheets are also executed when the SFC function block is in SFC_OPERATING_MODE_HALT mode. |