User Tools

Site Tools


getting_started:tutorials:system2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
getting_started:tutorials:system2 [2020/12/03 08:49] – [Example with a More Complex Safety System] ursgrafgetting_started:tutorials:system2 [2021/03/31 14:00] (current) ursgraf
Line 1: Line 1:
 ====== Example with a More Complex Safety System ====== ====== 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 [[getting_started:install_wrapper#simulator|]]. In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run +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 [[getting_started:install_wrapper#simulator|Simulator]].  
 + 
 +In the EEROS library you will find a directory with examples. For this example see [[https://github.com/eeros-project/eeros-framework/blob/master/examples/system/SystemTest2.cpp|SystemTest2.cpp]].  
 + 
 +Open a shell in the build directory of your EEROS library and run 
 <code> <code>
-$ sudo LD_LIBRARY_PATH=/home/you/work/compiled/install-x86/lib/ ./system/systemTest2 -c system/SystemTest2Config.json+$ sudo LD_LIBRARY_PATH=/home/you/work/compiled/install-x86/lib/ ./examples/system/systemTest2 -c examples/system/SystemTest2Config.json
 </code> </code>
 +
 +IMPORTANT You have to run a program using real time threads with root privileges and you have to set your library path so that the simulator library can be found, see [[getting_started:deploy:deploy_host|]].
  
 The example comprises a safety system with five different safety levels and six safety events.  The example comprises a safety system with five different safety levels and six safety events. 
-{{ :getting_started:tutorials:safetysystemtest1.png?300 |}}+{{ :getting_started:tutorials:systemtest2ss.png?400 |}}
 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 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: The following events are defined and used in the example:
Line 19: Line 25:
  
 The example shows a typical use of safety levels and safety events. The system works as follows: The example shows a typical use of safety levels and safety events. The system works as follows:
-  * 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.+  * 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. A periodic would usually be used for running a time domain in the control system. As we do not have such a control system here, we simply use the periodic to trigger safety events.
   * 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''   * 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.   * 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.
getting_started/tutorials/system2.1606981777.txt.gz · Last modified: 2020/12/03 08:49 by ursgraf