If you have a physical incremental encoder (with A/B outputs) wired to a target board, you can use the Quadrature encoder blocks which are available in Simulink for the target board and are used to get position, direction, and speed information from a rotating machine.
You can refer the below documentation links on Encoders:
