Hallo All,
I have a doubt,
while(B040= 2) // B040 value we get from Initial Loops of the program, as B040 value is true it should perform Tasks in the while Loop
call Job: Pick
call Job: Place
End While
Hallo All,
I have a doubt,
while(B040= 2) // B040 value we get from Initial Loops of the program, as B040 value is true it should perform Tasks in the while Loop
call Job: Pick
call Job: Place
End While
HI
I don't really understand what is not working or what you want to do.
but if you want to cancel the loop, there are more ways to do that.
maybe you use the for loop (for b040 <=2 do ...
or the "ret" command
please more information what you want to do
My Loop should execute only if value in B040 is 2.
Im Sorry for inconvenience, the while Loop should execute only two times and should come out from the Loop. Instead as the value is true it continues to Loop.
My Loop should execute only if value in B040 is 2.
It will. The way the line is written this will execute forever or until B040's value is changed to something other than 2. Setting up an additional loop counter, another variable, and INC or DEC the loop counter would work. You would then add an AND to the WHILE instruction.
That seems like a lot of work when instead I could use the FOR-NEXT, unless the number of loops is a variable between part numbers (sometimes 2, sometimes, 5, sometimes 7, using the same code). This is a loop counter instruction. The loop counter is in an I-variable.
FOR I000
CALL JOB: PICK
CALL JOB:PLACE
NEXT I000
Hi 95 Devils,
Thanks for your Suggestion. I tried with Inc and If loop it is working properly and
I tried also with:
For I000= 0 TO 2 Step 1
Call Job: Pick
Call Job: Place
Next I000
End
After two times of for Loop it should come to End but it is still going to the for Loop, Could you please say me where is wrong. Thanks in advance.
It should stop the way it is written after three cycles.
You could write the FOR either of these two ways and do what you wanted.
For I000= 0 TO 1 Step 1
Call Job: Pick
Call Job: Place
Next I000
End
For I000= 1 TO 2 Step 1
Call Job: Pick
Call Job: Place
Next I000
End
The FOR loop in the example should execute twice (ie. Pick, Place, Pick, Place)
Each time this job is run, the FOR loop will reinitialize I000 and run through two more times...and so on and so on. You will need to make sure this job is only being called/run once for each instance that you want the Pick & Place jobs to run twice.