mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Fri Jul 02, 2004 12:20 pm Post subject: How To Automatically Uupdat Work Offsets |
|
|
I found this while surfing, and wanted to shair it here.
This program automatically updates the current coordinate system's work offsets. The program takes into account the current mirror image state. The program is written for the OM control because #3005 is used to determine the mirror image state. It can be modified for other controls by changing #3005 to #3007 and updating the IF statements.
Code: | %
O9011(SET WORK OFFSET)
#3003=1
(***FIND ACTIVE OFFSET***)
#101=#4014-53
(***FIND MIRROR IMAGE STATUS***)
#100=#3005
N5IF[[#100-1024]LT0]GOTO10
#100=#100-1024
N10IF[[#100-512]LT0]GOTO20
#100=#100-512
N20IF[[#100-128]LT0]GOTO30
#100=#100-128
N30IF[[#100-64]LT0]GOTO40
#100=#100-64
N40IF[[#100-16]LT0]GOTO50
#100=#100-16
N50IF[[#100-8]LT0]GOTO60
#100=#100-8
N60IF[[#100-4]LT0]GOTO70
#100=#100-4
N70
(***SET COORDINATE FOR EACH MIRROR IMAGE***)
IF[#100EQ0]GOTO100
IF[#100EQ1]GOTO200
IF[#100EQ2]GOTO300
#[2500+#101]=-#5021
#[2600+#101]=-#5022
GOTO1000
N100
#[2500+#101]=#5021
#[2600+#101]=#5022
GOTO1000
N200
#[2500+#101]=-#5021
#[2600+#101]=#5022
GOTO1000
N300
#[2500+#101]=#5021
#[2600+#101]=-#5022
N1000#3003=0
M30
% |
If you modify it post your changes here for others to shair
Legal stuff: I provide this "As Is" and make no express guarantees that it will work and/or will work on your machine. It is intended as a guide and as with all programs should be fully tested before it is ran. |
|