User Tools

Site Tools


eeros_architecture:safety_system:io_actions

Differences

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

Link to this comparison view

Next revision
Previous revision
eeros_architecture:safety_system:io_actions [2015/03/30 15:32] – external edit 127.0.0.1eeros_architecture:safety_system:io_actions [2021/07/08 20:09] (current) – [range(...)] ursgraf
Line 1: Line 1:
 ====== Input / Output Actions ====== ====== Input / Output Actions ======
-For each safety level all the critical inputs must be checked and all the critical outputs must be driven with a signal.+For each safety level all the critical inputs must be checked and all the critical outputs must be driven with a signal. 
  
 ===== Input Action ==== ===== Input Action ====
Line 7: Line 7:
 ==== ignore(...) ==== ==== ignore(...) ====
 <code c> <code c>
-  ignore(eeros::hal::SystemInput<T>* input);+  ignore(eeros::hal::Input<T>* input);
 </code> </code>
-The //ignore// action simply ignores the given input. There is no action to be taken by the safety system. As an example, the level //off// ignores the state on the signal //emergencyStop//.+The //ignore// action simply ignores the given input. There is no action to be taken by the safety system. As an example, the level //slOff// ignores the state on the signal //emergencyStop//.
 <code c> <code c>
-  level(off).setInputActions({..., ignore(emergencyStop), ...}); +  slOff.setInputActions({..., ignore(emergencyStop), ...});  
 +</code> 
 +Instead of passing a vector of actions you could also add the necessary actions one by one: 
 +<code c> 
 +  slOff.setInputAction(ignore(emergencyStop)); 
 </code> </code>
  
 ==== check(...) ==== ==== check(...) ====
 <code c> <code c>
-  check(eeros::hal::SystemInput<T>* input, T value, uint32_t event);+  check(eeros::hal::Input<T>* input, T value, SafetyEvent& event);
 </code> </code>
 The //check// action compares the value of the parameter //value// with the value of the system input. If the values are not the same an event is fired. The example below shows how a limit switch is checked. If the switch is //true// a //doEmergency// event is fired, which leads to a change of the safety level. The //check// action compares the value of the parameter //value// with the value of the system input. If the values are not the same an event is fired. The example below shows how a limit switch is checked. If the switch is //true// a //doEmergency// event is fired, which leads to a change of the safety level.
 <code c> <code c>
-  level(moving).setInputActions({..., check(limitSwitchQ0p, false, doEmergency), ...});+  slMoving.setInputActions({..., check(slLimitSwitchQ0p, false, doEmergency), ...});
 </code> </code>
  
 ==== range(...) ==== ==== range(...) ====
 <code c> <code c>
-  range(eeros::hal::SystemInput<T>* input, T min, T max, uint32_t event);+  range(eeros::hal::Input<T>* input, T min, T max, SafetyEvent event, bool offRange = false);
 </code> </code>
-The //range// action checks if the value of the input is in the range of min to max, and if this is not the case, an event is fired.+The //range// action checks if the value of the input is in the range of min to max, and if this is not the case, an event is fired. If the parameter ''offRange'' is set to true, the //range// action checks if the value is lower then min or higher than max
  
-In the following example the //range// action tests whether the value of //q0// is in the interval from 0.0 to 6.283. If not, the event //doMotionStopping// is fired, which causes a transition to the level //motionStopping//.+In the following example the //range// action tests whether the value of //q0// is in the interval from 0.0 to 6.283. If not, the event //doMotionStopping// is fired, which causes a transition to the level //slMotionStopping//.
 <code c> <code c>
-  level(moving).setInputActions({..., range(q0, 0.0, 6.283, doMotionStopping), ...});+  slMoving.setInputActions({..., range(q0, 0.0, 6.283, doMotionStopping), ...});
 </code> </code>
  
Line 39: Line 43:
 ==== set(...) ==== ==== set(...) ====
 <code c> <code c>
-  set(eeros::hal::SystemOutput<T>* output, T value);+  set(eeros::hal::Output<T>* output, T value);
 </code> </code>
 The //set// action sets an output to a certain value, e.g.: The //set// action sets an output to a certain value, e.g.:
 <code c> <code c>
-  level(off).setOutputActions({..., set(enable0, false), ...});+  slOff.setOutputActions({..., set(enable0, false), ...});
 </code> </code>
  
 ==== leave(...) ==== ==== leave(...) ====
 <code c> <code c>
-  leave(eeros::hal::SystemOutput<T>* output);+  leave(eeros::hal::Output<T>* output);
 </code> </code>
 The //leave// action does not change the current state or value of an output. This is particularly helpful if a certain safety level can be reached from various other levels with outputs set in those levels, and the current level does not want to change a certain output. The //leave// action does not change the current state or value of an output. This is particularly helpful if a certain safety level can be reached from various other levels with outputs set in those levels, and the current level does not want to change a certain output.
 <code c> <code c>
-  level(motionStopped).setOutputActions({..., leave(brake0), ...});+  slMotionStopped.setOutputActions({..., leave(brake0), ...});
 </code> </code>
  
 ==== toggle(...) ==== ==== toggle(...) ====
 <code c> <code c>
-  toggle(eeros::hal::SystemOutput<T>* output);+  toggle(eeros::hal::Output<T>* output);
 </code> </code>
 The //toggle// action changes thew current state each time the safety system runs. Please keep in mind that the safety system runs with the highest priority and highest frequency of the whole system. //toggle// is generally used to deliver a watchdog signal. The //toggle// action changes thew current state each time the safety system runs. Please keep in mind that the safety system runs with the highest priority and highest frequency of the whole system. //toggle// is generally used to deliver a watchdog signal.
 <code c> <code c>
-  level(running).setOutputActions({..., toggle(watchdog), ...});+  slRunning.setOutputActions({..., toggle(watchdog), ...});
 </code> </code>
eeros_architecture/safety_system/io_actions.1427722360.txt.gz · Last modified: 2016/11/06 08:12 (external edit)