##### Sample Script with All Commands

An example of a script file follows:

DECLARE X1, X2, X3, X4, Y1, Y2, Y3, Y4, XOFF, YOFF, ANS;

DATABASE "C:\DATAPAGE\DEMO";

FILTER MACHINE ROBODRILL LAST 10;

ATTACH 1;

IMPORT X1 = DEMO:CIR1.X:DEV;

IMPORT X2 = DEMO:CIR2.X:DEV;

IMPORT X3 = DEMO:CIR3.X:DEV;

IMPORT X4 = DEMO:CIR4.X:DEV;

IMPORT Y1 = DEMO:CIR1.Y:DEV;

IMPORT Y2 = DEMO:CIR2.Y:DEV;

IMPORT Y3 = DEMO:CIR3.Y:DEV;

IMPORT Y4 = DEMO:CIR4.Y:DEV;

XOFF = (X1 + X2 + X3 + X4)/4;

YOFF = (Y1 + Y2 + Y3 + Y4)/4;

IF (XOFF > 0.001) THEN GOTO WORKOFFSET;

IF (YOFF > 0.001) THEN GOTO WORKOFFSET;

GOTO NOWORKOFFSET;

LABEL WORKOFFSET;

PROMPT ANS = "Apply Work Offset, X is [XOFF] and Y is [YOFF]";

IF (ANS = 0) THEN GOTO NOWORKOFFSET;

WORKOFFSET G54 "" "" XOFF YOFF 0.0;

LABEL NOWORKOFFSET;

DECLARE DIAMDEV;

IMPORT DIAMDEV = DEMO:CIR1.D:DEV;

IF (DIAMDEV < 0.001) THEN GOTO NOTOOLOFFSET;

PROMPT ANS = "Apply Tool Offset, D is [DIAMDEV]";

IF (ANS = 0) THEN GOTO NOTOOLOFFSET;

TOOLOFFSET 6 "" "" 0.0 DIAMDEV;

LABEL NOTOOLOFFSET;

WRITE R C:\TEMP\MYALARM.BAT "REM Generated by monitor script file";

WRITE R C:\TEMP\DEMO.LOG "";

DECLARE AVERAGE, LAST, NOM, INDEX, BADCOUNT = 0;

IMPORT AVERAGE = DEMO:CIR1.D:MEA;

IMPORT LAST = DEMO:CIR1.D:LST;

IMPORT NOM = DEMO:CIR1.D:NOM;

INDEX = 1;

CHAIN C:\TESTER.SCR;

IMPORT AVERAGE = DEMO:CIR2.D:MEA;

IMPORT LAST = DEMO:CIR2.D:LST;

IMPORT NOM = DEMO:CIR2.D:NOM;

INDEX = 2;

CHAIN C:\TESTER.SCR;

IMPORT AVERAGE = DEMO:CIR3.D:MEA;

IMPORT LAST = DEMO:CIR3.D:LST;

IMPORT NOM = DEMO:CIR3.D:NOM;

INDEX = 3;

CHAIN C:\TESTER.SCR;

IMPORT AVERAGE = DEMO:CIR4.D:MEA;

IMPORT LAST = DEMO:CIR4.D:LST;

IMPORT NOM = DEMO:CIR4.D:NOM;

INDEX = 4;

CHAIN C:\TESTER.SCR;

IF (BADCOUNT = 0) THEN GOTO ALLISWELL;

EXECUTE C:\TEMP\MYALARM.BAT;

EXECUTE C:\TRANSFER\COPYTOREMOTE C:\TEMP\DEMO.LOG;

LABEL ALLISWELL;