public static int s7msecToInt(final ReadBuffer buffer) throws ParseException {
        int centenas = bcdToInt(buffer.readUnsignedByte(4));
        int decenas = bcdToInt(buffer.readUnsignedByte(4));
        int unidad = bcdToInt(buffer.readUnsignedByte(4));
        return centenas * 100 + decenas * 10 + unidad;
    }
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