← Counters

Count Up Down with Bounds

medium

Bidirectional counter with upper and lower bounds, and flag outputs when the limits are hit.

What it teaches

A bidirectional counter that respects a Min and Max. Hit the top — the count pins to Max and the at-max flag turns on. Hit the bottom — pins to Min and the at-min flag turns on. Useful when a tracked balance needs both directions and known boundaries.

Parameters

TagDirectionTypeDefaultDescription
In_CountUpInputBOOL0Count up pulse
In_CountDownInputBOOL0Count down pulse
Cfg_MinInputDINT0Lower limit for the count
Cfg_MaxInputDINT3Upper limit for the count
Out_CountOutputDINT0Current bounded count
Sts_AtMaxOutputBOOL0At maximum limit flag
Sts_AtMinOutputBOOL0At minimum limit flag

Required behavior