General Information on Function Block Management
The variables are used with the rising edge of the Execute input. To modify any variable, it is necessary to change the input variables and to trigger the function block again.
The function blocks managed by an Enable input are executed when this input is true. The values of the function block inputs can be modified continuously, and the outputs are updated continuously. When the Enable input is false, the function block execution is terminated and its outputs are reseted.
According to IEC 61131-3, if any variable of a function block input is missing (= open), then the value from the previous invocation of this instance will be used. In the first invocation the initial value is applied.
Management of Output Variables
The Done, Error, Busy, and CommandAborted outputs are mutually exclusive; only one of them can be TRUE on one function block. When the Execute input is TRUE, one of these outputs is TRUE.
At the rising edge of the Execute input, the Busy output is set. It remains set during the execution of the function block and is reset at the rising edge of one of the other outputs (Done, Error).
The Done output is set when the execution of the function block is successfully completed.
If an error is detected, the function block terminates by setting the Error output, and the error code is contained within the ErrId output.
The Done, Error, ErrID, and CommandAborted outputs are set or reset with the falling edge of Execute input:
oreset if the function block execution is finished.
oset for at least one task cycle if the function block execution is not finished.
When an instance of a function block receives a new Execute before it is finished (as a series of commands on the same instance), the function block does not return any feedback, like Done, for the previous action.
All blocks have two outputs that can report error detection during the execution of the function block:
oError= The rising edge of this bit informs that an error was detected.
oErrID= The error code of the error detected.
When an Error occurs, the other output signals, such as Done are reset.