0% found this document useful (0 votes)
25 views

Lab 19 - Using Activeevent 9-37

Uploaded by

RAHAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Lab 19 - Using Activeevent 9-37

Uploaded by

RAHAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Lab 19 – Using ActiveEvent 9-37

Lab 19 – Using ActiveEvent

Introduction
This Lab is designed to demonstrate the use of the ActiveEvent ActiveX Control to trigger external
events in the Historian.

Objective
Upon completion of this lab you will be able to:
z Import the ActiveEvent ActiveX Control into the Galaxy
z Create a template and include a script to trigger an external event
z Trigger the event from ObjectViewer
z Use the ActiveEvent ActiveX Control to trigger External events in the Historian

Wonderware System Platform Course - Part 2


9-38 Module 9 – Historian Event System

Import the ActiveEvent ActiveX Control into the Galaxy


1. Start the ArchestrA IDE.
2. Connect to WWGalaxy on your local GR node.
3. Click Galaxy / Import / Script Function Library…
4. Locate the file aahActiveEvent.dll, in C:\Program Files\Wonderware\InSQL\Server\.
5. Click Open.
An information dialog box displays:

6. Click OK.
The ActiveEvent ActiveX Control is ready to be used.

Wonderware Training
Lab 19 – Using ActiveEvent 9-39

Modify the Mixer Template


7. Edit the Mixer template in the Training Objects Toolset.
8. Select the UDAs tab, and create a UDA with the following configuration:
Name: Trigger
Data Type: Boolean
Category: User Writeable
Initial Value: False (unchecked)

9. Click the Scripts tab, and create a new script called Trigger.
10. In the Declarations section, write the following:
dim HistEvent as AAHACTIVEEVENTLib.aahEventClass; 'Instance of the
ActiveEvent Control
11. Select Startup for Execution Type.

Wonderware System Platform Course - Part 2


9-40 Module 9 – Historian Event System

12. Add the following to the scripts area:


HistEvent = new AAHACTIVEEVENTLib.aahEventClass;
HistEvent.InitializeEx( "localhost" ); 'Connects to Wonderware Historian
HistEvent.AddEventTag( "ExternalEvent" ); 'Registers Event Tag

Wonderware Training
Lab 19 – Using ActiveEvent 9-41

13. Select Execute for Execution Type.


14. In the Expression field, enter Me.Trigger.
15. Select OnTrue as Trigger Type.
16. Write the following in the script area:
If HistEvent.IsConnected() then
HistEvent.InvokeEventEx( "ExternalEvent" );
Endif;
Me.Trigger = false;
17. Lock all fields.

18. Save and Close the Editor.

Wonderware System Platform Course - Part 2


9-42 Module 9 – Historian Event System

19. Deploy the Mixer_XX0 and Mixer_XX1 instances.

Wonderware Training
Lab 19 – Using ActiveEvent 9-43

Trigger and Monitor the Event


20. Right-click the Mixer_XX0 instance and launch ObjectViewer.
21. Locate the Trigger attribute and add it to the watch window.

22. Set the Trigger attribute to True. This will trigger the external event in the Historian.
23. Start ActiveFactory Query.
24. Change the Query type to Event history values.
25. Select ExternalEvent in the Tag Picker.
26. Click the Time tab.
27. Select a time period of 1 hour.
28. Click the Data tab.
The event generated by Application Server displays:

Wonderware System Platform Course - Part 2


9-44 Module 9 – Historian Event System

– Intentionally left blank –

Wonderware Training
Module 10

Introduction to Information Server


Section 1 – Hardware and Software Requirements 10-3
Section 2 – Information Server License Management 10-5
Lab 20 – Licensing Management 10-9
10-2 Module 10 – Introduction to Information Server

– Intentionally left blank –

Wonderware Training

You might also like