Page 1 of 1

LabVIEW to FlowStone - For and While Loops

Posted: Wed Aug 27, 2014 5:07 pm
by Aeronomer
LabVIEW provides graphical for and while loops - see http://www.ni.com/white-paper/7588/en/. How do you achieve similar constructs in FlowStone? Thanks.

Re: LabVIEW to FlowStone - For and While Loops

Posted: Wed Aug 27, 2014 5:19 pm
by KG_is_back
It depends on what you are trying to achieve.
For static calculation I recommend using the ruby component. Ruby is very easy to learn if you have basic programing skills.

In green, while loop can be created using the "int loop" primitive or "draw loop" if the code also draws something.
In both cases the primitive outputs indexes one by one in given range and outputs trigger each time. While loop is more complicated thing to do, so I really recommend Ruby for such case.

In code components only loop that is possible is static loop (with hard-coded number of iterations which also must be power of 2). The code component was meant to calculate DSP code fast as possible so it contains very little place for any code branching.
It is however possible in assembler. That is however very risky (you may crash Flowstone with bad code very easily) and quite complicated to do.