Example with a More Complex Safety System

This example shows how to use the safety system. It further uses two inputs and two outputs. For this reason we will use the simulator again, see Simulator.

In the EEROS library you will find a directory with examples. For this example see SystemTest2.cpp.

Open a shell in the build directory of your EEROS library and run

$ ./examples/system/systemTest2 -c examples/system/SystemTest2Config.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
seInitializingDoneinitialization doneslIinitializingpublic eventtriggered by a periodic 5 seconds after the executor started
seStartRunningstart runningslInitializedprivate eventtriggered by checking the critical input, this could be an enable button
seShutDownstart shutting downslRunning, slInitialized, slIinitializingpublic eventtriggered by pressing Ctrl-C
seStopRunningstop runningslRunningprivate eventtriggered by checking the critical input, this could be an enable button
seSwitchingOffswitching offslShuttingDownprivate eventtriggered by a level action

The example shows a typical use of safety levels and safety events. The system works as follows:

How to shut down

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