From 530cdc038325ddc584f228af2fc4e33ad7c98165 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Tue, 6 Apr 2021 18:27:32 +0200 Subject: [PATCH] - .NET API: added function IedModel.GetDeviceByInst --- dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs b/dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs index 93d32b3a..e1f5cbe7 100644 --- a/dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs +++ b/dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs @@ -74,6 +74,9 @@ namespace IEC61850 [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern void IedModel_setIedNameForDynamicModel(IntPtr self, string iedName); + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr IedModel_getDeviceByInst(IntPtr self, string ldInst); + internal IntPtr self = IntPtr.Zero; internal IedModel(IntPtr self) @@ -193,6 +196,18 @@ namespace IEC61850 return parentNode; } + public LogicalDevice GetDeviceByInst(string ldInst) + { + IntPtr ldPtr = IedModel_getDeviceByInst(self, ldInst); + + if (ldPtr != IntPtr.Zero) + { + return new LogicalDevice(ldPtr, this); + } + else + return null; + } + private ModelNode GetModelNodeFromNodeRef(IntPtr nodeRef) { ModelNode modelNode = null;