COUNT – Controlled counter

Block SymbolLicensing group: STANDARD
PIC

Function Description
The COUNT block is designed for bidirectional pulse counting – more precisely, counting rising edges of the UP and DN input signals. When a rising edge occurs at the UP (DN) input, the cnt output is incremented (decremented) by 1. Simultaneous occurrence of rising edges at both inputs is indicated by the error output E set to on. The R1 input resets the counter to 0 and no addition or subtraction is performed unless the R1 input returns to off again. It is also possible to set the output cnt to the value n0 by the SETH input. Again, no addition or subtraction is performed unless the SETH input returns to off again. The R1 input has higher priority than the SETH input. The input HLD = on prevents both incrementing and decrementing. When the counter reaches the value cnt nmax, the Q output is set to on.

This block propagates the signal quality. More information can be found in the 1.4 section.

Input

R1

Block reset

Bool

n0

Value to set the counter to

Long (I32)

SETH

Set the counter value

Bool

UP

Incrementing input signal

Bool

DN

Decrementing input signal

Bool

HLD

Counter freeze

Bool

off ..

Counter is running

on ...

Counter is locked

nmax

Counter target value

Long (I32)

Output

cnt

Total number of pulses

Long (I32)

SGN

Sign of the cnt output

Bool

off ..

Less or equal to zero

on ...

Positive value

Q

Counter state

Bool

off ..

Target value not reached

on ...

Target value reached

E

Error indicator

Bool

off ..

No error

on ...

An error occurred

2024 © REX Controls s.r.o., www.rexygen.com