User Tools

Site Tools


tools:logger_trace:start

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
tools:logger_trace:start [2018/08/22 11:56] – external edit 127.0.0.1tools:logger_trace:start [2026/04/13 12:17] (current) ursgraf
Line 2: Line 2:
 When working with realtime applications you have to be careful when logging. The formatting of any output into an output stream takes time and usually cannot be done with the full speed of the control system or the safety system. However, when debugging a intricate control algorithm it might be desirable to study various signal values together with their timestamps as they are calculated in the control system. \\ When working with realtime applications you have to be careful when logging. The formatting of any output into an output stream takes time and usually cannot be done with the full speed of the control system or the safety system. However, when debugging a intricate control algorithm it might be desirable to study various signal values together with their timestamps as they are calculated in the control system. \\
  
-For this purpose you can place [[eeros_architecture:control_system:available_blocks:trace|]] blocks and log any signal into its internal ring buffer. The following example can be found under ''examples/controlSystem/traceTest''. It has a simple control system with two trace blocks, each having a ring buffer lenght of 64.+For this purpose you can place [[eeros_architecture:control_system:available_blocks:trace|]] blocks and log any signal into its internal ring buffer.  
 + 
 +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/block/TraceTest.cpp|TraceTest.cpp]] 
 + 
 +It has a simple control system with two trace blocks, each having a ring buffer lenght of 64.
 <code cpp> <code cpp>
   class ControlSystem {   class ControlSystem {
Line 42: Line 46:
  
 ===== Concurrent Writing of Trace Data ===== ===== Concurrent Writing of Trace Data =====
-The example above shows how a trace buffer can be written to a file. This has to be done only after the executor stopped, because the writing usually takes a long time. If you wish to write a trace buffer to a file for further analysis while the application still runs, you can use a ''TraceWriter''. This will do the writing in a separate thread and hence does not block the safety system or control system, see ''examples/controlSystem/traceTest''. In this example the trace buffer gets written to a file every 30 seconds.+The example above shows how a trace buffer can be written to a file. This has to be done only after the executor stopped, because the writing usually takes a long time. If you wish to write a trace buffer to a file for further analysis while the application still runs, you can use a ''TraceWriter''. This will do the writing in a separate thread and hence does not block the safety system or control system, see ''examples/block/traceTest''. In this example the trace buffer gets written to a file every 30 seconds.
 <code cpp> <code cpp>
   TraceWriter<Vector3> tw(cs.trace2, "/tmp/ctrlData");   TraceWriter<Vector3> tw(cs.trace2, "/tmp/ctrlData");
tools/logger_trace/start.1534931784.txt.gz · Last modified: by 127.0.0.1