当前位置:网站首页>How to use interrupt

How to use interrupt

2022-06-29 17:10:00 User 4442670

Hi Hello everyone , Everybody knows kuka Robot programs are executed sequentially , So how to realize the continuous monitoring of a certain signal . Or after a signal is triggered , The robot immediately stops the current task to perform another task .

This is what we want to say in this issue INTERRUPT Instructions .

Nonsense

The first is the break statement ;

<GLOBAL> INTERRUPT DECL Prio WHEN Ereignis DO Interruptprogramm

<GLOBAL>: Indicates a global interrupt

Notice the break statement ,INTERRUPT DECL

Prio: Interrupt number , It is also a priority , priority 1、2、4 - 39 and 81 - 128 To choose from . priority 3 and 40 - 80 It is reserved for system application

WHEN Ereignis : Interrupt trigger condition

DO Interruptprogramm: The program called after the condition is met

give an example :

INTERRUPT DECL 10 WHEN $IN[10] DO STOP_PROG( )

It should be noted that GLOBAL The concept of :

The following figure shows the pictures in the official data , This picture is a good illustration of GLOBAL Usage of .

That is, to declare an interrupt on a subroutine , add GLOBAL Then the upper layer program is also effective .

The next step is to enable interrupts

INTERRUPT ON/OFF/DISABLE/ENABLE < Number >

ON: Enable interrupt

OFF: Stop enabling

DISABLE: prohibit / Pause

ENABLE: Open a forbidden interrupt

ON/OFF These two don't say ,DISABLE/ENABLE These two are used to pause the interrupt that has been enabled .

And in DISABLE Still check the trigger condition after , But run to ENABLE Then the interrupt program will be executed .

DISABLE/ENABLE This general application is shown in the figure below ,

Program start interrupt ON Before the robot enters the machine tool DISABLE, The robot comes out of the machine tool ENABLE, In this way, whenever an interrupt triggers , The robot will not stop inside the machine tool , Ensure the safety of the equipment .

Interrupt the program

An interrupt can trigger a program to execute the operation after the interrupt

for example STOP_PROG( ) Such a name

Some syntax of interrupt program is different from that of ordinary program module

Not usable :

You cannot use online forms ,

Do not use tape s For example sptp,slin

Not available Advance

Not available INI

permissible :

Brake(F)

Resume

give an example :

GLOBAL INTERRUPT DECL 100 WHEN e_stop==FALSE DO robot_stop( )
INI
PTP HOME Vel= 100 % DEFAULT
INTERRUPT ON 100 ; The number is after , If you don't write it, it means all Interrupt All set ON
LOOP
…
…
ENDLOOP
INTERRUPT OFF 100 ; The number is after , If you don't write it, it means all Interrupt All set OFF
PTP HOME Vel= 100 % DEFAULT
END
;-------------------------------------
def robot_stop()
INTERRUPT OFF 100
BRAKE
WAIT FOR (E_stop)
CONTINUE
INTERRUPT ON 100
End

example 2:

DEF CELL ( )
INIT
BASISTECH INI
$out[appl_run]=false
CHECK HOME
PTP HOME Vel= 100 % DEFAULT
AUTOEXT INI
LOOP
INTERRUPT DECL 100 WHEN $out[236]==TRUE do Backhome() ; Statement interrupted 100
...
INTERRUPT ON 100 ; Turn on interrupt 100
P00 (#EXT_PGNO,#PGNO_GET,DMY[],0 )
SWITCH PGNO ; Select with Programnumber
CASE 9
P00 (#EXT_PGNO,#PGNO_ACKN,DMY[],0 ) ; Reset Progr.No.-Request
purge ( ) ; Call purge
DEFAULT
P00 (#EXT_PGNO,#PGNO_FAULT,DMY[],0 )
ENDSWITCH
INTERRUPT OFF 100 ; Turn off interrupt 100
ENDLOOP
END
;==========================================================
DEF Backhome() ; Interrupt subroutine 
INTERRUPT OFF 100 ; After the interrupt takes effect, turn off the interrupt to prevent multiple triggering 
$TIMER_STOP[2]=TRUE
$TIMER[2]=0
BRAKE ; Terminate the current action 
PTP XHOME ; return Home spot ( Can't track approaching in interrupt )
...
RESUME ; Returns the trigger location at the declarator level 
END
原网站

版权声明
本文为[User 4442670]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/180/202206291701178694.html