Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The DoReact methods  The DoReactStr method Next page


The DoReact method generates the reactions of the system objects. The method sends the reaction to the specified object. The reaction is transferred directly to the kernel on which the object is registered, and not to the entire system. In the DoReact method, the reaction is specified by the MsgObject object.

Syntax for method invocation:

 function DoReact(msgevent : MsgObject)

Method arguments:

  1. msgevent is a required argument. It specifies the reaction sent to the specified object. Possible values: the MsgObject objects created earlier in the script.

Note

Two types of system messages are available Axxon PSIM: events and reactions. The events usually contain some information and are used as notifications sent to all Axxon PSIM kernels connected to each other during the architecture configuration. The reactions are commands sent to specific objects. A reaction is transmitted only to the kernel on which the required object is registered, and not to the entire system. The DoReactStr and DoReact methods are used to generate reactions. The NotifyEventStr and NotifyEvent methods are used to generate events.

Example. When relay 1 closes, close relays 2 and 3. When relay 1 opens, open relay 2.

 if (Event.SourceType == "GRELE" && Event.SourceId == "1")
{
 var msgevent = Event.Clone();
 if(Event.Action == "ON")
 {
 msgevent.SourceId = "2";
 DoReact(msgevent);
 msgevent.SourceId = "3";
 DoReact(msgevent);
 }
 if(Event.Action == "OFF")
 {
 msgevent.SourceId = "2";
 DoReact(msgevent);
 }
}