LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Floating Nested Loop?

I have a similar problem. My solution, which I've only partially implemented, is to use an index generator (a mixed base counter in this case). There wouldn't be any loops, only class methods for indexing vectors (private class data) of swept variables. Without explicit For Loops the order of sweeping can be easily changed.

Let me know if this might work for you. I hope to get to this within the next few weeks.

David

David Grucza, CLD
0 Kudos
Message 11 of 26
(1,307 Views)
If I understand, you want a program that will perform a function x times, x being specified by the user and the user can select what order the functions happen in. If that is what you want, a state machine would work.

Here is a state machine that will perform 3 functions x, y, and z times, as specified by the user, and in whatever oder the user wants.



Message Edited by StevenD on 06-09-2008 11:31 AM
0 Kudos
Message 12 of 26
(1,299 Views)
I am looking into something where the nested for loop sequence is not fixed but according to the user sequence. say a fixed nested for loop is 1,2,3,4 but if the user want a sequence of 2,3,1,4. How am I going to make the nested loop do that?
0 Kudos
Message 13 of 26
(1,292 Views)
Sorry, forgot to add something to my orginal post, just updated it. Check out Example2.vi, lets the user chose what order the functions happen in.
0 Kudos
Message 14 of 26
(1,291 Views)

A nested loop means that you have a loop, inside a loop, inside a loop..  The innermost loop runs, then goes outwardly..

What you are looking for is a State Machine where you can select which loop will run next.  All loops are independant, not nested, in order to do that.

I will create an example for you..

RayR

0 Kudos
Message 15 of 26
(1,277 Views)

Please disregard my previous.

I'll have to give some thought to how I did that.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 16 of 26
(1,273 Views)
Scracth number 2 as well. Sorry, I need sleep...

HERE is what I think you want.

Performs 3 different functions, x many times, and whatever order.




0 Kudos
Message 17 of 26
(1,269 Views)
Hi,

If the 2 loops running independently, then it means 1 loop will complete before another loop starts. But I am looking for 2 loop nested together where 2 are running at the same time.
0 Kudos
Message 18 of 26
(1,262 Views)

Here's my example...

Now I need to catch up with the other posts 😉

 

0 Kudos
Message 19 of 26
(1,255 Views)


cheyne wrote:
Hi,

If the 2 loops running independently, then it means 1 loop will complete before another loop starts. But I am looking for 2 loop nested together where 2 are running at the same time.


What is supposed to be happening in each loop?
0 Kudos
Message 20 of 26
(1,254 Views)