Menu

Hello_world_loop_tutorial

Dominic Letourneau
Attachments
CaptureFD2-01.png (24830 bytes)
CaptureFD2-02.png (18334 bytes)
CaptureFD2-03.png (59470 bytes)
CaptureFD2-04.png (48674 bytes)
CaptureFD2-05.png (24670 bytes)
CaptureFD2-06.png (5375 bytes)
CaptureFD2-07.png (5562 bytes)
CaptureFD2-08.png (19442 bytes)
CaptureFD2-09.png (4966 bytes)
CaptureFD2-10.png (3534 bytes)
CaptureFD2-11.png (4709 bytes)
CaptureFD2-12.png (5864 bytes)
CaptureFD2-13.png (5277 bytes)
CaptureFD2-14.png (29487 bytes)

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.

  • Add a IO->Print node.

"

  • Add a Time->USleep node.

  • 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.

  • Press "RUN".

  • 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].


Related

FlowDesigner-Wiki: FlowDesigner_User's_Guide
FlowDesigner-Wiki: Hello_world_tutorial
FlowDesigner-Wiki: Probing_tutorial

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.