AVEVA Recipe Management Events Example
- Last UpdatedMay 15, 2024
- 1 minute read
To process events in AVEVA 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)/AVEVA/Recipe Management/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 AVEVA Application Server script that can be used to subscribe to the events raised by AVEVA Recipe Management:
**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;