General Information on Administrative Function Block Management

Overview

The high speed counter (HSC) library of the TM3 expert modules includes the GetParam_TM3 and SetParam_TM3 administrative function blocks.

The following provides general information on managing common input and output variables.

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 function blocks, it is best to use the instance only once, and preferably use the instance in the main task.

Management of Output Variables

The Done output is mutually exclusive with the Busy 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 or Error).

The Done output is set when the function block execution has been completed successfully.

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 ErrorID output.

The Done, Error, and ErrorID outputs are reset with the falling edge of Execute. If the Execute input is reset before 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 HSC function blocks have 2 outputs that can report a detected error during the execution of the function block:

  • Error = TRUE when an error is detected.

  • ErrorID When Error = TRUE, returns an HSC_ERROR_TM3 detected error ID.