DMISMN/'Start Template',05.2
FILNAM/'Start Template',05.2
DV(0)=DMESWV/'83,1,1,20531'
UNITS/MM,ANGDEC
DECPL/ALL,DEFALT
V(0)=VFORM/ALL,PLOT
DISPLY/TERM,V(0),STOR,DMIS,V(0)
SNSET/APPRCH,5
SNSET/RETRCT,5
SNSET/SEARCH,5
SNSET/CLRSRF,15
SNSET/DEPTH,0
MODE/MAN
$$DMISMN/''
$$============================================================$$$ PROGRAM TO ME$
ASURE GAUGE BLOCK $$$ ACCORDING THE ISO 10360-2 RUL$
ES WITH RESTRICTIONS $$$ $
$$$ THE REPETITION WILL NOT BE DONE OF A GAUGE $$$
$$IS OUT OF TOLERANCE $$$ $
$$$ LAST MODIFICATION: 18/12/2001 $
$$$===============================================$
=============$$DECLARATION OF THE VARIABLES
$$DONT'T MODIFY OR DELETE THIS SECTION
RECALL/SA(A0.0_B0.0_L90D5)
$$ DECL/DOUBLE,BLOCCO[5]
SNSLCT/SA(A0.0_B0.0_L90D5)
DECL/DOUBLE,BLOCCOJ
DECL/CHAR,20,BLOCCOJS
DECL/DOUBLE,BLOCCO1
DECL/DOUBLE,BLOCCO2
DECL/DOUBLE,BLOCCO3
DECL/DOUBLE,BLOCCO4
DECL/DOUBLE,BLOCCO5
$$ DECL/DOUBLE,MISURATO[3]
DECL/DOUBLE,MISURATO1
DECL/DOUBLE,MISURATO2
DECL/DOUBLE,MISURATO3
$$ DECL/DOUBLE,ERRORE[3]
DECL/DOUBLE,ERRORE1
DECL/DOUBLE,ERRORE2
DECL/DOUBLE,ERRORE3
DECL/DOUBLE,ALTEZZA
DECL/DOUBLE,LARGHEZZA
DECL/DOUBLE,PRIMO
DECL/DOUBLE,SECONDO
DECL/DOUBLE,VELMIS
DECL/DOUBLE,VELPOS
DECL/DOUBLE,ACCMIS
DECL/DOUBLE,ACCPOS
DECL/DOUBLE,FLYRAD
DECL/DOUBLE,PREHIT
DECL/DOUBLE,POSTHIT
DECL/DOUBLE,RETURN
DECL/DOUBLE,XSAFE
DECL/DOUBLE,ZSAFE
DECL/DOUBLE,XPTO1
DECL/DOUBLE,YPTO1
DECL/DOUBLE,ZPTO1
DECL/DOUBLE,XPTO2
DECL/DOUBLE,YPTO2
DECL/DOUBLE,ZPTO2
DECL/DOUBLE,MIS
DECL/DOUBLE,TOLL
DECL/DOUBLE,PO1X
DECL/DOUBLE,PO1Y
DECL/DOUBLE,PO1Z
DECL/DOUBLE,PO2X
DECL/DOUBLE,PO2Y
DECL/DOUBLE,PO2Z
DECL/DOUBLE,TRASX
DECL/INTGR,NUMMISURE
DECL/INTGR,NUMBLOCCHI
DECL/INTGR,I
DECL/INTGR,J
DECL/INTGR,MANALL
DECL/CHAR,20,MANALL1
DECL/INTGR,COMPTEMP
DECL/INTGR,TEMPX
DECL/INTGR,TEMPY
DECL/INTGR,TEMPZ
DECL/CHAR,64,FILENAME
DECL/CHAR,2,RISULTATO
DECL/CHAR,64,DAFILE
$$INITIAL SETTINGS AND MACHINE PARAMETERS
UNITS/MM, ANGDEC, TEMPC
PRCOMP/OFF
FINPOS/OFF
$$ RAPID/0.7500
D(MAC) = DATSET/MCS
WKPLAN/XYPLAN
SNSET/CLRSRF, 0.0000
SNSET/DEPTH, 0.0000
DECPL/ALL,4
MODE/MAN
$$THERMAL COMPENSATION
$$ TEXT/QUERY,(COMPTEMP),10,N,L,'DO YOU WANT TO ENABLE THE THERMAL COMPENSAT$
ION? (1=YES 0=NO)'
$$ IF/(COMPTEMP.LE.0.0)
$$ TECOMP/OFF
$$ ELSE
$$ TECOMP/ON,11.4
$$ ENDIF
$$ READING PARAMETER FROM "PARAMETRI.TXT"
$$ THIS FILE IS IN C:\ISO10360
DID(PARAMETRI)=DEVICE/STOR,'C:\ISO10360\PARAMETRI.TXT'
OPEN/DID(PARAMETRI),DIRECT,INPUT
$$HEADER
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
$$BLOCK DIMENSION
ALTEZZA=ASSIGN/9
LARGHEZZA=ASSIGN/35
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),NUMMISURE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),NUMBLOCCHI
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),BLOCCO1
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),BLOCCO2
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),BLOCCO3
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),BLOCCO4
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),BLOCCO5
$$ACCURACY
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),PRIMO
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),SECONDO
$$MOTION
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),VELPOS
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),VELMIS
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),ACCPOS
$$$$ FEDRAT/MESVEL,PCENT,0.2
$$ FEDRAT/POSVEL, PCENT,1
$$$$ ACLRAT/MESACL,PCENT,0.2
$$ ACLRAT/POSACL, PCENT,1
$$
$$ FLYRAD=ASSIGN/10
$$ FLY/FLYRAD
$$MEASURING PARAMETRS
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),PREHIT
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),RETURN
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),DAFILE
READ/DID(PARAMETRI),POSTHIT
SNSET/APPRCH, 6
SNSET/SEARCH, 6
SNSET/RETRCT, 6
CLOSE/DID(PARAMETRI)
$$SAFE CLEARANCE FOR THE GAUGE BLOCK
XSAFE=ASSIGN/15
ZSAFE=ASSIGN/70
$$SELECTING THE PROBE
DECL/CHAR,20,TASTATORE
$$ DECL/INTGR,TT
$$ TEXT/QUERY,(TASTATORE),256,AN,L,'ENTER THE PROBE FOR THE MEASURE'
TASTATORE=PROMPT/'ENTER THE PROBE FOR THE MEASURE[1 TO 6]',40,1
TASTATORE=ASSIGN/CONCAT(TASTATORE)
RECALL/SA(TASTATORE)
SNSLCT/SA(TASTATORE)
$$REQUEST TO PERFORM MANUAL ALIGNMENT
$$ TEXT/QUERY,(MANALL),10,N,L,'PERFORM THE MANUAL ALIGNMENT? (1=YES 2=NO)'
MANALL=PROMPT/'PERFORM THE MANUAL ALIGNMENT? (1=YES 2=NO)',40,1
$$ MANALL1=ASSIGN/CONCAT(MANALL1)
IF/(MANALL.EQ.2)
JUMPTO/(NOMANALL)
ENDIF
$$MANUAL ALIGNMENT
$$ TEXT/MAN,'MEASURE THE FRONT PLANE OF THE LONGEST BLOCK FOR Z DIRECTION '
F(PIANOZ)=FEAT/PLANE,CART,0,0,0,0,0,1
MEAS/PLANE,F(PIANOZ),3
ENDMES
DATDEF/FA(PIANOZ),DAT(A)
D(MANTEMP)=DATSET/DAT(A),ZDIR,ZORIG
$$ TEXT/MAN,' '
$$ TEXT/MAN,'MEASURE THE TOP PLANE OF THE LONGEST BLOCK FOR -Y DIRECTION'
$$ F(PLANEY)=FEAT/PLANE,CART,0,0,0,0,1,0
$$ MEAS/PLANE,F(PLANEY),3
$$ ENDMES
F(LINE0X)=FEAT/LINE,UNBND,CART,0,0,0,1,0,0,0,1,0
MEAS/LINE,F(LINE0X),2
ENDMES
DATDEF/FA(LINE0X),DAT(B)
D(MANTEMP)=DATSET/DAT(A),ZDIR,ZORIG,DAT(B),XDIR,YORIG
$$ TEXT/MAN,' '
$$ TEXT/MAN,'MEASURE THE POINT FOR THE X AXIS ORIGIN X'
F(ORIGINEX)=FEAT/POINT,CART,0,0,0,-1,0,0
MEAS/POINT,F(ORIGINEX),1
PTMEAS/CART,0,0,0,-1,0,0
ENDMES
DATDEF/FA(ORIGINEX),DAT(C)
D(MANTEMP)=DATSET/DAT(A),ZDIR,ZORIG,DAT(B),XDIR,YORIG,DAT(C),XORIG
PRCOMP/ON
D(MANTEMP)=TRANS/XORIG,PRBRAD,YORIG,PRBRAD,ZORIG,-PRBRAD
SAVE/D(MANTEMP)
$$POINT FOR OUTPUT FILE
RECALL/D(MAC)
PO1X=OBTAIN/FA(ORIGINEX),3
PO1Y=OBTAIN/FA(ORIGINEX),4
PO1Z=OBTAIN/FA(ORIGINEX),5
$$POINT FOR OUTPUT FILE
F(PO2)=FEAT/POINT,CART,0,0,0,1,0,0
CONST/POINT,F(PO2),MOVEPT,FA(ORIGINEX),BLOCCO1,0,0
PO2X=OBTAIN/FA(PO2),3
PO2Y=OBTAIN/FA(PO2),4
PO2Z=OBTAIN/FA(PO2),5
$$CNC MODE
(NOMANALL)
MODE/PROG,MAN
RECALL/D(MANTEMP)
$$OPENING THE OUTPUT FILE
FILENAME=PROMPT/'ENTER THE NAME OF THE DATA FILE WITHOUT EXTENSION'
FILENAME=ASSIGN/CONCAT(FILENAME,'.TXT')
FILENAME=ASSIGN/CONCAT('C:\ISO10360\DATI\',FILENAME)
DID(FILEDATI)=DEVICE/STOR,FILENAME
OPEN/DID(FILEDATI),DIRECT,OUTPUT,OVERWR
$$HEADER
WRITE/DID(FILEDATI),'"COORDINATES OF THE POINTS PO1 AND PO1 OF THE LONGEST GAUG$
E IN CMM SYSTEM"'
WRITE/DID(FILEDATI),'"PO1" ', PO1X, ' ', PO1Y, ' ', PO1Z, ' '
WRITE/DID(FILEDATI),'"PO2" ', PO2X, ' ', PO2Y, ' ', PO2Z, ' '
WRITE/DID(FILEDATI),'" "'
WRITE/DID(FILEDATI),'"=========================================================$
========================"'
WRITE/DID(FILEDATI),'"L.BPP" "LMIS1" "LMIS2" "LMIS3" " " "E" "DELTAL1" "DELTAL2$
" "DELTAL3" "F.TOLL"'
WRITE/DID(FILEDATI),'"=========================================================$
========================"'
WRITE/DID(FILEDATI),'" "'
$$$$OUTPUT ON TERMINAL
$$ V(UGO)=VFORM/ALL
$$ DISPLY/TERM,V(UGO),STOR,V(UGO)
$$MEASURING ALL BLOCKS
DO/J,1,NUMBLOCCHI,1
$$ BLOCCOJS=ASSIGN/CONCAT('BLOCCO',STR(J))
$$ TEXT/OUTFIL,CONCAT('BLOCCO MISURA : ' , STR(BLOCCO[J]))
$$POINT FOR THE DISTANCE
XPTO1=ASSIGN/0
YPTO1=ASSIGN/LARGHEZZA/2
ZPTO1=ASSIGN/ALTEZZA/2
$$ XPTO2=ASSIGN/BLOCCO[J]
IF/(J .EQ. 1)
XPTO2=ASSIGN/BLOCCO1
ENDIF
IF/(J .EQ. 2)
XPTO2=ASSIGN/BLOCCO2
ENDIF
IF/(J .EQ. 3)
XPTO2=ASSIGN/BLOCCO3
ENDIF
IF/(J .EQ. 4)
XPTO2=ASSIGN/BLOCCO4
ENDIF
IF/(J .EQ. 5)
XPTO2=ASSIGN/BLOCCO5
ENDIF
YPTO2=ASSIGN/LARGHEZZA/2
ZPTO2=ASSIGN/ALTEZZA/2
$$CNC ALIGNMENT
MIS=ASSIGN/4
TEMPX=ASSIGN/-XSAFE
GOTO/TEMPX,0,ZSAFE
F(PIANOZ)=FEAT/PLANE,CART,0,0,0,0,0,1
MEAS/PLANE,F(PIANOZ),4
PTMEAS/CART,MIS,MIS,0,0,0,1
TEMPZ=ASSIGN/LARGHEZZA-MIS
TEMPX=ASSIGN/XPTO2-MIS
PTMEAS/CART,MIS,TEMPZ,0,0,0,1
GOTO/MIS,TEMPZ,ZSAFE
GOTO/TEMPX,TEMPZ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