I am currently using a DX200 controller in which my program is iterating through a set of instructions by the use of a FOR loop which is found within one of my subroutines. It currently looks like this:
FOR I000 = 4 TO 60
(STATEMENTS)
NEXT I000
The program essentially picks up the 4th part and places it, continuing this process all the way till the 60th part.
However, once the next batch of parts come in I want it to restart from the beginning and pick up the 1st part - without having to manually change the number 4 to 1 in the subroutine.
I noticed that the FOR function only accepts a numerical value in the range and thus I wasn't able to use a variable. Hence, I was wondering if there's a way for the numerical value of 4 to automatically be set to 1 after the end of the job?
I'm fairly new to robotics so I'm not sure if this is a simple fix.
Thank you!
(P.S I have written a sample solution to better visualize what I am trying to achieve. I001 is simply an integer variable that I can set)
FOR I000 = I001 TO 60
(STATEMENTS)
NEXT I000
SET I001 1