LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can we initialize a loop with a value otherthan zero

Can we initialize a loop(for,while or shiftregisters) with a value other that zero??

Suppose if we want our loop to start iteration with a value greather than zero,how can we configure it??

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 1 of 12
(4,709 Views)

Yes you can do that for shift register (also feedback nodes). Whatever value you want to make it as initial value make it as a constant but what do you mean by Initializing for loop and while loop?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 12
(4,706 Views)

that means setting an initial value like:-

 

for(i=2;<10;i++)

{

}

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 3 of 12
(4,704 Views)

You cannot directly do it here but you can indirectly do by this way. Give any value you want to initialize before the for loop the same case with the while loop.

 

For_loop Init.png

 

Good luck

-----

The best solution is the one you find it by yourself
Message 4 of 12
(4,696 Views)

works fine.ThanksSmiley Very Happy

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 5 of 12
(4,685 Views)

@P Anand wrote:

You cannot directly do it here but you can indirectly do by this way. Give any value you want to initialize before the for loop the same case with the while loop.

 

For_loop Init.png

 

Good luck


How is this supposed to work without a loop count or auto-index terminal?  Unless LV2011 does things differently than 2010.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 6 of 12
(4,676 Views)
Ha come on for giving an instance to initialize i I don't have to write a code and also the O.P is capable of understanding that.
-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 12
(4,662 Views)
Ha come on for giving an instance to initialize i I don't have to write a code and also the O.P is capable of understanding that.
-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 12
(4,661 Views)

Perhaps he is, but not all OPs would be.  I'm just used to giving people something that works and not broken.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 9 of 12
(4,646 Views)

Good. Thats my style. 🙂

-----

The best solution is the one you find it by yourself
0 Kudos
Message 10 of 12
(4,637 Views)