Counter

image-1623684174534.40.14.png

The encoder motor can be used as a counter. The number of revolutions is counted, not only when it is turning itself as a motor, but also when it is mechanically driven by an external force.

The Start each time block

The Start each time block offers the option of running a program when a condition is fulfilled. Therefore, it works similar to a case distinction, but runs not only one time, but rather every time the condition is fulfilled during the entire course of the program. The Start each time block:

Bild2.PNG

Is an abbreviation for the following construct:

Bild3.PNG

You can insert all conditions from this category into the counter category in the Start each time block.

Note: The program section in the Start each time block should be kept short, and should not contain any blocking calls or endless loops, so that this part of the program can be processed quickly.

Call

Use Get counter value to obtain the value counted by the counter.

Query

To query whether the counter has counted a certain value, use this

Bild4.PNG

the drill hole. You can use the drop down menu (small triangle) to select how the counted value should be compared to the entered value (<, ≤, =, ≠, ≥, >) .

Reset

The counter starts over at 0 when the Reset counter block is executed.


Revision #2
Created 21 February 2022 15:50:51 by Admin
Updated 9 January 2023 10:31:44 by Alexander Steiger