Geo SCADA Knowledge Base
Access vast amounts of technical know-how and pro tips from our community of Geo SCADA experts.
Link copied. Please paste this link to share this article on your social media post.
Originally published on Geo SCADA Knowledge Base by Anonymous user | June 09, 2021 07:48 PM
The database client COM interface remains in support, but modern applications should use the .Net Client instead. It enables a program or script to manipulate Geo SCADA database object properties and methods. You can not use it to manipulate Geo SCADA mimic or logic content - see below for this. You can find details of the API in the Visual Studio Object Browser.
Name of the library "ScxV6DbClient"
DLL Name: C:\Program Files (x86)\Schneider Electric\ClearSCADA\DBClient.dll
Text description: "Scx V6 Automation Interface" or "Geo SCADA Expert Automation Interface"
To use this interface from C#, you need to use lines like this:
using ScxV6DbClient; 'Add a reference to the COM library first ... var server = new ScxV6Server(); server.Connect("Local", "user", "password"); // System name is Local ScxV6Object obj = server.FindObject("$Root"); Console.WriteLine(obj.FullName);
To use this from VBScript (for example within a Geo SCADA Mimic script):
Set svr = CreateObject("Serck.ScxV6Server") svr.Connect "Local", "user", "password" ' System name is Local Set obj = svr.FindObject( "$Root") MsgBox obj.FullName
You don't really need to use this from a mimic script because you have the Server object, to make calls like Server.FindObject().
Objects within Geo SCADA have properties that define the behavior of the object, and a number of methods that allow users to perform some action on that object. An example of a method is Accept. This method is called when users acknowledge an alarm in ClearSCADA and is associated with the point currently in alarm. Methods can be called in the Automation Interface using the 'Interface' property.
Some examples of this are shown below:
Object.Interface.Accept
Object.Interface.AcceptWithComment "Comment"
Object.Interface.DisableAlarms 5
The units for the duration are in minutes, so this example will disable alarms on Object for 5 minutes.
The second COM interface can be used to manipulate ViewX objects on the client side, such as mimic or logic content.
Name of the library "ViewX"
DLL Name: C:\Program Files (x86)\Schneider Electric\ClearSCADA\SE.Scada.ViewX.Interop.dll
Text description: "Serck Controls ViewX Object Library"
Again, you can find details of the API in the Visual Studio Object Browser.
To use this interface from C#, you need to use lines like this:
using ViewX; 'Add a reference to the COM library first ... var vwx = new ViewX.Application(); vwx.Logon("Local", "user", "password"); // System name is Local vwx.Mimics.OpenFromServer(false, "Local", "Opening Page");
To use this from VBScript (for example within a Geo SCADA Mimic script):
Set xvw = CreateObject("Serck.ViewXApplication") 'xvw.Logon("Local", "user", "password"); ' Optional if ViewX is running and logged in already Set mim = xvw.Mimics.OpenFromServer( False, "Local", MimicFullname )
Note that when using from VBScript there are currently some operations which will cause ViewX to fail. This is because you are 'looping back' into ViewX. We're looking to see if this can be resolved, but in current versions you won't be able to set properties of the parent (e.g. mimic size), select items (e.g. select for deletion or cutting/pasting). But it can be used to add or modify properties of items within the mimic's layers.
For example, this incomplete code add lines and animations:
Set xvw = CreateObject("Serck.ViewXApplication") Set mim = xvw.Mimics.OpenFromServer( False, SystemName, MimicFullname ) Set Layer = mim.Layers(0) Set tLine = Layer.AddLine( cx, cy, x, y ) With tLine With .Animations .Add "Visible", """Parameter:ShowTicks""" .Add "PosMax", """Parameter:MaxValues.V" & trim(a) & """" End With End With Dim TitleText Set TitleText = Layer.AddText( cx-r*0.7, cy-r*1.2, cx+r*0.7, cy-r) With TitleText .Font.HorzAlignment = 1 .Font.VertAlignment = 1 .Animations.Add "Text", """Parameter:TitleText""" .Font.Height = 18 End With mim.Save mim.Close
You can enumerate the contents of mimics like this example:
For Each Layer In m.Layers For Each Item In Layer If Not IsEmpty(Item) Then If Item.Type = DrwEmbeddedMimic Then For Each AnimItem In Item.Animations
Documentation for this interface is in the class definitions - viewable from Visual Studio's object browser.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.