Previous tutorial
[Hello_world_tutorial]
Hello world loop tutorial
This tutorial will show you how to do a loop in FlowDesigner. It is same behavior than a 'while(Condition)' in programming. For the first step, refer to the [Hello_world_tutorial] for further explanations.
- Create a new document, add a General->Constant node, and modify his string property to "Hello world!".
- Select the menu "Network->newIteratorNetwork".
- A dialog appeared and click ok.
- Select the loop network.
"
- Edit properties of the USleep node (double click on it) and set the "Time required to sleep" to 1000000 (1 sec in micro sec).
- Right-click on the terminal of USleep node and select "Add condition output" (or do crtl-click). Our loop network is a iterator network, it will iterate while the condition of the network is true. Here the output of USleep is always true, so it will iterate forever.
- For the Print node, shift-click on his input and output terminals (click "OK" in the dialog that appeared). The input and the output will be the input and the output of the loop network.
- Return to the MAIN network. Click on the MAIN tab.
- Right-click on the background and select loop.
->
- The loop node is the loop network with the input and the output that we just defined.
- Link the Constant output terminal to the loop input terminal. To do that, left-click on the output terminal of the "Constant" node drag the link to the input terminal of the loop node.
->
- Shift-click on the output terminal of the loop node and press "OK" in the dialog that just appeared.
- A message <String Hello World!> is appended to the console at each second. This process will iterate forever.
- To stop the process, press "Stop".
File
HelloWorldLoop.n
What's next?
See the [Probing_tutorial].