Ladder - Using Counters
XG5000 has various counter function blocks. Below is a table giving a description of each counter function block.
Counter Function Block Name | Description |
---|---|
CTD_DINT | Down counter function block that decreases to min of DINT (-2,147,483,648) |
CTD_INT | Down counter function block that decreases to min of INT (-32,768) |
CTD_LINT | Down counter function block that decreases to min of LINT (-9,223,372,036,854,775,808) |
CTD_UDINT | Down counter function block that decreases to min of UDINT 0) |
CTD_UINT | Down counter function block that decreases to min of UINT (0) |
CTD_ULINT | Down counter function block that decreases to min of ULINT (0) |
CTR | Ring counter function block. |
CTU_DINT | Up counter function block that increases to max of DINT (2,147,483,647) |
CTU_INT | Up counter function block that increases to max of INT (32,767) |
CTU_LINT | Up counter function block that increases to max of LINT (9,223,372,036,854,775,807) |
CTU_UDINT | Up counter function block that increases to max of UDINT (4,294,967,295) |
CTU_UINT | Up counter function block that increases to max of UINT (65,535) |
CTU_ULINT | Up counter function block that increases to max of ULINT (2^64-1) |
CTUD_DINT | Up/Down counter function block that increases/decreases to range of DINT (-2,147,483,648 ~ 2,147,483,647) |
CTUD_INT | Up/Down counter function block that increases/decreases to range of INT (-32,768 ~ 32,767) |
CTUD_LINT | Up/Down counter function block that increases/decreases to range of LINT (-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807) |
CTUD_UDINT | Up/Down counter function block that increases/decreases to range of UDINT (0 ~ 4,294,967,295) |
CTUD_UINT | Up/Down counter function block that increases/decreases to range of UINT (0 ~ 65,535) |
CTUD_ULINT | Up/Down counter function block that increases/decreases to range of ULINT (0 ~ 2^64-1) |
Help Files for Counter function blocks can be found easily from the Function/Function Block insert screen.
Step | Action |
---|---|
1 | Insert a function/function block from the Scan Program. |
2 | Choose Counter category. |
3 | Select the Counter function block to view help on. |
4 |
Press Help button.
|
5 |
Review the Counter Function Block Help file.
|
XG5000 treats counters as a function block. A counter function block requires an instance variable to be used.
The outputs of a counter can be used without creating separate variables. This is done by ‘counter_instance_name.output_name’.
For example: Counter1.Q
LP303