Sei sulla pagina 1di 11

'PAR 20 COVER 04.04.

2009 40stck/min Global Preserve Integer Vel, LimZAxis, Acc, Dec Global Real CycleTime Global Preserve Real PickUpTime Global Preserve Real GiveOffTime Global Preserve Real GiveOffTime2 Global Preserve Real BlowOutDelayTime Global Preserve Real BlowOutTime Global Preserve Boolean BlowOutOn Global Boolean In_Secure_Pos, In_Wait_Pos '!!!!!!!!!!!!!!!!!!!!!!!!!!! 'Using the Pls function, specify the current position of the arm as the Home pos ition. 'homeset Pls(1), Pls(2), Pls(3), Pls(4) for Inbetriebnahme noch durchfhren und Be wegungsgrenzen definieren '!!!!!!!!!!!!!!!!!!!!!!!!!!! Function main 'Hauptprogramm: Sel_Prog1 = 0 Sel_Prog_2 = 0 Sel_Prog_4 = 0 ' Benutzeroberflche Touch ' Falls Fehler auftritt ' Leistung maximal ' definiert Verschleifen ' definiert Verschleifen ' Hhenbegrenzung je nach

Xqt main_BlowOutTimer Xqt main_UserInterface Pendant TP Xqt main_Error Power High Arch 0, 10, 10 Arch 1, 10, 10 LimZ LimZAxis Artikel

Accel Acc, Dec ' Beschleunigung max. 120 Weight 1, 250 ' ca. 1kg Last und 250mm Lnge des Gelenkarmes 2 -> ' Inertia 1 ' 1 BlowOutOn = 1 On EnableTablePress ' Freigaben fr ersten Start noch von Positionsabfrage abhngig machen !!!!!!!!!! On EnableTablePunch In_Secure_Pos = False In_Wait_Pos = False ' Fine 50, 50, 50, 50 n -> kleinere Zykluszeit ' ' ' ' ' ' ' ' ' LimZAxis = -30 Acc = 60 Dec = 60 Vel = 80 PickUpTime = 0.1 GiveOffTime = 0.05 GiveOffTime2 = 0.05 BlowOutTime = 0.3 BlowOutDelayTime = 0.0 Do If (Sw(SecurePosition) = 1) And (In_Secure_Pos = False) Then ' If Input "SavePosition" = On then jump to P_save wait Speed 10 Jump P_secure If InPos Then ' In Save positi ' greren Positionierfehler zulasse

' Speed max. 100

on allow turning of hole punching indexing table On EnableTablePress ' Freiga ben fr ersten Start noch von Positionsabfrage abhngig machen !!!!!!!!!! On EnableTablePunch Off VacuumOn In_Secure_Pos = True In_Wait_Pos = False EndIf GoTo End EndIf If (Sw(SecurePosition) = 0) And (In_Secure_Pos ' If Input "SavePosition" = Off then jump to P_wait Speed 10 Jump P_wait If InPos Then on allow turning of hole punching indexing table On EnableTablePress ben fr ersten Start noch von Positionsabfrage abhngig machen On EnableTablePunch On VacuumOn In_Secure_Pos = False In_Wait_Pos = True EndIf GoTo End Position" = Off jump to end -> do nothing! EndIf = True) Then

' In Save positi ' Freiga !!!!!!!!!!

' If Input "Save

If (Sw(SavePosition) = 1) And (Sw(SecurePosition) = 0) Then Go P_save If InPos Then ' evtl. Jump P_save On EnableTablePress On EnableTablePunch Off VacuumOn EndIf GoTo End EndIf If Sw(Start) = 0 Then GoTo End abbrechen LimZ LimZAxis renzung je nach Artikel Accel Acc, Dec Speed Vel ' Geschwindigkeit Override TmReset 0 ' Reset Timer 0 fr Zykluszeitmessung Go P_start ! D0; On VacuumOn; D0; Off EnableTablePress ! 'zur Aufnahme fahren und Vakuum einschalten Signal 1 ' Signal an BlowOut-Task Wait PickUpTime ' Aufnahmezeit ' Trap 1, Sw(ThrowOff) = On GoTo EHandle ' Defines Trap: Abwurf If Sw(ThrowOff) = 1 Then ' Hhenbeg ' kein Startimpuls dann

