LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Floating Nested Loop?

Dear All,

I have a problem in creating a "floating" nested for loop. Please look at the picture. There is 4 variable to be sweep and the sequence of the 4 variable can be selected by the end user. How can I create this by using labview? Please advice.

Thanks

Cheyne


Message Edited by cheyne on 06-09-2008 08:41 AM

Message Edited by cheyne on 06-09-2008 08:42 AM
0 Kudos
Message 1 of 26
(4,156 Views)

I don't know what you mean by a "floating nested for loop".

If you are looking for a while loop that changes from one reading to another in sequence, but the sequence is variable, it sounds like you want a state machine architecture.  Search the forums for that phrase and look at New VI... architectures.  You basically would have a case structure inside a while loop.  There is an enum control that is passed from one iteration to the next through a shift register that controls which case is executed in the next iteration of the while loop.  This allows you to operate different cases in a sequence, but vary the sequence while running as needed.

0 Kudos
Message 2 of 26
(4,119 Views)
It sounds like you're looking to create 4 nested loops, but the order of nesting varies depending on the order of the variables in the table. You cannot programmatically change the order of the loops once you plop them down. I agree that a state machine architecture is your best bet. Very flexible.


Message Edited by smercurio_fc on 06-09-2008 09:07 AM
0 Kudos
Message 3 of 26
(4,112 Views)
Hi,

Thanks for prompt reply. Is there any example for State Machine?
0 Kudos
Message 4 of 26
(4,105 Views)
You can start by looking at the page that I provided as a link in my reply. Smiley Wink
0 Kudos
Message 5 of 26
(4,098 Views)
"You cannot programmatically change the order of the loops once you plop them down. "
 
Agreed but you can easily manipulate the output using a cluster sort by simply changing the order of the components in the cluster.
 
Have fun,
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 26
(4,095 Views)
I would suspect it would be easier to keep the data in a multi-dimensional array. This way, you're just changing the interpretation of the indices, rather than trying to reshuffle clusters.
0 Kudos
Message 7 of 26
(4,082 Views)
Can you write me a simple 2 variable netsted for loop where user can choose who 1st and who second. Appreciate alot.
0 Kudos
Message 8 of 26
(4,072 Views)

This is a quick demo of implementing an arbitrary sort. Yes, the idexes must be unique. Did not test it. Let me know if you spot something wrong here.

Trying to help,

Ben



Message Edited by Ben on 06-09-2008 10:10 AM

Message Edited by Ben on 06-09-2008 10:12 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 9 of 26
(4,065 Views)
Thanks for the program. However, it seems like it is not the one I am looking for.
0 Kudos
Message 10 of 26
(4,048 Views)