Our work with programming languages
Our second "How we work with" post this time is about C#. C what? Yes, for laymen, the modern, object-oriented and type-safe programming language comes across as a bit spartan in terms of sound. But for our development team, we can't do without it, because C# has become widespread in recent years, especially in the IoT environment. In the meantime, numerous, often open source software packages exist for the preparation of data as well as communication stacks for connecting edge controllers to higher-level cloud systems.
The first version was released in the early 2000s. Its roots are C and C++, but many elements of Java can also be found in it. The most important design goal of the C# language was and is its platform independence. From the history closely with the .NET framework, C# is therefore also on Windows platforms most widespread. Projects such as Mono or also .NET Core from Microsoft enable cross-development, so that applications written in C# can now also be run equivalently on other operating systems such as Linux.
C# in practice
Our development team has integrated the Mono runtime into the Linux BSP of our edge controller sysWORXX CTR-700. This allows programs written in C# to be executed directly on the CTR-700. The class library "Ctr700Drv" implemented by SYS TEC also allows direct addressing of the inputs and outputs of the device from C#. Polling queries are supported as well as triggering events when an input value changes. Together with the very extensive .NET class library, this provides a very powerful framework for the cross-development of embedded applications.
We rely on Visual Studio as the development environment for C# programming. This comfortable and powerful IDE is available free of charge in the form of the Community Edition for training, evaluation and other non-commercial purposes. With the help of the "VSMonoDebugger" plug-in, the compiled programs can be deployed and executed directly from Visual Studio to the CTR-700. As usual, debugging functionalities such as breakpoints, single step and the inspection of variables and data objects are available for debugging.
With the duo of Visual Studio and C#, cross-development for embedded systems like our sysWORXX CTR-700 is as comfortable and easy as writing desktop and server applications. The comprehensive and powerful framework reduces development time and error rates in equal measure.
Curious how to program our sysWORXX CTR-700 in C#? Here you can find the programming example.