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

pulsing IO during HALTs

  • AiSard
  • March 27, 2018 at 6:33 AM
  • Thread is Resolved
  • AiSard
    Reactions Received
    1
    Trophies
    3
    Posts
    44
    • March 27, 2018 at 6:33 AM
    • #1

    A question on coding:

    I currently have a tool mapped to $out[1]
    During a portion of the robot movement, the robot HALTS and waits for input before continuing.
    During that time, I would like to have the tool pulsing on/off continuously.

    Is this possible while using Halt? or perhaps by replacing Halt with something else?
    Just that it doesn't introduce a delay once the input is pressed,
    and if possible for the pulsing to then immediately stop (less important)

    KR C4 compact
    KSS 8.3.25

    Thanks,

  • Online
    Leon
    Reactions Received
    35
    Trophies
    5
    Posts
    471
    • March 27, 2018 at 7:14 AM
    • #2

    the first thing that come's to mind is the sps. there you could write a function to pulse when the robot is halted

    Every problem has a solution, that isn't the problem. The problem is the solution.

  • davidina
    Reactions Received
    3
    Trophies
    3
    Posts
    95
    • March 27, 2018 at 7:32 AM
    • #3

    You could also use a WHILE loop and use that input as a condition. Inside the loop you can use your pulse as you want.

  • AiSard
    Reactions Received
    1
    Trophies
    3
    Posts
    44
    • March 27, 2018 at 7:35 AM
    • #4
    Quote from Leon


    the first thing that come's to mind is the sps. there you could write a function to pulse when the robot is halted

    Any alternative to that? Never touched SPS and don't want to mess it up inadvertently..
    If I allow for a small delay (trying to avoid this) would something like this work instead? (rough draft):

    Code
    DECL REAL STEP
    
    
    STEP = 0.25
    
    
    LIN P1
    LIN P2
    LIN P3
    HALTPULSE()
    LIN P4
    LIN P5
    LIN P6
    HALTPULSE()
    LIN …
    …
    END
    _______________
    
    
    DEF HALTPULSE()
    LOOP
    $OUT[1] = TRUE
    CHECK()
    $OUT[1] = FALSE
    CHECK()
    $OUT[1] = FALSE
    CHECK()
    $OUT[1] = FALSE
    CHECK()
    ENDLOOP
    END
    
    
    DEF CHECK()
    WAIT SEC STEP
    IF(?) ;input replacing halt became true*
    $OUT[1] = FALSE ; immediately stop $out and exit
    EXIT ;but exit all loops??**
    ENDIF
    Display More


    *Not sure how to trigger the IF with the play button (replacing the HALT command)
    **And have forgotten what the command is for breaking out of all nested loops.

    Would prefer if there was no delay whatsoever, but I guess I could just have 0.1 sec intervals for checking instead (any negatives to that approach?)

  • AiSard
    Reactions Received
    1
    Trophies
    3
    Posts
    44
    • March 27, 2018 at 8:08 AM
    • #5
    Quote from davidina


    You could also use a WHILE loop and use that input as a condition. Inside the loop you can use your pulse as you want.

    Which input? I am currently using Halt which requests the play button be pressed to continue..
    WHILE loops only check at the beginning of the loop, if inside the WHILE loop there's only a PULSE and WAIT command, that's a really long period of time between checks...

  • Jrk
    Reactions Received
    1
    Trophies
    3
    Posts
    21
    • March 27, 2018 at 10:39 AM
    • #6

    If you need CONSTANT pulse all the time, you can try to put it in to the loop of sps.sub program.

    Edit:
    You have description how sps.sub works in chapter 12 in system integrator manual.

    Edited once, last by Jrk (March 27, 2018 at 11:10 AM).

  • Online
    SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,427
    • March 27, 2018 at 2:49 PM
    • #7

    How fast a pulse rate?

    Code
    $TIMER[1] = -500 ; preset timer
    $TIMER_STOP[1] = FALSE ; let timer run
    REPEAT
      IF $TIMER_FLAG[1] THEN ; $TIMER[1] is above 0
        $TIMER[1] = -500 ; 500ms delay
        $OUT[1] = NOT $OUT[1] ; invert output
      ENDIF
    UNTIL $IN[1] ; input to end the pause
    $OUT[1] = TRUE ; set tool output to fixed state before moving
  • AiSard
    Reactions Received
    1
    Trophies
    3
    Posts
    44
    • March 28, 2018 at 9:36 AM
    • #8

    Will try that out this afternoon, is there no way to get rid of the variable 0-500ms delay though?
    Though I suppose I could try 100ms cycle and just trigger the pulse every 10 cycles or something like that (if that works? is there a problem / minimum cycle time for running a REPEAT cycle?)

    Also people seem to be missing the second part of the question..
    What do I replace the HALT command with? so that the Play button on the pad triggers $IN[1]
    (unless I'm missing something very simple here?)

  • Online
    Leon
    Reactions Received
    35
    Trophies
    5
    Posts
    471
    • March 28, 2018 at 12:31 PM
    • #9

    Well you could wire a resume button to external I/O en then you can check an input. I you don't want that you can check the variable manual in manuals section. if there is a variable linked to the start button on the pendant. If not, then i come back to my previous post about the sps.

    Every problem has a solution, that isn't the problem. The problem is the solution.

  • Online
    SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,427
    • March 28, 2018 at 2:44 PM
    • #10

    KRL execution runs at mircoseconds per line of code, or less on the newer controllers. The limiting factor is the resolution of the $TIMER variable, which is 12ms. So your smallest time step would be 12ms True, 12ms False. 500ms is just a number I pulled out of thin air.

    A HALT command can only be overridden by the Step-Go button in AUT mode, or by an external start signal in EXT mode. But using a HALT would stop this loop from executing, in which case your only option would be to put the pulsing loop into the SPS.

    The better option would probably be to post an operator message that waits for a softkey, and change the loop so the exit condition is associated to that softkey.

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

Users Viewing This Thread

  • 1 Guest
  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