2台机器人联动程序

时间:2022-08-11 19:27:27 阅读: 最新文章 文档下载
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

MODULE module1

VAR syncident sync1;

VAR syncident sync2;

VAR syncident sync3;

PERS tasks all_tasks{3} := [["T_ROB1"],["T_ROB2"],["T_STN1"]];

PERS wobjdata wobj_stn1 := [ FALSE, FALSE, "STN_1", [ [0, 0, 0], [1, 0, 0 ,0] ], [ [0, 0, 250], [1, 0, 0, 0] ] ];

TASK PERS tooldata tool1 := ...

CONST robtarget p100 := ...

...

CONST robtarget p199 := ...

PROC main()

...

SyncMove;

...

ENDPROC

PROC SyncMove()

MoveJ p100, v1000, z50, tool1;

WaitSyncTask sync1, all_tasks;

MoveL p101, v500, fine, tool1 \WObj:=wobj_stn1;

SyncMoveOn sync2, all_tasks;

MoveL p102\ID:=10, v300, z10, tool1 \WObj:=wobj_stn1;

MoveC p103, p104\ID:=20, v300, z10, tool1 \WObj:=wobj_stn1;

MoveL p105\ID:=30, v300, z10, tool1 \WObj:=wobj_stn1;

MoveC p106, p101\ID:=40, v300, fine, tool1 \WObj:=wobj_stn1;

SyncMoveOff sync3;

MoveL p199, v1000, fine, tool1;

UNDO

SyncMoveUndo;

ENDPROC

ENDMODULE

T_ROB2任务程序 MODULE module2

VAR syncident sync1;

VAR syncident sync2;

VAR syncident sync3;

PERS tasks all_tasks{3} := [["T_ROB1"],["T_ROB2"],["T_STN1"]];

PERS wobjdata wobj_stn1 := [ FALSE, FALSE, "STN_1", [ [0, 0, 0], [1, 0, 0 ,0] ], [ [0, 0, 250], [1, 0, 0, 0] ] ];

TASK PERS tooldata tool2 := ...

CONST robtarget p200 := ...

...

CONST robtarget p299 := ...

PROC main()

...

SyncMove;

...

ENDPROC

PROC SyncMove()

MoveJ p200, v1000, z50, tool2;

WaitSyncTask sync1, all_tasks;

MoveL p201, v500, fine, tool2 \WObj:=wobj_stn1;

SyncMoveOn sync2, all_tasks;

MoveL p202\ID:=10, v300, z10, tool2 \WObj:=wobj_stn1;

MoveC p203, p204\ID:=20, v300, z10, tool2 \WObj:=wobj_stn1;

MoveL p205\ID:=30, v300, z10, tool2 \WObj:=wobj_stn1;

MoveC p206, p201\ID:=40, v300, fine, tool2 \WObj:=wobj_stn1;

SyncMoveOff sync3;

MoveL p299, v1000, fine, tool2;

UNDO

SyncMoveUndo;

ENDPROC

ENDMODULE

T_STN1任务程序 MODULE module3

VAR syncident sync1;

VAR syncident sync2;

VAR syncident sync3;

PERS tasks all_tasks{3} := [["T_ROB1"],["T_ROB2"],["T_STN1"]];

CONST jointtarget angle_neg20 := [ [ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9], [ -20, 9E9, 9E9, 9E9, 9E9, 9E9] ];

...

CONST jointtarget angle_340 := [ [ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9], [ 340, 9E9, 9E9, 9E9, 9E9, 9E9] ];

PROC main()

...

SyncMove;

...

ENDPROC

PROC SyncMove()

MoveExtJ angle_neg20, vrot50, fine;

WaitSyncTask sync1, all_tasks;

! Wait for the robots

SyncMoveOn sync2, all_tasks;

MoveExtJ angle_20\ID:=10, vrot100, z10;

MoveExtJ angle_160\ID:=20, vrot100, z10;

MoveExtJ angle_200\ID:=30, vrot100, z10;

MoveExtJ angle_340\ID:=40, vrot100, fine;

SyncMoveOff sync3;

UNDO

SyncMoveUndo;

ENDPROCS

ENDMODULE

本文来源:https://www.wddqw.com/doc/363fbae453ea551810a6f524ccbff121dc36c55d.html