The eCLR programming system

The eCLR programming system consists of the three main components:

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 (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 eCLR base class libraries, such as

  • mscorlib.dll
  • System.dll
  • System.Core.dll
  • etc...

and some eCLR-specific libraries:

  • eclrlib.dll
  • pcoslib.dll

 

The eCLR base class libraries implement the .NET Framework class libraries.

In every eCLR project in Visual Studio you find the eCLRProgramming Reference online help.

For the PLCnext Technology Runtime System 2019.0 LTS and later, the current eCLR programming reference version is 3.2 
Here you find the eCLR programming reference:(click to show where to find that)

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

In the 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, the Readme.txt file 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.

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. An overview of the eCLR runtime is available as a product data sheet on the Phoenix Contact website.