Difference between revisions of "Loop Icon Properties"

From Flowcode Help
Jump to navigationJump to search
Tags: Flowcode v9 Flowcode v8 Flowcode v10 Version
(updated for v11)
 
Line 1: Line 1:
<sidebar>Sidebar: Icon Properties</sidebar>
 
 
{| style="margin:auto; text-align:center;"
 
{| style="margin:auto; text-align:center;"
 
|-
 
|-
Line 6: Line 5:
 
|[[File:Gen_Loop_Flowchart_Icon.png]]  
 
|[[File:Gen_Loop_Flowchart_Icon.png]]  
 
|width="50px" |&rarr;  
 
|width="50px" |&rarr;  
|[[File:Gen_Loop_Icon_Properties.png]]
+
|[[File:Properties-loop.png]]
 
|}
 
|}
  
 +
<br>
 +
==Old Versions==
 +
This page is current for Flowcode v11 and later. Earlier versions can be found below:
 +
{| class="wikitable"
 +
|+
 +
|-
 +
| [[Special:PermanentLink/17609|Flowcode v10]]
 +
|-
 +
| [[Special:PermanentLink/17609|Flowcode v9]]
 +
|-
 +
| [[Special:PermanentLink/17609|Flowcode v8]]
 +
|}
 +
 +
<br>
 +
 +
 +
==Introduction==
 
Loop icons are used to repeat a task until specified conditions are fulfilled, or to perform the loop a set number of times.
 
Loop icons are used to repeat a task until specified conditions are fulfilled, or to perform the loop a set number of times.
  
Line 17: Line 33:
 
   
 
   
 
The name of the icon that appears on the flowchart.
 
The name of the icon that appears on the flowchart.
 +
 +
 +
'''Loop forever'''
 +
 +
Creates an infinite loop where the icons between the start and end of this loop icon are repeated forever. Many embedded programs require an infinite loop because the code running in the microcontroller will never stop.  In versions of Flowcode prior to v11, a condition "While 1" would have been used instead to create an infinite loop.
  
  
 
'''Loop while'''
 
'''Loop while'''
  
Loops the program until the specified condition becomes true. Enter the conditions which will fulfill the loop.
+
Loops the program until the specified condition becomes true. Enter the conditions which will fulfil the loop.
  
 
(Setting the test condition to something that is always true will make the loop repeat forever e.g. While 1)
 
(Setting the test condition to something that is always true will make the loop repeat forever e.g. While 1)
Line 50: Line 71:
  
 
When active this automatically resets the count variable to 0 and increments the variable for you to give you the correct number of loop iterations.
 
When active this automatically resets the count variable to 0 and increments the variable for you to give you the correct number of loop iterations.
 
 
'''Infinite loops'''
 
 
Sometimes a task needs to be repeated continually. One useful way of achieving this is to have an infinite loop.
 
 
Setting the test condition to something that is always true will make the loop repeat forever e.g. While 1
 
 
[[File:Gen_Loop_Icon_Properties.png]]
 
  
  
Line 64: Line 76:
  
 
See the [http://www.youtube.com/watch?v=Ty0ZfkFbtNQ&list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Loop] video to learn how to use infinite, limited and conditional loops, as well as the use of loops with other icons such as [[Input Icon Properties|Input]], [[Output Icon Properties|Output]] and [[Calculation Icon Properties|Calculation]] icons.
 
See the [http://www.youtube.com/watch?v=Ty0ZfkFbtNQ&list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Loop] video to learn how to use infinite, limited and conditional loops, as well as the use of loops with other icons such as [[Input Icon Properties|Input]], [[Output Icon Properties|Output]] and [[Calculation Icon Properties|Calculation]] icons.
 
<div align="center">
 
{{#ev:youtube|Ty0ZfkFbtNQ|640}}
 
</div>
 

Latest revision as of 14:40, 24 October 2025

Btn Loop.gif Gen Loop Flowchart Icon.png Properties-loop.png


Old Versions

This page is current for Flowcode v11 and later. Earlier versions can be found below:

Flowcode v10
Flowcode v9
Flowcode v8



Introduction

Loop icons are used to repeat a task until specified conditions are fulfilled, or to perform the loop a set number of times.

Note that you will need to add calculation icons that modify the variables used for the condition in order for the condition to be fulfilled.


Display Name

The name of the icon that appears on the flowchart.


Loop forever

Creates an infinite loop where the icons between the start and end of this loop icon are repeated forever. Many embedded programs require an infinite loop because the code running in the microcontroller will never stop. In versions of Flowcode prior to v11, a condition "While 1" would have been used instead to create an infinite loop.


Loop while

Loops the program until the specified condition becomes true. Enter the conditions which will fulfil the loop.

(Setting the test condition to something that is always true will make the loop repeat forever e.g. While 1)


Variables Arrow

Clicking on the down arrow brings up the variables dialog window allowing you to select an existing variable or to create a new one.


Test the loop at the:

Select whether you wish the loop to be tested at the start or at the end of the loop.

Can be set to check the condition at the start of the loop or at the end of the loop.


Loop count

Sets the loop to loop through a set number of times.

Count must be a whole number between 1 and 99999999.


Count using a variable

Allows one of your existing variables to be used as the count variable.

When active this automatically resets the count variable to 0 and increments the variable for you to give you the correct number of loop iterations.


Video instructions

See the Loop video to learn how to use infinite, limited and conditional loops, as well as the use of loops with other icons such as Input, Output and Calculation icons.