Monitoring a client connection

To monitor a client connection, it is necessary to call the FB_BACnetRM_Device function block cyclically.

The current status of the connection can be taken from the FB_BACnet_Client function block.

If the connection is interrupted, e.g. by disconnecting the peer device or by a defective network cable, the BACnet supplement attempts to re-establish the connection. If after these attempts (variable nErrorCnt in function block FB_BACnetRM_Device) the connection is still interrupted, it is assumed that the device or the network connection is no longer present. This process may take 30 seconds or longer to safely detect the interrupted connection.

In this case the variable eSysState of the FB_BACnetRM_Device takes the value eNoCommunication and bOperational is set to FALSE. The variables bReady and bConnected of the function block FB_BACnet_Client are set to FALSE, the variable eState takes the value eInit.

The BACnet supplement continues to attempt to connect to the peer device. Once the connection is re-established, the state machine behaves as it did when it was first started.