How to achieve Event Redundancy?

We have a redundant SCADA system,

Where we require to run an event from any one computer at a time. (Same as Report server run as disables tandem processing of reports).

Here we are unable to comply the outcome using Reports.

  • Well the next question is why are you unable comply the outcome using Reports.
    Because using reports is, as you mentioned, the answer.
  • Hi Peter,
    Thanks for the reply.

    I know by using reports we can archive all same functionality of events.

    But just wanted to check is there any workaround to use event redundancy!!! Like by using a status bit of active server or so...
  • It depends on which server process you need to run in (if that matters for your event). For the I/O Server, you can use IODeviceInfo("devicename", 10) to check the status of an internal I/O Device, like a DISKDRV or Persisted Memory device. It should return a value from 1-3 if that server is currently the active server for that device. For other server processes, you could use ServerInfo(), ServerInfoEx() or ServerGetProperty() to check the status of the two servers and ProcessIsServer() to check which server the code is running in.
  • I have done similar where I needed to record batch information to an SQL server, but only wanted the code to run on the primary report server (not have each event log twice).

    I don't recall exactly which forum I found the information, but basically I run a function on start-up that subscribes to the "trigger" tags and sets up the callback function

    FUNCTION FM_Subscribe()
    TagSubscribe("Hmi_MB2_Grp1_Rec_Status" ,250, "Raw",0,"FM_evtRecMB2_Grp1", 1 ,0);
    TagSubscribe("Hmi_MB2_Grp2_Rec_Status" ,250, "Raw",0,"FM_evtRecMB2_Grp2", 1 ,0);
    .
    .
    .
    END


    Then in each callback function check if the server is primary, if so (and for this application, bit 8 of the tag is high), run the function. If not, do nothing

    FUNCTION Fm_EvtRecMB2_Grp1(INT handle)
    INT subsVal
    INT iTask
    IF StrToInt(ServerInfoEx("Report",0,"")) = 1 THEN
    DebugMsg("MB2_Grp1 - This is Primary Server")

    subsVal = SubscriptionGetAttribute(handle, "Value");
    DebugMsg("Subscr MB2_Grp1="+IntToStr(subsVal)+","+IntToStr(subsVal BITAND 256));
    IF (subsVal BITAND 256) > 0 THEN
    iTask =TaskNew("_FM_Rec_Ing_MB2_Grp1","",8);
    TraceMsg("EvtRecMB2_Grp1 TaskID"+IntToStr(iTask));
    END!IF

    ELSE
    DebugMsg("MB2_Grp1 - this is standby server, nothing done")
    END!IF
    END!FUNCTION