Status Bytes on RevPi Connect

Status Byte RevPiStatus

The byte RevPiStatus contains the status of the piControl driver. Please note the distinction between RevPi I/O modules and RevPi Gateways.

Bit

Meaning

0 piControl driver is running
1 At least one I/O module is connected that has not been configured by
PiCtory.
2 At least one I/O module by PiCtory has been configured, but it is not
connected. The bit is also set if a Gateway has been configured.
3 An I/O module takes up more or less bytes in the process image than
specified in the PiCtory configuration. This can happen if the version of the configuration
file or the device description files used does not match the firmware in the I/O module. Get
an update of PiCtory.
4 A RevPi Gateway is connected to the left of the RevPi.
5 A RevPi Gateway is connected to the right of RevPi.
6 Digital input on terminal X2

Status byte RevPiLED

RevPi Connect

Via the byte RevPiLED the free programmable LEDs, the watchdog and the relay can be controlled:

Bit

Component

Status information

1:0 LED A1 00 = off
01= green
10= red
orange
3:2 LED A2
5:4 LED A3
6 Relay 0 = relay is closed
1 = relay is open
7 Watchdog To restart the watchdog timer, the bit must be set once to 0 and once to
1 within 60 seconds.
NOTE
Change only the desired bit in the RevPiLED byte. If you want to switch on e.g. LED A3 green, you can write PiTest -w RevPiLED,16. However, this switches off the LEDs A1 and A2 at the same time. You have to read the current value, change the desired bit and then write back the whole byte.

RevPi Connect 4

Bit

Component

Status information

2:0 LED A1 000 = off
001= red
010= green
100 =
blue
011 = orange
110 = cyan
101 = magenta
111 = white
5:3 LED A2
8:6 LED A3
11:9 LED A4
15:12 LED A5

Status bytes RS485ErrorCnt and RS485ErrorLimit

he status byte RS485ErrorCnt controls the communication with the I/O modules. This is interesting for you if you want to integrate your own devices into your system.

The RevPi I/O modules exchange data with the RevPi device 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 device receives the input values and writes them into the process image. This procedure is repeated with the next module and so on in turn.

Although RS485 is insensitive to interference, it can still happen that the data is disturbed during transmission between RevPi device and I/O module. piControl has an internal error counter for each module. If a transmission error has occurred, the counter is incremented. The maximum value of the counter is 255. As soon as a telegram has been transferred correctly between RevPi device to I/O module and back, the counter is reset to 0. The first error is ignored, i.e. only if two or more errors occur in succession the following error handling will become active.

The value RS485ErrorCnt contains the sum of all errors. The value can therefore be between 0 and 255*n if n I/O modules are connected. At the end of each cycle, the error counter is compared with the two limit values RS485ErrorLimit1 and RS485ErrorLimit2. If it has reached RS485ErrorLimit1, a message is output in kern.log. In the next version of piControl, the default values defined in PiCtory are written to the process image. If the error counter has reached RS485ErrorLimit2, the piBridge communication is stopped.

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

RS485ErrorLimit1 is set to 10 and RS485ErrorLimit2 is set to 1000 as default.