Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Recipe Management

Recipe Manager Plus Events Example

  • Last UpdatedApr 19, 2017
  • 1 minute read

To process events in Wonderware Application Server script, you need to import the ArchestrA.Events.Scripting.aaSLIB file into your Galaxy using the ArchestrA IDE Import scripting library menu option. This script library is available in the "Program Files (x86)/Wonderware/RecMngrPlus/AppObjects" folder on any system where you installed the "Components for ArchestrA IDE" feature. There is also a help file (ArchestrAEventsScripts.chm) in the same location that describes the client Event API in more detail.

The following example shows the Wonderware Application Server script that can be used to subscribe to the events raised by Recipe Manager Plus:

**Declarations**

dim hostName = "MyRMPServer";

dim portNo = 3575;

dim connectOptions = false;

dim connectionId = ConnectToEventService(hostName, portNo, connectOptions);

dim bFlag = false;

**OnScan - this is optional, but would be used to only see events for a specific Equipment**

dim propertyName = "EquipmentName";

dim comparisionType = "eq";

dim propertyValue = "Equipment_0001";

AddEventFilter(connectionId, propertyName, comparisionType, propertyValue);

**Execute (Periodic)**

If(bFlag) then

dim currentEvent = GetNextEvent(connectionId);

If currentEvent <> null then

dim property = currentEvent.EventType;

LogMessage(property.ToString());

dim property2 = currentEvent.GetProperty("EquipmentName");

LogMessage(property2.ToString());

else

LogMessage("No more data....");

endif;

else

bFlag = StartRequestingEvents(connectionId);

endif;