LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For Loop Iteration Different Conditions

Solved!
Go to solution

 Hi,

I have an For loop with 8 iterations inside an Event structure.

I want to execute some code when iteration <4 and other code in the other case.

Can you help me to do this ?

Thank in advice!

0 Kudos
Message 1 of 6
(3,361 Views)
Solution
Accepted by topic author Claudinho18

Put a case structure inside the For Loop.  Connect the iteration terminal to the case selector.

 

Use 0..3 for one case,  4...  Default, for the other.

Message 2 of 6
(3,347 Views)

@RavensFan wrote:

Put a case structure inside the For Loop.  Connect the iteration terminal to the case selector.

 

Use 0..3 for one case,  4...  Default, for the other.



While correct.  That sounds like an absolutely awful way to begin to use events.

 

Can you share code where this solution is used? 

 

 


"Should be" isn't "Is" -Jay
Message 3 of 6
(3,308 Views)

The question was about For Loops and different cases based on iteration number.  The event structure part of the question is superfluous.

Message 4 of 6
(3,302 Views)

@Claudinho18 wrote:

 Hi,

I have an For loop with 8 iterations inside an Event structure.

I want to execute some code when 


I thought my question was fair Bill???? We OK?


"Should be" isn't "Is" -Jay
Message 5 of 6
(3,297 Views)

Sure.  We're okay.

 

Message 6 of 6
(3,291 Views)