Users may have criteria dependent upon continuous data flow to PI. This failover prevents the disruption of data flow to PI that may cause user dependent operations to fail when the connection to the PI Server is lost. The following sequence of events is taken by the primary and backup interface if the primary interface loses its connection to the PI Server.
When the primary interface loses its connection to the PI server, it writes a value incrementing between 17 – 31 and then back to 17 to its heartbeat point. UniInt will send a signal to the state machine if any of the PI API functions return a value indicating that PI is unavailable.
The backup interface reads a value of 17 – 31 on the primary’s heartbeat point during its next failover update interval.
The backup transitions to a state indicating that the primary has lost its connection to the PI server (PrimaryNOPI).
The old primary will notice that the value of the active ID point on the data source is equal to the failover ID of the other copy and immediately transition to the backup role. The newly designated backup interface begins to queue its data.
This scenario may result in up to 2 seconds of overlapping data depending on the timing. The overlapping or duplicate data will not appear in PI until the interface that lost its connection to PI reestablishes its communication to PI and bufserv sends the buffered data.
Following is a failover timing chart of the situation where the primary interface loses its connection with the PI Server.
Time
Action
T+0
Both interfaces are running with IF1 in the primary role.
T+2.5
IF2 reads the active ID point and IF1’s heartbeat point. Both are good, so IF2 discards data older than time 0.5.
T+3
Event A: IF1 updates its heartbeat to 30 because it has lost its connection to the PI Server. When the connection to PI is lost, the heartbeat for the interface increments between 17-31 and then back to 17. In this example the primary interface copy heartbeat was at 13 for IF1, so the next heart beat will be 30 if the connection to PI is lost.
T+3.5
Event B: IF2 reads the active ID point and IF1’s heartbeat point. IF2 still has a good connection to PI, so it transitions to primary and sets the active ID point to 2.
T+4
Event C: IF1 reads the active ID point and notices the change to a 2. IF1 immediately transitions to backup.
Overlap data from time 0.5 to 4
Figure 5: Timing chart for failover when the primary interface loses its connection with the PI Server.