' Abwerfen D100; Off VacuumOn ! Else Off EnableTablePunch ! EndIf 'Trap 1 ' Mglichkeit des Interruptes beenden Wait GiveOffTime2 Off VacuumOn Wait GiveOffTime ' Abgabezeit 'If Sw(SavePosition) = 1 Then er Aufnahme erhhen, falls Kollision mit Glas droht VacuumOn ! If Sw(SavePosition) = 1 Then ' Do nothing Else Go P_wait CP ' Nein: kurz oberhalb Aufnahmepunkt Presse !!evtl. hier schon Vakuum einschalten EndIf CP Off ' falls es Verzgerungen beim Unterdruckaufbau gibt !!!!!!! On Acknowledge, 0.05 CycleTime = Tmr(0) ' Zyklus zeit GoTo End Ehandle: On EnableTablePunch ' Defines Trap: Abwurf Jump P_throw_off ! D20; On EnableTablePress; On VacuumOn ! Wait GiveOffTime Jump P_save C(1) CP ! D10; On EnableTablePunch ! If Sw(SavePosition) = 1 Then ' Do nothing Else Go P_wait CP EndIf CP Off On Acknowledge, 0.05 CycleTime = Tmr(0) End: Loop Fend Function main_BlowOutTimer Do WaitSig 1 If BlowOutOn = 1 Then Off BlowOut Wait BlowOutDelayTime On BlowOut Wait BlowOutTime ' Warteposition b Jump P_stop C0 ! D10; On EnableTablePress; D90; 'Nein Jump P_throw_off C0 ! D10; On EnableTablePress; 'Ja

Jump P_save CP C(1) ! D10; On EnableTablePunch; D25; On

Off BlowOut Else Off BlowOut EndIf Loop Fend Function main_Error ' noch erweitern Do If Oport(3) = 1 Then ' Error aufgetreten Off EnableTablePress Off EnableTablePunch Off VacuumOn Off BlowOut EndIf If Not (Oport(0) = 1 Or Oport(1) = 1) Then beiden Bits mssen immer ein sein, falls nicht ist Controller evtl. Off EnableTablePress ngslos oder Kabelfehler Off EnableTablePunch Off VacuumOn Off BlowOut EndIf Loop Fend

' Diese ' Spannu

Function main_UserInterface String a$ Do Cls #24 Print #24, "- WALTEC Robot 1 -- Auto-Menu -----" 'Port-Nummer 24 definie rt Touch Pendant Print #24, "1= position setup" Print #24, "2= speed setup" Print #24, "3= timing setup" Print #24, "4= display actual values" Print #24, "5= save positions" Print #24, "6= blowout on/off" Print #24, "-------- actual values ----------- " Print #24, "t_cycle=", CycleTime, " s" ' Print #24, "BlowOut=", Oport(BlowOut) ' Print #24, "VacuumOn=", Oport(VacuumOn) 'Wichtig: Noch Bewegungsgrenzen definieren und berprfen -> ' z.B: +-10mm um Aufnahmepunkt fr Z-Achsen Input #24, a$ If a$ = "1" Then Cls #24 Print #24, "menu position setup" Print #24, "1= change P_start" Print #24, "2= change P_stop" Print #24, "3= change LimZ" Input #24, a$ If a$ = "1" Then L_P_start: Cls #24 Print #24, "change position P_start" Print #24, "1= x+0.2mm ", "2=x-0.2mm " Print #24, "3= y+0.2mm ", "4=y-0.2mm " Print #24, "5= z+0.2mm ", "6=z-0.2mm "

