How we work with C# | Topics

Our work with programming languages
Our second ‘How we work with’ post focuses this time on C#. C what? Yes, to the uninitiated, this modern, object-oriented and type-safe programming language might sound a bit austere. But our development team couldn’t do without it, as C# has become widely used in recent years, particularly in the IoT sector. There are now numerous, often open-source software packages for data processing, as well as communication stacks for connecting edge controllers to higher-level cloud systems.
The first version was released in the early 2000s. It has its roots in C and C++, but also incorporates many elements of Java. The most important design goal of the C# language was, and remains, its platform independence. Historically closely linked to the .NET Framework, C# is consequently most widely used on Windows platforms. Projects such as Mono and Microsoft’s .NET Core enable cross-platform development, meaning that applications written in C# can now run equally well on other operating systems, such as Linux.
C# in practice
Our development team has integrated the Mono runtime into the Linux BSP of our sysWORXX CTR-700 edge controller. This makes it possible to run programmes written in C# directly on the CTR-700. The “Ctr700Drv” class library implemented by SYS TEC also allows the device’s inputs and outputs to be addressed directly from C#. This supports both polling queries and the triggering of events when an input value changes. Together with the very comprehensive .NET class library, this provides a highly capable framework for the cross-development of embedded applications.
We use Visual Studio as the development environment for C# programming. This user-friendly and powerful IDE is available free of charge in the form of the Community Edition for educational, evaluation and other non-commercial purposes. With the help ofthe “VSMonoDebugger”plug-in, compiled programmes can be deployed to the CTR-700 and executed directly from within Visual Studio. For troubleshooting, the usual debugging features such as breakpoints, single-step execution and the inspection of variables and data objects are available.
With the combination of Visual Studio and C#, cross-development for embedded systems such as our sysWORXX CTR-700 is just as convenient and straightforward as writing desktop and server applications. The comprehensive and powerful framework reduces both development time and the error rate.
Curious to find out how our sysWORXX CTR-700 is programmed in C#? You can find the programming example here .