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
Next revisionBoth sides next revision
eeros_architecture:safety_system:properties [2017/02/27 15:19] – [Level Actions] grafeeros_architecture:safety_system:properties [2017/07/25 08:46] – [Safety Events] graf
Line 9: Line 9:
 Define critical output signals, get references to them from the HAL and assign them.  Define critical output signals, get references to them from the HAL and assign them. 
 <code c> <code c>
-  eeros::hal::SystemOutput<bool>* watchdog; +  eeros::hal::Output<bool>* watchdog; 
-  eeros::hal::SystemOutput<bool>* enable0;+  eeros::hal::Output<bool>* enable0;
  
   HAL& hal = HAL::instance();   HAL& hal = HAL::instance();
  
-  watchdog = hal.getLogicSystemOutput("watchdog"); +  watchdog = hal.getLogicOutput("watchdog"); 
-  enable0 = hal.getLogicSystemOutput("enable0");+  enable0 = hal.getLogicOutput("enable0");
   ...   ...
   criticalOutputs = {watchdog, enable0, ...};   criticalOutputs = {watchdog, enable0, ...};
Line 22: Line 22:
 Define critical input signals, get references to them from the HAL and assign them. Define critical input signals, get references to them from the HAL and assign them.
 <code c> <code c>
-  eeros::hal::SystemInput<double>* q0; +  eeros::hal::Input<double>* q0; 
-  eeros::hal::SystemInput<bool>* runButton;+  eeros::hal::Input<bool>* runButton;
      
-  q0 = hal.getRealSystemInput("q0"); +  q0 = hal.getScalableInput("q0"); 
-  limitSwitchQ0p = hal.getLogicSystemInput("runButton");+  limitSwitchQ0p = hal.getLogicInput("runButton");
   ...   ...
   criticalInputs = {q0, runButton, ...};   criticalInputs = {q0, runButton, ...};
Line 62: Line 62:
   addEventToLevelAndAbove(slPowerOn, slMoving, seDoEmergency, kPublicEvent);   addEventToLevelAndAbove(slPowerOn, slMoving, seDoEmergency, kPublicEvent);
 </code> </code>
 +Two more functions serve a similar purpose.
 +<code c>
 +  // Add events to all levels equal or smaller than srcLevel
 +  addEventToLevelAndBelow(srcLevel, destLevel, event, kPublicEvent);
 +</code>
 +
  
 ===== Input and Output Actions ===== ===== Input and Output Actions =====
Line 77: Line 83:
  
 === Counter === === Counter ===
-Each time that the safety system runs in a certain level a counter named ''nofActivations'' is incremented. Whenever the safety level due to an event this counter will be reset to 0. This allows for measuring the time the system will run in a given safety level. The following example  +Each time that the safety system runs in a certain level a counter named ''nofActivations'' is incremented. Whenever the safety level due to an event this counter will be reset to 0. This allows for measuring the time the system will run in a given safety level. The following example demonstrates this.  
 +<code cpp> 
 +  slRunning.setLevelAction([&](SafetyContext* privateContext) { 
 +    if (slRunning.getNofActivations() * period >= 60.0) 
 +      privateContext->triggerEvent(seStop); 
 +  }); 
 +</code> 
 +The system will stay for 60 seconds in safety level ''slRunning''. After this time has elapsed it will trigger a ''seStop'' event.
 ===== Entry Level ===== ===== Entry Level =====
 As a last point, you have to specify with which level the system has to start. As a last point, you have to specify with which level the system has to start.
eeros_architecture/safety_system/properties.txt · Last modified: 2024/06/10 09:45 by ursgraf