#24, "7= u+1grad ", "8=u-1grad " #24, "0= quit" #24, a$ = "1" Then P_start = P_start +X(0.2) 'X-Achse ElseIf a$ = "2" Then P_start = P_start -X(0.2) 'X-Achse ElseIf a$ = "3" Then P_start = P_start +Y(0.2) 'Y-Achse ElseIf a$ = "4" Then P_start = P_start -Y(0.2) 'Y-Achse ElseIf a$ = "5" Then P_start = P_start +Z(0.2) 'Z-Achse ElseIf a$ = "6" Then P_start = P_start -Z(0.2) 'Z-Achse ElseIf a$ = "7" Then P_start = P_start +U(1) 'U-Achse + ElseIf a$ = "8" Then P_start = P_start -U(1) 'U-Achse ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!" EndIf Cls #24 Print #24, "actual position P_start:" Print #24, "x = ", CX(P_start) Print #24, "y = ", CY(P_start) Print #24, "z = ", CZ(P_start) Print #24, "u = ", CU(P_start) GoTo L_P_start ElseIf a$ = "2" Then L_P_stop: Cls #24 Print #24, "change position P_stop" Print #24, "1= x+0.2mm ", "2=x-0.2mm " Print #24, "3= y+0.2mm ", "4=y-0.2mm " Print #24, "5= z+0.2mm ", "6=z-0.2mm " Print #24, "7= u+1grad ", "8=u-1grad " Print #24, "0= quit" Input #24, a$ If a$ = "1" Then P_stop = P_stop +X(0.2) 'X-Achse + ElseIf a$ = "2" Then P_stop = P_stop -X(0.2) 'X-Achse ElseIf a$ = "3" Then P_stop = P_stop +Y(0.2) 'Y-Achse + ElseIf a$ = "4" Then P_stop = P_stop -Y(0.2) 'Y-Achse ElseIf a$ = "5" Then P_stop = P_stop +Z(0.2) 'Z-Achse + ElseIf a$ = "6" Then P_stop = P_stop -Z(0.2) 'Z-Achse ElseIf a$ = "7" Then P_stop = P_stop +U(1) 'U-Achse + x ElseIf a$ = "8" Then P_stop = P_stop -U(1) 'U-Achse - x ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!"

Print Print Input If a$

+ x mm - x mm + x mm - x mm + x mm - x mm x grad x grad

x mm x mm x mm x mm x mm x mm grad grad

EndIf Print #24, "actual position P_stop:" Print #24, "x = ", CX(P_stop) Print #24, "y = ", CY(P_stop) Print #24, "z = ", CZ(P_stop) Print #24, "u = ", CU(P_stop) GoTo L_P_stop ElseIf a$ = "3" Then L_P_LimZ: Cls #24 Print #24, "change LimZ position " Print #24, "1= LimZ+1mm ", "2= LimZ-1mm " Print #24, "0= quit" Input #24, a$ If a$ = "1" Then LimZAxis = LimZAxis + 1 'LimZ + x mm If LimZAxis >= -1 Then LimZAxis = -1 ElseIf a$ = "2" Then LimZAxis = LimZAxis - 1 'LimZ - x mm If LimZAxis <= -179 Then LimZAxis = -179 ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!" EndIf Print #24, "actual LimZ position" Print #24, "LimZ = ", LimZAxis GoTo L_P_LimZ Else Print #24, "Wrong Input!" EndIf ElseIf a$ = "2" Then Cls #24 Print #24, "menu speed setup" Print #24, "1= change speed" Print #24, "2= change acceleration" Print #24, "3= change deceleration" Print #24, "0= quit" Input #24, a$ If a$ = "1" Then L_speed: Cls #24 Print #24, "change speed" Print #24, "1= speed + 1% ", "2= speed - 1%" Input #24, a$ If a$ = "1" Then Vel = Vel + 1 If Vel <= 1 Then Vel = 1 If Vel >= 100 Then Vel = 100 ElseIf a$ = "2" Then Vel = Vel - 1 If Vel <= 1 Then Vel = 1 If Vel >= 100 Then Vel = 100 ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!" EndIf Print #24, "actual speed" Print #24, "speed = ", Vel GoTo L_speed ElseIf a$ = "2" Then

