User Tools

Site Tools


getting_started:tutorials:safetysystem

This is an old revision of the document!


Create a Safety System

In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run examples/safety/SafetySystemTest1. This example shows how to use the safety system. It further uses two inputs and two outputs. For this reason you will need to install a simple simulator, see simulator. Please remember to set the LD_LIBRARY_PATH as described there. The following command will run the example

$ ./safetySystemTest1 -c SafetySystemTest1Config.json

The example comprises a safety system with five different safety levels and six safety events. The levels and events are defined in the safety properties. The properties further include one critical input in1 and one critical output out1. In order to test and drive them, the configuration file specifies one more input inTest and one more output outTest. The following events are defined and used in the example:

namedescriptionregistered for safety leveltypewhen triggered
e1start initializingslOffpublic eventtriggered by the main program immediately after initialization of the safety system
e2initialization doneslIinitializingpublic eventtriggered by a periodic 5 seconds after the executor started
e3start runningslInitializedprivate eventtriggered by checking the critical input, this could be an enable button
e4start shutting downslRunning, slInitialized, slIinitializingpublic eventtriggered by pressing Ctrl-C
e5stop runningslRunningprivate eventtriggered by checking the critical input, this could be an enable button
e6switching offslShuttingDownprivate eventtriggered by a level action

The example shows a typical use of safety levels and safety events. In order to demonstrate how the system works in a very limited example the following assumptions have been taken:

  • The end of the initialization phase is triggered by a periodic which is run by the executor. In general this would be signalled by the sequencer after a initializing sequence has finished or by the control system as soon as a certain condition arises.
  • To start and stop running might be triggered by pressing or releasing a button connected to the critical input. In our simple example we do not have real hardware. We therefore use the simulator which connects the output named outTest with the critical input. After 5 seconds the state on this output pin changes alternately, which causes the safety level to alternate between slRunning and slInitialized.
  • When pressing Ctrl-C the system falls into level slShuttingDown. A level action for this safety level causes the system to automatically switch to level slOff which then terminates the program. Here again, this would be signalled by the sequencer after a shutting down sequence has finished or by the control system as soon as a certain safe condition is reached.

How to shut down

The example demonstrates how the system should be stopped in a well controlled manner, see Shutting down a System Properly.

getting_started/tutorials/safetysystem.1581428160.txt.gz · Last modified: 2020/02/11 14:36 by graf