Skip to main content

Attribute: sil2context

This attribute is required for non-safe IO driver libraries to be able to execute the initialization of the IO driver instance in the safe context.

Syntax:

{attribute 'sil2context':='safe'}

Insert location: First line above the declaration part of a library POU

The classification with safe causes the part of the POU marked with this attribute to be executed in the safe context.

This is required in a CODESYS Safety SIL2 system, for example, for the initialization of certain non-safe IO driver libraries. The marked part of the POU is executed in the safe context and can therefore have write access to the safe IO configuration.

However, code which is called with this attribute and is used in a CODESYS Safety SIL2 system has to be developed in a safety-oriented manner and also has to fulfill the following criteria:

  • Determination of cyclomatic complexity according to McCabe. The determined value has to be less than 5.

  • Fewer than 3 functions are called. These functions are located in libraries which have the "SIL2" property set to TRUE or fulfill the same criteria as the tested functions.

  • Verification of compliance with the rules of [H2] User Manual for Extended Level