User Tools

Site Tools


getting_started:tutorials:sequencer3

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
getting_started:tutorials:sequencer3 [2020/12/03 19:27] – [Subsequence Has Timeout Monitor] ursgrafgetting_started:tutorials:sequencer3 [2021/03/31 15:39] (current) – [Subsequence Has Timeout Monitor With Restart] ursgraf
Line 4: Line 4:
 ===== Main Sequence Calls Nonblocking Sequence ===== ===== Main Sequence Calls Nonblocking Sequence =====
  
-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/sequencer/SequencerTest30.cpp|SequencerTest30.cpp]]. 
 + 
 +Open a shell in the build directory of your EEROS library and run 
 <code> <code>
 $ ./examples/sequencer/sequencerTest30 $ ./examples/sequencer/sequencerTest30
Line 29: Line 31:
 ===== Main Sequence Has Timeout Monitor ===== ===== Main Sequence Has Timeout Monitor =====
  
-next example demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is called. Run +The next example is [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest31.cpp|SequencerTest31.cpp]]. It demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is called. Run 
 <code> <code>
 $ examples/sequencer/sequencerTest31 $ examples/sequencer/sequencerTest31
Line 41: Line 43:
 ===== Main Sequence Has Timeout Monitor With Resume ===== ===== Main Sequence Has Timeout Monitor With Resume =====
  
-next example demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is called. Run +The next example is [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest32.cpp|SequencerTest32.cpp]]. It demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is called. Run 
 <code> <code>
 $ examples/sequencer/sequencerTest32 $ examples/sequencer/sequencerTest32
Line 53: Line 55:
 ===== Main Sequence Has Timeout Monitor With Restart ===== ===== Main Sequence Has Timeout Monitor With Restart =====
  
-next example demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is called. Run +The next example is [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest33.cpp|SequencerTest33.cpp]]. It demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is called. Run 
 <code> <code>
 $ examples/sequencer/sequencerTest33 $ examples/sequencer/sequencerTest33
Line 65: Line 67:
 ===== Subsequence Has Timeout Monitor ===== ===== Subsequence Has Timeout Monitor =====
  
-next example demonstrates what happens if the subsequence is interrupted by a monitor while being called from the main sequence. Run +The next example is [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest34.cpp|SequencerTest34.cpp]]. It demonstrates what happens if the subsequence is interrupted by a monitor while being called from the main sequence. Run 
 <code> <code>
 $ examples/sequencer/sequencerTest34 $ examples/sequencer/sequencerTest34
Line 77: Line 79:
 ===== Subsequence Has Timeout Monitor With Resume ===== ===== Subsequence Has Timeout Monitor With Resume =====
  
-next example demonstrates what happens if the subsequence is interrupted by a monitor while being called from the main sequence. Run +The next example is [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest35.cpp|SequencerTest35.cpp]]. It demonstrates what happens if the subsequence is interrupted by a monitor while being called from the main sequence. Run 
 <code> <code>
 $ examples/sequencer/sequencerTest35 $ examples/sequencer/sequencerTest35
Line 89: Line 91:
 ===== Subsequence Has Timeout Monitor With Restart ===== ===== Subsequence Has Timeout Monitor With Restart =====
  
-next example demonstrates what happens if the subsequence is interrupted by a monitor while being called from the main sequence. Run +The next example is [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest36.cpp|SequencerTest36.cpp]]. It demonstrates what happens if the subsequence is interrupted by a monitor while being called from the main sequence. Run 
 <code> <code>
 $ examples/sequencer/sequencerTest36 $ examples/sequencer/sequencerTest36
Line 99: Line 101:
 \\ \\
  
-====== Example with several Monitors ====== 
- 
-it will run in parallel. ''Step A'' and ''Step B'' will be called in parallel, though their waiting time is different. ''Sequence B'' has its timeout condition set to 2.5s. This causes its associated timeout monitor to interrupt the sequence and jump to an exception sequence. In the meantime the main sequence continues unhindered. After the exception sequence ''Sequence B'' is aborted, because its monitor behavior is set to ''abort''. The program stops after the main sequences has finished running its steps. 
- 
-[{{ .:sequencerexample2.png?550 | //Flow of SequencerTest2// }}] 
- 
-The main sequences starts with three ''Step A'' after which the ''Sequence B'' is called. ''Sequence B'' is nonblocking, that means, it will run in parallel. ''Step A'' and ''Step B'' will be called in parallel, though their waiting time is different. ''Sequence B'' has its timeout condition set to 2.5s. This causes its associated timeout monitor to interrupt the sequence and jump to an exception sequence. In the meantime the main sequence continues unhindered. After the exception sequence ''Sequence B'' is aborted, because its monitor behavior is set to ''abort''. The program stops after the main sequences has finished running its steps. 
- 
- 
-===== Sequence with two Monitors ===== 
- 
-In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run ''examples/sequencer/SequencerTest4'' 
- 
-[{{ .:sequencerexample4.png?450 | //Flow of SequencerTest4// }}] 
- 
-This example shows a sequence with two associated monitors. The ''Main Sequence'' tries to run several steps called ''Step A''. After each step counter is incremented. A monitor checks for this count to reach a given level (''MyMonitor''). As soon as this happens an exception sequence is started. After termination of the exception sequence the original sequence resumes because the monitor property is set to ''resume''. The ''Main Sequence'' continues and is soon interrupted by its timeout monitor because its timeout limit has expired. The timeout monitor has no exception sequence assigned to it and immediately aborts the ''Main Sequence'' and with it the application because its monitor property is set to //abort//. 
- 
-==== Altering the Monitor Behavior ==== 
-Change the behavior of ''My Monitor'' to ''restart'', recompile, and observe what happens. After the exception sequence the ''Main Sequence'' restarts. This causes the counter to start with 0 and the timeout will be reset as well. Hence, the timeout monitor will never fire.\\ 
-If you change the behavior of the timeout monitor to ''restart'', things get more complicated. ''MyMonitor'' will fire, the exception sequence will run, the ''Main Sequence'' will resume, and the timeout monitor will fire. This monitor has no exception sequence but will simply restart the whole procedure.  
- 
-===== Monitor Checking two Sequences ===== 
- 
-A next example demonstrates what happens if the same monitor checks two sequences. It can be found in ''examples/sequencer/SequencerTest5'' 
- 
-[{{ .:sequencerexample5.png?550 | //Flow of SequencerTest5// }}] 
- 
-The ''Main Sequence'' and ''Sequence B'' have the same monitor. The ''Main Sequence'' tries to run several steps called ''Step A''. After each step a counter is incremented. A monitor checks for this count to reach a given level (''MyMonitor''). The same monitor also checks ''Sequence B'', which runs in parallel. As soon as the monitor condition is met, both sequences will abort because the monitor property is set to //abort// 
  
getting_started/tutorials/sequencer3.1607020057.txt.gz · Last modified: 2020/12/03 19:27 by ursgraf