LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For loop and updated variable

Hi,
here is something that  I am trying to do...but no success.

data1=0;
For [ x = 0 , x < N , x++,
{Write-Read buffer equipment 1} ;
t = result_buffer ;
data1 = data1 + t ;
]

{Write-Read buffer equipment 1} is a sequence that Write-Read the buffer of the equipment 1 and return the value t;
the value of data1 is updated after each loop.

Thanks for your time.

JM
0 Kudos
Message 1 of 5
(2,381 Views)
Hi,
your code:
data1=0;
For [ x = 0 , x < N , x++,
{Write-Read buffer equipment 1} ;
t = result_buffer ;
data1 = data1 + t ;
]

What is "N"?
Regards,
0 Kudos
Message 2 of 5
(2,377 Views)
Thanks for the reply.

N is an integer.
Let's say N=100.
0 Kudos
Message 3 of 5
(2,373 Views)
You need a for-loop with N wired a value, and a shift register to keep track of "data1".

I would suggest going through some of the tutorials and heading over to the NI Learning Center for more training resources.


Message Edited by smercurio_fc on 02-29-2008 11:54 AM
0 Kudos
Message 4 of 5
(2,352 Views)
Thank you so much.
0 Kudos
Message 5 of 5
(2,341 Views)