getting_started:tutorials:tasking1
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
getting_started:tutorials:tasking1 [2020/11/26 15:53] – created ursgraf | getting_started:tutorials:tasking1 [2021/03/31 17:27] (current) – [Main Task with Several Harmonic Tasks] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Harmonic Tasks ====== | ====== Harmonic Tasks ====== | ||
- | The [[eeros_architecture: | + | The [[eeros_architecture: |
+ | |||
+ | ===== Main task with one Harmonic ===== | ||
+ | |||
+ | In the EEROS library you will find a directory with examples. For this example see [[https:// | ||
+ | |||
+ | Open a shell in the build directory of your EEROS library and run | ||
+ | < | ||
+ | $ sudo ./ | ||
+ | </ | ||
- | In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run '' | ||
This examples does: | This examples does: | ||
- | * Creates a main task //ss// with an execution period of five milliseconds. The task itself is defined of type '' | + | * Creates a main task //mainTask// with an execution period of 10ms. The task itself is defined of type '' |
- | * Creates a time domain //t1// with a period of five milliseconds. | + | * Creates a time domain //harmonicTask// with a period of 2s. |
- | Both harmonic tasks have a periodic counter which measure its periods and run times. Once every 1000th | + | Both harmonic tasks have a periodic counter which measure its periods and run times. Once every 200th run the results |
Additionally both harmonics have a default monitor function added. This monitor function logs a warning if the measured period differs more than 5%. Depending on your hardware platform and realtime support of your operating system you might get no warnings, several or many warnings. | Additionally both harmonics have a default monitor function added. This monitor function logs a warning if the measured period differs more than 5%. Depending on your hardware platform and realtime support of your operating system you might get no warnings, several or many warnings. | ||
+ | |||
+ | ===== Harmonic with no Main Task ===== | ||
+ | |||
+ | If you don't specify a main task, the executor will create a default main task, which does nothing, see [[https:// | ||
+ | |||
+ | Run | ||
+ | < | ||
+ | $ sudo ./ | ||
+ | </ | ||
+ | |||
+ | This examples does: | ||
+ | * Creates a time domain // | ||
+ | |||
+ | The tasks has a periodic counter which measure its periods and run times. The harmonic task logs every time it runs. The results are printed in units of seconds. | ||
+ | |||
+ | ===== Main Task with Several Harmonic Tasks ===== | ||
+ | An example with many tasks can be found under [[https:// | ||
+ | |||
+ | Run | ||
+ | < | ||
+ | $ sudo ./ | ||
+ | </ | ||
+ | This examples does: | ||
+ | * Creates a main task // | ||
+ | * Creates a periodic //t1// with a period of one second. Its run method prints out some messages with a short delay in between. //t1// runs concurrently to // | ||
+ | * Creates a periodic //t2// with a period of two seconds. Its run method prints out some messages with a short delay in between. //t2// runs after //t1// has finished. | ||
+ | * Creates a periodic //t4// with a period of four seconds. Its run method prints out some messages with a short delay in between. //t4// runs after //t2// has finished. | ||
+ | * Creates a periodic //t3// with a period of five seconds. Its run method prints out some messages with a short delay in between. //t3// runs after //t1// has finished but concurrently to //t2//. | ||
+ | * Creates a periodic //t5// with a period of three seconds. Its run method prints out some messages with a short delay in between. //t5// runs concurrently to //t1//. | ||
+ | |||
+ | All of the harmonic tasks have a periodic counter which measure its periods and run times. Once every 10th run the results are logged. The results are printed in milliseconds. |
getting_started/tutorials/tasking1.1606402409.txt.gz · Last modified: 2020/11/26 15:53 by ursgraf