kuka robot needs to wait for an input to be on for a certain amount of time

  • hey guy could do with pointing in the right direction. I need the robot to wait for an input to be on for 10 seconds before it continues with its program how would i go about this many thanks on advance p

  • VERY crude example:


    Code
    $TIMER[1] = -10000 ; 10 thousand milliseconds
    $TIMER_STOP[1] = FALSE
    REPEAT
      IF NOT $IN[1] THEN
        $TIMER[1] = -10000 ; reset to -10sec
      ENDIF
    UNTIL ($IN[1] AND $TIMER_FLAG[1])

    Any time the input isn't true, the timer resets. So this is a "debounce" with a 10sec period.

  • VERY crude example:


    Code
    $TIMER[1] = -10000 ; 10 thousand milliseconds
    $TIMER_STOP[1] = FALSE
    REPEAT
      IF NOT $IN[1] THEN
        $TIMER[1] = -10000 ; reset to -10sec
      ENDIF
    UNTIL ($IN[1] AND $TIMER_FLAG[1])

    Any time the input isn't true, the timer resets. So this is a "debounce" with a 10sec period.

    Actually ,there is a system build-in function for timer limit: EXTFCTP BOOL TIMER_LIMIT (REAL SECONDS:IN)

    It returns true , when the timer is out. FOR EXAMPLE:

    WAIT FOR $IN[1] AND TIMER_LIMIT(10)

  • SkyeFire

    This system build-in function should have been there for really a long time, i believe(I had idea about it around 2011).There are many system build-in functions/subprograms you can refer to the data file Operate.dat,but it has been hidden in the KRC4 systems.


    panic mode

    This timer function has nothing to do with the 64 system $TIMER[], and it must be used together with WAIT FOR command,you can use it in Robot/submit interpreter.Even if the timer limit is used in SPS and over 16 ms,it could not stop sps program.Thus i believe it's based on system time, and has nothing to do with interpreter time.


    Below is part of system functions and subprograms i took out from data file:

  • and timers are confusing for plenty of people.... i don't know what they are thinking when coming up with various terms. specially when doing negatives.

    $TIMER_STOP is bad, $TIMER_RUN is better

    $ALARM_STOP is bad, $ESTOP_OK is better

    etc.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Advertising from our partners