Timer in kuka

  • hey guys,

    I am using KRC4, KSS 8.6.8


    i have a question regarding timer in KUKA.

    i just found out that even if the Timer is started in Robot program, the timer will continue even when the robot program stops.


    lets say,

    $timer[1]=0

    $timer_stop[1]=false


    wait for $timer[1]>10000


    $timer[1]=0

    $timer_stop[1]=true


    so if i run this program timer will basically stop after 10000 ms.

    but what if the program is somehow forced to stop by mean of external button or some emergency stop before 10000 ms.

    the timer will keep on going all the time.


    so i was looking for a solution where the timer stops when the robot program stops.

    can anyone help me with it?

  • simply use submit to stop the timer if program is not running

    $timer_stop[1]=not $pro_act

    or

    $timer_stop[1]=$pro_act=false

    or

    $timer_stop[1]=$pro_state1<>#p_active

    or similar...


    key documentation is your friend (Programming Manuals for Systems Integrators, System Variables Manual). for more info check READ FIRST

    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

  • thankyou very much for the idea,

    its not like i dont read those manuals, manuals are standard explanation.

    Manuals cant generate a good idea like you did for this.

    but anyways thankyou again,

    that way i can try to fix some problem, if i cant fix it maybe i will summon you again.

  • The only way for program instructions to be executed is if they are placed inside a program, program is linked (interpreted) and the code is valid


    Placing above in robot program can work while robot program is interpreted. But once the program is stopped, code is no longer processed.


    One solution is to place such code into a program that is normally processed all the time - submit interpreter

    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

  • Still i am confuse in this, I used all yours optional code in my program but timer runnning as it is.


    Will you please explain that code with example. ??


    1.I want to reset timer 1

    2.Then i want to start timer 1

    3.After some working of robot i want to stop timer 1

    4.In between working of robot, if i stop the robot motion by help of hold button or by means of any external emergency stop pb, timer shold be stop, for that certain robo stop period.

  • Mangesh Shenavi if robot motion stops then, $robot_stopped = true

    if robot is moving then, $robot_stopped = false


    if robot_running_with_program == false then

    if $robot_stopped == true then

    $TIMER_STOP[1]=true

    endif

    endif

    robot_running_with_program, define this variable in config.dat, make it go true when robot program is running and if false turn it off. then use above code in SPS sub and you have to try everything by yourself, try to understand the behaviour of your own program and robot system variable.

  • I just try this code in my pendant


    Then contig.dat is in error.


    And the error is 'variable is longer than 24 character'




    What i have to do now ??

Advertising from our partners