getting_started:tutorials:sequencer3
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
getting_started:tutorials:sequencer3 [2020/12/03 17:12] – [Example with several Monitors] ursgraf | getting_started:tutorials:sequencer3 [2021/03/31 15:39] – [Subsequence Has Timeout Monitor With Resume] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Example with several Monitors | + | ====== Example with Nonblocking Sequence |
+ | The following example all have a main sequence which calls a few steps and a another sequence. This second sequence is a nonblocking sequence. That means that the main sequence runs in parallel to the second sequence. A timeout monitor either supervises the main sequence or the second sequence. | ||
- | it will run in parallel. '' | + | ===== Main Sequence |
- | [{{ .:sequencerexample2.png?550 | //Flow of SequencerTest2// }}] | + | In the EEROS library you will find a directory with examples. For this example see [[https://github.com/eeros-project/eeros-framework/blob/master/ |
- | The main sequences starts with three '' | + | Open a shell in the build directory of your EEROS library and run |
+ | < | ||
+ | $ ./ | ||
+ | </ | ||
+ | The main sequences starts with three '' | ||
+ | [{{ : | ||
+ | \\ | ||
Please note the method //action// of the main sequence. | Please note the method //action// of the main sequence. | ||
<code cpp> | <code cpp> | ||
- | int action() { | + | |
- | for (int i = 0; i < 3; i++) stepA(2); | + | for (int i = 0; i < 3; i++) { |
- | seqB(); | + | |
- | for (int i = 0; i < 5; i++) stepA(2); | + | } |
- | seqB.waitAndTerminate(); | + | seqS(); |
- | } | + | for (int i = 0; i < 3; i++) { |
+ | | ||
+ | } | ||
+ | seqS.wait(); | ||
+ | | ||
+ | | ||
</ | </ | ||
- | At the end of the method you have to wait for the sequence B as it runs in its own thread. | + | At the end of the method you have to wait for the subsequence |
- | ===== Sequence | + | ===== Main Sequence |
- | In the EEROS library you will find a directory with examples. | + | The next example is [[https:// |
+ | < | ||
+ | $ examples/ | ||
+ | </ | ||
- | [{{ .: | + | The main sequence does three steps and starts the second sequence. The timeout monitor |
- | This example shows a sequence with two associated monitors. The '' | + | [{{ : |
+ | \\ | ||
- | ==== Altering the Monitor | + | ===== Main Sequence Has Timeout |
- | Change the behavior of '' | + | |
- | If you change the behavior of the timeout monitor to '' | + | |
- | ===== Monitor | + | The next example is [[https:// |
+ | < | ||
+ | $ examples/ | ||
+ | </ | ||
+ | |||
+ | The main sequence does three 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 continues where it was interrupted as the timeout behavior is set to '' | ||
+ | |||
+ | [{{ : | ||
+ | \\ | ||
+ | |||
+ | ===== Main Sequence Has Timeout | ||
+ | |||
+ | The next example is [[https:// | ||
+ | < | ||
+ | $ examples/ | ||
+ | </ | ||
+ | |||
+ | The main sequence does three 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 starts again as the timeout behavior is set to '' | ||
+ | |||
+ | [{{ : | ||
+ | \\ | ||
+ | |||
+ | ===== Subsequence Has Timeout Monitor ===== | ||
+ | |||
+ | The next example is [[https:// | ||
+ | < | ||
+ | $ examples/ | ||
+ | </ | ||
+ | |||
+ | The main sequence does three 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 terminates immediately as the timeout behavior is set to '' | ||
+ | |||
+ | [{{ : | ||
+ | \\ | ||
+ | |||
+ | ===== Subsequence Has Timeout Monitor With Resume ===== | ||
+ | |||
+ | The next example is [[https:// | ||
+ | < | ||
+ | $ examples/ | ||
+ | </ | ||
+ | |||
+ | The main sequence does three 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 the timeout behavior is set to '' | ||
+ | |||
+ | [{{ : | ||
+ | \\ | ||
+ | |||
+ | ===== Subsequence Has Timeout Monitor With Restart ===== | ||
+ | |||
+ | A next example demonstrates what happens if the subsequence is interrupted by a monitor while being called from the main sequence. Run | ||
+ | < | ||
+ | $ examples/ | ||
+ | </ | ||
- | A next example demonstrates what happens if the same monitor | + | The main sequence does three steps and starts |
- | [{{ .:sequencerexample5.png?550 | //Flow of SequencerTest5// }}] | + | [{{ :getting_started: |
+ | \\ | ||
- | The '' | ||
getting_started/tutorials/sequencer3.txt · Last modified: 2021/03/31 15:39 by ursgraf