L_acc: Cls #24 #24, "change acceleration" #24, "1= Acc + 1% ", "2= Acc - 1%" #24, a$ = "1" Then Acc = Acc + 1 If Acc <= 1 Then Acc = 1 If Acc >= 100 Then Acc = 100 ElseIf a$ = "2" Then Acc = Acc - 1 If Acc <= 1 Then Acc = 1 If Acc >= 100 Then Acc = 100 ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!" EndIf Print #24, "actual acceleration" Print #24, "Acc = ", Acc GoTo L_acc ElseIf a$ = "3" Then L_dec: Cls #24 Print Print Input If a$ #24, "change deceleration" #24, "1= Dec + 1% ", "2= Dec - 1%" #24, a$ = "1" Then Dec = Dec + 1 If Dec <= 1 Then Dec = 1 If Dec >= 100 Then Dec = 100 ElseIf a$ = "2" Then Dec = Dec - 1 If Dec <= 1 Then Dec = 1 If Dec >= 100 Then Dec = 100 ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!" EndIf Print #24, "actual deceleration" Print #24, "Dec = ", Dec GoTo L_dec Else Print #24, "Wrong Input!" EndIf ElseIf a$ = "3" Then Cls #24 Print #24, "menu timing setup" Print #24, "1= change pickup time" Print #24, "2= change place time" Print #24, "3= change blowout delay time" Print #24, "4= change blowout time" Print #24, "0= quit" Input #24, a$ If a$ = "1" Then L_pickup: Cls #24 Print #24, "change pickup time" Print #24, "1= pickup time + 0.01s " Print #24, "2= pickup time - 0.01s " Input #24, a$ If a$ = "1" Then Print Print Input If a$

If PickUpTime < 1 Then 'Zeitgrenzen prfen PickUpTime = PickUpTime + 0.01 Else PickUpTime = 1 Print #24, "T_pickup upper limit = 1 s ! " EndIf ElseIf a$ = "2" Then If PickUpTime < 0.1 Then n PickUpTime = 0.05 'Aufnahmezeit nicht kl einer als 0.1 s zulassen Print #24, "T_pickup lower limit = 0.05 s !" Else PickUpTime = PickUpTime - 0.01 EndIf ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!" EndIf Print #24, "actual pickup time" Print #24, "PickUpTime = ", PickUpTime GoTo L_pickup ElseIf a$ = "2" Then L_place: Cls #24 Print #24, "change place time" Print #24, "1= place time + 0.01s " Print #24, "2= place time - 0.01s " Input #24, a$ If a$ = "1" Then If GiveOffTime < 1 Then 'Zeitgrenzen prfen GiveOffTime = GiveOffTime + 0.01 Else GiveOffTime = 1 Print #24, "place time upper limit = 1 s !" EndIf ElseIf a$ = "2" Then If GiveOffTime < 0.1 Then 'Zeitgrenzen prfe n GiveOffTime = 0.05 'Aufnahmezeit nicht k leiner als 0.1 s zulassen Print #24, "place time lower limit = 0.0 5 s !" Else GiveOffTime = GiveOffTime - 0.01 EndIf ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!" EndIf Print #24, "actual place time" Print #24, "GiveOffTime = ", GiveOffTime GoTo L_place ElseIf a$ = "3" Then L_blowoutdelay: Cls #24 Print #24, "change blowout delay time" 'Zeitgrenzen prfe

Print Print Input If a$ n

