diff --git a/dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs b/dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs index 82f133a2..6056fcaa 100644 --- a/dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs +++ b/dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs @@ -127,10 +127,10 @@ namespace IEC61850 static extern void IedConnection_installConnectionClosedHandler (IntPtr self, InternalConnectionClosedHandler handler, IntPtr parameter); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr IedConnection_readDataSetValues (IntPtr self, out int error, string dataSetReference, IntPtr dataSet); + static extern IntPtr IedConnection_readDataSetValues (IntPtr self, out int error, [MarshalAs(UnmanagedType.LPStr)] string dataSetReference, IntPtr dataSet); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr IedConnection_createDataSet (IntPtr self, out int error, string dataSetReference, IntPtr dataSet); + static extern IntPtr IedConnection_createDataSet (IntPtr self, out int error, [MarshalAs(UnmanagedType.LPStr)] string dataSetReference, IntPtr dataSet); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern void IedConnection_deleteDataSet (IntPtr self, out int error, string dataSetReference); @@ -861,7 +861,7 @@ namespace IEC61850 IntPtr linkedList = LinkedList_create (); foreach (string dataSetElement in dataSetElements) { - IntPtr handle = System.Runtime.InteropServices.Marshal.StringToHGlobalAuto (dataSetElement); + IntPtr handle = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi (dataSetElement); LinkedList_add (linkedList, handle); } diff --git a/dotnet/datasets/DataSetExample.cs b/dotnet/datasets/DataSetExample.cs index bd73cd54..f816c24c 100644 --- a/dotnet/datasets/DataSetExample.cs +++ b/dotnet/datasets/DataSetExample.cs @@ -12,12 +12,13 @@ namespace datasets { IedConnection con = new IedConnection (); - string hostname; - - if (args.Length > 0) - hostname = args[0]; - else - hostname = "localhost"; + string hostname; + + if (args.Length > 0) + hostname = args[0]; + else + hostname = "10.0.2.2"; + //hostname = "localhost"; Console.WriteLine("Connect to " + hostname); @@ -36,13 +37,13 @@ namespace datasets List dataSetElements = new List(); - dataSetElements.Add("IEDM1CPUBHKW/DRCS1.ModOnConn.stVal[ST]"); - dataSetElements.Add("IEDM1CPUBHKW/DRCS1.ModOnConn.t[ST]"); + dataSetElements.Add("simpleIOGenericIO/GGIO1.AnIn1.mag.f[MX]"); + dataSetElements.Add("simpleIOGenericIO/GGIO1.AnIn2.mag.f[MX]"); - con.CreateDataSet("IEDM1CPUBHKW/LLN0.ds1", dataSetElements); + con.CreateDataSet("simpleIOGenericIO/LLN0.ds1", dataSetElements); // get the directory of the data set - List dataSetDirectory = con.GetDataSetDirectory("IEDM1CPUBHKW/LLN0.ds1"); + List dataSetDirectory = con.GetDataSetDirectory("simpleIOGenericIO/LLN0.ds1"); foreach (string entry in dataSetDirectory) { @@ -50,7 +51,7 @@ namespace datasets } // read the values of the newly created data set - DataSet dataSet = con.ReadDataSetValues("IEDM1CPUBHKW/LLN0.ds1", null); + DataSet dataSet = con.ReadDataSetValues("simpleIOGenericIO/LLN0.ds1", null); MmsValue dataSetValues = dataSet.GetValues(); @@ -62,7 +63,7 @@ namespace datasets // delete the data set - con.DeleteDataSet("IEDM1CPUBHKW/LLN0.ds1"); + con.DeleteDataSet("simpleIOGenericIO/LLN0.ds1"); con.Abort(); } diff --git a/dotnet/reporting/ReportingExample.cs b/dotnet/reporting/ReportingExample.cs index dceb88bd..8f0c2000 100644 --- a/dotnet/reporting/ReportingExample.cs +++ b/dotnet/reporting/ReportingExample.cs @@ -45,7 +45,8 @@ namespace reporting if (args.Length > 0) hostname = args [0]; else - hostname = "localhost"; + //hostname = "localhost"; + hostname = "172.23.44.10"; Console.WriteLine ("Connect to " + hostname); diff --git a/tools/model_generator/genconfig.jar b/tools/model_generator/genconfig.jar index 6887d633..6b33f747 100644 Binary files a/tools/model_generator/genconfig.jar and b/tools/model_generator/genconfig.jar differ diff --git a/tools/model_generator/src/com/libiec61850/scl/model/DataModelValue.java b/tools/model_generator/src/com/libiec61850/scl/model/DataModelValue.java index a0f8c613..9434bc34 100644 --- a/tools/model_generator/src/com/libiec61850/scl/model/DataModelValue.java +++ b/tools/model_generator/src/com/libiec61850/scl/model/DataModelValue.java @@ -111,8 +111,6 @@ public class DataModelValue { public void updateEnumOrdValue(TypeDeclarations typeDecls) { if (enumType != null) { - - System.out.println("Lookup enum type " + enumType); SclType sclType = typeDecls.lookupType(enumType); diff --git a/tools/model_generator/src/com/libiec61850/scl/types/EnumerationType.java b/tools/model_generator/src/com/libiec61850/scl/types/EnumerationType.java index 06c55c07..eba43be5 100644 --- a/tools/model_generator/src/com/libiec61850/scl/types/EnumerationType.java +++ b/tools/model_generator/src/com/libiec61850/scl/types/EnumerationType.java @@ -46,32 +46,6 @@ public class EnumerationType extends SclType { static List getDefaultEnumTypes() { LinkedList defaultTypes = new LinkedList(); -// EnumerationType type = new EnumerationType("Tcmd"); -// type.addEnumValue(new EnumerationValue("stop", 0)); -// type.addEnumValue(new EnumerationValue("lower", 1)); -// type.addEnumValue(new EnumerationValue("higher", 2)); -// type.addEnumValue(new EnumerationValue("reserved", 3)); -// -// defaultTypes.add(type); - - /* - - intermediate-state - off - on - bad-state - - */ - -// type = new EnumerationType("Dbpos"); -// type.addEnumValue(new EnumerationValue("intermediate-state", 0)); -// type.addEnumValue(new EnumerationValue("intermediate", 0)); /* for compatibility with older SCL files */ -// type.addEnumValue(new EnumerationValue("off", 1)); -// type.addEnumValue(new EnumerationValue("on", 2)); -// type.addEnumValue(new EnumerationValue("bad-state", 3)); -// -// defaultTypes.add(type); - return defaultTypes; } diff --git a/tools/model_generator/src/com/libiec61850/tools/DynamicModelGenerator.java b/tools/model_generator/src/com/libiec61850/tools/DynamicModelGenerator.java index 900335cd..d2e65a56 100644 --- a/tools/model_generator/src/com/libiec61850/tools/DynamicModelGenerator.java +++ b/tools/model_generator/src/com/libiec61850/tools/DynamicModelGenerator.java @@ -287,9 +287,9 @@ public class DynamicModelGenerator { if (value == null) { value = dataAttribute.getDefinition().getValue(); -// if (value != null) -// if (value.getValue() == null) -// value.updateEnumOrdValue(ied.getTypeDeclarations()); + if (value != null) + if (value.getValue() == null) + value.updateEnumOrdValue(ied.getTypeDeclarations()); } if (value != null) {