LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to change the i of for loop

Solved!
Go to solution

Hello,

A Labview question. A tusk should be repeat 10 times in a for loop. so the value of i in the for loop will be changed from 0 to 9. Sometimes, some tusks may repeat one extra time. It there a way to let me change the value of i in the for loop?

Thanks a lot

0 Kudos
Message 1 of 3
(2,325 Views)
Solution
Accepted by topic author StevenInToronto

@Parallel Port wrote:

Hello,

A Labview question. A tusk should be repeat 10 times in a for loop. so the value of i in the for loop will be changed from 0 to 9. Sometimes, some tusks may repeat one extra time. It there a way to let me change the value of i in the for loop?

Thanks a lot


 

literally no.

 

You can use a While loop where you control the number of iterations.

 

It is possible to wire a value to the "N" to limit the number of iterations but if you are indexing an array through an auto-indexing input tunnel the input array will also limit the number of iterations.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(2,321 Views)

the i terminal will always output the iteration number (0 through 9 in your case).  But there's nothing that says you can't perform some weird math or use case structure with it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(2,319 Views)