Working with multiple clients
As the handshake between the PLC and the HMI, the client follows a sequential state machine. It is necessary that only one client initiates the communicationa and oversees it through all states.
The ClientID variable of the FB_PlcStateToHmi
is set to a unique ID by the first client that gets access to this variable. Only the client identified by this ID will process communication requests, to inform the PLC about the connection status and it will update the LiveSignHMI
variable every five hundred milliseconds.
If there is no change in the LiveSignHMI
variable for a more than 5 seconds period, the PLC should remove this client by writing ‘zero’ to the ClientID
variable.
If there are other clients currently active, one of them will get the access by writing its own ID into the ClientID
variable and show its active status by updating the LiveSignHMI
variable.