The libiec61850 source code distribution also contains a clinet/server API for C#/.NET. The C# library should run on .NET and Mono (on Linux and Mac OS X 10.9). Please also refer to the examples provided with the C# API.
The C# code is provided with solution and project files that can be either used with Visual Studio or MonoDevelop (Xamarin Studio).
Build the API and examples on Mono for Linux
To build the tools you can either use MonoDevelop or the xbuild command line tool.
To build on the command line just type:
On a Windows system you can use Visual Studio or the msbuild command line tool respectively.
The C# API requires the C/native library to be built as a native shared library (.so file or DLL).
The runtime (.NET or Mono) has to be able to find the shared library/DLL. This can be done by copying the library to the respective system directory:
On Linux or Mac OS X this is usually
On Windows this is the
C:/Windows/System32. (Depending on the version of Windows this directory may differ).
Mac OS X:
A simple example application
public static void Main (string args)
var connection = new IedConnection ();
bool stVal = connection.ReadBooleanValue ("simpleIOGenericIO/GGIO1.SPCSO1.stVal",
UInt64 t = connection.ReadTimestampValue("simpleIOGenericIO/GGIO1.SPCSO1.t",
DateTimeOffset timestamp = MmsValue.MsTimeToDateTimeOffset (t);
Console.WriteLine ("SPCSO1.stVal: " + stVal.ToString ());
Console.WriteLine ("SPCSO1.t: " + timestamp.ToString ());
var spcso1 = connection.CreateControlObject ("simpleIOGenericIO/GGIO1.SPCSO1");
The C# API is designed to be as close as possible to the C API without compromising the C# coding style. Main differences are the usage of real instance methods instead of static functions and exceptions instead of call by reference error variables.