public static int rightShift3(final ReadBuffer buffer, DataTransportSize tsize) throws ParseException {
        int value = 0;
        if ((tsize == DataTransportSize.OCTET_STRING) ||
            (tsize == DataTransportSize.REAL) ||
            (tsize == DataTransportSize.BIT)) {
            value = buffer.readUnsignedInt(16);
        } else {
            value = buffer.readUnsignedInt(16) >> 3;
        }
        return value;
    }
converts incoming byte to an integer regarding used BCD format

@param incomingByte the incoming byte
@return converted BCD number
plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java