Repeat Times Loop

 

        Repeat a number of times a set of statements.

 

Parameters

times         How many times the loop is executed.

 

Examples

         Here you have an example that will check a sensor 10 times for 10 seconds to see if there is motion.

 

Repeat Condition Loop

 

        Repeat a set of statements while a condition is true or until a condition is true.

 

Variations

          Repeat a set of statements while a condition is true. The condition precedes the execution. The statements in the block will be executed ZERO or more times.
          Repeat a set of statements until a condition is true. The condition is post execution. The statements in the block will be executed ONE or more times.
 

Examples

         Here you have an example that will extract all the temperature data collected in queue during a minute time frame and transform it into CSV data and store it in the wiring cloud.

 

 

For loop

 

        Repeat a set of statements while iterating a variable.

 

Examples

         Here you have an example that will check motion from 10 motion sensors and store the result in a variable that will indicate if there was motion or not.

 


For each item in a list loop

 

        Repeat a set of statements while iterating through a list.

 

Examples

         Here you have an example that will read data from three different sensors and store all the information in a single variable called DATA in a CSV format.

 

 

Break a loop

 

        Break the execution of a loop at any point within the loop.

 

Variations

          Break out of the loop immediately.
          Stop executing the following statements in the loop and jump to the next step of the loop.
 

Examples

         Here you have an example that will not do anything in particular but it will execute the loop 6 times and break out of it after that. Loop will not be executed 10 times.