JUMP INSTRUCTION ON A LOOP

  • Hi,


    Im recent to this forum, and recently started working on a yaskawa robotic arm (DX200 Controller). In one of my programs im using a loop instruction for a sub-routine. Example of the program:


    *LOOP

    MOVL LP001 V=50.0 WHILE IN(163)=OFF

    MOVL LP002 V=50.0 WHILE IN(163)=ON

    INC B001

    JUMP *LOOP IF B001<6


    The problem in this is that as soon as i press "interlock" and "test start" the variable B001 instantly goes up to 6 ending the loop. I thought it would only increment the variable B001 after both move instructions but it seems it loops all the time reaching B001=6 instantly. Am i doing something wrong?


    Any help would be aprecciated.

  • Bruno.Nogueira

    Changed the title of the thread from “LOOP INSTRUCTION” to “JUMP INSTRUCTION ON A LOOP”.
  • The same input is being used so one of those instructions is always true. I would expect this code could run in approximately 64 ms.

    I know a thing or two, because I’ve seen a thing or two. Don't even ask about a third thing. I won't know it.

  • Yes i know, thats the point, if the sensor is ON the robot moves to a x position and if its off its moves to a y position. The robot is doing pan deburring work. I just added a bigger condition on my Jump instruction and its working now.


    Change made:

    *LOOP

    MOVL LP001 V=50.0 WHILE IN(163)=OFF

    MOVL LP002 V=50.0 WHILE IN(163)=ON

    INC B001

    JUMP *LOOP IF B001<2000


    Now it runs for about 10/15 seconds.

Advertising from our partners