AutomationView Documentation

CTDR (Resettable Count-Down Counter)

Decrements .CV on each rising edge of .CD, sets .Q to TRUE when .CV <= 0, and reloads .CV with .PV when the dedicated LD (Load) operand is TRUE.


Description

CTDR is a count-down counter with an explicit LD (Load) operand chip displayed directly on the action node in the Sequence Editor:


Syntax

Sequence Visual Editor

  1. Select an action on a step and open the Instruction picker (Alt or right-click -> Edit Qualifier & Instruction).
  2. Select Counters -> CTDR and choose the P (Pulse) qualifier.
  3. Enter the starting count in PV (for example 10) and assign a boolean load variable in the LD operand chip.

Python

from automation_machine import ActionQualifier, ActionInstruction

step.add_action("magazine_slots", "Decrement remaining slots", qualifier=ActionQualifier.P, instruction=ActionInstruction.CTDR, preset_value=10, load="magazine_refilled")

Parameters


Counter Variables

Variable Type Description
.CD BOOL Count-down input: rising edge decrements .CV
.LD BOOL Load input: reloads .CV to .PV and sets .Q to FALSE
.Q BOOL Output signal: TRUE when .CV <= 0
.PV INT Preset starting count
.CV INT Current remaining count

See Also