SHARE
TWEET

Untitled

a guest Oct 25th, 2018 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MODULE MainModule
  2.    
  3.         CONST robtarget Home:=[[486.99,7.93,590.21],[0.0176087,-0.721082,0.0159713,-0.692442],[0,0,-3,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  4.         CONST robtarget GetMtrl:=[[639.46,132.55,378.33],[0.00284426,-0.712476,0.000492174,-0.70169],[0,0,-3,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  5.         CONST robtarget ToAssembly:=[[546.60,277.25,511.37],[0.002885,-0.712511,0.0006212,-0.701655],[0,0,-3,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  6.         CONST robtarget Rotate:=[[546.46,394.47,412.57],[0.701944,0.00107392,0.712226,-0.00264609],[0,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  7.         CONST robtarget Mounting:=[[557.99,396.06,376.53],[0.715979,0.000937868,0.698116,-0.00273462],[0,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  8.         CONST robtarget PickMounted:=[[557.97,396.06,451.72],[0.715987,0.000930153,0.698108,-0.0027456],[0,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  9.         CONST robtarget ToStorage:=[[488.50,-224.24,342.06],[0.684693,-0.0142713,0.728692,-0.000822082],[-1,-1,0,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  10.         CONST robtarget AtStorage:=[[681.78,-224.24,342.05],[0.684684,-0.0142849,0.7287,-0.000820676],[-1,-1,0,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  11.         CONST robtarget IntoStorage:=[[509.75,-224.23,348.14],[0.684692,-0.014292,0.728692,-0.000800338],[-1,-1,0,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
  12.          
  13.     !Main program
  14.     PROC main()
  15.         MoveJ Home, v1000, z50, tool_assembly;
  16.             GripperOpen;
  17.             ResetDoSignals;
  18.         TPErase;
  19.         SetDo PLC_ETH_DO0, 1; != ready
  20.         TPWrite "Robot in ready state, press start to continue";
  21.         WaitUntil PLC_ETH_DI4 = 1 OR PLC_ETH_DI5 = 1 OR PLC_ETH_DI6 = 1 OR PLC_ETH_DI7 = 1;
  22.         IF PLC_ETH_DI4 = 1 THEN
  23.             ResetDoSignals;
  24.             MakeWave;
  25.         ELSEIF PLC_ETH_DI5 = 1 THEN
  26.             ResetDoSignals;
  27.             MakeSmiley;
  28.         ELSEIF PLC_ETH_DI6 = 1 THEN
  29.             ResetDoSignals;
  30.             MakeCross;
  31.         ELSEIF PLC_ETH_DI7 = 1 THEN
  32.             ResetDoSignals;
  33.             TPWrite "Incorrect value";
  34.             Stop;
  35.         ENDIF
  36.     ENDPROC
  37.    
  38.     PROC MakeWave()
  39.         TPWrite "Starting the creation of part Wave";
  40.         MoveJ Offs(GetMtrl,0,0,100), v600, z50, tool_assembly;
  41.         MoveL GetMtrl, v100, fine, tool_assembly;
  42.         GripperClose;
  43.         MoveL Offs(GetMtrl,0,0,100), v600, z50, tool_assembly;
  44.         TPWrite "Moving part Wave to assembly";
  45.         Assembly;
  46.         StorageWave;
  47.     ENDPROC    
  48.    
  49.     PROC MakeSmiley()
  50.         TPWrite "Starting the creation of part Smiley";
  51.         MoveJ Offs(GetMtrl,0,-115,100), v600, z50, tool_assembly;
  52.         MoveL Offs(GetMtrl,0,-115,0), v100, fine, tool_assembly;
  53.         GripperClose;
  54.         MoveL Offs(GetMtrl,0,-115,100), v600, z50, tool_assembly;
  55.         TPWrite "Moving part Smiley to assembly";
  56.         Assembly;
  57.         StorageWave;
  58.     ENDPROC
  59.    
  60.     PROC MakeCross()
  61.         TPWrite "Starting the creation of part Cross";
  62.         MoveJ Offs(GetMtrl,0,-235,100), v600, z50, tool_assembly;
  63.         MoveL Offs(GetMtrl,0,-235,0), v100, fine, tool_assembly;
  64.         GripperClose;
  65.         MoveL Offs(GetMtrl,0,-235,100), v600, z50, tool_assembly;
  66.         TPWrite "Moving part Cross to assembly";
  67.         Assembly;
  68.         StorageWave;
  69.     ENDPROC
  70.    
  71.     !Assembly
  72.     PROC Assembly()
  73.         MoveJ ToAssembly, v1000, z50, tool_assembly;
  74.         MoveJ Rotate, v1000, z50, tool_assembly;
  75.         MoveL Offs(Mounting,0,0,50), v600, z50, tool_assembly;
  76.         MoveL Mounting, v600, z50, tool_assembly;
  77.             GripperOpen;
  78.         MoveL PickMounted, v600, z50, tool_assembly;
  79.             GripperClose;
  80.         MoveL Offs(PickMounted,0,0,200), v600, z50, tool_assembly;
  81.         TPwrite "Moving assemblied part to storage";
  82.         MoveJ ToStorage, v1000, z50, tool_assembly;
  83.     ENDPROC
  84.    
  85.     !Storage difference
  86.     PROC StorageWave()
  87.         MoveJ AtStorage, v200, z50, tool_assembly;
  88.         MoveL IntoStorage, v200, fine, tool_assembly;
  89.         GripperOpen;
  90.         TPWrite "Operation done";
  91.         MoveL Offs(IntoStorage,0,0,100), v200, fine, tool_assembly;
  92.         MoveJ Home, v1000, z50, tool_assembly;
  93.     ENDPROC
  94.        
  95.     PROC StorageSmiley()
  96.         MoveJ Offs(AtStorage, 0,-100,0), v200, z50, tool_assembly;
  97.         MoveL Offs(IntoStorage,0,-100,0), v200, fine, tool_assembly;
  98.         GripperOpen;
  99.         TPWrite "Operation done";
  100.         MoveL Offs(IntoStorage,0,-100,100), v200, fine, tool_assembly;
  101.         MoveJ Home, v1000, z50, tool_assembly;
  102.     ENDPROC
  103.        
  104.     PROC StorageCross()
  105.         MoveJ Offs(AtStorage,0,-200,0), v200, z50, tool_assembly;
  106.         MoveL Offs(IntoStorage,0,-200,0), v200, fine, tool_assembly;
  107.         GripperOpen;
  108.         TPWrite "Operation done";
  109.         MoveL Offs(IntoStorage,0,-200,100), v200, fine, tool_assembly;
  110.         MoveJ Home, v1000, z50, tool_assembly;
  111.     ENDPROC
  112.    
  113.     PROC GripperOpen()
  114.         SetDO DO_Gripper_Close,0;
  115.         SetDO DO_Gripper_Open,1;
  116.         Waittime 2;
  117.     ENDPROC
  118.  
  119.     PROC GripperClose()
  120.         SetDO DO_Gripper_Open,0;
  121.         SetDO DO_Gripper_Close,1;
  122.         Waittime 2;
  123.     ENDPROC
  124.     PROC ResetDoSignals()
  125.         Reset PLC_ETH_DO4;
  126.         Reset PLC_ETH_DO5;
  127.         Reset PLC_ETH_DO6;
  128.         Reset PLC_ETH_DO7;
  129.     ENDPROC
  130. ENDMODULE
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top