LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add multiple inputs in sequence in a for loop

ABC Plus 1.png

 

This will do:

A + 1, then

B + 1, then

C + 1, then repeat until stopped.

 

Is this what you are after????????

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 11 of 22
(1,873 Views)

Hi Lucither,

 

thanks for your advice, but i intend to 2 of +1 and 1 of -1. 

 

Hi Mike,

 

there will be 3 variables. 2 of which i intend to add 1 and 1 to subtract by 1. 

 

best,

 

MC 

0 Kudos
Message 12 of 22
(1,865 Views)

ABC plus minus 1 snippet.png

 

This will first:

A - 1, then

B + 1, then

C + 1, then repeat until stopped.

 

 You can play around with the order to suit your needs.

Message Edited by Lucither on 03-23-2010 08:12 AM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 13 of 22
(1,859 Views)

YMC wrote:

Hi Mike,

 

C follow by B then A. This sequence will then loop in the 'for' loop accordingly to the loop count.

 

best,

MC


But your sketch shows A, then B, then C.

 

Why do you need them to be executed in a particular order?  Nothing about the 3 values are dependent on each other.  What else are you doing with these values besides incrementing them N times in the For Loop?

0 Kudos
Message 14 of 22
(1,851 Views)

Hi Mike and Lucither,

 

thanks for your help! I am able to carry on with my vi!

 

thanks again!

 

cheers,

MC 

0 Kudos
Message 15 of 22
(1,842 Views)

ABC plus minus 1 snippet.png

 

The last vi i posted wouldnt of worked well, here is a better version.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 16 of 22
(1,839 Views)

How does that in any way look like the sketch drawn in message 5?

 

All of the proposed solutions show the shift register being used with the extra history terminals.  The sketch does not indicate that at all, and just shows 3 independent variables.

 

This is what the sketch shows.

 

 

And if this isn't what the OP wants, then he needs to adequately describe his problem.

Message Edited by Ravens Fan on 03-23-2010 09:37 AM
0 Kudos
Message 17 of 22
(1,829 Views)

He does not want them incrementing at the same time. He wants one to increment only per iteration, thats why the history terminals are added. So they go in order, A then B then C then loop forever.

 

He also changed what he wanted from sketch 5 later on. he wants the last one to - 1 not + 1.

Message Edited by Lucither on 03-23-2010 08:43 AM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 18 of 22
(1,824 Views)

hi Guys,

 

Any way to set a delay btw each addition/subtraction ?

 

best.

mc 

0 Kudos
Message 19 of 22
(1,787 Views)

Hi YMC,

yes it's possible. You can use a state mashine. Create a case for every addition of one variable and min. one case for the delay case. Initialize your state mashine with the first case and jump then from case to case as needed.

 

Mike

0 Kudos
Message 20 of 22
(1,783 Views)