Page 1 of 1

Iterators

PostPosted: Thu Oct 28, 2010 9:17 am
by vpnsoluk
In labview you can wrap each block in an interator (called a 'for' or 'while', but that's just a name). I can't find anything simplar in FlowStone.

The iterator becomes a container for the schematic within the iteration wrapper, and the ports externally are either mapped to indexes of that loop or connected straight through. The parameters to the loop are either a boolean condition or a range.

This creates a means of 'step and repeat' allowing a simple circuit to assemble or disasemble arrays of signals as well as process array entries in some way to create another signal. Omitting the limits on the array would process the entire array.

E.g.1. In it's simplest form, an array of 10 integers would be an int constant widget wrapped in a for loop of range 1..10.

E.g.2.
A more complicated example might be complex signal generator with 100 prime factor frequencies. This would be realised as a single signal generator in a loop (1..100) with an external prime number generator which supplies an array. The frequency of the generator is a multiple of the prime entry in the array pointed to by the loop index. The output is simply a sum signal array function externally to the loop.

Currently to implement this we would have a very huge schematic.

Compared to LV I can see another way to visualise this that may be tidyer. Simply have an 'iterate' parameter to each module, then display that module graphically with a shadow to illustrate that it occurs more than once. A selection on each port would decide if that signal is mapped to the index or not. Turning on iterate would expose a boolean or number of int ports depending on the iteration type.

Re: Iterators

PostPosted: Thu Oct 28, 2010 1:13 pm
by admin
Would the Int Loop component be what you're looking for?

Here's an example that generates 10 pseudo-random numbers:

randloop.png
randloop.png (46.15 KiB) Viewed 7364 times

Re: Iterators

PostPosted: Thu Oct 28, 2010 4:26 pm
by admin
In FlowStone you can tidy up your schematic by using 'Make Module', you can then make your own modules!

Select a group of modules or elements on the screen and then click 'Make Module' (bottom left next to the 'X'), all of the ins and outs are created automatically!