编程语言
首页 > 编程语言> > VisualDMIS 6.5更换架 SCR600 高级编程

VisualDMIS 6.5更换架 SCR600 高级编程

作者:互联网

$$DMISLAYER/'START'
DECL/REAL,PORTX,PORTY,PORTZ,IT,JT,IVEC,JVEC,KVEC,SNLENG,FPORTX,FPORTY,SENDIA
DECL/INTGR,10,SEQ,PORTDIR
DECL/CHAR,10,HomeDir,CalibFile,calibfil
TEXT/OPER,'Latch first port lids in their open position.' 
UNITS/MM,ANGDEC
WKPLAN/XYPLAN
MODE/MAN
RECALL/D(MCS)
$$S(DEFAULT)=SNSDEF/PROBE,INDEX,POL,0.0000,0.0000,$
0.000000,0.000000,-1.000000,126.9744,1.9797
SNSLCT/S(DEFAULT)
$$ENDLAYER
SNLENG=OBTAIN/SA(DEFAULT),9
SENDIA = OBTAIN/SA(DEFAULT),10
PRCOMP/OFF
CALL/EXTERN,DME, 'V3DHOME',HomeDir
CalibFile = CONCAT(HomeDir,'\Users\Sensor\Scr600calib.data')
DID(PORTDATA) = DEVICE/STOR, CalibFile
OPEN/DID(PORTDATA),DIRECT,OUTPUT,OVERWR
F(RACKLN)=FEAT/LINE,UNBND,CART, 150.000000, 300.000000, 250.000000, 1.000000, $
0.000000, 0.000000, 0.000000, -1.000000, 0.000000
MEAS/LINE,F(RACKLN),2
PTMEAS/CART,50.000000,300.000000,250.000000,0.000000,-1.000000,0.000000
PTMEAS/CART,350.000000,300.000000,250.000000,0.000000,-1.000000,0.000000
ENDMES
IVEC = OBTAIN/FA(RACKLN),7
JVEC = OBTAIN/FA(RACKLN),8
KVEC = OBTAIN/FA(RACKLN),9
WRITE/DID(PORTDATA),IVEC,',',JVEC,',',KVEC
IT=ABS(IVEC)
JT=ABS(JVEC)
IF/IT > JT
   PORTDIR=1
ELSE
  IF/JVEC > 0
   PORTDIR=2
  ELSE
   PORTDIR=3
  ENDIF
ENDIF
M(TOP_PT)=MACRO/
F(T_PT)=FEAT/POINT,CART, 81.740688, 27.852796, 328.708000, 0.000391, 0.222763, $
 0.974873
MEAS/POINT,F(T_PT),1
PTMEAS/CART,7.077813,27.538671,328.809700,0.000391,0.222763,0.974873
ENDMES
ENDMAC
M(MEASPT)=MACRO/
F(L_PT)=FEAT/POINT,CART, 245.841504, 178.573487, 76.230209, 0.999889, $
 0.006672, 0.013345
MEAS/POINT,F(L_PT),1
PTMEAS/CART,245.841504,178.573487,76.230209,0.999889,0.006672,0.013345
ENDMES
F(R_PT)=FEAT/POINT,CART, 257.767601, 178.603847, 76.309317, -0.999932, $
 0.005586, -0.010241
MEAS/POINT,F(R_PT),1
PTMEAS/CART,257.767601,178.603847,76.309317,-0.999932,0.005586,-0.010241
ENDMES
F(MID_PT)=FEAT/POINT,CART, 251.804552, 178.588667, 76.269763, 0.000000, $
 0.000000, 1.000000
CONST/POINT,F(MID_PT),MIDPT,FA(R_PT),FA(L_PT)
ENDMAC
M(LPWRT)=MACRO/
 DO/SEQ,0,3,1
  IF/(PORTDIR.EQ.1)
    PORTX=FPORTX+(53.5*SEQ)
  ENDIF
  IF/(PORTDIR.EQ.2)
    PORTY=FPORTY+(53.5*SEQ)
  ENDIF
  IF/(PORTDIR.EQ.3)
     PORTY=FPORTY-(53.5*SEQ)
  ENDIF
 WRITE/DID(PORTDATA),PORTX,',',PORTY,',',PORTZ
 ENDDO
$$ Write 2 dummy lines. (MCR20 has 6 ports)
 WRITE/DID(PORTDATA),PORTX,',',PORTY,',',PORTZ
 WRITE/DID(PORTDATA),PORTX,',',PORTY,',',PORTZ
ENDMAC
IF/(PORTDIR.EQ.1) 
	PORTY = OBTAIN/FA(RACKLN),5
	PORTY = PORTY + SENDIA + 21.5
	CALL/M(TOP_PT)
	PORTZ = OBTAIN/FA(T_PT),5
	CALL/M(MEASPT)
	FPORTX = OBTAIN/FA(MID_PT),3
	CALL/M(LPWRT)
ENDIF
IF/(PORTDIR.EQ.2) 
	PORTX = OBTAIN/FA(RACKLN),4
	PORTX = PORTX - SENDIA -21.5
	CALL/M(TOP_PT)
	PORTZ = OBTAIN/FA(T_PT),5
	CALL/M(MEASPT)
	FPORTY = OBTAIN/FA(MID_PT),4
	CALL/M(LPWRT)
ENDIF
IF/(PORTDIR.EQ.3) 
	PORTX = OBTAIN/FA(RACKLN),4
	PORTX = PORTX + SENDIA + 21.5
	CALL/M(TOP_PT)
	PORTZ = OBTAIN/FA(T_PT),5
	CALL/M(MEASPT)
	FPORTY = OBTAIN/FA(MID_PT),4
	CALL/M(LPWRT)
ENDIF
$$ // 42.25 = Module + PS2R
WRITE/DID(PORTDATA),SNLENG,',','0',',','42.25'
calibfil = CONCAT(HomeDir,'\Users\Sensor\Scr600calib.data')
dmesw/COMAND,'configmcr:calibfil'
PRCOMP/ON
MODE/PROG,MAN
TEXT/OPER,'Calibration completed!'
ENDFIL

标签:0.000000,PT,VisualDMIS,OBTAIN,CART,FA,6.5,SCR600,PORTX
来源: https://blog.csdn.net/weixin_43911798/article/details/111262065