Previous Up Next

Chapter 5  Example 5: condition and nested condition in algorithm

From the principal window, choose File / Save as and save your fifth application under your tutorial folder with the name example5.

5.1  An algorithm with condition

5.1.1  Sensors x and i, actuator o

To create the sensors and the actuator:

5.1.2  Function switch1

To create the switch1 function:

5.1.3  Algorithm AlgorithmMain1

The algorithm looks like the figure 5.6.


Figure 5.6: AlgorithmMain1 of the Example 5

5.2  An algorithm with nested condition

5.2.1  Sensors x and i, actuator o

Use previous definitions (cf. 5.1.1).

5.2.2  Function switch2

To create the switch2 function:

5.2.3  Algorithm AlgorithmMain2

The algorithm looks like the figure 5.9.


Figure 5.9: AlgorithmMain2 of the Example 5

From the principal window, choose File / Close. In the dialog window, click on the Save button.


Previous Up Next