#24, "1= blowout delay time + 0.01s " #24, "2= blowout delay time - 0.01s " #24, a$ = "1" Then If BlowOutDelayTime < 1 Then 'Zeitgrenzen prfe BlowOutDelayTime = BlowOutDelayTime + 0.

01 Else BlowOutDelayTime = 1 Print #24, "blowout delay time upper lim it = 1 s !" EndIf ElseIf a$ = "2" Then If BlowOutDelayTime < 0.1 Then 'Zeitgrenzen prfe n BlowOutDelayTime = 0.05 'Zeit nicht klei ner als 0.1 s zulassen Print #24, "blowout delay time lower lim it = 0.05 s !" Else BlowOutDelayTime = BlowOutDelayTime - 0. 01 EndIf ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!" EndIf Print #24, "actual blowout delay time" Print #24, "BlowOut Delay = ", BlowOutDelayTime GoTo L_blowoutdelay ElseIf a$ = "4" Then L_blowout: Cls #24 Print #24, "change blowout time" Print #24, "1= blowout time + 0.01s " Print #24, "2= blowout time - 0.01s " Input #24, a$ If a$ = "1" Then If BlowOutTime < 1 Then 'Zeitgrenzen prfen BlowOutTime = BlowOutTime + 0.01 Else BlowOutTime = 1 Print #24, "blowout time upper limit = 1 s !" EndIf ElseIf a$ = "2" Then If BlowOutTime < 0.1 Then 'Zeitgrenzen prfe n BlowOutTime = 0.05 'Zeit nicht kleiner a ls 0.1 s zulassen Print #24, "blowout time lower limit = 0 .05 s !" Else BlowOutTime = BlowOutTime - 0.01 EndIf ElseIf a$ = "0" Then GoTo L_end Else Print #24, "Wrong Input!"

EndIf Print #24, "actual blowout time" Print #24, "BlowOutTime = ", BlowOutTime GoTo L_blowout Else Print #24, "Wrong Input!" EndIf ElseIf a$ = "4" Then Cls #24 Print #24, "menu actual values" Print #24, "1= display positions" Print #24, "2= display speed, acc" Print #24, "3= display timing" Input #24, a$ If a$ = "1" Then Cls #24 Print #24, "actual position P_start:" Print #24, "x = ", CX(P_start), " mm" Print #24, "y = ", CY(P_start), " mm" Print #24, "z = ", CZ(P_start), " mm" Print #24, "u = ", CU(P_start), " grad" Print #24, "actual position P_stop:" Print #24, "x = ", CX(P_stop), " mm" Print #24, "y = ", CY(P_stop), " mm" Print #24, "z = ", CZ(P_stop), " mm" Print #24, "u = ", CU(P_stop), " grad" ElseIf a$ = "2" Then Cls #24 Print #24, "actual speed" Print #24, "speed = ", Vel Print #24, "acceleration = ", Acc, " %" Print #24, "deceleration = ", Dec, " %" ElseIf a$ = "3" Then Cls #24 Print #24, "actual timing" Print #24, "pickup time = ", PickUpTime, " s" Print #24, "place time = ", GiveOffTime, " s" Print #24, "cylce time = ", CycleTime, " s" Print #24, "blowout delay = ", BlowOutDelayTime, " s" Print #24, "blowout time = ", BlowOutTime, " s" Else Print #24, "Wrong Input!" EndIf Wait 5 ElseIf a$ = "5" Then Print #24, "Save Points to File" SavePoints "Points.pts" ElseIf a$ = "6" Then Cls #24 Print #24, "blowout on/off" Print #24, "1= on" Print #24, "2= off" Input #24, a$ If a$ = "1" Then BlowOutOn = 1 ElseIf a$ = "2" Then BlowOutOn = 0 Else Print #24, "Wrong Input!" EndIf

Else Print #24, "Wrong Input!" EndIf L_end: a$ = "" Loop Fend

Potrebbero piacerti anche