Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Examples of scripts with Incident server and Incident manager  Examples of scripts with BacNet Next page


Example 1. Using the START and STOP events for the Failover service

Objects from more than one main Server must not be moved to the Backup Server. For this, when moving objects from some main Server to the Backup Server, all other Failover service objects must be disabled on this Backup Server.

if (Event.SourceType  == "FAILOVER" )
{
  if (Event.Action == "START") {action="DISABLE";}
  if (Event.Action == "STOP") {action="ENABLE";}
  id=Event.SourceId;
  msg=CreateMsg();
  msg.StringToMsg(GetObjectIds("FAILOVER"));
  var
  objCount=msg.GetParam("id.count");
    for (i=0;i<objCount;i++)
    {
     pid=msg.GetParam("id."+i);
  
     if (!(id==pid)) {
       DoReactStr("FAILOVER",pid,action,"");
     }
  } 
}


  • No labels