User Tools

Site Tools


eeros_architecture:safety_system:properties

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
eeros_architecture:safety_system:properties [2024/06/10 09:45] – [Critical Inputs and Outputs] ursgrafeeros_architecture:safety_system:properties [2025/01/31 11:53] (current) – [Level Actions] ursgraf
Line 30: Line 30:
   criticalInputs = {q0, runButton, ...};   criticalInputs = {q0, runButton, ...};
 </code> </code>
-See [[eeros_architecture:safety_system:io_actions|]] +See [[eeros_architecture:safety_system:io_actions|]] how to handle the critical inputs and outputs.
 ===== Safety Levels ===== ===== Safety Levels =====
 Define safety levels. Each level has a unique number and a description. After this the levels have to be added. The order of adding the levels is highly important and determines their logical ordering. Add the lowest safety level first. If you forget to add some levels the safety system will not check its critical inputs and will therefore not run correctly! Define safety levels. Each level has a unique number and a description. After this the levels have to be added. The order of adding the levels is highly important and determines their logical ordering. Add the lowest safety level first. If you forget to add some levels the safety system will not check its critical inputs and will therefore not run correctly!
Line 82: Line 82:
 </code> </code>
 The method //setLevelAction// accepts a function, which is used solely here and can be defined without giving it a name. In this example the function is a so called lambda function meaning that it can be passed as a parameter without prior declaration. It must take a parameter itself of type ''SafetyContext''. This ensures that the level function can trigger a private event. The method //setLevelAction// accepts a function, which is used solely here and can be defined without giving it a name. In this example the function is a so called lambda function meaning that it can be passed as a parameter without prior declaration. It must take a parameter itself of type ''SafetyContext''. This ensures that the level function can trigger a private event.
 +
 +=== Entry and Exit Actions ===
 +You also have the possibility to define an action which is executed when a safety level is entered. That means when the safety system switches to this level.
 +<code cpp>
 +  slOff.setEntryAction([this](SafetyContext* privateContext) {
 +    // do anything
 +  });
 +</code>
 +
 +Further, you can define an action which is executed when a safety level is left. That means when the safety system switches from this level to another level.
 +<code cpp>
 +  slOff.setExitAction([this](SafetyContext* privateContext) {
 +    // do anything
 +  });
 +</code>
  
 === Counter === === Counter ===
eeros_architecture/safety_system/properties.1718005502.txt.gz · Last modified: 2024/06/10 09:45 by ursgraf