using System; using System.Collections.Generic; using IEC61850.Client; using IEC61850.Common; /// /// Example for browsing the data model of a server. Shows logical devices, logical nodes, /// data sets and report control blocks /// namespace model_browsing { class ModelBrowsing { public static void Main (string[] args) { IedConnection con = new IedConnection (); string hostname; if (args.Length > 0) hostname = args[0]; else hostname = "localhost"; try { Console.WriteLine("Connect to " + hostname + " ..."); con.Connect(hostname, 102); Console.WriteLine("Connected."); List serverDirectory = con.GetServerDirectory(false); foreach (string ldName in serverDirectory) { Console.WriteLine("LD: " + ldName); List lnNames = con.GetLogicalDeviceDirectory(ldName); foreach (string lnName in lnNames) { Console.WriteLine(" LN: " + lnName); string logicalNodeReference = ldName + "/" + lnName; // discover data objects List dataObjects = con.GetLogicalNodeDirectory(logicalNodeReference, ACSIClass.ACSI_CLASS_DATA_OBJECT); foreach (string dataObject in dataObjects) { Console.WriteLine(" DO: " + dataObject); } // discover data sets List dataSets = con.GetLogicalNodeDirectory(logicalNodeReference, ACSIClass.ACSI_CLASS_DATA_SET); foreach (string dataSet in dataSets) { Console.WriteLine(" Dataset: " + dataSet); } // discover unbuffered report control blocks List urcbs = con.GetLogicalNodeDirectory(logicalNodeReference, ACSIClass.ACSI_CLASS_URCB); foreach (string urcb in urcbs) { Console.WriteLine(" URCB: " + urcb); } // discover buffered report control blocks List brcbs = con.GetLogicalNodeDirectory(logicalNodeReference, ACSIClass.ACSI_CLASS_BRCB); foreach (string brcb in brcbs) { Console.WriteLine(" BRCB: " + brcb); } } } con.Abort(); } catch (IedConnectionException e) { Console.WriteLine(e.Message); } } } }