Graphics Builder Automation Interface
- Last UpdatedFeb 05, 2024
- 2 minute read
The Plant SCADA Graphics Builder now offers support for "automation," an OLE service that allows applications to expose their functionality, or to control the functionality of other applications on the same computer or across a network. As a result, applications can be integrated and automated with programming code.
The two key elements of automation are:
-
Applications or software components, called automation servers, that can be controlled because their functionality has been exposed and made accessible to other applications. Examples of Microsoft Automation servers are Microsoft Office applications and Microsoft Project. These Automation servers expose their functionality through object models.
-
Other applications or development tools, called automation controllers, that can control OLE Automation servers through programming code, by accessing the functionality exposed by the Automation servers. Examples of Microsoft Automation controllers are Microsoft Visual Basic, Microsoft Visual C++, and Microsoft Visual Basic for Applications (which is built into Microsoft Access, Microsoft Excel, and Microsoft Project).
Automation is the umbrella term for the process by which an automation controller sends instructions to an automation server (using the functionality exposed by the automation server), where they are run.
The Plant SCADA Graphics Builder automation interface enables the Plant SCADA Graphics Builder to act as an automation server as it exposes many Graphics Builder functions.
The interface supports a simple object model: functions are on the root level. Names are structured and contain a group identifier and a function name; for example, DrawLine, DrawRectangle, PositionAt, PositionRotate, ProjectSelect, ProjectUpgrade. These functions can be called from a Visual Basic (VB) program.
Note: In the VB development environment, the reference GraphicsBuilder Type Library needs to have previously been selected. If it has not, choose References from the Project menu in the VB and check the Graphics Builder Type Library.
Example
The following sample VB code allows you to create a new Plant SCADA page, place a Genie at a specific location, set one of its parameter, draw a line, and then save the page with the name "TEST". This example is compatible with the ExampleSA project.
Dim GraphicsBuilder As IGraphicsBuilder2
Set GraphicsBuilder = New GraphicsBuilder.GraphicsBuilder
With GraphicsBuilder
.Visible = True
.PageNew "sa_include", "situational_awareness", "pagecontent", 0, False, True
.LibraryObjectPlace "sa_include", "sa_filter", "item_priority_hd1080", 0, True
.PositionAt 300, 500
.LibraryObjectPutProperty "AsmPriority", "1"
.DrawLine 100, 100, 300, 300
.AttributeLineColour = 120
.PageSaveAs "ExampleSA", "TEST_AUTOMATION"
.PageClose
End With
Set GraphicsBuilder = Nothing