User Tools

Site Tools


eeros_architecture:safety_system:hal

Differences

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

Link to this comparison view

eeros_architecture:safety_system:hal [2015/03/30 15:17] – external edit 127.0.0.1eeros_architecture:safety_system:hal [2017/04/15 20:35] (current) – removed graf
Line 1: Line 1:
-====== Hardware Abstraction Layer (HAL) ====== 
-<box 100% green> 
-The safety system and the HAL are strongly coupled together. Make sure that your inputs and outputs in the HAL are all handled by your safety system. 
-</box> 
- 
-===== Getting the HAL ==== 
-Make an instance of the HAL with the following line: 
-<code c> 
-  HAL& hal = HAL::instance(); 
-</code> 
- 
-===== Inputs and Outputs ===== 
-All input and output should be observed by the safety system. The safety system alone decides if an input or output can be applied or not.  
- 
-=== Define inputs and outputs === 
-To access the digital I/O hardware within the comedi framework, you have to define the inputs and outputs and add them to the HAL. 
-<code c> 
-  ComediDevice* comedi0 = new ComediDevice("/dev/comedi0"); 
-  ComediDevice* comedi1 = new ComediDevice("/dev/comedi1"); 
-   
-  hal.addSystemInput(new ComediFqd("q0", comedi0, 11, 8, 10, 9, 6.28318530718 / (4 * 4096.0), 0, 0));   
-  hal.addSystemOutput(new ComediDigOut("watchdog", comedi1, 2, 22)); 
-  hal.addSystemOutput(new ComediDigOut("enable0", comedi0, 2, 24)); 
-  hal.addSystemOutput(new ComediDigOut("brake0", comedi1, 2, 4, true)); 
-</code> 
- 
-  * **Note:** The class //SystemInput<T>// and //SystemOutput<T>// are template classes. If you define an input or an output as a boolean or  a double, it should also be a boolean (on or off) or a double (e.g. voltage) on the hardware.  
  
eeros_architecture/safety_system/hal.1427721453.txt.gz · Last modified: 2015/03/30 15:17 (external edit)