CTUR (Resettable Count-Up Counter)
Increments .CV on each rising edge of .CU, sets .Q to TRUE when .CV >= .PV, and resets .CV to 0 when the dedicated R operand is TRUE.
Description
CTUR is a count-up counter with an explicit R (Reset) operand chip displayed directly on the action node in the Sequence Editor:
- Rising edge on
.CU:.CVincrements by1. .CV >= .PV: Output.QbecomesTRUE..R(Reset) isTRUE:.CVresets to0and.QbecomesFALSE.
Syntax
Sequence Visual Editor
- Select an action on a step and open the Instruction picker (Alt or right-click -> Edit Qualifier & Instruction).
- Select Counters -> CTUR and choose the P (Pulse) qualifier.
- Enter the target count in
PV(for example50) and assign a boolean reset variable in theRoperand chip.
Python
from automation_machine import ActionQualifier, ActionInstruction
step.add_action("batch_counter", "Count batch parts", qualifier=ActionQualifier.P, instruction=ActionInstruction.CTUR, preset_value=50, reset="batch_reset")
Parameters
- name: Counter instance name
- description: Action description
- qualifier:
ActionQualifier.Pto count once per step activation - instruction:
ActionInstruction.CTUR - preset_value: Target count (
PV, for example50) - reset (
R): Boolean variable or expression that resets.CVto0
Counter Variables
| Variable | Type | Description |
|---|---|---|
.CU |
BOOL |
Count-up input: rising edge increments .CV |
.R |
BOOL |
Reset input: resets .CV to 0 and .Q to FALSE |
.Q |
BOOL |
Output signal: TRUE when .CV >= .PV |
.PV |
INT |
Preset target count |
.CV |
INT |
Current accumulated count |