getting_started:tutorials:hal0
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
getting_started:tutorials:hal0 [2017/04/27 15:21] – graf | getting_started:tutorials:hal0 [2024/12/01 12:01] (current) – [Accessing Output Signals Directly] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using the HAL with the Simulator ====== | ====== Using the HAL with the 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 '' | + | The [[eeros_architecture: |
+ | |||
+ | In the EEROS library you will find a directory with examples. | ||
+ | |||
+ | Open a shell in the build directory of your EEROS library and run | ||
< | < | ||
$ ./halTest1 -c HalTest1Config.json | $ ./halTest1 -c HalTest1Config.json | ||
</ | </ | ||
- | This examples | + | This examples |
- | * Creates | + | [{{ : |
- | * Creates a time domain //t1// with a period of five milliseconds. | + | The dashed lines denote the feedback |
+ | The main sequence alters the values on digital and analog outputs periodically. A separate periodic | ||
+ | * The state on the digital output 0 is reflected by the simultor to the digital input 0. The control system connects this input to the digital output 1, which in turn is reflected by the simulator to digital input 1. However, the second reflection | ||
+ | * A constant value is output to analog output 0 and 2. These values change every 10 seconds. Both are reflected onto analog inputs 0 and 2, respectively. | ||
- | Both harmonic tasks have a periodic counter which measure its periods and run times. Once every 1000th run the results are logged. The results are printed | + | ===== Accessing Output Signals Directly ===== |
- | Additionally both harmonics | + | A peripheral output block delivers |
+ | |||
+ | Alternatively the signal | ||
+ | <code cpp> | ||
+ | auto digOut = hal.getLogicOutput(" | ||
+ | </ | ||
+ | The signal value can then be logged with | ||
+ | block with | ||
+ | <code cpp> | ||
+ | log.info() << digOut-> | ||
+ | </ | ||
+ | You have to make sure to access the output with non-exclusive rights, because the control system already has a handle to it, see line 25 in '' |
getting_started/tutorials/hal0.1493299265.txt.gz · Last modified: 2017/04/27 15:21 (external edit)