pulsing IO during HALTs

  • 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,

  • Place your Ad here!

  • 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):



    *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?)


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

  • 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 ().

  • 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
  • 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?)

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners