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. Fanuc Robot Forum
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

IF statement (w/t THEN and ENDIF) V8.20P/35

  • RKind
  • January 25, 2024 at 4:41 PM
  • Thread is Unresolved
  • RKind
    Trophies
    3
    Posts
    31
    • January 25, 2024 at 4:41 PM
    • #1

    Here I am encountering an issue while creating a BG Logic program. My objective is to abort the program upon encountering an error, specifically when the condition (UO[6] Fault = ON) is met due to any issues with the robot.

    Although CSTOPI for Abort is available, I prefer to incorporate it with the fault condition. This way, the robot can initiate the recovery to its home position whenever an error occurs during the execution of any program.

    Controller details:

    Model: LR Mate 200iD/7L

    Communication protocol: PROFIBUS-DP

    Software Version: V8.20P/35

    I have attempted various methods (refer to the attached picture) to achieve this, but consistently encounter the error INTP-443 (%s^4, %d^5) - Invalid item for Mixed Logic.

    Can someone assist me in comprehending how the IF statement works without the THEN and ENDIF conditions?

    Images

    • Screenshot 2024-01-25 163914.png
      • 42.3 kB
      • 587 × 215
      • 18
  • asdf
    Reactions Received
    7
    Trophies
    1
    Posts
    45
    • January 25, 2024 at 5:28 PM
    • #2

    You cannot "CALL" a program from BG logic but you can asynchronously "RUN" a program from BG logic.

    I am doing the exact same thing in one of my cells to abort from BG and it works great.

  • asdf
    Reactions Received
    7
    Trophies
    1
    Posts
    45
    • January 25, 2024 at 5:38 PM
    • #3

    The RUN instruction isn't available in the one line if statement so you must use the IF...THEN...ENDIF instructions as below.

    Code
    IF (UI[6]=ON) THEN
    RUN ABORTIT
    ENDIF
  • pdl
    Reactions Received
    266
    Trophies
    9
    Posts
    1,504
    • January 25, 2024 at 7:48 PM
    • #4

    I would highly recommend you NOT automatically abort simply because the robot is faulted, that is just throwing the baby out with the bathwater.

    For example, do you really think it is a good idea to abort your program when you're stepping through in manual and you get a fault because you released the dead-man switch? Or, when the robot faults because of a program bug, do you really want the robot to go back to line zero of the program, or would you rather debug from the line of code that generated the fault?

    I prefer to use a user alarm with an adequate severity to abort the robot when needed, rather than aborting for any and all faults.

  • RKind
    Trophies
    3
    Posts
    31
    • January 26, 2024 at 8:42 AM
    • #5

    This is what I stated earlier I cannot use THEN and ENDIF condition in V8.20, this is why I am siking for a solution...

    Quote from asdf

    The RUN instruction isn't available in the one line if statement so you must use the IF...THEN...ENDIF instructions as below.

    Code
    IF (UI[6]=ON) THEN
    RUN ABORTIT
    ENDIF
  • RKind
    Trophies
    3
    Posts
    31
    • January 26, 2024 at 8:49 AM
    • #6
    Quote from pdl

    I would highly recommend you NOT automatically abort simply because the robot is faulted, that is just throwing the baby out with the bathwater.

    For example, do you really think it is a good idea to abort your program when you're stepping through in manual and you get a fault because you released the dead-man switch? Or, when the robot faults because of a program bug, do you really want the robot to go back to line zero of the program, or would you rather debug from the line of code that generated the fault?

    I prefer to use a user alarm with an adequate severity to abort the robot when needed, rather than aborting for any and all faults.

    Definienetly you are right, I have a thought on this as well and the condition for automatic will be added in the abort command.

    Regarding the process, we can't or shouldn't continue because we have a deburing application that requires that any error during the process must result in an NIO part. And this is the result, I want to abort the programme at any point and go back home, so we have dropped NIO part on the NIO conveyor belt.

  • RKind
    Trophies
    3
    Posts
    31
    • January 26, 2024 at 8:50 AM
    • #7
    Quote from asdf

    The RUN instruction isn't available in the one line if statement so you must use the IF...THEN...ENDIF instructions as below.

    Code
    IF (UI[6]=ON) THEN
    RUN ABORTIT
    ENDIF

    This was informative and Thank you !

  • Online
    gpunkt
    Reactions Received
    119
    Trophies
    6
    Posts
    456
    • January 26, 2024 at 4:30 PM
    • #8
    Quote from RKind

    This is what I stated earlier I cannot use THEN and ENDIF condition in V8.20, this is why I am siking for a solution...

    Do you have the possibility to upgrade the system software to v8.30P/xx?
    I believe that was when they added IF/THEN/ELSE/ENDIF statements.

  • RKind
    Trophies
    3
    Posts
    31
    • January 29, 2024 at 8:27 AM
    • #9

    Hello gpunkt,

    Nope, there is no possibitlity to upgrade.

    Quote from gpunkt

    Do you have the possibility to upgrade the system software to v8.30P/xx?
    I believe that was when they added IF/THEN/ELSE/ENDIF statements.

  • Online
    gpunkt
    Reactions Received
    119
    Trophies
    6
    Posts
    456
    • January 29, 2024 at 8:57 AM
    • #10

    And you can't use the other IF-instruction that looks like:

    IF([condition]), [action]

    which gives you other options for the actions than just CALL or JMP LBL[], for example:

    IF(DI[10]), DO[10]=ON

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
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • 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
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • 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