The status byte RS485ErrorCnt counts the communication errors with the I/O modules.

The RevPi I/O modules exchange data with the RevPi base module via a serial line. The data is transmitted electrically according to the RS485 standard.

The piControl driver scans which modules are connected during startup and reset. It then communicates cyclically with the modules in the order in which they are mounted on the DIN rail from left to right next to the RevPi. First, piControl reads the output values for the respective module from the process image and sends them to the I/O module. In response, the RevPi base module receives the input values and writes them into the process image. This procedure is repeated with the next expansion module.

It can happen that the data is disturbed during transmission between RevPi base module and I/O module. piControl has an internal error counter for each module in the cyclic RS485 exchange. RevPi Gateways and the base module do not use the RS485 bus and are therefore not counted. If a communication error occurs, the counter for the affected module is incremented.

As soon as a telegram has been transferred correctly from the RevPi base module to the I/O module and back, the counter is reset to 0. The counter therefore reflects the number of errors that occurred in succession.

Every cycle, the error counter of each module is compared with the two limit values RS485ErrorLimit1 and RS485ErrorLimit2:

  • On reaching RS485ErrorLimit1, a warning is written to kern.log.

  • On reaching RS485ErrorLimit2, the module is taken offline, flagged as absent in the RevPiStatus byte, and an error is written to kern.log. It is brought back online automatically once it responds again.

The following limit values are preset and offer a good balance between fault tolerance and system stability for most applications:

  • RS485ErrorLimit1: 10

  • RS485ErrorLimit2: 1000

If one of the limit values is set to 0, the respective check is deactivated.

The value RS485ErrorCnt contains the sum of the error counters of all modules whose communication is currently disturbed. The first error of a module is ignored, i.e. a module is only included once two or more errors occur in succession. The value is recalculated in each cycle and drops back to 0 as soon as all modules communicate without errors again. The maximum value is 65 535.