-

CTU / CTU_S

Type Function block

Available as standard (non-safety-related) and safety-related type (*_S). For the safety-related type, the safety-related data types (SAFE*) are expected at the formal parameters.
Description Counts up. In case of a rising edge at CU and RESET = FALSE, CV is increased by one. When the preset value PV for the counter is reached, Q is set to TRUE and the function block stops counting.

If RESET = TRUE, the counter is initialized with 0. To enable the counting process, the RESET input must be FALSE. Otherwise the counter will always be re-initialized.
Notes
  • The inputs CU, RESET and the output Q can be negated.

    Note: The negation of formal parameters is not supported in safety-related code (SNOLD).

  • Function blocks have to be instantiated. The instance name of the function block has to be declared in the 'Variables' table of the POU where the FB is going to be used. The instance name must be unique within the POU.
Parameters Inputs

CU

RESET

PV

Outputs

Q

CV