主营ABB、库卡KUKA、安川YASKAWA、发那科FANUC、欧地希OTC、川崎Kawasaki、遨博AUBO、现代HYUNDAI、电装DENSO、欧姆龙OMRON、爱普生EPSON等进口机器人项目集成、机器人代理、机器人配件、机器人售后维保、机器人培训一站式服务。
地址:上海市嘉定区南翔镇众仁路399号B座20楼
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] Base[0]
PTP P3 CONT Vel=50 % PDAT1 Tool[0] Base[0]
LIN P2 CONT Vel=0.2 m/s CPDAT2 Tool[0] Base[0]
LIN P1 Vel=0.1 m/s CPDAT1 Tool[0] Base[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 sec :等待1S
Harder2=true :将Harder2置位为真
LIN P6 Vel=0.2 m/s CPDAT4 Tool[3]:GRIPPER2 Base[0]
LIN P5 CONT Vel=0.2 m/s CPDAT3 Tool[3]:GRIPPER2 Base[0]
WAIT FOR ( NOT IN 265 'Grip2_In_Place' ) : 等待抓手2在位输入信号265为假
LIN P8 CONT Vel=1 m/s CPDAT6 Tool[3]:GRIPPER2 Base[0]
LIN P7 CONT Vel=1 m/s CPDAT5 Tool[3]:GRIPPER2 Base[0]
PTP P9 CONT Vel=100 % PDAT4 Tool[3]:GRIPPER2 Base[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_Closed' ) :等待抓手2防尘盖打开到位输入信号269
PTP P7 CONT Vel=100 % PDAT3 Tool[3]:GRIPPER2 Base[0]
PTP P3 CONT Vel=100 % PDAT1 Tool[3]:GRIPPER2 Base[0]
LIN P2 CONT Vel=0.2 m/s CPDAT2 Tool[3]:GRIPPER2 Base[0]
LIN P1 Vel=0.1 m/s CPDAT5 Tool[3]:GRIPPER2 Base[0]
WAIT FOR ( IN 265 'Grip2_In_Place' )
Harder2=false :将Harder2置位为假
Repeat :循环指令
RET=IOCTL("PNIO-CTRL",60,3) :断开与抓手阀岛的通讯指令
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 sec
LIN P4 Vel=0.1 m/s CPDAT3 Tool[0] Base[0]
WAIT FOR ( NOT IN 263 'ATC_Face' )
LIN P5 CONT Vel=0.5 m/s CPDAT4 Tool[0] Base[0]
PTP P6 CONT Vel=100 % PDAT2 Tool[0] Base[0]
PTP P8 CONT Vel=100 % PDAT4 Tool[0] Base[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_Closed' )
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 Base[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
$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
$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 Base[0]
PTP P3 CONT Vel=100 % PDAT3 Tool[3]:GRIPPER2 Base[0]
PTP P4 CONT Vel=100 % PDAT4 Tool[3]:GRIPPER2 Base[0]
FIRST: :跳转指针
$OV_PRO=30 :改变速度的系统变量
INTERRUPT ON 101 :开中断101
$ADVANCE=0 :改变预读指针的系统变量
PTP P6 CONT Vel=100 % PDAT9 Tool[3]:GRIPPER2 Base[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 sec :等待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 Base[0]
LIN P8 CONT Vel=0.2 m/s CPDAT5 Tool[3]:GRIPPER2 Base[0]
LIN P9 CONT Vel=1 m/s CPDAT6 Tool[1]:GRIPPER1 Base[0]
$ADVANCE=3
$OV_PRO=20
PTP P11 CONT Vel=100 % PDAT5 Tool[1]:GRIPPER1 Base[0]
PTP P12 CONT Vel=100 % PDAT6 Tool[1]:GRIPPER1 Base[0]
PULSE 37 'Job Complete 5' State=TRUE Time=1 sec :发送一个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 Base[0]
LIN P13 Vel=0.5 m/s CPDAT10 Tool[3]:GRIPPER2 Base[0]
END
DEF INT_101() : 定义局部子程序INT_101 ()
Brake F :系统停止指令
Resume :系统中断运行指令
END
抓手放件程序:
DEF Q1_PUT_PART( )
INI
PTP p1 CONT Vel=100 % PDAT2 Tool[3]:GRIPPER2 Base[0]
Inzone :工作允许进入
$ADVANCE=0
WAIT FOR ( IN 33 'Entry OK 1' ) CONT :等待允许进入放件信号33
OUT 41 'Jig Non-Interference 1' State=FALSE CONT :发干涉信号
WAIT FOR ( IN 33 'Entry OK 1' ) CONT :等待允许进入放件信号33
$ADVANCE=3
In_mb70rh_1 :发送机器人与机器人之间的干涉区信号
$ADVANCE=0
WAIT FOR ( IN 57 'Robot Clear Zone 1' ) CONT :等待机器人干涉信号57
OUT 57 'Robot Clear Zone 1' State=FALSE CONT :输出机器人干涉信号57为假发干涉
WAIT FOR ( IN 57 'Robot Clear Zone 1' ) CONT :等待机器人干涉信号57
$ADVANCE=3
PTP p4 CONT Vel=100 % PDAT3 Tool[3]:GRIPPER2 Base[0]
PTP p5 CONT Vel=100 % PDAT4 Tool[3]:GRIPPER2 Base[0]
UnClamp1 :抓手夹具打开
$ADVANCE=0
OUT 348 'unclamp' State=TRUE CONT
OUT 347 'clamp' State=FALSE CONT
$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
$TIMER_STOP[6]=TRUE
$OUT[76]=TRUE
MsgQuit("Check If All Clamps Are Opened!", "Grip")
HALT
WAIT FOR ( NOT $IN[351] ) AND ( $IN[349] )
WAIT FOR ( NOT $IN[355] ) AND ( $IN[353] )
$OUT[76]=FALSE
ENDIF
$ADVANCE=3
LIN p6 CONT Vel=0.5 m/s CPDAT7 Tool[3]:GRIPPER2 Base[0]
LIN p7 CONT Vel=0.2 m/s CPDAT6 Tool[3]:GRIPPER2 Base[0]
LIN p14 CONT Vel=0.1 m/s CPDAT8 Tool[3]:GRIPPER2 Base[0]
LIN p8 Vel=0.1 m/s CPDAT5 Tool[3]:GRIPPER2 Base[0]
AGA:
MsgDialog(PCAnswer,"Part check ok?","TIPD",,,,,,,"NO","YES")
IF PCAnswer==2 then
GOTO AGA
ENDIF
IF PCAnswer==1 then
GOTO NEXT
ENDIF
NEXT:
OUT_mb70rh_1 :清除机器人与机器人之间的干涉区信号
$ADVANCE=0
OUT 57 'Robot Clear Zone 1' State=TRUE CONT
$ADVANCE=3
OUT 349 'Vac1_ON' State=FALSE
Outzone
$ADVANCE=0
OUT 49 'Robot action request 1' State=TRUE :输出机器人请求信号49为真
WAIT FOR ( IN 49 'Action complete 1' ) :等到请求应答完成输入信号
OUT 49 'Robot action request 1' State=FALSE :输出机器人请求信号49为假
$ADVANCE=3
PinUnShift1
$ADVANCE=0
OUT 346 'pin_unshift' State=TRUE CONT
OUT 345 'pin_shift' State=FALSE CONT
$TIMER_STOP[6]=TRUE
$TIMER[6]=-10000
$TIMER_STOP[6]=FALSE
WAIT FOR ( $TIMER_FLAG[6]==TRUE ) OR (( NOT $IN[347] ) AND ( $IN[345] ))
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[347] ) AND ( $IN[345] )
$OUT[76]=FALSE
ENDIF
$ADVANCE=3
In_mb70rh_1 :发送机器人与机器人之间的干涉区信号
$ADVANCE=0
WAIT FOR ( IN 57 'Robot Clear Zone 1' ) CONT
OUT 57 'Robot Clear Zone 1' State=FALSE CONT
WAIT FOR (IN 57 'Robot Clear Zone 1' ) CONT
$ADVANCE=3
LIN p9 CONT Vel=0.2 m/s CPDAT2 Tool[3]:GRIPPER2 Base[0]
WAIT FOR ( NOT IN 357 '' AND NOT IN 359 '' )
LIN p10 CONT Vel=1 m/s CPDAT3 Tool[3]:GRIPPER2 Base[0]
LIN p11 CONT Vel=2 m/s CPDAT4 Tool[3]:GRIPPER2 Base[0]
PTP p12 CONT Vel=100 % PDAT9 Tool[3]:GRIPPER2 Base[0]
PULSE 38 'Job Complete 6' State=TRUE Time=1 sec
OUT_mb70rh_1 :清除机器人与机器人之间的干涉区信号
$ADVANCE=0
OUT 57 'Robot Clear Zone 1' State=TRUE CONT
$ADVANCE=3
PTP p13 CONT Vel=100 % PDAT10 Tool[3]:GRIPPER2 Base[0]
END
换抢盘抓枪程序:
DEF PickGun1( )
INI
OUT 268 'Gun1_Bracket_Open' State=TRUE CONT
OUT 267 'Gun1_Bracket_Cls' State=FALSE CONT
WAIT FOR ( IN 268 'Gun1_Bracket_Opened' ) CONT
WAIT FOR ( IN 264 'Gun1_In_Place' ) CONT
WAIT FOR ( NOT IN 263 'ATC_Face' )
PTP HOME Vel=100 % DEFAULT
PTP P4 CONT Vel=100 % PDAT1 Tool[0] Base[0]
PTP P8 CONT Vel=100 % PDAT4 Tool[0] Base[0]
LIN P3 Vel=0.2 m/s CPDAT3 Tool[0] Base[0]
LIN P2 CONT Vel=0.1 m/s CPDAT2 Tool[0] Base[0]
LIN P1 Vel=0.1 m/s CPDAT1 Tool[0] Base[0]
WAIT FOR ( IN 263 'ATC_Face' )
OUT 261 'ATC_LOCK' State=TRUE
OUT 262 'ATC_UNLOCK' State=FALSE
WAIT FOR ( IN 261 'ATC_Locked' )
ServoGun Couple=1 :焊钳耦合指令
OUT 406 'RESET_FAULT_WITH_WF' State=TRUE :输出复位焊机报警信号406为真
WAIT Time=1 sec
WAIT FOR ( NOT IN 406 'WELDING_FAULT' ) :等待焊机报警俗输入信号406为非
OUT 406 'RESET_FAULT_WITH_WF' State=FALSE :输出复位焊机报警信号406为假
WAIT FOR ( IN 257 'WaterFlow_OK' ) :等待输入水信号257
WGUN1=TRUE :将WGUN1置位为真
LIN P9 Vel=0.1 m/s CPDAT6 Tool[2]:GUN Base[0]
LIN P5 Vel=0.1 m/s CPDAT4 Tool[2]:GUN Base[0]
LIN P6 CONT Vel=2 m/s CPDAT5 Tool[2]:GUN Base[0]
PTP P7 CONT Vel=100 % PDAT3 Tool[2]:GUN Base[0]
END
换抢盘放枪程序:
DEF PutGun1( )
INI
OUT 268 'Gun1_Bracket_Open' State=TRUE CONT
OUT 267 'Gun1_Bracket_Cls' State=FALSE CONT
WAIT FOR ( IN 268 'Gun1_Bracket_Opened' ) CONT
WAIT FOR ( NOT IN 264 'Gun1_In_Place' )
PTP P1 CONT Vel=100 % PDAT1 Tool[2]:GUN Base[0]
PTP P5 CONT Vel=100 % PDAT2 Tool[2]:GUN Base[0]
LIN P4 CONT Vel=1 m/s CPDAT3 Tool[2]:GUN Base[0]
LIN P3 Vel=0.1 m/s CPDAT2 Tool[2]:GUN Base[0]
LIN P9 Vel=0.1 m/s CPDAT8 Tool[2]:GUN Base[0]
LIN P2 Vel=0.1 m/s CPDAT7 Tool[2]:GUN Base[0]
WGUN1=false
WAIT FOR ( IN 263 'ATC_Face' )
ServoGun Decouple=1 :焊钳脱开指令
OUT 262 'ATC_UNLOCK' State=TRUE
OUT 261 'ATC_LOCK' State=FALSE
WAIT FOR ( IN 262 'ATC_Unlocked' )
WAIT Time=1 sec
LIN P6 Vel=0.1 m/s CPDAT4 Tool[0] Base[0]
WAIT FOR ( NOT IN 263 'ATC_Face' )
LIN P7 CONT Vel=0.5 m/s CPDAT5 Tool[0] Base[0]
LIN P8 CONT Vel=2 m/s CPDAT6 Tool[0] Base[0]
PTP P10 CONT Vel=100 % PDAT4 Tool[0] Base[0]
OUT 267 'Gun1_Bracket_Cls' State=TRUE
OUT 268 'Gun1_Bracket_Open' State=FALSE
WAIT FOR ( IN 267 'Gun1_Bracket_Closed' )
OUT 267 'Gun1_Bracket_Cls' State=FALSE
PTP HOME Vel=100 % DEFAULT
END
焊接程序:
DEF Q1( )
INI
INI() :信号初始化子程序
PTP HOME Vel=100 % DEFAULT
Inzone :工作进入允许信号处理
$ADVANCE=0
WAIT FOR ( IN 33 'Entry OK 1' ) CONT :等待焊接进入允许信号33
OUT 41 'Jig Non-Interference 1' State=FALSE CONT :发送干涉信号
WAIT FOR ( IN 33 'Entry OK 1' ) CONT :等待焊接进入允许信号33
$ADVANCE=3
PTP P1 CONT Vel=100 % PDAT1 Tool[1]:GUN1 Base[0]
PTP P2 CONT Vel=100 % PDAT2 Tool[1]:GUN1 Base[0]
PTP P3 CONT Vel=100 % PDAT3 Tool[1]:GUN1 Base[0]
PTP SG1 Vel=100 % PDAT4 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2 mm Force=2.5
kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG2 Vel=100 % PDAT5 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2 mm Force=2.2
kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG3 Vel=100 % PDAT6 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2 mm Force=2.2
kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP P34 CONT Vel=100 % PDAT56 Tool[1]:GUN1 Base[0]
PTP SG4 Vel=100 % PDAT7 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2 mm Force=2.2
kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP P4 CONT Vel=100 % PDAT8 Tool[1]:GUN1 Base[0]
PTP P5 CONT Vel=100 % PDAT9 Tool[1]:GUN1 Base[0]
PTP P6 CONT Vel=100 % PDAT10 Tool[1]:GUN1 Base[0]
PTP P7 CONT Vel=100 % PDAT11 Tool[1]:GUN1 Base[0]
PTP P8 CONT Vel=100 % PDAT12 Tool[1]:GUN1 Base[0]
PTP P9 CONT Vel=100 % PDAT13 Tool[1]:GUN1 Base[0]
PTP SG5 Vel=100 % PDAT14 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG6 Vel=100 % PDAT15 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG7 Vel=100 % PDAT16 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP P26 CONT Vel=100 % PDAT48 Tool[1]:GUN1 Base[0]
PTP P27 CONT Vel=100 % PDAT49 Tool[1]:GUN1 Base[0]
PTP P28 CONT Vel=100 % PDAT50 Tool[1]:GUN1 Base[0]
PTP P29 CONT Vel=100 % PDAT51 Tool[1]:GUN1 Base[0]
PTP P31 CONT Vel=100 % PDAT53 Tool[1]:GUN1 Base[0]
PTP SG11 Vel=100 % PDAT22 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG12 Vel=100 % PDAT23 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP P12 CONT Vel=100 % PDAT24 Tool[1]:GUN1 Base[0]
PTP SG13 Vel=100 % PDAT25 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG14 Vel=100 % PDAT26 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG15 Vel=100 % PDAT27 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG16 Vel=100 % PDAT28 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG17 Vel=100 % PDAT29 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP P13 CONT Vel=100 % PDAT30 Tool[1]:GUN1 Base[0]
PTP SG18 Vel=100 % PDAT31 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG19 Vel=100 % PDAT32 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG20 Vel=100 % PDAT33 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP SG21 Vel=100 % PDAT34 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP P14 CONT Vel=100 % PDAT35 Tool[1]:GUN1 Base[0]
PTP P15 CONT Vel=100 % PDAT36 Tool[1]:GUN1 Base[0]
PTP P16 CONT Vel=100 % PDAT37 Tool[1]:GUN1 Base[0]
PTP P17 CONT Vel=100 % PDAT38 Tool[1]:GUN1 Base[0]
PTP P32 CONT Vel=100 % PDAT54 Tool[1]:GUN1 Base[0]
PTP P18 CONT Vel=100 % PDAT39 Tool[1]:GUN1 Base[0]
PTP P19 CONT Vel=100 % PDAT40 Tool[1]:GUN1 Base[0]
PTP SG22 Vel=100 % PDAT41 ProgNr=1 ServoGun=1 Cont=CLS OPN Part=2.5 mm
Force=2.5 kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
PTP P20 CONT Vel=100 % PDAT42 Tool[1]:GUN1 Base[0]
PTP P35 CONT Vel=100 % PDAT57 Tool[1]:GUN1 Base[0]
>>>>>>>>>>>>>>>><<<<<<<<<<<<
PTP P22 CONT Vel=100 % PDAT44 Tool[1]:GUN1 Base[0]
PTP P48 CONT Vel=100 % PDAT72 Tool[1]:GUN1 Base[0]
Outzone :工位完成信号处理
$ADVANCE=0
OUT 41 'Jig Non-Interference 1' State=TRUE CONT :清除干涉信号
PULSE 34 'Job Complete 2' State=TRUE CONT Time=2 sec :输出一个2S的脉冲完
成信号
$ADVANCE=3
PTP P33 CONT Vel=100 % PDAT55 Tool[1]:GUN1 Base[0
PTP P24 CONT Vel=100 % PDAT46 Tool[1]:GUN1 Base[0
TIP :修磨及更换电极帽的计数处理
;Tip dress or change
TipD=TipD+1 :修磨计数
IF (TipD>=10) THEN :修磨的判断
TipdressReq=TRUE
TipC=TipC+1 :更换电极帽计数
TipD=0
ENDIF
IF (TipC>=10) THEN :更换电极帽的判断
TipchangeReq=TRUE
TipC=0
ENDIF
IF Tipdressreq OR Tipchangereq then :对修磨程序调用的判断
TIPDRESS() :调用修磨程序
ENDIF
PTP HOME Vel=100 % DEFAULT
END
修磨程序:
DEF TIPDRESS( )
INI
PTP HOME Vel=100 % DEFAULT
OUT 26 'Tip Dress Running' State=TRUE :输出焊钳修磨信号26
OUT 408 'CHK_WELD' State=FALSE :输出焊机是否通电信号408为假,切断焊接电源
PTP P1 CONT Vel=100 % PDAT1 Tool[1]:GUN1 Base[0]
PTP P2 CONT Vel=100 % PDAT2 Tool[1]:GUN1 Base[0]
PTP P3 CONT Vel=100 % PDAT3 Tool[1]:GUN1 Base[0]
PTP P4 CONT Vel=100 % PDAT4 Tool[1]:GUN1 Base[0]
Tipchange :更换电极帽部分
IF (TipchangeReq==true) then
OUT 257 'W.A.Unit_Sol_ON' State=FALSE :输出断水信号257为假,断水
WAIT FOR ( NOT IN 257 'WaterFlow_OK' ) :等待水压信号257没有输入
OUT 27 'Tip Change Position' State=TRUE :输出焊钳在电极帽更换位置信号为真
AG: :跳转指针
MsgDialog(TipAnswer,"Tip change complete?","TIPD",,,,,,,"NO","YES")
IF (TipAnswer==1) then
PULSE 28 'Tip Change Complete' State=TRUE Time=2 sec :输出脉冲为2S的电极
帽更换完成信号
ENDIF
IF (TipAnswer==2) then
GOTO AG
ENDIF
INIT ServoGun=1 New :电极初始化
OUT 27 'Tip Change Position' State=FALSE :输出焊钳在电极帽更换位置信号为假
OUT 257 'W.A.Unit_Sol_ON' State=TRUE :输出断水信号257为真,通水
WAIT FOR ( IN 257 'WaterFlow_OK' ) :等待水压信号257有输入
TipchangeReq=FALSE :将TipchangeReq置零
ENDIF
PTP P5 CONT Vel=100 % PDAT5 Tool[1]:GUN1 Base[0]
PTP P9 Vel=100 % PDAT10 Tool[1]:GUN1 Base[0]
PTP P6 Vel=100 % PDAT7 Tool[1]:GUN1 Base[0]
OUT 408 'CHK_WELD' State=FALSE :输出焊机是否通电信号408为假,切断焊接电源
OUT 258 'TipdresserON/OFF' State=TRUE :输出修磨器旋转信号为真
WAIT FOR ( NOT IN 408 'CHK_WELD' ) :等待焊机焊接电源是否切断信号
PTP SG1 Vel=100 % PDAT6 TipDress ProgNr=1 ServoGun=1 Part=3.8 mm Force=1.5
kN ApproxDist=5 mm SpotOffset=0 mm Tool[1]:GUN1 Base[0]
OUT 258 'TipdresserON/OFF' State=FALSE :输出修磨器旋转信号为假
PTP P7 Vel=100 % PDAT8 Tool[1]:GUN1 Base[0]
PTP P8 Vel=100 % PDAT9 Tool[1]:GUN1 Base[0]
INIT ServoGun=1 Same :电极周期性初始化
PTP P10 Vel=100 % PDAT11 Tool[1]:GUN1 Base[0]
PTP P11 Vel=100 % PDAT12 Tool[1]:GUN1 Base[0]
PTP P12 Vel=100 % PDAT13 Tool[1]:GUN1 Base[0]
OUT 26 'Tip Dress Running' State=FALSE :输出焊钳修磨信号26为假
OUT 408 'CHK_WELD' State=TRUE :输出焊机通电信号,给焊枪通电
TipDressReq=FALSE 将TipDressReq置零
PTP P13 Vel=100 % PDAT14 Tool[1]:GUN1 Base[0]
PTP HOME Vel=100 % DEFAULT
END