General Information on Administrative and Motion Function Block Management

Management of Input Variables

At the Execute input rising edge, the function block starts.

Any further modifications of the input variables are not taken into account.

Following the IEC 61131-3 standards, if any variable input to a function block is missing, that is, left open or unconnected, then the value from the previous invocation of the instance of the function block will be used. In the first invocation, the initial, configured value is applied in this case. Therefore, it is best that a function block always has known values attributed to its inputs to help avoid difficulties in debugging your program. For HSC and PTO function blocks, it is best to use the instance only once, and preferably the instance be in the main task.

Management of Output Variables

The Done, InVelocity, or InFrequency output is mutually exclusive with Busy, CommandAborted, and Error outputs: only one of them can be TRUE on one function block. If the Execute input is TRUE, one of these outputs is TRUE.

At the rising edge of the Execute input, the Busy output is set. This Busy output remains set during the function block execution, and is reset at the rising edge of one of the other outputs (Done, InVelocity, InFrequency, CommandAborted, and Error).

The Done, InVelocity, or InFrequency output is set when the function block execution has been completed successfully.

When a function block execution is interrupted by another one, the CommandAborted output is set instead.

When a function block execution ends due to a detected error, the Error output is set and the detected error number is given through the ErrId output.

The Done, InVelocity, InFrequency, Error, ErrID, and CommandAborted outputs are reset with the falling edge of Execute. If Execute input is reset before the execution is finished, then the outputs are set for one task cycle at the execution ending.

When an instance of a function block receives a new Execute before it is finished, the function block does not return any feedback, such as Done, for the previous action.

Handling a Detected Error

All blocks have 2 outputs that can report a detected error during the execution of the function block:

oError = TRUE when an error is detected.

oErrID When Error = TRUE, returns the detected error ID.