Simulación 11 con RobotStudio ABB, Estación entrenamiento.
Programación de robots industriais Off- Line.
Posición, e Rotación dos obxectos:
-Tomando como referencia Mundo.
Obxecto | X | Y | Z | Descargar Componentes | A | B | C |
Estación Completa (Vacía) | - | - | - | Estación Completa | - | - | - |
Loading...
RAPID:
MODULE Module1
CONST jointtarget Home:=[[0,0,0,0,30,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_10:=[[-198.122274017,194.568832612,255.019376828],[0.571845826,0.000000031,0.82036111,-0.000000081],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_20:=[[-198.122307412,18.352867034,255.019388108],[0.57184589,0.000000037,0.820361066,-0.000000075],[-1,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_30:=[[-223.404693948,18.352998581,183.732236115],[0.597877371,0.000000079,0.801587581,-0.000000007],[-1,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_40:=[[121.575674155,-224.431198546,260.704176504],[0.571845827,0.000000032,0.82036111,-0.000000081],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_50:=[[1.116693975,0.572787637,-0.380843384],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_60:=[[1.339695416,-179.543212361,-0.365836902],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_70:=[[1.056695691,-211.41921227,2.238164248],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_80:=[[0.990696002,-241.429211949,11.157165329],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_90:=[[0.981696451,-287.467211585,21.284166986],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_100:=[[0.890696789,-336.538211831,14.481168753],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_110:=[[174.883696789,-336.559210439,14.479167362],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_120:=[[174.766696451,-287.424210193,21.329165594],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_130:=[[174.876696001,-241.388210558,11.170163936],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_140:=[[174.93269569,-211.420210879,2.249162857],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_150:=[[175.088695413,-179.454210975,-0.462838295],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_160:=[[174.959693972,0.540789023,-0.483844774],[-0.000000004,-0.000000004,1,-0.000000018],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_20_2:=[[-223.404693948,18.352998581,183.732236115],[0.597877371,0.000000079,0.801587581,-0.000000007],[-1,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_30_2:=[[-27.408298224,18.352986803,125.437562932],[0.597877386,0.000000127,0.801587569,0.000000033],[-1,1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_170:=[[135.059716242,-88.715199986,-0.425832841],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_180:=[[134.73071697,-179.772199988,-0.386831207],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_190:=[[111.262717112,-199.28220016,0.491168769],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_200:=[[88.377717211,-218.477200282,3.885168748],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_210:=[[47.025717305,-253.265200405,15.421168713],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_220:=[[46.818717446,-281.930200307,20.942169226],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_230:=[[47.220717704,-312.554200319,20.116169784],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_240:=[[159.231717705,-312.667199423,20.129171578],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_250:=[[158.810717369,-268.838199443,19.230170782],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_260:=[[158.880717278,-241.302199588,11.170170287],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_270:=[[158.705717155,-206.794199762,1.598169663],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_280:=[[159.18871697,-179.562199795,-0.456830819],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_290:=[[159.159716433,-112.451199795,-0.461832027],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_36:=[[-244.957393023,18.353010963,96.7678494],[0.645291922,0.000000142,0.76393608,0.000000117],[-2,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_37:=[[-27.40830505,18.352995337,59.87515844],[0.645291919,0.000000116,0.763936083,0.00000006],[-1,1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_25:=[[-22.29,18.353,190.795],[0.571845234,0,0.820361523,0],[-1,1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_35:=[[-27.408298224,18.352986803,125.437562932],[0.597877386,0.000000127,0.801587569,0.000000033],[-1,1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_300:=[[25.222715675,-17.299200865,-0.439835884],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_310:=[[20.148716295,-94.744200906,-0.444834571],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_320:=[[97.576716341,-100.407200287,-0.48483323],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_330:=[[102.926715717,-22.449200244,-0.481834548],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_340:=[[25.222715355,-17.299200505,19.560164116],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_350:=[[25.000715946,-91.095200507,19.545165441],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_360:=[[25.000716266,-91.095200867,-0.454834559],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_370:=[[87.511716048,-63.850200367,-0.480834049],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_380:=[[70.749715812,-34.4962005,-0.438834846],[0.000000008,-0.000000004,1,-0.000000009],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_390:=[[-180,130,280],[0.707106781,0,0.707106781,0],[-1,1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_400:=[[-106.687680003,19.422612394,13.060981221],[0.707106787,0.000000448,0.707106775,0.000000245],[-1,1,-3,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_410:=[[-14.239689921,19.422607287,13.060978255],[0.707106784,0.000000091,0.707106778,-0.00000015],[-1,1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_420:=[[160.869598746,-26.568795934,82.862748673],[-0.000000078,-0.000000005,1,-0.000000043],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_450:=[[158.677303418,-35.280002908,18.544348527],[-0.000000818,0.707106795,0.00000005,0.707106767],[0,-2,3,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_430:=[[-58,20.604,502.782],[0,0.707106781,0,0.707106781],[-1,0,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_440:=[[160.453286574,-27.233691771,9.590470276],[-0.000000155,0.707106801,0.000000063,0.707106761],[-1,0,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_460:=[[2.09139959,28.603982614,502.782069118],[-0.000000026,0.707106796,0.000000059,0.707106766],[-1,0,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_490:=[[-186.400973582,245.4714121,502.781967645],[-0.000000011,0.707106782,-0.000000041,0.70710678],[-1,0,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR num Alimen := 0;
VAR num Dejar := 0;
CONST robtarget Target_500:=[[-186.400988245,441.181109319,502.781973643],[0.00000006,0.707106766,0.000000008,0.707106797],[0,-1,2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_510:=[[-85.024899514,-224.000003625,106.849947852],[0,1,0.000000041,-0.000000037],[-1,-1,-3,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_520:=[[-55.024903254,-168.034939315,-48.327365556],[0.000000001,1,0.000000094,-0.000000007],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_530:=[[-105.024893023,-168.03494845,69.658859795],[-0.000000001,1,0.000000086,-0.000000007],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_540:=[[126.912720418,-296.591916497,294.180458345],[-0.000000052,0.707106787,0.000000105,0.707106775],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_560:=[[52.405420824,-78.591908183,13.214092553],[-0.000000012,0.707106781,0.000000064,0.707106781],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_570:=[[52.109126245,-7.267121766,2.669793057],[0.000000002,0.707106778,0.000000096,0.707106784],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_580:=[[52.405423855,75.113095322,13.214088265],[0.000000021,0.707106782,-0.000000003,0.70710678],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_590:=[[-34.616700743,75.113105936,13.214082436],[-0.000000005,0.707106788,0.000000022,0.707106774],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_600:=[[-34.870378052,-2.00189559,2.66978609],[-0.000000004,0.707106785,0.000000015,0.707106777],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_610:=[[-34.616699659,-79.055135429,13.214084617],[0.000000036,0.707106785,0.000000021,0.707106778],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_620:=[[9.394890142,-79.055145201,13.214091328],[-0.000000076,0.707106781,-0.000000027,0.707106781],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_630:=[[51.280919598,-79.055148777,13.214095509],[0.000000069,0.707106777,-0.000000031,0.707106785],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_640:=[[51.280919711,-79.055149314,3.214095509],[-0.000000069,0.707106777,-0.000000031,0.707106785],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_650:=[[9.596891655,-79.055145058,3.21408653],[0.000000036,0.707106784,0.000000002,0.707106779],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_660:=[[24.406618666,-49.802879466,6.971274565],[-0.000000047,0.707106785,0.000000136,0.707106777],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_670:=[[37.616794183,-21.132738592,2.669792505],[0.000000071,0.707106778,0.000000084,0.707106784],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_680:=[[42.161590225,-1.945953683,2.669792141],[-0.000000033,0.707106779,0.000000038,0.707106784],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_690:=[[37.616797102,25.807690384,2.669789525],[0.000000087,0.707106781,0.000000076,0.707106781],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_700:=[[38.050894816,65.427534223,10.136880011],[-0.000000054,0.707106783,0.000000073,0.707106779],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_710:=[[-17.440968069,65.427541661,10.136881837],[0.000000096,0.707106778,0.000000116,0.707106785],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_720:=[[0.789410072,46.954881902,6.290364613],[-0.000000191,0.707106772,0.000000129,0.707106791],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_730:=[[19.944137986,27.361274362,4.13195009],[0.000000108,0.707106782,0.00000003,0.707106781],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_740:=[[4.571803121,-1.945955041,2.669791756],[-0.000000043,0.707106782,0.000000024,0.70710678],[0,0,1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_750:=[[-6.640784044,-23.28498878,2.791390748],[0.000000587,0.707106716,0.000000541,0.707106846],[-1,-1,2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_760:=[[-49.019685477,-168.03492976,-71.327447638],[0.000000004,1,0.000000093,0.000000009],[0,-1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_770:=[[-48.043790916,-168.03492601,-71.327446896],[0.000000002,1,0.000000093,0.000000016],[0,-1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR num Numero := 0;
VAR num Numero4 := 0;
VAR num Numero5 := 0;
VAR num Cantidad := 2;
VAR num Cantidad2 := 2;
VAR num Entrada := 0;
VAR num Entrada2 := 0;
VAR num INS := 0;
VAR bool Okey := FALSE;
VAR bool Okey2 := FALSE;
PROC main()
SetDO OUT_1 , 0;
SetDO OUT_2 , 0;
SetDO OUT_3 , 0;
SetDO OUT_4 , 0;
SetDO OUT_5 , 0;
TPErase;
TPReadFK Numero,"Seleccióne la secuencia a Realizar:", "Todas las secuencias", "Mesa Exterior y Mesa Interior", "Cuadrado, Circulo, Triangulo", "Pieza Mesa - Pieza Alim 1" , "Pieza Mesa - Pieza Alim 2" ;
TEST Numero
CASE 1:
TPWrite " Realizando Toda las Secuencia ";
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Mesa_Exterior;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Mesa_Interior;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
INS := 4;
Cua_Cir_Tri;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Cantidad := 2;
Cantidad2 := 2;
Entrada := 0;
Entrada2 := 0;
Okey := True;
Okey2 := True;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Herramienta;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 2:
TPWrite " Realizando Mesa Exterior e Interior";
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Mesa_Exterior;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Mesa_Interior;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 3:
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
IF IN_10 = 1 THEN
INS := 1;
TPWrite " Realizando Cuadrado";
Cua_Cir_Tri;
ELSEIF IN_11 = 1 THEN
INS := 2;
TPWrite " Realizando Circulo";
Cua_Cir_Tri;
ELSE
IF IN_12 = 1 THEN
INS := 3;
TPWrite " Realizando Triángulo";
Cua_Cir_Tri;
ELSEIF IN_13 = 1 THEN
INS := 4;
TPWrite " Realizando Cuadrado, Círculo, Triángulo";
Cua_Cir_Tri;
ELSE
IF IN_13 = 0 THEN
TPWrite "Ninguna entrada activa";
WaitTime 1;
ENDIF
ENDIF
ENDIF
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 4:
TPReadNum Numero4,"Introduzca un numero entre: 1 y 6.";
TEST Numero4
CASE 1:
TPWrite " Realizando Pieza 1";
Cantidad := 0;
Cantidad2 := 0;
Entrada := 0;
Entrada2 := 0;
Okey := True;
Okey2 := False;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 2:
TPWrite " Realizando Pieza 1 & Pieza 2";
Cantidad := 1;
Cantidad2 := 0;
Entrada := 0;
Entrada2 := 0;
Okey := True;
Okey2 := False;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 3:
TPWrite " Realizando Pieza 1 , Pieza 2 & Pieza 3";
Cantidad := 2;
Cantidad2 := 0;
Entrada := 0;
Entrada2 := 0;
Okey := True;
Okey2 := False;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 4:
TPWrite " Realizando Pieza 1 , Pieza 2 , Pieza 3 & Pieza 4";
Cantidad := 2;
Cantidad2 := 0;
Entrada := 0;
Entrada2 := 0;
Okey := True;
Okey2 := True;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 5:
TPWrite " Realizando Pieza 1 , Pieza 2 , Pieza 3, Pieza 4 & Pieza 5";
Cantidad := 2;
Cantidad2 := 1;
Entrada := 0;
Entrada2 := 0;
Okey := True;
Okey2 := True;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 6:
TPWrite " Realizando Pieza 1 , Pieza 2 , Pieza 3, Pieza 4, Pieza 5 & Pieza 6";
Cantidad := 2;
Cantidad2 := 2;
Entrada := 0;
Entrada2 := 0;
Okey := True;
Okey2 := True;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
DEFAULT :
TPWrite "Error Numero Incorrecto";
WaitTime 2;
Cantidad := 0;
Cantidad2 := 0;
Entrada := 0;
Entrada2 := 0;
Okey := false;
Okey2 := false;
ENDTEST
CASE 5:
TPReadNum Numero5,"Introduzca un numero entre: 1 y 6.";
TEST Numero5
CASE 1:
TPWrite " Realizando Pieza 1";
Cantidad := 0;
Cantidad2 := 0;
Entrada := 0;
Entrada2 := 0;
Okey := True;
Okey2 := False;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 2:
TPWrite " Realizando Pieza 2";
Cantidad := 1;
Cantidad2 := 0;
Entrada := 1;
Entrada2 := 0;
Okey := True;
Okey2 := False;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 3:
TPWrite " Realizando Pieza 3";
Cantidad := 2;
Cantidad2 := 0;
Entrada := 2;
Entrada2 := 0;
Okey := True;
Okey2 := False;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 4:
TPWrite " Realizando Pieza 4";
Cantidad := 0;
Cantidad2 := 0;
Entrada := 0;
Entrada2 := 0;
Okey := False;
Okey2 := True;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 5:
TPWrite " Realizando Pieza 5";
Cantidad := 0;
Cantidad2 := 1;
Entrada := 0;
Entrada2 := 1;
Okey := False;
Okey2 := True;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
CASE 6:
TPWrite " Realizando Pieza 6";
Cantidad := 0;
Cantidad2 := 2;
Entrada := 0;
Entrada2 := 2;
Okey := False;
Okey2 := True;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
Pieza_Alim;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
DEFAULT :
TPWrite "Error Numero Incorrecto";
WaitTime 2;
Cantidad := 0;
Cantidad2 := 0;
Entrada := 0;
Entrada2 := 0;
Okey := false;
Okey2 := false;
ENDTEST
ENDTEST
ENDPROC
PROC ABRIR()
SetDO OUT_1,0;
SetDO OUT_4,1;
WaitDI IN_1,0;
ENDPROC
PROC CERRAR()
SetDO OUT_4,0;
SetDO OUT_1,1;
WaitDI IN_1,1;
ENDPROC
PROC COGER()
SetDO OUT_5,0;
SetDO OUT_2,1;
WaitDI IN_2,1;
ENDPROC
PROC COGER_PIEZA()
MoveL Target_390,v300,fine,Pinza\WObj:=Alimentador;
MoveL Target_400,v300,fine,Pinza\WObj:=Alimentador;
MoveL Target_410,v300,fine,Pinza\WObj:=Alimentador;
CERRAR;
MoveL Target_400,v300,fine,Pinza\WObj:=Alimentador;
MoveL Target_390,v300,fine,Pinza\WObj:=Alimentador;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
ENDPROC
PROC Cua_Cir_Tri()
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
MoveJ Target_36,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_37,v300,fine,Pinza\WObj:=Cambiador;
CERRAR;
MoveL Target_36,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_20,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
TEST INS
CASE 1:
!Cuadrado
MoveL Target_300,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_310,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_320,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_330,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_300,v300,fine,PEN_120\WObj:=Mesa;
CASE 2:
!Circulo
MoveL Target_300,v300,fine,PEN_120\WObj:=Mesa;
MoveC Target_310,Target_320,v300,fine,PEN_120\WObj:=Mesa;
MoveC Target_330,Target_300,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_300,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_340,v300,fine,PEN_120\WObj:=Mesa;
CASE 3:
!Triangulo
MoveL Target_350,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_360,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_370,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_380,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_360,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_350,v300,fine,PEN_120\WObj:=Mesa;
CASE 4:
!Cuadrado
MoveL Target_300,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_310,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_320,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_330,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_300,v300,fine,PEN_120\WObj:=Mesa;
!Circulo
MoveL Target_300,v300,fine,PEN_120\WObj:=Mesa;
MoveC Target_310,Target_320,v300,fine,PEN_120\WObj:=Mesa;
MoveC Target_330,Target_300,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_300,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_340,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_350,v300,fine,PEN_120\WObj:=Mesa;
!Triangulo
MoveL Target_360,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_370,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_380,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_360,v300,fine,PEN_120\WObj:=Mesa;
MoveL Target_350,v300,fine,PEN_120\WObj:=Mesa;
ENDTEST
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_20,v300,fine,Pinza\WObj:=Cambiador;
MoveJ Target_36,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_37,v300,fine,Pinza\WObj:=Cambiador;
ABRIR;
MoveL Target_36,v300,fine,Pinza\WObj:=Cambiador;
MoveJ Target_10,v300,fine,Pinza\WObj:=Cambiador;
ENDPROC
PROC Mesa_Exterior()
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_20,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_25,v300,fine,Pinza\WObj:=Cambiador;
CERRAR;
MoveL Target_20,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_40,v300,fine,PEN_130\WObj:=Mesa;
MoveL Target_50,v300,fine,PEN_130\WObj:=Mesa;
MoveL Target_60,v300,fine,PEN_130\WObj:=Mesa;
MoveC Target_70,Target_80,v300,fine,PEN_130\WObj:=Mesa;
MoveC Target_90,Target_100,v300,fine,PEN_130\WObj:=Mesa;
MoveL Target_110,v300,fine,PEN_130\WObj:=Mesa;
MoveC Target_120,Target_130,v300,fine,PEN_130\WObj:=Mesa;
MoveC Target_140,Target_150,v300,fine,PEN_130\WObj:=Mesa;
MoveL Target_160,v300,fine,PEN_130\WObj:=Mesa;
MoveL Target_50,v300,fine,PEN_130\WObj:=Mesa;
MoveL Target_40,v300,fine,PEN_130\WObj:=Mesa;
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_20,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_25,v300,fine,Pinza\WObj:=Cambiador;
ABRIR;
MoveL Target_20,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
ENDPROC
PROC Pieza_Alim()
if Okey = true then
FOR Alimen FROM Entrada TO Cantidad DO
MoveJ Target_490,v300,fine,Ventosa\WObj:=Alimentador;
MoveL Target_500,v300,fine,Ventosa\WObj:=Alimentador;
MoveL RelTool (Target_450,50,0,-(70*Alimen)),v300,fine,Ventosa\WObj:=Mesa;
MoveL RelTool (Target_450,0,0,-(70*Alimen)),v300,fine,Ventosa\WObj:=Mesa;
COGER;
MoveL RelTool (Target_450,50,0,-(70*Alimen)),v300,fine,Ventosa\WObj:=Mesa;
MoveJ Target_490,v300,fine,Ventosa\WObj:=Alimentador;
SOLTAR_PIEZA;
ENDFOR
ENDIF
if Okey2 = true then
FOR Alimen FROM Entrada2 TO Cantidad2 DO
MoveJ Target_490,v300,fine,Ventosa\WObj:=Alimentador;
MoveL Target_500,v300,fine,Ventosa\WObj:=Alimentador;
MoveL RelTool (Target_450,50,66,-(70*Alimen)),v300,fine,Ventosa\WObj:=Mesa;
MoveJ RelTool (Target_450,0,66,-(70*Alimen)),v300,fine,Ventosa\WObj:=Mesa;
COGER;
MoveL RelTool (Target_450,50,66,-(70*Alimen)),v300,fine,Ventosa\WObj:=Mesa;
MoveJ Target_490,v300,fine,Ventosa\WObj:=Alimentador;
SOLTAR_PIEZA;
ENDFOR
ENDIF
ENDPROC
PROC Pieza_Mesa()
if Okey = true then
FOR Dejar FROM Entrada TO Cantidad DO
COGER_PIEZA;
MoveL RelTool (Target_420,(70*Dejar),0,0),v300,fine,Pinza\WObj:=Mesa;
MoveL RelTool (Target_420,(70*Dejar),0,50),v300,fine,Pinza\WObj:=Mesa;
ABRIR;
MoveL RelTool (Target_420,(70*Dejar),0,0),v300,fine,Pinza\WObj:=Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
ENDFOR
ENDIF
if Okey2 = true then
FOR Dejar FROM Entrada2 TO Cantidad2 DO
COGER_PIEZA;
MoveL RelTool (Target_420,(70*Dejar),-66,0),v300,fine,Pinza\WObj:=Mesa;
MoveL RelTool (Target_420,(70*Dejar),-66,50),v300,fine,Pinza\WObj:=Mesa;
ABRIR;
MoveL RelTool (Target_420,(70*Dejar),-66,0),v300,fine,Pinza\WObj:=Mesa;
MoveAbsJ Home,v500,fine,Ventosa\WObj:=Mesa;
ENDFOR
ENDIF
ENDPROC
PROC SOLTAR()
SetDO OUT_2,0;
SetDO OUT_5,1;
WaitDI IN_2,0;
ENDPROC
PROC SOLTAR_PIEZA()
MoveL Target_430,v300,fine,Ventosa\WObj:=Alimentador;
MoveL Target_460,v300,fine,Ventosa\WObj:=Alimentador;
SOLTAR;
MoveL Target_430,v300,fine,Ventosa\WObj:=Alimentador;
ENDPROC
PROC Mesa_Interior()
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_30,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_35,v300,fine,Pinza\WObj:=Cambiador;
CERRAR;
MoveL Target_30,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_170,v300,fine,PEN_125\WObj:=Mesa;
MoveL Target_180,v300,fine,PEN_125\WObj:=Mesa;
MoveL Target_190,v300,fine,PEN_125\WObj:=Mesa;
MoveC Target_200,Target_210,v300,fine,PEN_125\WObj:=Mesa;
MoveC Target_220,Target_230,v300,fine,PEN_125\WObj:=Mesa;
MoveL Target_240,v300,fine,PEN_125\WObj:=Mesa;
MoveC Target_250,Target_260,v300,fine,PEN_125\WObj:=Mesa;
MoveC Target_270,Target_280,v300,fine,PEN_125\WObj:=Mesa;
MoveL Target_290,v300,fine,PEN_125\WObj:=Mesa;
MoveL Target_170,v300,fine,PEN_125\WObj:=Mesa;
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_30,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_35,v300,fine,Pinza\WObj:=Cambiador;
ABRIR;
MoveL Target_30,v300,fine,Pinza\WObj:=Cambiador;
MoveL Target_10,v300,fine,Pinza\WObj:=Cambiador;
ENDPROC
PROC Dejar_Pieza()
ENDPROC
PROC Herramienta()
MoveJ Target_510,v300,fine,Pinza\WObj:=Mesa;
MoveL Target_520,v300,fine,Pinza\WObj:=Mesa;
CERRAR;
MoveL Target_770,v300,fine,Pieza_Trabajo\WObj:=Mesa;
MoveL Target_760,v300,fine,Pieza_Trabajo\WObj:=Mesa;
MoveL Target_530,v300,fine,Pinza\WObj:=Mesa;
MoveJ Target_540,v300,fine,Pieza_Trabajo\WObj:=Mesa;
MoveJ Target_560,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveC Target_570,Target_580,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_590,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveC Target_600,Target_610,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_620,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_630,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_640,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_650,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_620,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_660,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_670,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_680,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_690,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_700,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_710,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_720,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_730,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_740,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_750,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_610,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_620,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveL Target_630,v300,fine,Pieza_Trabajo\WObj:=Herramienta_Fija;
MoveJ Target_510,v300,fine,Pinza\WObj:=Mesa;
MoveL Target_770,v300,fine,Pieza_Trabajo\WObj:=Mesa;
MoveL Target_520,v300,fine,Pinza\WObj:=Mesa;
ABRIR;
MoveL Target_530,v300,fine,Pinza\WObj:=Mesa;
ENDPROC
ENDMODULE