-
Notifications
You must be signed in to change notification settings - Fork 0
/
swap_dtool code.txt
48 lines (36 loc) · 936 Bytes
/
swap_dtool code.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
!PRECONDITION:
--UFRAME_NUM=0, UTOOL_NUM=4, PR[4] & R[9] ARE OVERWRITABLE, PR[11]=DRAW TOOL 1, PR[12]=OFFSET TO DRAW TOOL 2, R[12]=CURRENT DRAW TOOL #, R[13]=TARGET DRAW TOOL #
!POSTCONDITION:
--ROBOT REPLACES CURRENT DRAW TOOL AND RETRIEVES TARGET DRAW TOOL
!CHECK VARIABLES SAFE
IF R[13]<1 OR R[13]>7 OR R[13]=R[12],JMP LBL[1]
!RETURN CURRENT DRAW TOOL
RETURN DRAW TOOL
OPEN GRIPPER
!GO ABOVE DRAW TOOLS
PR[4]=LPOS
PR[4,3]=PR[11,3]+50
L PR[4] 100mm/sec FINE
!GET X,Y OF DRAW TOOL 1
PR[4,1]=PR[11,1]
PR[4,2]=PR[11,2]
!OFFSET RESULT TO THIS DRAW TOOL
R[9]=1
JMP LBL[3]
LBL[2:LOOP_START]
PR[4]=PR[4]+PR[12]
R[9]=R[9]+1
LBL[3:LOOP_COND]
IF R[9]<R[13],JMP LBL[2]
!GO TO RESULT
L PR[4] 100mm/sec CNT 100
!GRAB TOOL
PR[4,3]=PR[4,3]-45
L PR[4] 100mm/sec FINE
CLOSE GRIPPER
!UPDATE CURRENT DRAW TOOL #
R[12]=R[13]
!GO ABOVE DRAW TOOLS
PR[4,3]=PR[4,3]+95
L PR[4] 100mm/sec FINE
LBL[1:END]