Reads the Quadrature encoder counter value.
Description
When using this block, the channel A and channel B signals of the quadrate encoder should be connected to the channel 1 and channel 2 pins respectively of the timer module that was selected in the block parameters.
The underlying software driver processes the channel A and channel B signals to create a
32-bit signed counter as can be seen in the illustration below. TI1 is the quadrature
encoder's channel A, TI2 is channel B, and Counter is the value returned by this block.
The counter value that is outputted by this block is of datatype int32, so its range is from –2,147,483,648 to 2,147,483,647. The counter will underflow/overflow if it gets out of range. To prevent the counter from going out of range you can manually reset the counter back to 0 through the block's boolean input. This input can be enabled through the checkbox 'Show counter reset input'. If a rising edge is detected on the block input, the counter will be reset to 0.
OutputCounter value
The used datatype is of int32.
Counter reset trigger
The used datatype is of boolean.