Supported platforms: CODESYS 3.5, CODESYS 3.5 SAFETY

 

How to use safety libraries

This section describes basic operation of safety libraries.

 

Each safety library has its own set of error statuses defined in public global status structure named Status.

 

Event code structure and enumerations are common to all safety libraries. They are defined in DiagnosticInterface library.

 

 

All safety POUs must have an event code pointer set. See also How to use event code system.

 

Safety libraries can be used also in non-safety code.

In non-safety related code the POU background is not yellow.

 

 

Initialization method

Safety library function blocks implement an initialization method to set all constant parameters for function blocks. This reduces the amount of inputs at program cycle calls.

The initialization method checks limit and calibration parameters for consistency, and that pointers are not null (i.e. uninitialized).

The function block outputs remain unchanged until the i_Enable input is set to TRUE.

 

Common activity diagram

The following image shows the basic operation principle of a safety library function block.

 

 

Using POU parameters

The following image is an example of a safety library function block's main interface.

Init method is not shown in the image.

 

i_Enable input

The i_Enable input has similar functionality in all function blocks. When it is FALSE, all SAFE variable type outputs are set to the given safe value/state. For function block instances, the safe value is given in the Init method. On the rising edge of i_Enable, all error diagnostic is reset.

 

See library documentation for more details.  

See also