Current Help System: Tutor Translator (View Core Help)

### Part Program Structure

The structure of a translated PC-DMIS part program is outlined below:

1. Machine Reference Systems Declaration

STARTUP =ALIGNMENT/START,RECALL:,LIST=YES
ALIGNMENT/END

2. Default Functions Definition

ASSIGN/E.OFF2ROT = FUNCTION((X,Y),IF(X==0,IF(Y>0,90,90),RAD2DEG(ATAN(Y/X))))

ASSIGN/E.BIGGEST = FUNCTION((F),IF(ABS(F.I)>ABS(F.J),IF(ABS(F.K)>ABS(F.I),IF(F.K>0,E.ZPLUS,E.ZMINUS),IF(F.I>0,E.XPLUS,E.XMINUS)),IF(ABS(F.K)>ABS(F.J),IF(F.K>0,E.ZPLUS,E.ZMINUS),IF(F.J>0,E.YPLUS,E.YMINUS))))

ASSIGN/E.CALC_AXY = FUNCTION((V1,V2), ANGLEBETWEEN(UNIT(MPOINT(V1.I,V1.J,0)),UNIT(MPOINT(V2.I,V2.J,0))))

ASSIGN/E.CALC_AYZ = FUNCTION((V1,V2), ANGLEBETWEEN(UNIT(MPOINT(0,V1.J,V1.K)),UNIT(MPOINT(0,V2.J,V2.K))))

ASSIGN/E.CALC_AZX = FUNCTION((V1,V2), ANGLEBETWEEN(UNIT(MPOINT(V1.I,0,V1.K)),UNIT(MPOINT(V2.I,0,V2.K))))

ASSIGN/E.BOOLVAL = FUNCTION((BVAL),IF(BVAL<>0,"TRUE","FALSE"))

ASSIGN/E.PMS2DEG = FUNCTION((VAL),INT(VAL)+INT((VAL-INT(VAL))*100)/60+ (((VAL-INT(VAL))*100)-INT((VAL-INT(VAL))*100))*100/3600)

ASSIGN/E.DMS2DEG = FUNCTION((VAL,ISDMS),IF((ISDMS),VAL,IF((VAL>=0), E.PDMS2DEG(VAL), -E.PDMS2DEG(-VAL))))

3. Part Program Declaration

PROGRAM_PrgName = LABEL/
ASSIGN/E.WM1 = TUTORELEMENT (1)
ASSIGN/E.WM2 = TUTORELEMENT (1)
ASSIGN/E.MEMORY = TUTORELEMENT (300)
ASSIGN/E.MEMSIZE = 300
ASSIGN/E.SELPL=E.ZPLUS

4. Variables Declaration

. . . .
ASSIGN/BoolVar = 0
ASSIGN/BoolVar = 1
ASSIGN/CoordVar = MPOINT(0,0,0)
. . . .

5. Tutor Output Format Table Structure Initialization

ASSIGN/E.OFMT.ON = 1
CS3 =CALLSUB/INIT_FORMAT_TBL,:E.OFMT,,

6. Tutor Theoretical Table Structure Initialization

ASSIGN/E.TH.X.N = 0
=CALLSUB/THEO_INIT,TutorSub.prg:E.TH,,,

7. Probe Structures Initialization
ASSIGN/PROBE_SP=0

ASSIGN/E.PROBE_STACK=0
LOADPROBE/PROBEFILENAME
=CALLSUB/ ERASE_PROBE_SUB,TutorSub.PRG:0,0,E.TIPARRAY,
ASSIGN/E.TipArray[1,1] = "T1A0B0"
ASSIGN/E.TipArray[2,1] = "T1A45B0"
ASSIGN/E.TipArray[3,1] = "T1A90B0"
ASSIGN/E.TipArray[4,1] = "T1A90B45"
ASSIGN/E.TipArray[5,1] = "T1A90B90"
ASSIGN/E.TipArray[6,1] = "T1A45B45"
ASSIGN/E.TipArray[7,1] = "T1A-90B45"
. . . .

8. Alignments Structures Initialization

ALIGNMENT/END
ASSIGN/E.CUR_ALIGN = 0
ASSIGN/E.REF_SP = 0
ASSIGN/E.ALIGNMENTS[0] = "STARTUP"
ASSIGN/E.ALIGNMENTS[1] = " STARTUP "
ASSIGN/E.ALIGNMENTS[2] = " STARTUP "
ASSIGN/E.ALIGNMENTS[3] = " STARTUP "
ASSIGN/E.ALIGNMENTS[4] = " STARTUP "
ASSIGN/E.ALIGNMENTS[5] = " STARTUP "
ASSIGN/E.ALIGNMENTS[6] = " STARTUP "
ASSIGN/E.ALIGNMENTS[7] = " STARTUP "
ASSIGN/E.ALIGNMENTS[8] = " STARTUP "
ASSIGN/E.ALIGNMENTS[9] = " STARTUP "
ASSIGN/E.ALIGNMENTS[10] = " STARTUP "

9. Part Program Body