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 (
The most interesting parts are:
PRU passes three values from the encoder block to the main PLC program:
The encoder block is not something magical. You can hold
ctrland click its name
PRU_ABZ_ENCODERto navigate to the source:
You can use the same
ctrl+clickapproach to see the sources of other blocks of the standard library.