1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Nachi Robots
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Help programming IF statement

  • devilstang
  • March 6, 2019 at 7:58 PM
  • Thread is Resolved
  • devilstang
    Trophies
    3
    Posts
    29
    • March 6, 2019 at 7:58 PM
    • #1

    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.

  • bsrr
    Reactions Received
    12
    Trophies
    3
    Posts
    150
    • March 7, 2019 at 3:00 AM
    • #2

    See below example with IF statement for Input 1
    IF I1=1 THEN 2 ELSE 3 'Input 1 is high Prog 2 else Prog 3
    CALLP 2
    CALLP 3
    END

  • knnklnc
    Trophies
    3
    Posts
    7
    • March 12, 2019 at 11:20 AM
    • #3

    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

  • BillPbody
    Reactions Received
    1
    Trophies
    3
    Posts
    7
    • April 9, 2019 at 4:31 PM
    • #4

    I too need help with the IF statements but within a program that jumps steps if an input/inputs are true. Just need examples to refresh my memory lol

  • Stephannie
    Guest
    • April 19, 2019 at 8:05 AM
    • #5

    Try using multiple If's statements for various problems.

  • r013071c5
    Reactions Received
    1
    Trophies
    3
    Posts
    25
    • February 21, 2020 at 8:08 PM
    • #6
    Quote from devilstang

    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

  • MX330
    Trophies
    3
    Posts
    3
    • February 25, 2020 at 7:40 PM
    • #7

    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]

  • r013071c5
    Reactions Received
    1
    Trophies
    3
    Posts
    25
    • February 26, 2020 at 7:02 AM
    • #8

    A possible cause could be missing endif and end in your statement

    Endif

    End

  • Alroboter
    Trophies
    3
    Posts
    3
    • February 26, 2020 at 10:35 PM
    • #9

    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

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download