Programación 6 ABB.

Aprender Linguaxe RAPID, poderemos programar desde RobotStudio, ou desde a FlexPendant.

  1. Control de Flujo WHILE; Bucle While, este repetirá a instrucións do seu interior mentres o valor da variable cumpra a condición programada.
  2. Control de Flujo WHILE; Formato da mesma:
    WHILE IN1 = 1 DO !O Bucle executarase sempre que se cumpra esta condición
              
      !Instrucions a realizar mentras se cumpre a condición
    
    ENDWHILE
    
  3. Exemplo usando estas instrucións  TPWrite, TPErase, IF & WHIL; Se quere realizar o exemplo pode tomar como base o exercicio Programación 4 ABB:
    MODULE Module1
    	CONST robtarget Target_10:=[[547.330665099,0,451.64730631],[0.190808996,0,0.981627183,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    	CONST robtarget Target_20_2:=[[580.004388386,-300.000173756,49.997538618],[0.00007062,0.000000176,-0.999999998,0.000000105],[-1,1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    	CONST robtarget Target_20:=[[579.997326386,-300.000184257,-0.002460883],[0.00007062,0.000000176,-0.999999998,0.000000105],[-1,1,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    	CONST robtarget Target_30_2:=[[580.007086271,300.000028414,49.999940578],[0.000070808,0.000000206,-0.999999997,0.000000106],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    	CONST robtarget Target_30:=[[580.000005471,300.000017813,-0.000058921],[0.000070808,0.000000206,-0.999999997,0.000000106],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    	VAR num Contador := 1;
        PROC main()
    	    MoveJ Target_10,v1000,fine,MyTool\WObj:=wobj0;
            TPErase;
           WHILE IN1 = 1 DO
              
               TPErase;
               TPWrite "Numero: " \ NUM:= Contador;
               TPWrite "Soldando Derecha";
               Secuencia_1;
               TPWrite "Soldando Izquierda";
               Secuencia_2;
               MoveJ Target_10,v1000,fine,MyTool\WObj:=wobj0;
               Contador := Contador + 1;
               
               IF IN2 = 1 THEN !Resetar Contador
                Contador := 1;  
               ENDIF
           
           ENDWHILE
            MoveJ Target_10,v1000,fine,MyTool\WObj:=wobj0;
            
           IF IN2 = 1 THEN    !Resetar Contador
              Contador := 1;  
           ENDIF
            
    	ENDPROC
    	PROC Secuencia_1()
    	    MoveJ Target_20_2,v1000,fine,MyTool\WObj:=wobj0;
    	    MoveJ Target_20,v1000,fine,MyTool\WObj:=wobj0;
            WaitTime 2;
    	    MoveJ Target_20_2,v1000,fine,MyTool\WObj:=wobj0;
    	ENDPROC
    	PROC Secuencia_2()
    	    MoveJ Target_30_2,v1000,fine,MyTool\WObj:=wobj0;
    	    MoveJ Target_30,v1000,fine,MyTool\WObj:=wobj0;
            WaitTime 2;
    	    MoveJ Target_30_2,v1000,fine,MyTool\WObj:=wobj0;
    	ENDPROC
    ENDMODULE



     Links de Interese:


    Data Publicación: 10/02/2021