EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-10 05:30 AM
Hi everyone,
I'm making a tool that interfaces with GeoSCADA through the API.
Is there a method that returns me the list of all object types existing in GeoSCADA? (Ex. CMimic, CGroup, CDNP3AnalogIn, etc.)
Is there a method that returns all the properties of one or of these objects? (Ex. FullScale, Units, etc.)
Thank you!
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-10 06:31 AM
You've not said which API you're using but you can do this in the .NET client API. The IDatabaseMetadata.ListClasses() method will return all the classes (aka types) if you specify an empty string for the base class name parameter.
var classes = conn.Server.ListClasses("");
This method returns an array of ClassMetadata objects, which has a property called Properties which is a collection of the class's properties.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-10 06:31 AM
You've not said which API you're using but you can do this in the .NET client API. The IDatabaseMetadata.ListClasses() method will return all the classes (aka types) if you specify an empty string for the base class name parameter.
var classes = conn.Server.ListClasses("");
This method returns an array of ClassMetadata objects, which has a property called Properties which is a collection of the class's properties.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-10 06:43 AM
More detail - you can walk the class definitions:
var dbobject = connection.GetObject(fullname);
var cd = dbobject.ClassDefinition;
var bc = cd.BaseClass;
var dc = cd.DerivedClasses;
// Properties are separated into types for Config and Data (also Dynamic)
var cp = cd.ConfigurationProperties;
var dp = cd.DataProperties;
// You may need to walk into the aggregates too
var af = dbobject.Aggregates;
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-10 07:21 AM
I write this code in VB.NET:
SCXSystem = "Main"
SCXUser = "root"
SCXPassword = "MyPassword"
Svr.Connect(SCXSystem, SCXUser, SCXPassword)
After that, I don't understand what I have to write to have a list of objects...
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-10 08:45 AM
Your VB.NET code is using the legacy COM automation API whereas Steve and myself are using the .NET client API and C#, see "EcoStruxure Geo SCADA \ Client API Guide" in the Windows start menu for the documentation.
Your original question asked for a list of object types (not a list of objects), which is what I described in my answer. Steve's answer assumed you had already created an object of a particular type and wanted to list the properties of that object.
I don't think the COM automation API contains any methods for listing the types of objects or getting a list of their properties.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-11 01:01 AM
Ah ok perfect.
is there a method to get the list of servers configured with client api?
The equivalent of:
Dim Systems As ScxV6DbClient.ScxV6Systems
Systems = Svr.Systems
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-11 01:20 AM
Here's some sample code which reads systems.xml set up in Configure Connections.
It gets the address of the servers in a system from the system name. You could change it or add a function to return all systems.
private static Dictionary<String, Int16> ReadServerDetails( string server)
{
Dictionary<String, Int16> result = new Dictionary<string, short>();
// Any errors cause abort and no servers to be found
try
{
// Open Systems.XML
XmlDocument SystemsXML = new XmlDocument();
SystemsXML.Load("C:\\ProgramData\\Schneider Electric\\ClearSCADA\\Systems.xml");
XmlNodeList Systems = SystemsXML.SelectNodes("Systems/System");
foreach (XmlNode System in Systems)
{
var SystemName = System.Attributes.GetNamedItem("name").Value;
if (SystemName.ToLower() == server.ToLower())
{
XmlNodeList Servers = System.SelectNodes("Server");
foreach (XmlNode Server in Servers)
{
var ServerName = Server.Attributes.GetNamedItem("name").Value;
short ServerPort;
if (short.TryParse(Server.Attributes.GetNamedItem("port").Value, out ServerPort))
{
// Identical server names but different ports will not be supported
// i.e. if you are using 127.0.0.1 and two different ports, then change one for "localhost"
result.Add(ServerName, ServerPort);
}
}
break;
}
}
}
catch (Exception e)
{
Console.WriteLine("Error reading SYSTEMS.XML: " + e.Message);
}
return result;
}
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-05-11 01:46 AM
You can also use the ServerSystemCollection class to parse the "Systems.xml" file for you, using a
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-02-20 04:45 AM
Hi Steve,
I start from class "CDNP3BinaryOut" and if I use "configurationProperties" I see InService, FullScale, ZeroScale, ecc.
How can I start from "CDNP3BinaryOut" and get to the "CDNP3BinaryControl" class?
Thanks!
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-02-23 01:36 AM
The "CDNP3BinaryOut" class has an aggregate called "Control" of type "CDNP3BinaryControl". You can see this in the database schema:
So if you have a DNP3 binary output object you need to get the "Control" property of the object to get the associated control aggregate.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-03-15 10:36 AM
Hi Andrew,
it works! Just one last question...
How do I see the enable status of "Control"? I see all the properties relating to the control but I don't know which of these is the enable.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-03-18 04:59 AM
Are you referring to whether the control aggregate is enabled (i.e. whether the point can be controlled by Geo SCADA) or the operational state of the control (i.e. whether users are currently allowed to issue controls)?
See Specify Whether an Output Point is Controlled by Geo SCADA Expert
See Disable Controls and Enable Controls pick actions
For the former the "Control" property itself indicates if the control aggregate is enabled or disabled.
For the later the "Control.ControlDisabled" Boolean property indicates whether controls are enabled (false) or disabled (true).
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.