The eCLR programming system

The eCLR programming system for C# programming consists of the three main components:

  • CIL compiler 
  • embedded Common Language Runtime (= eCLR)
  • eCLR core libraries

CIL compiler

The CIL compiler is responsible for translating the CIL code. The eCLR CIL compiler is an ahead-of-time compiler. This means that the CIL code has been fully translated for the platform before being transferred to the controller (and more importantly, before execution).

This fulfills an essential requirement for the real-time capability of the system. The functional scope of the CIL compiler enables the use of many C# language elements and namespaces of the base class library, which are listed in Section C# language functions.

eCLR core libraries

The core libraries consist of the eCLR base class libraries in versions 3.2 and 3.3

  • mscorlib.dll
  • system.dll
  • system.core.dll

and some eCLR-specific libraries:

  • eclrlib.dll
  • pcoslib.dll
  • IecEngineering.dll

 

The eCLR base class libraries implement real-time capable, adapted parts of the .Net™ framework class libraries.

eCLR Programming Reference

After installing the C# In every eCLR project in Visual Studio® you find the eCLR Programming Reference online help. With that eCLR-Programming-Reference.chm file, the eCLR base class libraries' description is at hand while programming. 

Known issues and constraints of the current version are linked on the start page of this online help file. 

In addition, a Readme.txt file in Visual Studio® contains a "cheat sheet" for common procedures in programming, along with a short overview how the IEC 61131-3 data types are matching to .Net™ and C# data types.

Here you find the eCLR programming reference:Show where to find the files in Visual Studio®

In Visual Studio, open your C# project and expand the EclrFirmwareLibrary branch in the Solution Explorer in the upper right corner of the screen.

PLCnext_VS_SolutionExplorer_CHM_Readme.PNG

If you don't want to work with the Visual Studio® Extension you can download the eCLR-Programming-Reference.chm file separately. 

Note: This reference is downwards compatible to former eCLR versions. Make sure to come back and update the eCLR-Programming-Reference.chm over time. 

eCLR runtime

The eCLR runtime executes the compiled CIL code on the controller. The runtime is responsible for object and memory management, metadata processing (e.g., for debugging), as well as for the transition of managed API calls to native implementation specific to the operating system.

 

 

 


•  Web browser recommendation: Chrome/Edge 88 or newer, Firefox ESR 90 or neweror Safari • 
• Published/reviewed: 2022-09-14 • Revision 046 •