Fast encoder
Let’s process values from ABZ encoder. In general, it does not differ that much from fast counter.
If you have Hardella IDE opened, you can either open
code sample in the IDE, or you can create a new project with this code (File
> New
> Project
> Fast encoder
).
The most interesting parts are:
-
PRU passes three values from the encoder block to the main PLC program:
position
,counter
,zeroDetected
-
The encoder block is not something magical. You can hold
ctrl
and click its namePRU_ABZ_ENCODER
to navigate to the source:You can use the same
ctrl+click
approach to see the sources of other blocks of the standard library.
Leave a Comment