User Tools

Site Tools


getting_started:tutorials:sequencer2

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:sequencer2 [2020/12/03 17:25] – [Restarting Sequence A] ursgrafgetting_started:tutorials:sequencer2 [2021/03/31 15:33] (current) – [Subsequence Has Timeout Monitor with Restart] ursgraf
Line 1: Line 1:
 ====== Example with Blocking Sequence ====== ====== Example with Blocking Sequence ======
 The following example all have a main sequence which calls a few steps and a another sequence. This second sequence is a blocking sequence. That means that the main sequence pauses while the second sequence runs. A timeout monitor either supervises the main sequence or the second sequence. The following example all have a main sequence which calls a few steps and a another sequence. This second sequence is a blocking sequence. That means that the main sequence pauses while the second sequence runs. A timeout monitor either supervises the main sequence or the second sequence.
-===== Main Sequence Has Timeout Monitor =====+===== Main Sequence Calls Blocking 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/SequencerTest20.cpp|SequencerTest20.cpp]]. 
 +Open a shell in the build directory of your EEROS library and run 
 <code> <code>
 $ ./examples/sequencer/sequencerTest20 $ ./examples/sequencer/sequencerTest20
Line 14: Line 15:
 ===== 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 can be found under [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest21.cpp|SequencerTest21.cpp]]. It demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is called. Run 
 <code> <code>
 $ examples/sequencer/sequencerTest21 $ examples/sequencer/sequencerTest21
Line 21: Line 22:
 The main sequence does its steps and starts the second sequence. The timeout monitor of the main sequence fires while the second sequence still runs. The monitor causes an exception sequence to run. After that the main sequence together with the second sequence immediately stop as the timeout behavior is set to ''abort''. The main sequence does its steps and starts the second sequence. The timeout monitor of the main sequence fires while the second sequence still runs. The monitor causes an exception sequence to run. After that the main sequence together with the second sequence immediately stop as the timeout behavior is set to ''abort''.
  
-[{{ :getting_started:tutorials:sequencetest21.png?500 | //Calling a blocking sequence// }}]+[{{ :getting_started:tutorials:sequencetest21.png?500 | //Aborting both sequences// }}]
 \\ \\
  
 ===== 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 can be found under [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest22.cpp|SequencerTest22.cpp]]. It demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is called. Run 
 <code> <code>
 $ examples/sequencer/sequencerTest22 $ examples/sequencer/sequencerTest22
Line 33: Line 34:
 The main sequence does its steps and starts the second sequence. The timeout monitor of the main sequence fires while the second sequence still runs. The monitor causes an exception sequence to run. After that the main sequence together with the second sequence continue from their previous state as the timeout behavior is set to ''resume''. The main sequence does its steps and starts the second sequence. The timeout monitor of the main sequence fires while the second sequence still runs. The monitor causes an exception sequence to run. After that the main sequence together with the second sequence continue from their previous state as the timeout behavior is set to ''resume''.
  
-[{{ :getting_started:tutorials:sequencetest22.png?500 | //Calling a blocking sequence// }}]+[{{ :getting_started:tutorials:sequencetest22.png?500 | //Resuming both sequences// }}]
 \\ \\
  
-==== Resuming Sequence ==== +===== Main Sequence Has Timeout Monitor with Restart ===== 
-For the last experiment change the timeout behavior of the monitor to ''resume''As soon as the timeout monitor fires, ''Sequence A'' resumesThe monitor would immediately fire again, as the timeout is not automatically reset for ''resume''In order for the example to make sense, you have to enable the exception sequence with + 
-<code cpp+The next example can be found under [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest23.cpp|SequencerTest23.cpp]]. It demonstrates what happens if the main sequence is interrupted by a monitor while a subsequence is calledRun  
-setTimeoutExceptionSequence(eSeq);+<code> 
 +$ examples/sequencer/sequencerTest23
 </code> </code>
-This in turn will reset the timeout and increase its value to allow ''Sequence A'' and ''Sequence B'' to finish.+ 
 +The main sequence does its steps and starts the second sequence. The timeout monitor of the main sequence fires while the second sequence still runs. The monitor causes an exception sequence to run. After that both sequences stop immediately and the main starts again as the timeout behavior is set to ''resume''. The timeout monitor will fire again with the same consequences. This would go on forever. After three restarts the timeout behavior is set to ''abort'' and the example terminates. 
 + 
 +[{{ :getting_started:tutorials:sequencetest23.png?500 | //Restarting the main sequence// }}] 
 +\\ 
 +===== Subsequence Has Timeout Monitor ===== 
 + 
 +The next example can be found under [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest24.cpp|SequencerTest24.cpp]]. It demonstrates what happens if the subsequence is interrupted by a monitor. Run  
 +<code> 
 +$ examples/sequencer/sequencerTest24 
 +</code> 
 + 
 +The main sequence does its steps and starts the second sequence. The timeout monitor of the subsequence fires. The monitor causes an exception sequence to run. After that the sugsequence stops immediately as the timeout behavior is set to ''abort''. The main sequence will continue to run until it is done. 
 + 
 +[{{ :getting_started:tutorials:sequencetest24.png?500 | //Aborting the subsequence// }}] 
 +\\ 
 + 
 +===== Subsequence Has Timeout Monitor with Resume ===== 
 + 
 +The next example can be found under [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest25.cpp|SequencerTest25.cpp]]. It demonstrates what happens if the subsequence is interrupted by a monitor. Run  
 +<code> 
 +$ examples/sequencer/sequencerTest25 
 +</code> 
 + 
 +The main sequence does its steps and starts the second sequence. The timeout monitor of the subsequence fires. The monitor causes an exception sequence to run. After that the subsequence continues from where it was interrupted as its timeout behavior is set to ''resume''. After the subsequence has terminated the main sequence will continue until it is done. 
 + 
 +[{{ :getting_started:tutorials:sequencetest25.png?500 | //Resuming the subsequence// }}] 
 +\\ 
 + 
 +===== Subsequence Has Timeout Monitor with Restart ===== 
 + 
 +The next example can be found under [[https://github.com/eeros-project/eeros-framework/blob/master/examples/sequencer/SequencerTest26.cpp|SequencerTest26.cpp]]. It demonstrates what happens if the subsequence is interrupted by a monitor. Run  
 +<code> 
 +$ examples/sequencer/sequencerTest26 
 +</code> 
 + 
 +The main sequence does its steps and starts the second sequence. The timeout monitor of the subsequence fires. The monitor causes an exception sequence to runAfter that the subsequence restarts from the beginning as its timeout behavior is set to ''restart''. This would go on forever. After three restarts the behavior is set to ''abort'' which causes the subsequence to terminate. After this, the main sequence will continue until it is done. 
 + 
 +[{{ :getting_started:tutorials:sequencetest26.png?500 | //Resuming the subsequence// }}] 
 +\\
  
getting_started/tutorials/sequencer2.1607012736.txt.gz · Last modified: 2020/12/03 17:25 by ursgraf