技术论坛

 我见过的最牛的NC程序

返回主题列表
作者 主题
baiguorong2003
游侠

经验值:515
发帖数:226
精华帖:13
楼主    2007-05-25 21:11:38
主题:我见过的最牛的NC程序 精华帖 
此程序为机械手在不同的机床中抓料和方料的程序:主程序

N01 def int St_Index ;站号
N02 def int Function
N03 def int WSTyp ;工件型号
N04 def int MaschStatus ;程序中没有使用
N05 def int GripperStatus ;程序中没有使用
N06 def real y_1InOutPos ; GRIPPER1 放置工件和取出工件Y 轴所需要走的位置 (保证Z1或Z2 轴能够安全下降和上升的位置)
N07 def real y_1EndPos ; GRIPPER1 放置工件和取出工件Y最终要走的位置
N08 def real y_1slowpos ; GRIPPER1 放置工件和取出工件Y 轴启动慢速移动的位置
N09 def real z_1EndPos ; GRIPPER1 放置工件和取出工件Z 1 最终要走的位置
N10 def real z_1slowpos ; GRIPPER1 放置工件和取出工件Z 1 轴启动慢速移动的位置
N11 def real z_1BasisPos ; Z1 轴的原位位置
N12 def real y_2InOutPos ;GRIPPER2 放置工件和取出工件Y 轴所需要走的位置 (保证Z1或Z2 轴能够安全下降和上升的位置)
N13 def real y_2EndPos ;GRIPPER2 放置工件和取出工件Y最终要走的位置
N14 def real y_2slowpos ;GRIPPER2 放置工件和取出工件Y 轴启动慢速移动的位置
N15 def real z_2EndPos ;GRIPPER2 放置工件和取出工件Z 1 最终要走的位置
N16 def real z_2slowpos ;GRIPPER2 放置工件和取出工件Z 1 轴启动慢速移动的位置
N17 def real z_2BasisPos ; Z1 轴的原位位置
N18 def real x_WPOffset ;不同工件X 轴的偏移量
N19 def real z_WPOffset ;不同工件X 轴的偏移量
N20 def real slow_feed1 ;程序中没有使用
N21 def real z_SlowPosDiff ;Z1 Z2 轴慢速下降的位置距离最终位置的距离
N22 def bool Machines
N23 def real DepoMass
N24 def real DryCycleMass
N25 def real x_landingOffset
N26 def real z_landingOffset
N27 def real x_AnticipDoor
N28 def int dachluke_M_Auf
N29 def int dachluke_M_Zu
N30 def int MaTableBack
N31 def int MaTableFront
N32 def int StationMF_B11
N33 def int StationMF_B12
N34 def int StationMF_C11
N35 def int StationMF_C12
N36 def real z_B_RotSafePos
N37 def bool NoAxisTurnWhileXMove
N38 def bool NoAxisTurnAtEndPos
N39 def real ZPosToRetractTable
; DPR-Definitions
N50 DEFINE CMDInExecution AS $A_DBB[108] = 1
N51 DEFINE CMDEnd AS $A_DBB[108] = 2
N52 DEFINE FeedStop AS $A_DBB[108] = 4
N53 DEFINE PositionError AS $A_DBB[108] = 8
N56 DEFINE NoConfirmation AS $A_DBB[108] = 64
N58 DEFINE FeedStopped AS ($A_DBB[108]==4)
N60 DEFINE XAnticipMin AS R15
N61 DEFINE V_XAnticipMin AS $R15
N62 DEFINE XAnticipMax AS R16
N63 DEFINE V_XAnticipMax AS $R16
N64 DEFINE ZAnticipEnd AS R11
N65 DEFINE V_ZAnticipEnd AS $R11
N66 DEFINE ZInMachine AS R13
N67 DEFINE V_ZInMachine AS $R13
N68 DEFINE ZInDepoArea AS R18
N69 DEFINE V_ZInDepoArea AS $R18
N80 DEFINE V_MaZAxePos AS $R20
N81 DEFINE MaZAxeBack AS R20==1
N82 DEFINE MaZReadyForGantryMove AS R20==2
N83 DEFINE MaZInPickPos AS R20==3
N84 DEFINE MaZInDepositPos AS R20==4
N85 DEFINE V_MaBAxePos AS $R21
N86 DEFINE MaBAxeInPosA AS R21==1
N87 DEFINE MaBAxeInPosB AS R21==2
N88 DEFINE MaBAxePosCorrect AS (((WSTyp < 2) AND (R21==1)) OR ((WSTyp >= 2) AND (R21==2)) OR (Machines == FALSE) OR (R21==0))
;
N0100 ;--------------------------------------------------------
N0110 ;SafeLW1 ; TEST !!!!!!!
N0120 init0:
N0130 $A_DBB[108]=0 ; NC-End RESET
N0140 STOPRE
N0150 ID=220 WHENEVER (M_ZAxeMoveNeeded==FALSE) OR (M_ZBack==TRUE) DO V_MaZAxePos = 1
N0160 ID=221 WHENEVER (M_ZAxeMoveNeeded==TRUE) AND (M_ZReadyForGantryMove==TRUE) DO V_MaZAxePos = 2
N0170 ID=222 WHENEVER (M_ZAxeMoveNeeded==TRUE) AND (M_ZInPickPos==TRUE) DO V_MaZAxePos = 3
N0180 ID=223 WHENEVER (M_ZAxeMoveNeeded==TRUE) AND (M_ZInDepositPos==TRUE) DO V_MaZAxePos = 4
N0190 ID=224 WHENEVER (M_ZAxeMoveNeeded==TRUE) AND ((M_ZBack==FALSE) AND (M_ZReadyForGantryMove==FALSE) AND (M_ZInPickPos==FALSE) AND (M_ZInDepositPos==FALSE)) DO V_MaZAxePos = 99
N0200 ID=225 WHENEVER (M_BAxeMoveNeeded==TRUE) AND (M_BInPositionA==TRUE) DO V_MaBAxePos = 1
N0210 ID=226 WHENEVER (M_BAxeMoveNeeded==TRUE) AND (M_BInPositionB==TRUE) DO V_MaBAxePos = 2
N0220 ID=227 WHENEVER (M_BAxeMoveNeeded==FALSE) OR ((M_BInPositionA==FALSE) AND (M_BInPositionB==FALSE)) DO V_MaBAxePos = 0
N0230 ;--------------------------------------------------------
N0240 init1:
N0250 STOPRE
N0260 MSG ("Laufwagen 1 Wartet auf neue Auftrag")
N0270 ;MSG ("PickUP 1 attende nuovo ordine")
N0280 ;MSG ("PickUP 1 waiting for new order")
N0290 if BAError1 gotof ende ; End if errors in manual mode
N0300 if (PLCStart1 == FALSE) gotob init1 ; Wait PLC-Start authorisation
N0310 STOPRE
N0320 St_Index = $A_DBB[100]-1 Function = $A_DBB[101] WSTyp = $A_DBB[102]-1
N0330 if (WSTyp < 0)
N0340 WSTyp = 0
N0350 endif
N0360 if (((St_Index < 0) OR (WSTyp < 0) OR (WSTyp > 20)) AND ((Function <> 255) AND (Function <> 113))) ;Auftrag-Fehler
N0370 gotof ErrorMsg4 ;Auftragsfehler
N0380 endif
N0390 CMDInExecution ; NC-Command in Execution
N0400 MSG ("PickUP 1 Executing new command")
N0410 G90 ; Absolute Coordinate-System
N0420 z_1BasisPos = BasisPos[0,1] ZPosToRetractTable = ZAxeInChangePos[1]
N0430 z_2BasisPos = BasisPos[0,1] + DistanceGripper1_2[0,1]
N0440 x_landingOffset = 0.0 z_landingOffset = 0.0 x_AnticipDoor = 3500.0
N0450 ZAnticipEnd = (z_1BasisPos - 0.0)
N0460 ZInMachine = (z_1BasisPos - 20.0)
N0470 ACC[Y1]=NormalAcc ACC[Z11]=NormalAcc ACC[Z12]=NormalAcc
N0480 if RAPID==true
N0490 G0 G60 ; Select RAPID
N0500 else
N0510 G1 G60 F=WagonSpeed ; Select Feedrate
N0520 endif
N0530 DepoMass = SlowDownDim[0] ; Distance between Part-presence Switch to Deposit position by conveyors
N0540 DryCycleMass=0.0
N0550 if M_1DryCycle
N0560 DryCycleMass=400.0
N0570 endif
N0580 if ((Function == 255) OR (Function == 113))
N0590 DestStation[0] = 254 $A_DBB[109] = 254
N0600 MSG ("Laufwagen 1 faehrt nach Grundstellung")
N0610 ;MSG ("PickUP 1 Ruturn to Basic-Position")
N0620 WAITP(Y1)
N0630 PGrund1 ; Rueckzug oder Grundstellungsfahrt
N0640 gotof ende
N0650 endif
N0660 ACC[Y1]=NormalAcc
N0670 if ((St_Index==11) AND (Function < 80)) OR ((Function >= 128) AND (Function < 144)) ; Laufwagen Bild oder Maschinenbefehle
N0680 gotof FunCase
N0690 endif
N0700 ; if (St_Index > 9) ; Inkonsistenten Station-Nr. nachpruefen
N0710 ; if BAHand1 AND (Function >= 80) AND (Function <= 95) ; Auftrag von Laufwagen-Bild hat keine richtige Station-Nr.
N0720 ; St_Index = 10 ; Forcieren Auftrag fuer -serviceluke
N0730 ; else
N0740 ; if (Function == 45) ;Serviceluke
N0750 ; gotof FunCase
N0760 ; else
N0770 ; gotof ErrorMsg4 ;Auftragsfehler
N0780 ; endif
N0790 ; endif
N0800 ; endif
N0810 DestStation[0] = St_Index
N0820 $A_DBB[109] = St_Index + 1
N0830 ;*************************************
N0840 ;Destination Case
N0850 ;*************************************
N0860 CASE St_Index of 0 gotof Cnv_Data 1 gotof Cnv_Data 8 gotof Cnv_Data 9 gotof Cnv_Data 11 gotof Cnv_Data ;Zielstation ist ein Band
N0870 CASE St_Index of 2 gotof Ma_Data 3 gotof Ma_Data 4 gotof Ma_Data 5 gotof Ma_Data 6 gotof Ma_Data 7 gotof Ma_Data
N0880 gotof ErrorMsg4 ;Auftragsfehler
N0890 ;=====================
N0900 ;POSITIONS CALCULATION
N0910 ;=====================
N0920 Cnv_Data:
N0930 x_WPOffset = WPOffsetConveyor[WSTyp,0] ;in this project is y axise
N0940 z_WPOffset = WPOffsetConveyor[WSTyp,1]
N0950 y_1EndPos = StationPosGr11[St_Index,0] + x_WPOffset
N0960 y_1slowpos = y_1EndPos x_landingOffset = 0.0
N0970 y_1InOutPos = LoadingDoorXPos[St_Index]
N0980 y_2EndPos = StationPosGr12[St_Index,0] + x_WPOffset
N0990 y_2slowpos = y_2EndPos x_landingOffset = 0.0
N1000 y_2InOutPos = LoadingDoorXPos[St_Index] + DistanceGripper1_2[0,0]
N1010 z_SlowPosDiff = SlowDownDim[0] z_landingOffset = 0.0
N1020 if (St_Index == 8) ;SPC-Station need to open the Drawer
N1030 dachluke_M_Auf = (St_Index * 2) + 129
N1040 dachluke_M_Zu = (St_Index * 2) + 128
N1050 else
N1060 dachluke_M_Auf = 255
N1070 dachluke_M_Zu = 254
N1080 endif
N1090 Machines = FALSE ; Destination is not a machine
N1100 gotof VALREAD
N1110 ;--------------------------------------------------------
N1120 ;Axis-Positions and M-Functions for Machine 1-2
N1130 ;--------------------------------------------------------
N1140 Ma_Data:
N1150 MSG ("PickUP 1 Calculating Positions for Machine 1-3-5-7")
N1160 x_WPOffset = WPOffsetMachine[WSTyp,0]
N1170 z_WPOffset = WPOffsetMachine[WSTyp,1]
N1180 y_1EndPos = StationPosGr11[St_Index,0] + x_WPOffset
N1190 y_1slowpos = y_1EndPos - SlowDownDim[1]
N1200 y_1InOutPos = LoadingDoorXPos[St_Index]
N1210 y_2EndPos = StationPosGr12[St_Index,0] + x_WPOffset
N1220 y_2slowpos = y_2EndPos - SlowDownDim[1]
N1230 y_2InOutPos = LoadingDoorXPos[St_Index] + DistanceGripper1_2[0,0]
N1240 z_SlowPosDiff = SlowDownDim[1] z_landingOffset = 0.0
N1250 dachluke_M_Auf = (St_Index * 2) + 129
N1260 dachluke_M_Zu = (St_Index * 2) + 128
N1270 Machines = TRUE ; Destination is a machine
N1280 DryCycleMass=0.0
N1290 gotof VALREAD
N1300 ;--------------------------------------------------------
N1310 ; END CALCULATIONS & CHECK
N1320 VALREAD:
N1330 z_1EndPos = StationPosGr11[St_Index,1] + z_WPOffset
N1340 z_1slowpos = z_1EndPos + z_SlowPosDiff
N1350 z_2EndPos = StationPosGr12[St_Index,1] + z_WPOffset
N1360 z_2slowpos = z_2EndPos + z_SlowPosDiff
N1370 MaTableBack = ((St_Index-2) * 2) + 228 ; M-Funktion f黵 Tisch R點kzug
N1380 MaTableFront = ((St_Index-2) * 2) + 229 ; M-Funktion f黵 Tisch vorfahren
N1390 StationMF_B11 = 148 + (RTOI(StationPosGr11[St_Index,2]/90.0))
N1400 StationMF_B12 = 150 + (RTOI(StationPosGr12[St_Index,2]/90.0))
N1410 StationMF_C11 = 164 + (RTOI(StationPosGr11[St_Index,3]/90.0))
N1420 StationMF_C12 = 166 + (RTOI(StationPosGr12[St_Index,3]/90.0))
N1430 z_B_RotSafePos = $MN_USER_DATA_FLOAT[15] ;Abstand zwischen Z-Grundstellung und Sichere Position f黵 B-Achse rotieren
N1440 if (ABS(y_1InOutPos - y_1EndPos)) > X_MaxMoveInMachine
N1450 STOPRE
N1460 PositionError ;ERROR POSITION-COORDINATES X-AXE
N1470 M00
N1480 gotob VALREAD
N1490 endif
N1500 FunCase:
N1510 ;*************************************
N1520 ;Function Case
N1530 ;*************************************
N1540 ;Handfunktionen fuer Elemente Ansteuerung (Greifer, Andr乧ker, Ladeluke,..)
N1550 ;--------------------------------------------------------------------------
N1560 if ((Function >= 0) AND (Function < 80)) OR ((Function >= 128) AND (Function < 144))
N1570 M=(100+Function)
N1580 STOPRE
N1590 if BAHand1
N1600 gotof CommandEnd
N1610 endif
N1620 gotof EndAuto
N1630 endif
N1640 CASE Function of 80 gotof Gr1XPosInOut 81 gotof Gr1XPosEnd 82 gotof Gr2XPosInOut 83 gotof Gr2XPosEnd
N1650 CASE Function of 96 gotof Gr1ZPosUp 97 gotof Gr1ZPosDown 98 gotof Gr2ZPosUp 99 gotof Gr2ZPosDown
N1660 if BAHand1 gotof ErrorMsg4 ;Auftragsfehler
N1670 ZInDepoArea= z_1EndPos + DepoMass
N1680 CASE Function of 144 gotof PickNew1 224 gotof DepoFin1
N1690 CASE Function of 192 gotof DepoNew1 176 gotof PickFin1
N1700 CASE Function of 146 gotof PickNew2 178 gotof PickFin2
N1710 CASE Function of 194 gotof DepoNew2 226 gotof DepoFin2
N1720 gotof ErrorMsg4 ;Auftragsfehler
N1730 ;-------------------------------------
N1740 Gr1XPosInOut:
N1750 ;-------------------------------------
N1760 ACC[Y1]=NormalAcc
N1770 if ((y_1InOutPos - 1.0) <= $AA_IM[Y1]) AND ((y_1InOutPos + 1.0) >= $AA_IM[Y1])
N1780 STOPRE ;Wait for DPR-Actualisation if Axis is already in Position
N1790 endif
N1800 F=WagonSpeed FA[Y1]=WagonSpeed
N1810 ID=200 WHENEVER ((M_1Unclamped==FALSE) AND (Gripper11Open==FALSE) AND ($AA_IM[Z11] < V_ZInMachine)) DO RDISABLE $AC_OVR = 0 FeedStop
N1820 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND (Gripper11Open OR M_1Unclamped) AND FeedStopped DO CMDInExecution
N1830 IF (Gripper11Open == FALSE) AND (Machines == TRUE)
N1840 ACC[Y1]=SlowAcc
N1850 POS[Y1] = y_1slowpos FA[Y1]=WagonSpeed ;langsam mit Werkstueck ausfahren
N1860 ELSE
N1870 POSA[Y1] = y_1InOutPos
N1880 ACC[Y1]=NormalAcc
N1890 ENDIF
N1900 if BAAuto1
N1910 CMDEnd ; NC-End Anticipation
N1920 endif
N1930 WAITP(Y1)
N1940 gotof ExitGrCMD
N1950 ;-------------------------------------
N1960 Gr1XPosEnd:
N1970 ;-------------------------------------
N1980 ID=200 WHENEVER ((M_1PickRls==FALSE) AND (M_1DepositRls==FALSE) AND ($AA_IM[Z11] < V_ZInMachine)) DO RDISABLE $AC_OVR = 0 FeedStop
N1990 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND (M_1PickRls OR M_1DepositRls) AND FeedStopped DO CMDInExecution
N2000 POS[Y1] = y_1EndPos FA[Y1]=WagonSpeed ACC[Y1]=SlowAcc ;langsam mit Werkst點k ausfahren
N2010 ACC[Y1]=NormalAcc
N2020 gotof ExitGrCMD
N2030 ;-------------------------------------
N2040 Gr1ZPosUp:
N2050 ;-------------------------------------
N2060 ID=200 WHENEVER (M_1NoAlarm==FALSE) OR ((V_MaZAxePos > 2) AND NOT Gripper11Open) OR (NOT Gripper11Open AND NOT M_1Unclamped) DO $AC_OVR = 0 FeedStop
N2070 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND (V_MaZAxePos <= 2) AND (Gripper11Open OR M_1Unclamped) AND FeedStopped DO CMDInExecution
N2080 WAITP(Z11)
N2090 if ($AA_IM[Z11] <= z_B_RotSafePos)
N2100 if M_ZBack OR (M_ZReadyForGantryMove AND Gripper11Close AND M_1Unclamped)
N2110 Z11 = z_B_RotSafePos
N2120 else
N2130 Z11 = ZPosToRetractTable
N2140 gotof ExitGrCMD
N2150 endif
N2160 M=(148 + (RTOI(BasisPos[0,2]/90.0))) ;B11-Achse nach Grundstellung
N2170 STOPRE
N2180 endif
N2190 Z11 = z_1BasisPos
N2200 gotof ExitGrCMD
N2210 ;-------------------------------------
N2220 Gr1ZPosDown:
N2230 ;-------------------------------------
N2240 ID=200 WHENEVER ((M_1PickRls==FALSE) AND (M_1DepositRls==FALSE)) OR (V_MaZAxePos > 4) OR (NOT Gripper11Open AND NOT M_1Unclamped) DO RDISABLE $AC_OVR = 0 FeedStop
N2250 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND (M_1PickRls OR M_1DepositRls) AND (V_MaZAxePos <= 2) AND (Gripper11Open OR M_1Unclamped) AND FeedStopped DO CMDInExecution
N2260 STOPRE
N2270 if Machines
N2280 if M_ZReadyForGantryMove AND M_1Unclamped AND NOT M_PartPresent AND (ABS($AA_IM[Y1]-y_1EndPos) < (SlowDownDim[1]+1.0))
N2290 if ($AA_IM[Z11] >= (z_B_RotSafePos - 1.0))
N2300 Z11 = z_B_RotSafePos F=(WagonSpeed / 2)
N2310 endif
N2320 Z11 = z_1EndPos F=SlowSpeed
N2330 gotof ExitGrCMD
N2340 endif
N2350 if M_ZBack AND Gripper11Open AND (ABS($AA_IM[Y1]-y_1InOutPos) < (SlowDownDim[1]+1.0)) AND ($AA_IM[Z11] >= (ZPosToRetractTable - 20.0))
N2360 Z11 = ZPosToRetractTable F=WagonSpeed
N2370 gotof ExitGrCMD
N2380 endif
N2390 if (M_ZReadyForGantryMove OR M_ZInPickPos OR M_ZInDepositPos) AND Gripper11Open AND (ABS($AA_IM[Y1]-y_1InOutPos) < (SlowDownDim[1]+1.0)) AND ($AA_IM[Z11] <= (ZPosToRetractTable + 20.0))
N2400 Z11 = z_1EndPos F=WagonSpeed
N2410 gotof ExitGrCMD
N2420 endif
N2421 if (M_ZInPickPos OR M_ZInDepositPos) AND NOT Gripper11Open AND ($AA_IM[Z11] <= (ZPosToRetractTable + 20.0)
N2422 Z11 = z_1EndPos F=WagonSpeed
N2423 M180; Gripper release but not open
N2424 Z11 = (z_1EndPos - SlowDownDim[1]) F=SlowSpeed ;push down with gripper released ;move down released gripper 1-9 mm
N2428 gotof ExitGrCMD
N2429 endif
N2430 gotof ErrorMsg4
N2440 else
N2450 if ($AA_IM[Z11] >= z_B_RotSafePos)
N2460 Z11 = z_B_RotSafePos
N2470 M=StationMF_B11 M=StationMF_C11
N2480 STOPRE
N2490 endif
N2500 Z11 = (z_1slowpos + DryCycleMass) F=WagonSpeed
N2510 ID=200 WHENEVER (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N2520 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND FeedStopped DO CMDInExecution
N2530 Z11 = (z_1EndPos + DryCycleMass) F=SlowSpeed
N2540 endif
N2550 gotof ExitGrCMD
N2560 ;-------------------------------------
N2570 Gr2XPosInOut:
N2580 ;-------------------------------------
N2590 ACC[Y1]=NormalAcc
N2600 if ((y_2InOutPos - 1.0) <= $AA_IM[Y1]) AND ((y_2InOutPos + 1.0) >= $AA_IM[Y1])
N2610 STOPRE ;Wait for DPR-Actualisation if Axis is already in Position
N2620 endif
N2630 F=WagonSpeed FA[Y1]=WagonSpeed
N2640 ID=200 WHENEVER ((M_1Unclamped==FALSE) AND (Gripper12Open==FALSE) AND ($AA_IM[Z12] < V_ZInMachine)) DO RDISABLE $AC_OVR = 0 FeedStop
N2650 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND (Gripper12Open OR M_1Unclamped) AND FeedStopped DO CMDInExecution
N2660 IF (Gripper12Open == FALSE) AND (Machines == TRUE)
N2670 ACC[Y1]=SlowAcc
N2680 POS[Y1] = y_2slowpos FA[Y1]=WagonSpeed ;langsam mit Werkst點k ausfahren
N2690 ELSE
N2700 POSA[Y1] = y_2InOutPos
N2710 ACC[Y1]=NormalAcc
N2720 ENDIF
N2730 if BAAuto1
N2740 CMDEnd ; NC-End Anticipation
N2750 endif
N2760 WAITP(Y1)
N2770 gotof ExitGrCMD
N2780 ;-------------------------------------
N2790 Gr2XPosEnd:
N2800 ;-------------------------------------
N2810 ID=200 WHENEVER ((M_1PickRls==FALSE) AND (M_1DepositRls==FALSE) AND ($AA_IM[Z12] < V_ZInMachine)) DO RDISABLE $AC_OVR = 0 FeedStop
N2820 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND (M_1PickRls OR M_1DepositRls) AND FeedStopped DO CMDInExecution
N2830 POS[Y1] = y_2EndPos FA[Y1]=WagonSpeed ACC[Y1]=SlowAcc ;langsam mit Werkst點k ausfahren
N2840 ACC[Y1]=NormalAcc
N2850 gotof ExitGrCMD
N2860 ;-------------------------------------
N2870 Gr2ZPosUp:
N2880 ;-------------------------------------
N2890 ID=200 WHENEVER (M_1NoAlarm==FALSE) OR ((V_MaZAxePos > 2) AND NOT Gripper12Open) OR (NOT Gripper12Open AND NOT M_1Unclamped) DO $AC_OVR = 0 FeedStop
N2900 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND (V_MaZAxePos <= 2) AND (Gripper12Open OR M_1Unclamped) AND FeedStopped DO CMDInExecution
N2910 WAITP(Z12)
N2920 if ($AA_IM[Z12] <= z_B_RotSafePos)
N2930 if M_ZBack OR (M_ZReadyForGantryMove AND Gripper12Close AND M_1Unclamped)
N2940 Z12 = z_B_RotSafePos
N2950 else
N2960 Z12 = ZPosToRetractTable
N2970 gotof ExitGrCMD
N2980 endif
N2990 M=(150 + (RTOI(BasisPos[0,2]/90.0))) ;B12-Achse nach Grundstellung
N3000 STOPRE
N3010 endif
N3020 Z12 = z_2BasisPos
N3030 gotof ExitGrCMD
N3040 ;-------------------------------------
N3050 Gr2ZPosDown:
N3060 ;-------------------------------------
N3070 ID=200 WHENEVER ((M_1PickRls==FALSE) AND (M_1DepositRls==FALSE)) OR (V_MaZAxePos > 4) OR (NOT Gripper12Open AND NOT M_1Unclamped) DO RDISABLE $AC_OVR = 0 FeedStop
N3080 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND (M_1PickRls OR M_1DepositRls) AND (V_MaZAxePos <= 2) AND (Gripper12Open OR M_1Unclamped) AND FeedStopped DO CMDInExecution
N3090 STOPRE
N3100 if Machines
N3110 if M_ZReadyForGantryMove AND M_1Unclamped AND NOT M_PartPresent AND (ABS($AA_IM[Y1]-y_2EndPos) < (SlowDownDim[1]+1.0))
N3120 if ($AA_IM[Z12] >= (z_B_RotSafePos - 1.0))
N3130 Z12 = z_B_RotSafePos F=(WagonSpeed / 2)
N3140 endif
N3150 Z12 = z_2EndPos F=SlowSpeed
N3160 gotof ExitGrCMD
N3170 endif
N3180 if M_ZBack AND Gripper12Open AND (ABS($AA_IM[Y1]-y_2InOutPos) < (SlowDownDim[1]+1.0)) AND ($AA_IM[Z12] >= (ZPosToRetractTable - 20.0))
N3190 Z12 = ZPosToRetractTable F=WagonSpeed
N3200 gotof ExitGrCMD
N3210 endif
N3220 if (M_ZReadyForGantryMove OR M_ZInPickPos OR M_ZInDepositPos) AND Gripper12Open AND (ABS($AA_IM[Y1]-y_2InOutPos) < (SlowDownDim[1]+1.0)) AND ($AA_IM[Z12] <= (ZPosToRetractTable + 20.0))
N3230 Z12 = z_2EndPos F=WagonSpeed
N3240 gotof ExitGrCMD
N3250 endif
N3251 if (M_ZInPickPos OR M_ZInDepositPos) AND NOT Gripper12Open AND ($AA_IM[Z12] <= (ZPosToRetractTable + 20.0))
N3252 Z12 = z_2EndPos F=WagonSpeed
N3253 M181; Gripper release but not open
N3254 Z12 = (z_2EndPos - SlowDownDim[1]) F=SlowSpeed ;push down with gripper released ;move down released gripper 1-9 mm
N3258 gotof ExitGrCMD
N3259 endif
N3260 gotof ErrorMsg4
N3270 else
N3280 if ($AA_IM[Z12] >= z_B_RotSafePos)
N3290 Z12 = z_B_RotSafePos
N3300 M=StationMF_B12 M=StationMF_C12
N3310 STOPRE
N3320 endif
N3330 Z12 = (z_2slowpos + DryCycleMass) F=WagonSpeed
N3340 ID=200 WHENEVER (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N3350 ID=201 WHENEVER (M_1NoAlarm==TRUE) AND FeedStopped DO CMDInExecution
N3360 Z12 = (z_2EndPos + DryCycleMass) F=SlowSpeed
N3370 endif
N3380 gotof ExitGrCMD
N3390 ExitGrCMD:
N3400 CANCEL(200)
N3410 CANCEL(201)
N3420 if BAHand1
N3430 gotof CommandEnd
N3440 endif
N3450 gotof EndAuto
N3460 ;==========================================================
N3470 ; AUTOMATIK ABLAUF
N3480 ;==========================================================
N3490 ;-------------------------------------
N3500 PickNew1: ; Pick New WP from Input-conveyor with Gripper 1
N3510 ;-------------------------------------
N3520 MSG ("PickUP 1 Pick New WorPiece with Gripper 1")
N3530 if Gripper11Open; AND Gripper12Open
N3540 if Machines gotof ErrorMsg5
N3550 POS[Z11] = z_1BasisPos F=WagonSpeed
N3560 POS[Y1] = y_1InOutPos FA[Y1]=WagonSpeed ACC[Y1]=NormalAcc
N3570 ID=200 WHENEVER (M_1PickRls==FALSE) DO RDISABLE $AC_OVR = 0
N3580 ID=201 WHENEVER (M_1PickRls==FALSE) OR (M_1NoAlarm<>TRUE) DO FeedStop
N3590 ID=202 WHENEVER (M_1PickRls==TRUE) AND (M_1NoAlarm==TRUE) DO CMDInExecution
N3600 STOPRE
N3610 Z11 = z_B_RotSafePos
N3620 M=StationMF_B11 M=StationMF_C11
N3630 STOPRE
N3640 Z11 = (z_1EndPos + DryCycleMass)
N3650 Y1 = y_1EndPos
N3660 STOPRE ;Wait PLC-SW-Cam actualisation
N3670 ID=201 WHENEVER (M_1NoAlarm<>TRUE) DO FeedStop
N3680 ID=202 WHENEVER (M_1NoAlarm==TRUE) DO CMDInExecution
N3690 M101 ;Close Gripper
N3700 CANCEL(200)
N3710 STOPRE
N3720 POSA[Z11] = z_B_RotSafePos
N3730 ID=203 WHENEVER (M_1PickDepositOK==FALSE) DO RDISABLE
N3740 STOPRE
N3750 CANCEL(203)
N3760 WAITP(Z11)
N3770 M149 M165 ;B- und C- Achsen orientieren auf 90?
N3780 ; ID=205 WHEN ($AA_IM[Z11] > V_ZAnticipEnd) DO CMDEnd ; NC-End Anticipation
N3790 STOPRE
N3800 Z11 = z_1BasisPos F=WagonSpeed
N3810 CANCEL(201)
N3820 CANCEL(202)
N3830 gotof EndAuto
N3840 endif
N3850 gotof ErrorMsg1
N3860 ;-------------------------------------
N3870 PickNew2: ; Pick New WP from Input-conveyor with Gripper 2
N3880 ;-------------------------------------
N3890 MSG ("PickUP 1 Pick New WorPiece with Gripper 2")
N3900 if Gripper12Open; AND Gripper11Open
N3910 if Machines gotof ErrorMsg5
N3920 POS[Z12] = z_2BasisPos F=WagonSpeed
N3930 POS[Y1] = y_2InOutPos FA[Y1]=WagonSpeed ACC[Y1]=NormalAcc
N3940 ID=200 WHENEVER (M_1PickRls==FALSE) DO RDISABLE $AC_OVR = 0
N3950 ID=201 WHENEVER (M_1PickRls==FALSE) OR (M_1NoAlarm<>TRUE) DO FeedStop
N3960 ID=202 WHENEVER (M_1PickRls==TRUE) AND (M_1NoAlarm==TRUE) DO CMDInExecution
N3970 STOPRE
N3980 Z12 = z_B_RotSafePos
N3990 M=StationMF_B12 M=StationMF_C12
N4000 STOPRE
N4010 Z12 = (z_2EndPos + DryCycleMass)
N4020 Y1 = y_2EndPos
N4030 STOPRE ;Wait PLC-SW-Cam actualisation
N4040 ID=201 WHENEVER (M_1NoAlarm<>TRUE) DO FeedStop
N4050 ID=202 WHENEVER (M_1NoAlarm==TRUE) DO CMDInExecution
N4060 M103 ;Close Gripper
N4070 CANCEL(200)
N4080 STOPRE
N4090 POSA[Z12] = z_B_RotSafePos
N4100 ID=203 WHENEVER (M_1PickDepositOK==FALSE) DO RDISABLE
N4110 STOPRE
N4120 CANCEL(203)
N4130 WAITP(Z12)
N4140 M151 M167 ;B- und C- Achsen orientieren
N4150 ; ID=205 WHEN ($AA_IM[Z12] > V_ZAnticipEnd) DO CMDEnd ; NC-End Anticipation
N4160 STOPRE
N4170 Z12 = z_2BasisPos F=WagonSpeed
N4180 CANCEL(201)
N4190 CANCEL(202)
N4200 gotof EndAuto
N4210 endif
N4220 gotof ErrorMsg1
N4230 ;-------------------------------------
N4240 PickFin1: ; Pick Finished WP from Maschine-n Gripper 1
N4250 ;-------------------------------------
N4260 MSG ("PickUP 1 Pick Finished WorPiece with Gripper 1")
N4270 if Gripper11Open
N4280 Z11 = z_1BasisPos F=WagonSpeed
N4290 POSA[Y1] = y_1InOutPos FA[Y1]=WagonSpeed ACC[Y1]=NormalAcc
N4300 ID=200 WHENEVER (M_1PickRls==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N4310 ID=202 WHENEVER (M_1PickRls==TRUE) AND (M_1NoAlarm==TRUE) DO CMDInExecution
N4320 STOPRE
N4330 IF Machines
N4340 M=(dachluke_M_Auf) M=MaTableBack M=StationMF_B11 M=StationMF_C11
N4350 STOPRE
N4360 WAITP(Y1)
N4370 REPEAT
N4380 STOPRE
N4390 MSG ("Waiting for Table Retracted position")
N4400 UNTIL (M_ZBack==TRUE) AND MaBAxePosCorrect
N4410 ID=201 WHENEVER (M_ZBack<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N4420 ID=202 WHENEVER (M_1PickRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZBack==TRUE) DO CMDInExecution
N4430 Z11 = ZPosToRetractTable F = WagonSpeed
N4440 CANCEL(201)
N4450 REPEAT
N4460 STOPRE
N4470 M=MaTableFront
N4480 MSG ("Waiting for Table Exchange position")
N4490 UNTIL (M_ZInPickPos==TRUE)
N4500 ID=201 WHENEVER (M_ZInPickPos<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N4510 ID=202 WHENEVER (M_1PickRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N4520 Z11 = z_1EndPos
N4530 Y1 = y_1EndPos
N4540 STOPRE ;Wait PLC-SW-Cam actualisation
N4550 M101 ;Close Gripper
N4560 REPEAT
N4570 STOPRE
N4580 MSG ("Waiting Part unclamped from machine")
N4590 UNTIL (M_1Unclamped==TRUE) AND (M_1PickDepositOK==TRUE)
N4600 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N4610 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N4620 Z11 = z_1slowpos Y1 = y_1slowpos
N4630 CANCEL(201)
N4640 REPEAT
N4650 STOPRE
N4660 M=MaTableBack
N4670 MSG ("Waiting for Table Gantry-move position")
N4680 UNTIL (M_ZReadyForGantryMove==TRUE)
N4690 ID=201 WHENEVER (M_ZReadyForGantryMove<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N4700 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZReadyForGantryMove==TRUE) DO CMDInExecution
N4710 Z11 = z_B_RotSafePos F=SlowSpeed
N4720 POSA[Z11] = z_1BasisPos FA[Z11]=WagonSpeed
N4730 CANCEL(201)
N4740 ELSE
N4750 WAITP(Y1)
N4760 Z11 = z_B_RotSafePos F=WagonSpeed
N4770 M=StationMF_B11 M=StationMF_C11
N4780 STOPRE
N4790 Z11 = (z_1EndPos + DryCycleMass)
N4800 Y1 = y_1EndPos
N4810 STOPRE ;Wait PLC-SW-Cam actualisation
N4820 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N4830 ID=202 WHENEVER (M_1NoAlarm==TRUE) DO CMDInExecution
N4840 M101 ;Close Gripper
N4850 STOPRE
N4860 Z11 = z_B_RotSafePos F=WagonSpeed
N4870 M149 M165 M=QU(151) M=QU(167)
N4880 STOPRE
N4890 POSA[Z11] = z_1BasisPos FA[Z11]=WagonSpeed
N4900 ID=203 WHENEVER (M_1PickDepositOK==FALSE) DO RDISABLE
N4910 STOPRE
N4920 CANCEL(203)
N4930 ENDIF
N4940 ; ID=205 WHEN ($AA_IM[Z11] > V_ZAnticipEnd) DO CMDEnd ; NC-End Anticipation
N4950 WAITP(Z11)
N4960 F=WagonSpeed
N4970 CANCEL(200)
N4980 CANCEL(201)
N4990 CANCEL(202)
N5000 CANCEL(205)
N5010 gotof EndAuto
N5020 endif
N5030 gotof ErrorMsg1
N5040 ;-------------------------------------
N5050 PickFin2: ; Pick Finished WP from Maschine-n Gripper 2
N5060 ;-------------------------------------
N5070 MSG ("PickUP 1 Pick Finished WorPiece with Gripper 2")
N5080 if Gripper12Open
N5090 Z12 = z_2BasisPos F=WagonSpeed
N5100 POSA[Y1] = y_2InOutPos FA[Y1]=WagonSpeed ACC[Y1]=NormalAcc
N5110 ID=200 WHENEVER (M_1PickRls==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N5120 ID=202 WHENEVER (M_1PickRls==TRUE) AND (M_1NoAlarm==TRUE) DO CMDInExecution
N5130 STOPRE
N5140 IF Machines
N5150 M=(dachluke_M_Auf) M=MaTableBack M=StationMF_B12 M=StationMF_C12
N5160 STOPRE
N5170 WAITP(Y1)
N5180 REPEAT
N5190 STOPRE
N5200 MSG ("Waiting for Table Retracted position")
N5210 UNTIL (M_ZBack==TRUE) AND MaBAxePosCorrect
N5220 ID=201 WHENEVER (M_ZBack<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N5230 ID=202 WHENEVER (M_1PickRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZBack==TRUE) DO CMDInExecution
N5240 Z12 = ZPosToRetractTable F = WagonSpeed
N5250 CANCEL(201)
N5260 REPEAT
N5270 STOPRE
N5280 M=MaTableFront
N5290 MSG ("Waiting for Table Exchange position")
N5300 UNTIL (M_ZInPickPos==TRUE)
N5310 ID=201 WHENEVER (M_ZInPickPos<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N5320 ID=202 WHENEVER (M_1PickRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N5330 Z12 = z_2EndPos
N5340 Y1 = y_2EndPos ;;;MG maybe SlowSpeed
N5350 STOPRE ;Wait PLC-SW-Cam actualisation
N5360 M103 ;Close Gripper
N5370 REPEAT
N5380 STOPRE
N5390 MSG ("Waiting Part unclamped from machine")
N5400 UNTIL (M_1Unclamped==TRUE) AND (M_1PickDepositOK==TRUE)
N5410 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N5420 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N5430 ;;;MG Z12 = z_2slowpos Y1 = y_2slowpos
N5430 Z12 = z_2slowpos Y1 = (y_2slowpos + SlowDownDim[1] + 1) F=SLOWSPEED ;;;MG
N5440 CANCEL(201)
N5450 REPEAT
N5460 STOPRE
N5470 M=MaTableBack
N5480 MSG ("Waiting for Table Gantry-move position")
N5490 UNTIL (M_ZReadyForGantryMove==TRUE)
N5500 ID=201 WHENEVER (M_ZReadyForGantryMove<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N5510 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZReadyForGantryMove==TRUE) DO CMDInExecution
N5520 Z12 = -1130.0 F=SlowSpeed
N5530 POSA[Z12] = z_2BasisPos FA[Z12]=WagonSpeed
N5540 CANCEL(201)
N5550 ELSE
N5560 WAITP(Y1)
N5570 Z12 = z_B_RotSafePos F=WagonSpeed
N5580 M=StationMF_B12 M=StationMF_C12
N5590 STOPRE
N5600 Z12 = (z_2EndPos + DryCycleMass)
N5610 Y1 = y_2EndPos
N5620 STOPRE ;Wait PLC-SW-Cam actualisation
N5630 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N5640 ID=202 WHENEVER (M_1NoAlarm==TRUE) DO CMDInExecution
N5650 M103 ;Close Gripper
N5660 STOPRE
N5670 Z12 = z_B_RotSafePos F=WagonSpeed
N5680 M151 M167 M=QU(149) M=QU(165)
N5690 STOPRE
N5700 POSA[Z12] = z_2BasisPos FA[Z12]=WagonSpeed
N5710 ID=203 WHENEVER (M_1PickDepositOK==FALSE) DO RDISABLE
N5720 STOPRE
N5730 CANCEL(203)
N5740 ENDIF
N5750 ; ID=205 WHEN ($AA_IM[Z12] > V_ZAnticipEnd) DO CMDEnd ; NC-End Anticipation
N5760 WAITP(Z12)
N5770 F=WagonSpeed
N5780 CANCEL(200)
N5790 CANCEL(201)
N5800 CANCEL(202)
N5810 CANCEL(205)
N5820 gotof EndAuto
N5830 endif
N5840 gotof ErrorMsg1
N5850 ;-------------------------------------
N5860 DepoNew1: ; Deposit New-WP in Maschine-n with Gripper 1
N5870 ;-------------------------------------
N5880 MSG ("PickUP 1 Deposit New WorPiece with Gripper 1")
N5890 if (Gripper11Open==FALSE)
N5900 Z11 = z_1BasisPos F=WagonSpeed
N5910 POSA[Y1] = y_1EndPos FA[Y1]=WagonSpeed ACC[Y1]=NormalAcc
N5920 ID=200 WHENEVER (M_1DepositRls==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N5930 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) DO CMDInExecution
N5940 STOPRE
N5950 IF Machines
N5960 M=(dachluke_M_Auf) M=MaTableFRONT M=StationMF_B11 M=StationMF_C11
N5970 STOPRE
N5980 WAITP(Y1)
N5990 REPEAT
N6000 STOPRE
N6010 MSG ("Waiting for Table Gantry-move position")
N6020 UNTIL (M_ZReadyForGantryMove==TRUE) AND MaBAxePosCorrect
N6030 ID=201 WHENEVER (M_ZReadyForGantryMove<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N6040 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZReadyForGantryMove==TRUE) DO CMDInExecution
N6050 ;;;MG Z11 = z_B_RotSafePos
N6050 Z11 = -1130.0 ;;;MG
N6051 Z11 = z_1EndPos F=SlowSpeed
N6060 Y1 = y_1EndPos
N6070 CANCEL(201)
N6080 REPEAT
N6090 STOPRE
N6100 M=MaTableFront
N6110 MSG ("Waiting for Table Exchange position")
N6120 UNTIL (M_ZInPickPos==TRUE)
N6130 ID=201 WHENEVER (M_ZInPickPos<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N6140 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N6141 M180 ;Gripper 11 valves release
N6143 STOPRE
N6144 Z11 = (z_1EndPos - SlowDownDim[1]) F=SlowSpeed ;push down with gripper released
N6145 M188 ;Close Machine Clamping
N6150 REPEAT
N6160 STOPRE ;Wait PLC-SW-Cam actualisation
N6170 MSG ("Waiting Part Clamped from machine")
N6180 UNTIL (M_1Clamped==TRUE)
N6190 M100 ;Open Gripper
N6200 REPEAT
N6210 STOPRE
N6220 MSG ("Waiting Deposit Confirmation from machine")
N6230 UNTIL (M_1PickDepositOK==TRUE)
N6240 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N6250 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N6260 Y1 = y_1InOutPos F=WagonSpeed
;JK N6270 Z11 = ZPosToRetractTable F=WagonSpeed
;JK N6280 CANCEL(201)
;JK N6290 REPEAT
;JK N6300 STOPRE
;JK N6310 M=MaTableBack
;JK N6320 MSG ("Waiting for Table Retracted position")
;JK N6330 UNTIL (M_ZBack==TRUE)
;JK N6340 ID=201 WHENEVER (M_ZBack<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
;JK N6350 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZBack==TRUE) DO CMDInExecution
;JK N6360 Z11 = z_B_RotSafePos F=WagonSpeed
N6370 POSA[Z11] = z_1BasisPos FA[Z11]=WagonSpeed
N6380 CANCEL(201)
N6390 ELSE
N6400 WAITP(Y1)
N6410 Z11 = z_B_RotSafePos F=WagonSpeed
N6420 M=StationMF_B11 M=StationMF_C11
N6430 STOPRE
N6440 Z11 = (z_1slowpos + DryCycleMass) F=WagonSpeed
N6450 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N6460 ID=202 WHENEVER (M_1NoAlarm==TRUE) DO CMDInExecution
N6470 Z11 = (z_1EndPos + DryCycleMass) F=SlowSpeed
N6480 M100 ;Open Gripper
N6490 STOPRE
N6500 ;;;MG Y1 = y_1InOutPos F=SlowSpeed
N6500 Y1 = y_1InOutPos F=WagonSpeed ;;;MG
N6510 Z11 = z_B_RotSafePos F=WagonSpeed
N6520 M149 M165 M=QU(151) M=QU(167)
N6530 STOPRE
N6540 POSA[Z11] = z_1BasisPos FA[Z11]=WagonSpeed
N6550 ID=203 WHENEVER (M_1PickDepositOK==FALSE) DO RDISABLE
N6560 STOPRE
N6570 CANCEL(203)
N6580 ENDIF
N6590 ; ID=205 WHEN ($AA_IM[Z11] > V_ZAnticipEnd) DO CMDEnd ; NC-End Anticipation
N6600 WAITP(Z11)
N6610 F=WagonSpeed
N6620 CANCEL(200)
N6630 CANCEL(201)
N6640 CANCEL(202)
N6650 CANCEL(205)
N6660 gotof EndAuto
N6670 endif
N6680 gotof ErrorMsg2
N6690 ;-------------------------------------
N6700 DepoNew2: ; Deposit New-WP in Maschine-n with Gripper 2
N6710 ;-------------------------------------
N6720 MSG ("PickUP 1 Deposit New WorPiece with Gripper 2")
N6730 if (Gripper12Open==FALSE)
N6740 Z12 = z_2BasisPos F=WagonSpeed
N6750 POSA[Y1] = y_2EndPos FA[Y1]=WagonSpeed ACC[Y1]=NormalAcc
N6760 ID=200 WHENEVER (M_1DepositRls==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N6770 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) DO CMDInExecution
N6780 STOPRE
N6790 IF Machines
N6800 M=(dachluke_M_Auf) M=MaTableFront M=StationMF_B12 M=StationMF_C12
N6810 STOPRE
N6820 WAITP(Y1)
N6830 REPEAT
N6840 STOPRE
N6850 MSG ("Waiting for Table Gantry-move position")
N6860 UNTIL (M_ZReadyForGantryMove==TRUE) AND MaBAxePosCorrect
N6870 ID=201 WHENEVER (M_ZReadyForGantryMove<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N6880 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZReadyForGantryMove==TRUE) DO CMDInExecution
N6890 Z12 = z_2EndPos
N6900 Y1 = y_2EndPos
N6910 CANCEL(201)
N6920 REPEAT
N6930 STOPRE
N6940 M=MaTableFront
N6950 MSG ("Waiting for Table Exchange position")
N6960 UNTIL (M_ZInPickPos==TRUE)
N6970 ID=201 WHENEVER (M_ZInPickPos<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N6980 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N6981 M181 ;Gripper 12 valves release
N6983 STOPRE
N6984 Z12 = (z_2EndPos - SlowDownDim[1]) F=SlowSpeed ;push down with gripper released
N6985 M188 ;Close Machine Clamping
N6990 REPEAT
N7000 STOPRE ;Wait PLC-SW-Cam actualisation
N7010 MSG ("Waiting Part Clamped from machine")
N7020 UNTIL (M_1Clamped==TRUE)
N7030 M102 ;Open Gripper
N7040 REPEAT
N7050 STOPRE
N7060 MSG ("Waiting Deposit Confirmation from machine")
N7070 UNTIL (M_1PickDepositOK==TRUE)
N7080 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N7090 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N7100 Y1 = y_2InOutPos F=WagonSpeed
N7110 Z12 = ZPosToRetractTable F=WagonSpeed
N7120 CANCEL(201)
N7130 REPEAT
N7140 STOPRE
N7150 M=MaTableBack
N7160 MSG ("Waiting for Table Retracted position")
N7170 UNTIL (M_ZBack==TRUE)
N7180 ID=201 WHENEVER (M_ZBack<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N7190 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZBack==TRUE) DO CMDInExecution
N7200 Z12 = z_B_RotSafePos F=WagonSpeed
N7210 POSA[Z12] = z_2BasisPos FA[Z12]=WagonSpeed
N7220 CANCEL(201)
N7230 ELSE
N7240 WAITP(Y1)
N7250 Z12 = z_B_RotSafePos F=WagonSpeed
N7260 M=StationMF_B12 M=StationMF_C12
N7270 STOPRE
N7280 Z12 = (z_2slowpos + DryCycleMass) F=WagonSpeed
N7290 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N7300 ID=202 WHENEVER (M_1NoAlarm==TRUE) DO CMDInExecution
N7310 Z12 = (z_2EndPos + DryCycleMass) F=SlowSpeed
N7320 M102 ;Open Gripper
N7330 STOPRE
N7340 Y1 = y_2InOutPos F=SlowSpeed
N7350 Z12 = z_B_RotSafePos F=WagonSpeed
N7360 M151 M167 M=QU(149) M=QU(165)
N7370 STOPRE
N7380 POSA[Z12] = z_2BasisPos FA[Z12]=WagonSpeed
N7390 ID=203 WHENEVER (M_1PickDepositOK==FALSE) DO RDISABLE
N7400 STOPRE
N7410 CANCEL(203)
N7420 ENDIF
N7430 ; ID=205 WHEN ($AA_IM[Z12] > V_ZAnticipEnd) DO CMDEnd ; NC-End Anticipation
N7440 WAITP(Z12)
N7450 F=WagonSpeed
N7460 CANCEL(200)
N7470 CANCEL(201)
N7480 CANCEL(202)
N7490 CANCEL(205)
N7500 gotof EndAuto
N7510 endif
N7520 gotof ErrorMsg2
N7530 ;-------------------------------------------------------------------------------------------
N7540 DepoFin1: ; Deposit Finished-WP with Gripper 1
N7550 ;-------------------------------------------------------------------------------------------
N7560 MSG ("PickUP 1 Deposit Finished WorPiece with Gripper 1")
N7570 if (Gripper11Open==FALSE)
N7580 Z11 = z_1BasisPos F=WagonSpeed
N7590 POS[Y1] = y_1EndPos FA[Y1]=WagonSpeed ACC[Y1]=NormalAcc
N7600 ID=200 WHENEVER (M_1DepositRls==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N7610 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) DO CMDInExecution
N7620 STOPRE
N7630 IF Machines
N7640 M=(dachluke_M_Auf) M=MaTableFront M=StationMF_B11 M=StationMF_C11
N7650 STOPRE
N7660 WAITP(Y1)
N7670 REPEAT
N7680 STOPRE
N7690 MSG ("Waiting for Table Gantry-move position")
N7700 UNTIL (M_ZReadyForGantryMove==TRUE) AND MaBAxePosCorrect
N7710 ID=201 WHENEVER (M_ZReadyForGantryMove<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N7720 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZReadyForGantryMove==TRUE) DO CMDInExecution
N7730 Z11 = z_1EndPos
N7740 Y1 = y_1EndPos
N7750 CANCEL(201)
N7760 REPEAT
N7770 STOPRE
N7780 M=MaTableFront
N7790 MSG ("Waiting for Table Exchange position")
N7800 UNTIL (M_ZInPickPos==TRUE)
N7810 ID=201 WHENEVER (M_ZInPickPos<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N7820 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N7821 M180 ;Gripper 11 valves release
N7823 STOPRE
N7824 Z11 = (z_1EndPos - SlowDownDim[1]) F=SlowSpeed ;push down with gripper released
N7825 M188 ;Close Machine Clamping
N7830 REPEAT
N7840 STOPRE ;Wait PLC-SW-Cam actualisation
N7850 MSG ("Waiting Part Clamped from machine")
N7860 UNTIL (M_1Clamped==TRUE)
N7870 M100 ;Open Gripper
N7880 REPEAT
N7890 STOPRE
N7900 MSG ("Waiting Deposit Confirmation from machine")
N7910 UNTIL (M_1PickDepositOK==TRUE)
N7920 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N7930 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N7940 Y1 = y_1InOutPos F=WagonSpeed
N7950 Z11 = ZPosToRetractTable F=WagonSpeed
N7960 CANCEL(201)
N7970 REPEAT
N7980 STOPRE
N7990 M=MaTableBack
N8000 MSG ("Waiting for Table Retracted position")
N8010 UNTIL (M_ZBack==TRUE)
N8020 ID=201 WHENEVER (M_ZBack<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N8030 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZBack==TRUE) DO CMDInExecution
N8040 Z11 = z_B_RotSafePos F=WagonSpeed
N8050 POSA[Z11] = z_1BasisPos FA[Z11]=WagonSpeed
N8060 CANCEL(201)
N8070 ELSE
N8080 WAITP(Y1)
N8090 Z11 = z_B_RotSafePos F=WagonSpeed
N8100 M=StationMF_B11 M=StationMF_C11
N8110 STOPRE
N8120 Z11 = (z_1slowpos + DryCycleMass) F=WagonSpeed
N8130 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N8140 ID=202 WHENEVER (M_1NoAlarm==TRUE) DO CMDInExecution
N8150 Z11 = (z_1EndPos + DryCycleMass) F=SlowSpeed
N8160 M100 ;Open Gripper
N8170 STOPRE
N8180 ;;;MG Y1 = y_1InOutPos F=SlowSpeed
N8180 Y1 = y_1InOutPos F=WagonSpeed ;;;MG
N8190 Z11 = z_B_RotSafePos F=WagonSpeed
N8200 M149 M165 M=QU(151) M=QU(167)
N8210 STOPRE
N8220 POSA[Z11] = z_1BasisPos FA[Z11]=WagonSpeed
N8230 ID=203 WHENEVER (M_1PickDepositOK==FALSE) DO RDISABLE
N8240 STOPRE
N8250 CANCEL(203)
N8260 ENDIF
N8270 ; ID=205 WHEN ($AA_IM[Z11] > V_ZAnticipEnd) DO CMDEnd ; NC-End Anticipation
N8280 WAITP(Z11)
N8290 F=WagonSpeed
N8300 CANCEL(200)
N8310 CANCEL(201)
N8320 CANCEL(202)
N8330 CANCEL(205)
N8340 gotof EndAuto
N8350 endif
N8360 gotof ErrorMsg2
N8370 ;-------------------------------------------------------------------------------------------
N8380 DepoFin2: ; Deposit Finished-WP with Gripper 2
N8390 ;-------------------------------------------------------------------------------------------
N8400 MSG ("PickUP 1 Deposit Finished WorPiece with Gripper 2")
N8410 if (Gripper12Open==FALSE)
N8420 Z12 = z_2BasisPos F=WagonSpeed
N8430 POSA[Y1] = y_2EndPos FA[Y1]=WagonSpeed ACC[Y1]=NormalAcc
N8440 ID=200 WHENEVER (M_1DepositRls==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N8450 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) DO CMDInExecution
N8460 STOPRE
N8470 IF Machines
N8480 M=(dachluke_M_Auf) M=MaTableFront M=StationMF_B12 M=StationMF_C12
N8490 STOPRE
N8500 WAITP(Y1)
N8510 REPEAT
N8520 STOPRE
N8530 MSG ("Waiting for Table Gantry-move position")
N8540 UNTIL (M_ZReadyForGantryMove==TRUE) AND MaBAxePosCorrect
N8550 ID=201 WHENEVER (M_ZReadyForGantryMove<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N8560 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZReadyForGantryMove==TRUE) DO CMDInExecution
N8570 Z12 = z_2EndPos
N8580 Y1 = y_2EndPos
N8590 CANCEL(201)
N8600 REPEAT
N8610 STOPRE
N8620 M=MaTableFront
N8630 MSG ("Waiting for Table Exchange position")
N8640 UNTIL (M_ZInPickPos==TRUE)
N8650 ID=201 WHENEVER (M_ZInPickPos<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N8660 ID=202 WHENEVER (M_1DepositRls==TRUE) AND (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N8661 M181 ;Gripper 12 valves release
N8663 STOPRE
N8664 Z12 = (z_2EndPos - SlowDownDim[1]) F=SlowSpeed ;push down with gripper released
N8665 M188 ;Close Machine Clamping
N8670 REPEAT
N8680 STOPRE ;Wait PLC-SW-Cam actualisation
N8690 MSG ("Waiting Part Clamped from machine")
N8700 UNTIL (M_1Clamped==TRUE)
N8710 M102 ;Open Gripper
N8720 REPEAT
N8730 STOPRE
N8740 MSG ("Waiting Deposit Confirmation from machine")
N8750 UNTIL (M_1PickDepositOK==TRUE)
N8760 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N8770 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZInPickPos==TRUE) DO CMDInExecution
N8780 Y1 = y_2InOutPos F=WagonSpeed
N8790 Z12 = ZPosToRetractTable F=WagonSpeed
N8800 CANCEL(201)
N8810 REPEAT
N8820 STOPRE
N8830 M=MaTableBack
N8840 MSG ("Waiting for Table Retracted position")
N8850 UNTIL (M_ZBack==TRUE)
N8860 ID=201 WHENEVER (M_ZBack<>TRUE) DO RDISABLE $AC_OVR = 0 FeedStop
N8870 ID=202 WHENEVER (M_1NoAlarm==TRUE) AND (M_ZBack==TRUE) DO CMDInExecution
N8880 Z12 = z_B_RotSafePos F=WagonSpeed
N8890 POSA[Z12] = z_2BasisPos FA[Z12]=WagonSpeed
N8900 CANCEL(201)
N8910 ELSE
N8920 WAITP(Y1)
N8930 Z12 = z_B_RotSafePos F=WagonSpeed
N8940 M=StationMF_B12 M=StationMF_C12
N8950 STOPRE
N8960 Z12 = (z_2slowpos + DryCycleMass) F=WagonSpeed
N8970 ID=200 WHEN (M_1NoAlarm==FALSE) DO RDISABLE $AC_OVR = 0 FeedStop
N8980 ID=202 WHENEVER (M_1NoAlarm==TRUE) DO CMDInExecution
N8990 Z12 = (z_2EndPos + DryCycleMass) F=SlowSpeed
N9000 M102 ;Open Gripper
N9010 STOPRE
N9020 ;;;MG Y1 = y_2InOutPos F=SlowSpeed
N9020 Y1 = y_2InOutPos F=WagonSpeed ;;;MG
N9030 Z12 = z_B_RotSafePos F=WagonSpeed
N9040 M151 M167 M=QU(149) M=QU(165)
N9050 STOPRE
N9060 POSA[Z12] = z_2BasisPos FA[Z12]=WagonSpeed
N9070 ID=203 WHENEVER (M_1PickDepositOK==FALSE) DO RDISABLE
N9080 STOPRE
N9090 CANCEL(203)
N9100 ENDIF
N9110 ; ID=205 WHEN ($AA_IM[Z12] > V_ZAnticipEnd) DO CMDEnd ; NC-End Anticipation
N9120 WAITP(Z12)
N9130 F=WagonSpeed
N9140 CANCEL(200)
N9150 CANCEL(201)
N9160 CANCEL(202)
N9170 CANCEL(205)
N9180 gotof EndAuto
N9190 endif
N9200 gotof ErrorMsg2
N9210 ;-------------------------------------
N9220 CommandEnd:
N9230 CANCEL(200)
N9240 CANCEL(201)
N9250 STOPRE
N9260 gotof ende
N9270 ;-------------------------------------
N9280 ErrorMsg1:
N9290 MSG ("GRIPPER NOT OPEN")
N9300 M00
N9310 gotof ende
N9320 ;-------------------------------------
N9330 ErrorMsg2:
N9340 MSG ("GRIPPER NOT CLOSED")
N9350 M00
N9360 gotof ende
N9370 ;-------------------------------------
N9380 ErrorMsg3:
N9390 MSG ("GRIPPER 1.1 NOT CLOSED OR GRIPPER 1.2 NOT OPEN")
N9400 M00
N9410 gotof ende
N9420 ;-------------------------------------
N9430 ErrorMsg4:
N9440 MSG ("IMPOSSIBLE COMMAND")
N9450 M00
N9460 gotof ende
N9470 ;-------------------------------------
N9480 ErrorMsg5:
N9490 MSG ("RAW-Part pick possible only by conveyor")
N9500 M00
N9510 gotob ErrorMsg5
N9520 gotof ende
N9530 ;-------------------------------------
N9540 EndAuto:
N9550 MSG ("PickUP 1 Command successfully Executed")
N9560 CMDEnd ; NC-End
N9570 CANCEL(200)
N9580 CANCEL(201)
N9590 CANCEL(202)
N9600 CANCEL(203)
N9610 CANCEL(204)
N9620 CANCEL(205)
N9630 GOTOB init1
N9640 ;-------------------------------------
N9650 ende:
N9660 CMDEnd ; NC-End
N9670 CANCEL(205)
N9680 WAITP(Y1)
N9690 M30



您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。