getting_started:tutorials:sequencer3
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
getting_started:tutorials:sequencer3 [2020/12/03 17:46] – ursgraf | getting_started:tutorials:sequencer3 [2021/03/31 15:39] (current) – [Subsequence Has Timeout Monitor With Restart] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Example with Nonblocking Sequence ====== | ====== 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. | 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. | ||
+ | |||
+ | ===== Main Sequence Calls Nonblocking Sequence ===== | ||
+ | |||
+ | In the EEROS library you will find a directory with examples. For this example see [[https:// | ||
+ | |||
+ | 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. | ||
+ | <code cpp> | ||
+ | int action() { | ||
+ | for (int i = 0; i < 3; i++) { | ||
+ | stepA(1); | ||
+ | } | ||
+ | seqS(); | ||
+ | for (int i = 0; i < 3; i++) { | ||
+ | stepA(1); | ||
+ | } | ||
+ | seqS.wait(); | ||
+ | return 0; | ||
+ | } | ||
+ | </ | ||
+ | At the end of the method you have to wait for the subsequence as it runs in its own thread. | ||
===== Main Sequence Has Timeout Monitor ===== | ===== Main Sequence Has Timeout Monitor ===== | ||
- | In the EEROS library you will find a directory with examples. | + | The next example is [[https:// |
< | < | ||
- | $ ./examples/ | + | $ examples/ |
</ | </ | ||
- | The main sequences starts with three '' | + | |
- | [{{ : | + | The main sequence does three steps and starts |
+ | |||
+ | [{{ : | ||
\\ | \\ | ||
+ | ===== Main Sequence Has Timeout Monitor With Resume ===== | ||
- | ====== Example with several Monitors ====== | + | The next example is [[https:// |
+ | < | ||
+ | $ examples/ | ||
+ | </ | ||
- | it will run in parallel. '' | + | The main sequence does three steps and starts the second sequence. The timeout monitor |
- | [{{ .:sequencerexample2.png?550 | //Flow of SequencerTest2// }}] | + | [{{ :getting_started: |
+ | \\ | ||
- | The main sequences starts with three '' | + | ===== Main Sequence Has Timeout Monitor With Restart ===== |
- | Please note the method //action// of the main sequence. | + | |
- | < | + | The next example |
- | int action() { | + | < |
- | for (int i = 0; i < 3; i++) stepA(2); | + | $ examples/ |
- | seqB(); | + | |
- | for (int i = 0; i < 5; i++) stepA(2); | + | |
- | seqB.waitAndTerminate(); | + | |
- | } | + | |
</ | </ | ||
- | At the end of the method you have to wait for the sequence B as it runs in its own thread. | ||
- | ===== Sequence with two Monitors ===== | + | 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 '' |
- | In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run '' | + | [{{ : |
+ | \\ | ||
- | [{{ .: | + | ===== Subsequence Has Timeout Monitor ===== |
- | This example | + | The next example |
+ | < | ||
+ | $ examples/sequencer/sequencerTest34 | ||
+ | </code> | ||
- | ==== Altering the Monitor Behavior ==== | + | The main sequence does three steps and starts |
- | Change the behavior of '' | + | |
- | If you change the behavior | + | |
- | ===== Monitor Checking two Sequences ===== | + | [{{ : |
+ | \\ | ||
- | A next example demonstrates what happens if the same monitor checks two sequences. It can be found in '' | + | ===== Subsequence Has Timeout Monitor With Resume ===== |
- | [{{ .:sequencerexample5.png?550 | //Flow of SequencerTest5// }}] | + | 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 '' | ||
+ | |||
+ | [{{ :getting_started: | ||
+ | \\ | ||
+ | |||
+ | ===== Subsequence Has Timeout Monitor With Restart ===== | ||
+ | |||
+ | The next example is [[https:// | ||
+ | < | ||
+ | $ examples/ | ||
+ | </ | ||
+ | |||
+ | The main sequence does three steps and starts the second sequence. The timeout monitor | ||
+ | |||
+ | [{{ : | ||
+ | \\ | ||
- | The '' | ||
getting_started/tutorials/sequencer3.1607013996.txt.gz · Last modified: 2020/12/03 17:46 by ursgraf