ABSTRACT

This chapter describes three counter functions, up counter, down counter, and up/down counter. The up counter can be used to signal when a count has reached a maximum value. The up counter counts the number of rising edges detected at the input. PV defines the maximum value for the counter. The down counter can be used to signal when a count has reached zero, on counting down from a preset value. The up/down counter has two inputs. It can be used to both count up on one input and count down on the other. Each time the counter is called with a new rising edge on input, the count value is decremented by one. When the counter reaches zero, the counter output is set true (ON—1) and the counting stops.