User Tools

Site Tools


getting_started:tutorials:tasking1

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
Last revisionBoth sides next revision
getting_started:tutorials:tasking1 [2020/11/26 16:06] ursgrafgetting_started:tutorials:tasking1 [2021/03/31 17:26] – [Harmonic with no Main Task] ursgraf
Line 4: Line 4:
 ===== Main task with one Harmonic ===== ===== Main task with one Harmonic =====
  
-In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run +In the EEROS library you will find a directory with examples. For this example see [[https://github.com/eeros-project/eeros-framework/blob/master/examples/task/PeriodicExample1.cpp|PeriodicExample1.cpp]].  
 + 
 +Open a shell in the build directory of your EEROS library and run 
 <code> <code>
 $ sudo ./examples/task/periodicExample1 $ sudo ./examples/task/periodicExample1
Line 18: Line 20:
 ===== Harmonic with no Main Task ===== ===== Harmonic with no Main Task =====
  
-If you don't specify a main task, the executor will create a default main task, which does nothing.+If you don't specify a main task, the executor will create a default main task, which does nothing, see [[https://github.com/eeros-project/eeros-framework/blob/master/examples/task/PeriodicExample2.cpp|PeriodicExample2.cpp]].  
 Run  Run 
 <code> <code>
Line 29: Line 32:
 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. 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.
  
-====== Control System with Several Time Domains ====== +===== Main Task with Several Harmonic Tasks ===== 
-In the EEROS library you will find a directory with examplesOpen a shell in the build directory of your EEROS library and run ''examples/controlsystem/PeriodicExample2''.+Run 
 +<code> 
 +$ sudo ./examples/task/periodicExample3 
 +</code>
 This examples does: This examples does:
-  * Creates a main task //ss// with an execution period of one second. The task itself is defined of type ''Lambda'' with a run method given by a lambda function. It prints out two messages with a short delay in between. +  * Creates a main task //mainTask// with an execution period of one second. The task itself is defined of type ''Lambda'' with a run method given by a lambda function. It prints out two messages with a short delay in between. 
-  * Creates a periodic //task1// with a period of one second. Its run method prints out some messages with a short delay in between. //task1// runs concurrently to //ss//.+  * 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 //mainTask//.
   * 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 //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 //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.
getting_started/tutorials/tasking1.txt · Last modified: 2021/03/31 17:27 by ursgraf