Tag Archives: DMIS

Rational DMIS 7.1 replacement rack DMIS program

$$DMISLAYER/'ACC2(afterhome)'
$$ ********************************************************************************
(Notes)
$$ RECALIBRATION PROGRAM for ACR1 with ACC2(ACC1)	
$$ RUN THIS PROGRAM AFTER HOMING MACHINE
$$ ********************************************************************************
$$ ___________________
$$
$$ LIABILITY STATEMENT:
$$ ___________________
$$
$$ Entelegence Software Solutions Inc., and their representatives hold no 
$$ liability as to the contents and/or results obtained by using the sample
$$ code below.
$$
$$ The sole purpose of this sample code is to assist customers and third
$$ party CMM application writers in becoming more profficient in the
$$ writing of DMIS CMM application programs.
$$
$$ Entelegence Software Solutions Inc., and their representatives
$$ will not be held liable for injury, death, machine damages, claims
$$ made as a result of the use of this program, nor any other claim as to
$$ it's fit for use.
$$ENDLAYER
$$DMISLAYER/'Read'
$$ ******************** READ THE CALIBRATION FILE *******************************
DECL/REAL,ACR_X[9],ACR_Y[9],ACR_Z[9],ACR_IV,ACR_JV,ACR_KV
DECL/REAL,ACR_SNLENG,ACR_N,ACR_LNJINT
DECL/REAL,PHX_OLD, PHY_OLD, PHZ_OLD, ZZ, PHX_DEV, PHY_DEV, PHZ_DEV
DECL/REAL,PHX_NEW, PHY_NEW, PHZ_NEW
DECL/INTGR,PORTNO
DID(PORTDATA)=DEVICE/STOR,'C:\Vms\Users\Sensor\Acc2calib.data'
OPEN/DID(PORTDATA),DIRECT,INPUT
READ/DID(PORTDATA),ACR_IV,ACR_JV,ACR_KV
DO/PORTNO,1,8,1
  READ/DID(PORTDATA),ACR_X[PORTNO],ACR_Y[PORTNO],ACR_Z[PORTNO]
ENDDO
READ/DID(PORTDATA),ACR_SNLENG,ACR_N,ACR_LNJINT
READ/DID(PORTDATA),PHX_OLD,PHY_OLD,PHZ_OLD
CLOSE/DID(PORTDATA),KEEP
$$ENDLAYER
$$ ***************************MAKE NECESSARY SETTINGS
decl/char,10,calibfil
UNITS/MM,ANGDEC
WKPLAN/XYPLAN
MODE/PROG,MAN
RECALL/D(MCS)
$$ ******************* DEFINE AND SELECT SENSOR WITH ZERO LENGTH 
S(SN_ZERO)=SNSDEF/PROBE,INDEX,POL,0.000000,0.000000,0.000000,0.000000, $
-1.000000,0.000000,2.000000
SNSLCT/S(SN_ZERO)
PRCOMP/OFF
ZZ=PHZ_OLD+ACR_SNLENG
FEDRAT/POSVEL,MPM,3.6
FEDRAT/MESVEL,MPM,0.3
SNSET/APPRCH,6.000000
SNSET/RETRCT,4.000000
SNSET/DEPTH,6.000000
SNSET/SEARCH,12.499300
SNSET/CLRSRF,7.000000
DMESW/COMAND,'ACC2:K,Y0'
DMESW/COMAND,'ACC2:D,L0'
$$ ****************************MEASURE THE AUTORACK DATUMING BALL
TEXT/OPER,' Unlock and remove the autojoint adaptor(PAA1) from the probe head.'
TEXT/OPER,' Automatic measurement of the rack datum ball(8mm) follows.'
F(PHPT)=FEAT/POINT,CART, PHX_OLD, PHY_OLD+8.000000, ZZ, 0.000000, 0.000000, 1.00000
MEAS/POINT,F(PHPT),1
PTMEAS/CART,PHX_OLD,PHY_OLD+8.000000,ZZ,0.000000,0.000000,1.00000
ENDMES
PHZ_NEW = OBTAIN/FA(PHPT),5
PHZ_NEW = PHZ_NEW-ACR_SNLENG
GOTO/PHX_OLD+25.000000,PHY_OLD,ZZ+7
F(PHCR)=FEAT/CIRCLE,INNER,CART, PHX_OLD, PHY_OLD, ZZ-8, 0.000000, $
 0.000000, 1.000000,31.000000
MEAS/CIRCLE,F(PHCR),4
PTMEAS/CART,PHX_OLD+16.500000,PHY_OLD,ZZ-8,1.000000,0.000000,0.000000
GOTO/PHX_OLD+20.000000,PHY_OLD+20.000000,ZZ-8
PTMEAS/CART,PHX_OLD,PHY_OLD+16.500000,ZZ-8,0.000000,1.000000,0.000000
GOTO/PHX_OLD-20.000000,PHY_OLD+20.000000,ZZ-8
PTMEAS/CART,PHX_OLD-16.500000,PHY_OLD,ZZ-8,-1.000000,0.000000,0.000000
GOTO/PHX_OLD-20.000000,PHY_OLD-20.000000,ZZ-8
PTMEAS/CART,PHX_OLD,PHY_OLD-16.500000,ZZ-8,0.000000,-1.000000,0.000000
ENDMES
PHX_NEW = OBTAIN/FA(PHCR),4
PHY_NEW = OBTAIN/FA(PHCR),5
PRCOMP/ON
GOTO/PHX_NEW,PHY_NEW-20,ZZ+50
DMESW/COMAND,'IDLE'
$$ *********** APDATE VDMIS CALIBRATION DATA
DMESW/COMAND,'UPDATEACR:PHX_NEW,PHY_NEW,PHZ_NEW'
DMESW/COMAND,'ACC2:K,Y0'
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ *********** NEW PORT CENTERs DATA RECALCULATION***********************
PHX_DEV = PHX_NEW - PHX_OLD
PHY_DEV = PHY_NEW - PHY_OLD
PHZ_DEV = PHZ_NEW - PHZ_OLD
DO/PORTNO,1,8,1
  ACR_X[PORTNO] = ACR_X[PORTNO] + PHX_DEV
  ACR_Y[PORTNO] = ACR_Y[PORTNO] + PHY_DEV  
  ACR_Z[PORTNO] = ACR_Z[PORTNO] + PHZ_DEV
ENDDO
$$ ********************REWRITE THE CALIBRATION FILE ****************************
DID(PORTDATA)=DEVICE/STOR,'C:\Vms\Users\Sensor\Acc2calib.data'
OPEN/DID(PORTDATA),DIRECT,OUTPUT,OVERWR
WRITE/DID(PORTDATA),ACR_IV,',',ACR_JV,',',ACR_KV
DO/PORTNO,1,8,1
  WRITE/DID(PORTDATA),ACR_X[PORTNO],',',ACR_Y[PORTNO],',',ACR_Z[PORTNO]
ENDDO
WRITE/DID(PORTDATA),ACR_SNLENG,',',ACR_N,',',ACR_LNJINT
WRITE/DID(PORTDATA),PHX_NEW,',',PHY_NEW,',',PHZ_NEW
CLOSE/DID(PORTDATA),KEEP
TEXT/OPER,'After home recalibration completed ! You can mount PAA1 back.'
ENDFIL