10-30-2013 08:37 AM
10-30-2013 08:41 AM
I do not find 20/stepsize in code that sent to you. can you mark it in that code and send me back ?
10-30-2013 08:47 AM
Hi,
I've attached the document with a red arrow pointing towards the start of that part of the code.
Thanks
10-30-2013 09:28 AM
Any ideas?
Thanks,
Tania
10-30-2013 09:29 AM
I wrote code too many times with step-by-step improvement. I thaink, I might have written that to control the number of iterations of the for loop. If you use any other stop condition, you can just delete that.
Mahendar
10-30-2013 09:35 AM
So 20 divide by stepsize, then +1, then truncating is basically just a limit for the number of iterations? Currently my stop condition is if the position reaches 20 (which is the maximum) then the code should stop running. Is that sufficient?
Tania
10-30-2013 09:37 AM
If you are using while loop, it is sufficient.
Mahendar
10-30-2013 09:37 AM
And so if it is calculating the maximum number of iterations, this value stays the same till the code stops running?
Tania
10-30-2013 09:38 AM
Value remain same means current position is same, peizo is not performing any motion at that moment.
10-30-2013 09:47 AM
But if this is calculating the maximum number of iterations then how can it keep changing?
So for example if I choose step size to be 0.1. Then 20/0.1=200, 200+1=201, and no need to truncate because it's not a decimal number. So this number 201 is the maximum number of iterations for the while loop is my question? What is it computing?
Given that 201 is the no. of iterations, then the code inside the while loop starts running step size multiplied by number of iteration starting from 0 and until the iteration reaches 201 the loop will keep running unless some other condition is fulfilled and the code has to stop. Is this what you're saying?
Thanks
Tania