EcoStruxure Geo SCADA Expert Forum
Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.
Posted: 3 weeks ago
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!
Posted: 3 weeks ago
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.
Posted: 3 weeks ago
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.
Posted: 3 weeks ago
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;
Posted: 3 weeks ago
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...
Posted: 3 weeks ago
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.
Posted: 2 weeks ago
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
Posted: 2 weeks ago
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;
}
Posted: 2 weeks ago
You can also use the ServerSystemCollection class to parse the "Systems.xml" file for you, using a
Create your free account or log in to subscribe to the forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.