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. KUKA 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

How to avoid that little stop between movements (IF clauses involved)

  • robotecnik
  • May 30, 2013 at 11:33 AM
  • Thread is Resolved
  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • May 30, 2013 at 11:33 AM
    • #1

    Hello all,

    I'm trying to get an output ON without stopping the robot.

    Of course I'm using

    Code
    TRIGGER WHEN DISTANCE=0 DELAY=0 DO PULSE(ADO_bU21LiquidPApply,TRUE,0.5)


    to get it done, but there are some conditions before that must be observed, therefore, I have some IF clauses and a couple of function calls prior to activating the output itself...

    In pseudocode the logic flow is the following one:

    Code
    ; IN THE SAME SRC FILE THAN THE USER POINTS/PROGRAM
    DEF UserFunction(iP1,iP2)
     INT iP1
     INT iP2
    
    
     IF (iP1==0) THEN
        HALT
     ELSE
       SWITCH iP1
        CASE 2
          IF(Global_bool_var)THEN
           IF(MOD(Global_int_var,iP2)==(iP2-1))THEN
             fxThatMakesThePulse(100)
           ENDIF
          ENDIF
    
    
        DEFAULT
          HALT
       ENDSWITCH
     ENDIF
    END
    
    
    ;IN ANOTHER AND GLOBAL SRC FILE
    GLOBAL DEF fxThatMakesThePulse(iT)
    	INT iT
    
    
    	  IF (iT == 0)THEN
    	    TRIGGER WHEN DISTANCE=0 DELAY=0 DO PULSE(ADO_bU21LiquidPApply,TRUE,0.5)
    	  ELSE
    	    TRIGGER WHEN DISTANCE=0 DELAY=0 DO PULSE(ADO_bU21LiquidPApply,TRUE,m_iT/1000)
    	  ENDIF
    
    
    ; Something will be handled in the SPS after a while...
      $TIMER[3]=0
      $TIMER_STOP[3]=FALSE
    END
    Display More

    Of course, if in the main program I'm using the TRIGGER... call directly the robot is not stopping.

    I would like to be able to keep the different functions and so in my logics in order to separate the physical inputs and outputs from the logics.

    I've tried placing a continue just before any of the IF clauses present in the code with the same result...

    Any idea or hint?

    as always thank you in advance.

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • eusty
    Reactions Received
    6
    Trophies
    4
    Posts
    721
    • May 30, 2013 at 11:56 AM
    • #2

    Could you use a subroutine rather than a different program? It's probably the program switching stopping the advance run.

    I have seen the call to BAS etc at the start of a program, which is called by another, removed which I thought might stop this?

    Sent using Tapatalk 4.

  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • May 30, 2013 at 12:18 PM
    • #3

    Thank you for your answer Eusty, but I'm afraid it reacts exactly in the same way. I've just made the test now (I've copied the content of the function inside the second SRC and pasted it directly where that function was called) and no change... :frowning_face:

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • May 30, 2013 at 1:04 PM
    • #4

    I've found a way to make it work as expected:

    Writting CONTINUE before and after ANY program line inside the first and second functions... This is probably the ugliest thing I've seen for a long time...

    Code
    CONTINUE
    code
    CONTINUE
    code
    CONTINUE
    code
    CONTINUE
    code
    CONTINUE
    code
    CONTINUE
    code
    CONTINUE
    ...
    Display More

    Do you know if I can activate some kind of global continue? I mean, I'd like to activate it before executing those functions and deactivate it again just after the functions have finished their job...

    It should be something like:

    Code
    GLOBAL_CONT_ACT
    code
    code
    code
    code
    code
    GLOBAL_CONT_DEACT

    Thank you in advance

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • SkyeFire
    Reactions Received
    1,060
    Trophies
    12
    Posts
    9,456
    • May 30, 2013 at 11:32 PM
    • #5

    That many CONTINUE statements shouldn't be necessary. There's a list of commands that break the Advance pointer run in the Expert Programming Manual. Any commands that aren't on that list shouldn't need a CONTINUE (most calls to BAS.SRC, for example, don't break the Advance run at all).

    Unfortunately, no, there isn't any sort of Global Continue.

  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • May 31, 2013 at 11:09 AM
    • #6

    Thank you for your answer Skyefire, I've started again to check the program.

    Note: believe it or not in the KUKA tech support told me that each IF clause stops the flow and that therefore I needed to put a continue just after each one. :frowning_face:

    Apart of that I've found some logic on the problem:

    The second function can be called in two different situations: with the robot in movement or with the robot stopped. This made me to design the logics in the following way:

    Code
    IF ($PRO_MOVE) THEN
      TRIGGER / DISTANCE...
    ELSE
      PULSE
    ENDIF

    I've put a halt just after the TRIGGER/DISTANCE (to check if the program was going there or not).

    The external code (the one who calls the second function) is something like:

    Code
    LOOP
    PTP 1
    Function2
    PTP 2
    PTP 3
    ENDLOOP

    My surprise has been big when I've seen that some times the robot got stopped at the halt and that sometimes it was not getting stopped (therefore the normal PULSE was being called).

    That's really strange, I've finished solving the issue putting a simple CONTINUE before the normal PULSE, but that is (at last) strange.

    Pointing me to the manual has been great, I've noticed that asking for internal/system variables stops the movements, therefore I've also put the continue before the first IF clause (where the $PRO_MOVE var is being checked).

    At last everything will work as expected.

    Thank you all for your help and comments.

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • SkyeFire
    Reactions Received
    1,060
    Trophies
    12
    Posts
    9,456
    • May 31, 2013 at 3:21 PM
    • #7

    Yeah, IF-THENs by themselves don't break the advance run, in my experience, but they may, depending on what variables they access.

    Some, but not all, system variables may do it. Setting outputs does.

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