Help programming IF statement

  • I have an OTC/Daihen welding package with an AX-21 controller. I have it setup on a rotary table with a side A and Side B. I want to have different programs on each side. I was trying to use an IF statement depending on which side the robot was on, it would call the appropriate program. I don't understand the variable part of it. I have input going to the robot so that it knows which side it is on.

  • AD
  • You can make that with a few way.
    One of them is, using variable for program selection.
    If it's little bit complicate for you, you can use station function.


    You need only 2 digital inputs for this operation.
    Firstly you should select number of station.


    Constant Setting > Operation Constant > Number of Station > 10 > Complete


    Then, you should select condition of starter.


    Constant Setting > Operation Constant > Condition of Multi Station Starter

  • I have an OTC/Daihen welding package with an AX-21 controller. I have it setup on a rotary table with a side A and Side B. I want to have different programs on each side. I was trying to use an IF statement depending on which side the robot was on, it would call the appropriate program. I don't understand the variable part of it. I have input going to the robot so that it knows which side it is on.

    You can try to use system functions to find out mechanism angle and use the IF function.

    Example:

    if system%(200)>0 'System%(200) Mechanism1 J1 value for external axis. If it's Mechanism 2 you can use System%(210) for J1 211 for J2... etc

    CALLP 1

    elseif system%(200)<0

    CALLP 2

    endif

    end


    Or you can set limit switch to CallPI

    CALLPI 1, I1 'Call program 1 when first limit switch is on

    CALLPI 2, I2 'Call program 2 when other limit switch is on

  • I am also having issues using IF statements. Both statements shown below give me error I2152 - The step does don't exist.

    I have several other programs (not programmed by me) that use IF statements like this. Any help would be appreciated.


    I am using FD Controller.


    IF V1%=1

    CALLP[5]


    IF V16%>=40

    LETVI[V16%,0]


  • There are 2 different IF commands on FD Robot (I don't know about AX. but I'm guessing it's the same.)

    One is: IF V1%=1 THEN 2 ELSE 3, which directly jumps to specified step no.


    The other is the one you're showing, where you need an ENDIF after the steps you want to skip if the condition doesn't exist.



    IF V1%=1

    CALLP[5]

    ENDIF



    IF V16%>=40

    LETVI[V16%,0]

    ENDIF

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now