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

FANUC Program Call issue

  • Weld Tech Tony
  • May 2, 2025 at 4:59 PM
  • Thread is Unresolved
  • Weld Tech Tony
    Posts
    2
    • May 2, 2025 at 4:59 PM
    • #1

    Hello!

    I am working on a project in which 3 different builds can be selected from an HMI. During our last test, but not every time, the robot would repeat the last build regardless of which build was selected. i suspect there might be an issue in the PLC program, but I want to make sure that there's nothing in my code that could be causing it to repeat intermittently.

    This is the main program, with each of the three builds having functionally identical subprograms.

    Code
       1:  !HMI Selects Build ;
       2:  LBL[1] ;
       3:  IF (DI[19:HOME ROBOT]=ON) THEN ;
       4:  CALL SAFE_HOME    ;
       5:  ENDIF ;
       6:   ;
       7:  IF (UO[8:TP enabled]=OFF) THEN ;
       8:  OVERRIDE=50% ;
       9:  ENDIF ;
      10:   ;
      11:  IF DI[21:BUILD ROBOT]=ON,CALL ROBOT_BUILD ;
      12:  IF DI[22:BUILD FIREFIGHTER]=ON,CALL FF_BUILD ;
      13:  IF DI[23:BUILD WELDER]=ON,CALL WELD_BUILD ;
      14:  JMP LBL[1] ;
    /POS
    /END
    Display More


    Code
       1:  LBL[999] ;
       2:  IF DI[24:PICK LEGS]=ON,JMP LBL[1] ;
       3:  IF DI[25:PICK BODY]=ON,JMP LBL[2] ;
       4:  IF DI[26:PICK HEAD]=ON,JMP LBL[3] ;
       5:  JMP LBL[999] ;
       6:   ;
       7:  !Calls Leg Pick Program ;
       8:  LBL[1] ;
       9:   ;
      10:  CALL ROBOT_LEGS    ;
      11:   ;
      12:  IF (DI[27:LEGS PRESENT]=OFF AND R[1]=0) THEN ;
      13:  R[1]=R[1]+1    ;
      14:  JMP LBL[1] ;
      15:  ENDIF ;
      16:  R[1]=0    ;
      17:   ;
      18:  JMP LBL[999] ;
      19:   ;
      20:  !Calls Body Pick Program ;
      21:  LBL[2] ;
      22:   ;
      23:  CALL ROBOT_BODY    ;
      24:   ;
      25:  IF (DI[28:BODY PRESENT]=OFF AND R[1]=0) THEN ;
      26:  R[1]=R[1]+1    ;
      27:  JMP LBL[2] ;
      28:  ENDIF ;
      29:  R[1]=0    ;
      30:   ;
      31:  JMP LBL[999] ;
      32:   ;
      33:  !Calls Head Pick Program ;
      34:  LBL[3] ;
      35:   ;
      36:  CALL ROBOT_HEAD    ;
      37:   ;
      38:  IF (DI[29:HEAD PRESENT]=OFF AND R[1]=0) THEN ;
      39:  R[1]=R[1]+1    ;
      40:  JMP LBL[3] ;
      41:  ENDIF ;
      42:  R[1]=0    ;
      43:   ;
      44:  IF (DI[29:HEAD PRESENT]) THEN ;
      45:  R[10:ROBOTS MADE]=R[10:ROBOTS MADE]+1    ;
      46:  JMP LBL[99] ;
      47:  ENDIF ;
      48:   ;
      49:  JMP LBL[999] ;
      50:   ;
      51:  LBL[99] ;
      52:  !Robot @ Home ;
      53:  CALL SAFE_HOME    ;
    /POS
    /END
    Display More


    The second program is basically the same as the other "_build" programs, just with different registers and calls. Each part has a "retry" function - lines 25-29, for example - that has the robot try again if it misses the pick or place, then go home if it fails again. That's the only other thing I can think of that might be causing a problem, but as I said above, its not every time.

    Any insights are appreciated.

    Thanks!

  • Lemster68 May 2, 2025 at 5:09 PM

    Approved the thread.
  • YakawFaBB
    Reactions Received
    12
    Trophies
    1
    Posts
    74
    • May 5, 2025 at 8:43 AM
    • #2

    Hi Weld Tech Tony , probably you have the DI is enable for a few seconds after the sub-program is run . This is enough for the robot to repeat sometimes the last built. In your example the main program never ends.

  • sborchshev
    Reactions Received
    4
    Trophies
    2
    Posts
    39
    • May 5, 2025 at 5:08 PM
    • #3

    You can set an acknowledge DO signal to PLC right after you jump to the one of the routines, so PLC can drop program request DI. And give it a wait before you jump in the waiting loop.

  • Weld Tech Tony
    Posts
    2
    • May 6, 2025 at 1:19 PM
    • #4

    Thanks for the replies!

    I found the solution - in two of the 3 programs, the JMP LBL[999] was inside the last IF THEN statement, so the program would never actually reach LBL[99] to end the build. The program runs as expected in AUTO now.

    We still have an issue where when we try to call the individual programs (just the head/feet/body for one build) the robot gets stuck on one build and won't switch, even when going back to manual. An ABORT ALL on the TP fixes it, but I'd rather it be handled automatically. My guess is that is has to do with our PLC code structure.

    The project is due today, so I don't think I'll have time to fix it :grinning_face_with_sweat:

    Thanks again!

  • sborchshev
    Reactions Received
    4
    Trophies
    2
    Posts
    39
    • May 6, 2025 at 4:16 PM
    • #5

    If it is not exiting from the program, just check what is making it to keep looping. Must be condition in your IF statement.

    Could be a difference in scan times in PLC and your robot. That is why I advised to use confirmation bit for program switching, done bit will allow to trigger demand for next program switch.

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

Similar Threads

  • Stack Overflow Error for Hello World

    • TransformerStacker
    • April 2, 2025 at 10:43 PM
    • Fanuc Robot Forum
  • Robot running fine in teach mode, but not in auto.

    • elijahbrian1
    • April 3, 2025 at 11:32 PM
    • Fanuc Robot Forum
  • Converting RoboGuide Robot Motion to TP Program for Real-Time Synchronization

    • MANIKANDAN_S
    • February 3, 2025 at 10:44 AM
    • Fanuc Robot Forum
  • Defect and BG logic

    • ashley
    • December 19, 2024 at 2:47 PM
    • Fanuc Robot Forum
  • Unintialised Data - Fanuc Teach Pendant

    • AK95
    • May 20, 2024 at 4:46 PM
    • Fanuc Robot Forum
  • Bg Logic

    • Coldstart
    • April 18, 2024 at 12:07 PM
    • Fanuc Robot Forum
  • TCP/IP Communication Python and Fanuc

    • Shubham_23
    • March 26, 2024 at 11:36 PM
    • Fanuc Robot Forum
  • Fanuc code analyzer to do cross searchs

    • Shellmer
    • February 20, 2024 at 8:04 PM
    • Manuals, Software and Tools for Fanuc Robots (you should look here first before posting)
  • Dynamic control of FANUC Robot in Run-Time

    • Gokul N A
    • July 3, 2019 at 10:39 AM
    • Fanuc Robot Forum
  • Recording system data from a FANUC robot with the Karel program

    • AnisFrej
    • March 3, 2022 at 7:43 PM
    • Fanuc Robot Forum
  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