User Tools

Site Tools


tools:logger_cs:start

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
tools:logger_cs:start [2018/05/31 10:30] – [Log in the Same Task] graftools:logger_cs:start [2018/05/31 10:32] (current) graf
Line 14: Line 14:
 For more complete examples see ''examples/controlsystem/BlockTest2'' and ''examples/controlsystem/BlockTest3''. For more complete examples see ''examples/controlsystem/BlockTest2'' and ''examples/controlsystem/BlockTest3''.
  
 +===== Log in a Subsequent Task =====
 +One must keep in mind that the periodic task which runs the control system and the periodic task which does the logging are actually running in parallel. This might lead to complication as soon as more complex signals are involved. For this reason, it might be preferable to choose the following solution.
 +<code cpp>
 +  eeros::control::TimeDomain td("time domain CS", 0.001, true);  // time domain for the control system running with 1kHz
 +  eeros::task::Periodic perCS("periodic CS", 0.001, td);      // periodic task running the time domain
 +  executor.add(perCS);                           // add the control system task to the executor.
 +  perCS.after.push_back(perLog);                 // add the logging task to the task list running after the control system task
 +</code>
 +Now, the logging will be done after the control system task has finished running.
  
 ===== Log in the Task of the Time Domain ===== ===== Log in the Task of the Time Domain =====
Line 33: Line 42:
 Please note that you usually want the logging to happen at a much smaller frequency than the time domain. For this, you have to reduce this frequency as shown in the example above. Please note that you usually want the logging to happen at a much smaller frequency than the time domain. For this, you have to reduce this frequency as shown in the example above.
  
-===== Log in a Subsequent Task ===== +
-One must keep in mind that the periodic task which runs the control system and the periodic task which does the logging are actually running in parallel. This might lead to complication as soon as more complex signals are involved. For this reason, it might be preferable to choose the following solution. +
-<code cpp> +
-  eeros::control::TimeDomain td("time domain CS", 0.001, true);  // time domain for the control system running with 1kHz +
-  eeros::task::Periodic perCS("periodic CS", 0.001, td);      // periodic task running the time domain +
-  executor.add(perCS);                           // add the control system task to the executor. +
-  perCS.after.push_back(perLog);                 // add the logging task to the task list running after the control system task +
-</code> +
-Now, the logging will be done after the control system task has finished running.+
  
tools/logger_cs/start.1527755410.txt.gz · Last modified: 2018/05/31 10:30 by graf