halt库卡_怎么编写库卡KUKA机器⼈专业程序,⾼级写法案例程序写法案例分享
换抢盘抓抓⼿程序:
DEF Q1_PICKGRPPER( ) :程序名称
INI :系统初始化
PTP HOME Vel= 100 % DEFAULT :HOME原点
OUT 272 'Grip2_Bracket_Open' State=TRUE :输出272抓⼿2防尘盖打开信号为真
OUT 271 'Grip2_Bracket_Cls' State=FALSE :输出271抓⼿2防尘盖关闭信号为假
WAIT FOR ( IN 272 'Grip2_Bracket_Opened' ) :等待抓⼿2防尘盖打开到位输⼊信
号272
WAIT FOR ( NOT IN 263 'ATC_Face' ) :等待换抢盘⾯接触输⼊信号263为⾮
WAIT FOR ( IN 265 'Grip2_In_Place' ) :等待抓⼿2在位输⼊信号265
青岛翻译公司
PTP P4 CONT Vel=100 % PDAT2 Tool[0] Ba[0]
PTP P3 CONT Vel=50 % PDAT1 Tool[0] Ba[0]
LIN P2 CONT Vel=0.2 m/s CPDAT2 Tool[0] Ba[0]
LIN P1 Vel=0.1 m/s CPDAT1 Tool[0] Ba[0]
WAIT FOR ( IN 263 'ATC_Face' ) :等待换抢盘⾯接触输⼊信号263
OUT 261 'ATC_LOCK' State=TRUE :输出换抢盘锁紧信号261为真
OUT 262 'ATC_UNLOCK' State=FALSE :输出换抢盘松开信号262为假
WAIT FOR ( IN 261 'ATC_Locked' ) :等待换抢盘锁紧到位输⼊信号261
RET=IOCTL("PNIO-CTRL",50,3) :恢复与抓⼿阀岛的通讯指令
WAIT Time=1 c :等待1S
Harder2=true :将Harder2置位为真
LIN P6 Vel=0.2 m/s CPDAT4 Tool[3]:GRIPPER2 Ba[0]
LIN P5 CONT Vel=0.2 m/s CPDAT3 Tool[3]:GRIPPER2 Ba[0]
WAIT FOR ( NOT IN 265 'Grip2_In_Place' ) :等待抓⼿2在位输⼊信号265为假不好意思日语
LIN P8 CONT Vel=1 m/s CPDAT6 Tool[3]:GRIPPER2 Ba[0]
LIN P7 CONT Vel=1 m/s CPDAT5 Tool[3]:GRIPPER2 Ba[0]
PTP P9 CONT Vel=100 % PDAT4 Tool[3]:GRIPPER2 Ba[0]
END
换抢盘放抓⼿程序
DEF Q1_PUTGRPPER( ) :程序名称
INI :系统初始化
OUT 271 'Grip2_Bracket_Cls' State=FALSE
OUT 272 'Grip2_Bracket_Open' State=TRUE
WAIT FOR ( IN 272 'Grip2_Bracket_Opened' )
WAIT FOR ( IN 269 'Grip1_Bracket_Clod' ) :等待抓⼿2防尘盖打开到位输⼊信号269 PTP P7 CONT Vel=100 % PDAT3 Tool[3]:GRIPPER2 Ba[0]
PTP P3 CONT Vel=100 % PDAT1 Tool[3]:GRIPPER2 Ba[0]
LIN P2 CONT Vel=0.2 m/s CPDAT2 Tool[3]:GRIPPER2 Ba[0]
LIN P1 Vel=0.1 m/s CPDAT5 Tool[3]:GRIPPER2 Ba[0]
WAIT FOR ( IN 265 'Grip2_In_Place' )
concordHarder2=fal :将Harder2置位为假
Repeat :循环指令
RET=IOCTL("PNIO-CTRL",60,3) :断开与抓⼿阀岛的通讯指令touch my heart什么意思
until (RET==0) :循环结束指令
WAIT FOR ( IN 263 'ATC_Face' )
OUT 261 'ATC_LOCK' State=FALSE
OUT 262 'ATC_UNLOCK' State=TRUE
WAIT FOR ( IN 262 'ATC_Unlocked' )
WAIT Time=1 c
LIN P4 Vel=0.1 m/s CPDAT3 Tool[0] Ba[0]
WAIT FOR ( NOT IN 263 'ATC_Face' )
LIN P5 CONT Vel=0.5 m/s CPDAT4 Tool[0] Ba[0]
cleansing creamPTP P6 CONT Vel=100 % PDAT2 Tool[0] Ba[0]
PTP P8 CONT Vel=100 % PDAT4 Tool[0] Ba[0]
PTP HOME Vel= 100 % DEFAULT
OUT 271 'Grip2_Bracket_Cls' State=TRUE
OUT 272 'Grip2_Bracket_Open' State=FALSE
WAIT FOR ( IN 271 'Grip2_Bracket_Clod' )
OUT 271 'Grip2_Bracket_Cls' State=FALSE
END
抓⼿抓件程序:
DEF Q1_Pick_part( )
INI
$CYCFLAG[11]=$IN[357] OR $IN[359] :定义循环旗标
INTERRUPT DECL 101 WHEN $CYCFLAG[11] DO INT_101() :中断声明
INTERRUPT Off 101 :关中断101
PTP P1 Vel=100 % PDAT1 Tool[3]:GRIPPER2 Ba[0]
OUT 349 'Vac1_ON' State=FALSE :输出真空信号249为假
UnClamp1 :抓⼿夹具打开
$ADVANCE=0
OUT 348 'unclamp' State=TRUE CONT :输出抓⼿打开信号348为真
OUT 347 'clamp' State=FALSE CONT :输出抓⼿夹紧信号347为假
$TIMER_STOP[6]=TRUE
$TIMER[6]=-10000
$TIMER_STOP[6]=FALSE
WAIT FOR ( $TIMER_FLAG[6]==TRUE ) OR (( NOT $IN[351] ) AND ( $IN[349] )) WAIT FOR ( $TIMER_FLAG[6]==TRUE ) OR (( NOT $IN[355] ) AND ( $IN[353] )) IF $TIMER_FLAG[6]==TRUE THEN
wowod
$TIMER_STOP[6]=TRUE
$OUT[76]=TRUE :输出抓⼿报警信号76为真
MsgQuit("Check If All Clamps Are Opened!", "Grip")
HALT
WAIT FOR ( NOT $IN[351] ) AND ( $IN[349] ) :等待抓⼿打开到位输⼊信号349 WAIT FOR ( NOT $IN[355] ) AND ( $IN[353] ) :等待抓⼿打开到位输⼊信号353 $OUT[76]=FALSE :输出抓⼿报警信号76为假
ENDIF
小学英语谚语
$ADVANCE=3
PinShift1 :抓⼿定位销伸出
$ADVANCE=0
OUT 346 'pin_unshift' State= FALSE CONT :输出定位销缩回信号346为假
OUT 345 'pin_shift' State= TRUE CONT :输出定位销伸出信号345为真
$TIMER_STOP[6]=TRUE
$TIMER[6]=-10000
$TIMER_STOP[6]=FALSE
WAIT FOR ( $TIMER_FLAG[6]==TRUE ) OR (( NOT $IN[345] ) AND ( $IN[347] )) IF $TIMER_FLAG[6]==TRUE THEN
$TIMER_STOP[6]=TRUE
$OUT[76]=TRUE :输出抓⼿报警信号76为真
MsgQuit("Check If All Clamps Are Opened!", "Grip")
HALT
WAIT FOR ( NOT $IN[345] ) AND ( $IN[347] ) :等待抓⼿定位销伸出到位输⼊
信号347
$OUT[76]=FALSE
ENDIF
du
$ADVANCE=3
WAIT FOR ( IN 34 'Entry OK 2' ) :等待允许进⼊抓件信号34
OUT 42 'Jig Non-Interference 2' State=FALSE :输出夹具⼲涉信号42为假,发送⼲涉
WAIT FOR ( IN 34 'Entry OK 2' ) :等待允许进⼊抓件信号34
PTP P2 CONT Vel=100 % PDAT2 Tool[3]:GRIPPER2 Ba[0]
PTP P3 CONT Vel=100 % PDAT3 Tool[3]:GRIPPER2 Ba[0]
PTP P4 CONT Vel=100 % PDAT4 Tool[3]:GRIPPER2 Ba[0]
FIRST: :跳转指针
$OV_PRO=30 :改变速度的系统变量
INTERRUPT ON 101 :开中断101
$ADVANCE=0 :改变预读指针的系统变量
PTP P6 CONT Vel=100 % PDAT9 Tool[3]:GRIPPER2 Ba[0]
$OV_PRO=10 :改变速度的系统变量
SEARCH() :调⽤⼦程序
INTERRUPT OFF 101 :关中断101
NOpartcheck :判断料框是否有件的逻辑集合
WAIT FOR ( IN 1025 'Always ON' AND IN 357 'part_check1' ) :等待板件检测到
位信号
OUT 349 'Vac1_ON' State=TRUE :输出真空信号349为真
WAIT Time=1 c :等待1S
Clamp1 :抓⼿夹具夹紧
$ADVANCE=0
OUT 347 'clamp' State=TRUE CONT
OUT 348 'unclamp' State=FALSE CONT
$TIMER_STOP[6]=TRUE
$TIMER[6]=-10000
$TIMER_STOP[6]=FALSE
WAIT FOR ( $TIMER_FLAG[6]==TRUE ) OR (( NOT $IN[349] ) AND ( $IN[351] )) WAIT FOR ( $TIMER_FLAG[6]==TRUE ) OR (( NOT $IN[353] ) AND ( $IN[355] ))
IF $TIMER_FLAG[6]==TRUE THEN
$TIMER_STOP[6]=TRUE
$OUT[76]=TRUE
MsgQuit("Check If All Clamps Are Opened!", "Grip")
HALT
WAIT FOR ( NOT $IN[349] ) AND ( $IN[351] )
WAIT FOR ( NOT $IN[353] ) AND ( $IN[355] )
$OUT[76]=FALSE
ENDIF
$ADVANCE=3
$OV_PRO=30
LIN P7 CONT Vel=0.2 m/s CPDAT7 Tool[3]:GRIPPER2 Ba[0]
LIN P8 CONT Vel=0.2 m/s CPDAT5 Tool[3]:GRIPPER2 Ba[0]
LIN P9 CONT Vel=1 m/s CPDAT6 Tool[1]:GRIPPER1 Ba[0]
$ADVANCE=3
$OV_PRO=20
PTP P11 CONT Vel=100 % PDAT5 Tool[1]:GRIPPER1 Ba[0]
PTP P12 CONT Vel=100 % PDAT6 Tool[1]:GRIPPER1 Ba[0]
PULSE 37 'Job Complete 5' State=TRUE Time=1 c :发送⼀个2S的完成信号37脉冲
OUT 42 'Jig Non-Interference 2' State=TRUE :输出⼲涉信号42为真,清除⼲涉END
DEF SEARCH() :定义局部⼦程序SEARCH()
$ADVANCE=0
LIN P7 Vel=0.5 m/s CPDAT8 Tool[3]:GRIPPER2 Ba[0]
LIN P13 Vel=0.5 m/s CPDAT10 Tool[3]:GRIPPER2 Ba[0]
END
DEF INT_101() :定义局部⼦程序INT_101 ()
Brake F :系统停⽌指令
Resume :系统中断运⾏指令
tofelEND
抓⼿放件程序:
decisionsDEF Q1_PUT_PART( )
INI