Lab 15.1 – Import the ActiveEvent ActiveX Control and modifying Mixer template

Import the ActiveEvent ActiveX Control into the Galaxy

The ActiveEvent script function library dll is one of the files that is in the installation folder of your Historian Server.

Step 1. In the ArchestrA IDE, in the Galaxy menu, click Import | Script Function Library.

Step 2. Navigate to C:\Program Files (x86)\Wonderware\Historian and select aahActiveEvent.dll.

Step 3. Click Open.

The Import Script Function Library succeeded message appears.

Step 4. Click OK.

Modify the Mixer Template

Now, you will create the script that will trigger the event generation.

Step 5. In the Template Toolbox, expand TrainingGalaxy\Training\Project toolset.

Step 6. Double-click $Mixer to open its editor.

Step 7. Click the UDAs tab.

Step 8. Click the Add button to create a new UDA and name it Trigger.

Step 9. Confirm that the Data type is Boolean and Category is User writeable.

Step 10. Click the Scripts tab.

Step 11. Click the Add button to create a new script and name it Trigger.

 

Note: You may use the below text file.

Step 12. Expand Declarations and enter the following:

' ActiveEvent reference.
Dim HistEvent As AAHACTIVEEVENTLib.aahEventClass;

 

Step 13. In the Execution Type drop-down list, select Startup.

Step 14. In the Scripts area, enter the following.

Make sure you replace the XXX string with the correct server name. Be aware that the ActiveEvent control is case sensitive, so the name of the event tag should match exactly the one you created in Historian Server earlier.

Instantiate ActiveEvent.
HistEvent = new AAHACTIVEEVENTLib.aahEventClass;
Connect to the Wonderware Historian Server.
Replace the XXX string with the name of your Tier-1 Historian HistEvent.InitializeEx("XXX");
Register the Event tag to be triggered. HistEvent.AddEventTag("ExternalEvent");

 

Step 15. In the Execution Type drop-down list, select Execute.

Step 16. In the Expression field, enter Me.Trigger.

Step 17. For Trigger Type, select OnTrue.

Step 18.Enter the following in the script area:

Verify connection to the Wonderware Historian Server.
If HistEvent.IsConnected() Then ' Trigger the External event.
HistEvent.InvokeEventEx("ExternalEvent"); EndIf;
 
'Reset trigger.
Me.Trigger = False;

Step 19.Click all lock icons to lock the fields.

Step 20. Save and check in the object.

Step 21. In Deployment view, redeploy the M100 and M200 objects.

 

 

Last modified: Tuesday, 12 May 2020, 4:43 PM