首页 > 编程语言 >RationalDMIS2023步距规程序3

RationalDMIS2023步距规程序3

时间:2023-09-07 18:04:07浏览次数:47  
标签:BLENGTH RationalDMIS2023 FA ERROR1 POINT 程序 CART 步距规 ASSIGN


DECL/COMMON,INTGR,Doloop,DONUM,LSTEP
DECL/COMMON,DOUBLE,DR_PRBRAD,TOL2,TOL1
DECL/COMMON, DOUBLE, VI, VJ, VK, VI2, VJ2, VK2
DECL/COMMON, DOUBLE, GAGEHEIGHT, GAGEWIDTH, ENDCLEAR
DECL/COMMON, DOUBLE, BLENGTH[30], ZP, XP, BL, LB
DECL/CHAR,20,PROB
$$ 步距规步长30,可以自行修改
LSTEP = ASSIGN/30

$$ 步距规步数20,可以自行修改
Doloop = ASSIGN/20

$$ 循环次数3,可以自行修改
DONUM = ASSIGN/10

$$ 机器精度1.5,可以自行修改
TOL2 = ASSIGN/1.5

BLENGTH[1] = ASSIGN/0.3
BLENGTH[2] = ASSIGN/0.1
BLENGTH[3] = ASSIGN/-0.1
BLENGTH[4] = ASSIGN/-0.1
BLENGTH[5] = ASSIGN/-0.2
BLENGTH[6] = ASSIGN/-0.4
BLENGTH[7] = ASSIGN/-0.4
BLENGTH[8] = ASSIGN/-0.3
BLENGTH[9] = ASSIGN/-0.3
BLENGTH[10] = ASSIGN/-0.4
BLENGTH[11] = ASSIGN/-0.3
BLENGTH[12] = ASSIGN/-0.8
BLENGTH[13] = ASSIGN/-0.7
BLENGTH[14] = ASSIGN/-0.4
BLENGTH[15] = ASSIGN/-0.6
BLENGTH[16] = ASSIGN/-1.0
BLENGTH[17] = ASSIGN/-1.0
BLENGTH[18] = ASSIGN/-0.8
BLENGTH[19] = ASSIGN/-0.8
BLENGTH[20] = ASSIGN/-0.8

LB = ASSIGN/0
GAGEHEIGHT = ASSIGN/10
GAGEWIDTH  = ASSIGN/32
ENDCLEAR   = ASSIGN/2.5
BL = ASSIGN/0
DECL/CHAR,1,ANS
ANS = PROMPT/'START CNC MEASUREMENT [ Y/N ]  '
IF/(ANS .EQ. 'Y') .OR. (ANS .EQ. 'Y')
   PRCOMP/OFF
  JUMPTO/(CNCSTART)
  ENDIF
RECALL/D(MCS)
UNITS/MM,ANGDEC
PRCOMP/OFF
MODE/MAN
F(PTL1)=FEAT/POINT,CART,1 ,0, 0, 0, 0, 1
F(PTL2)=FEAT/POINT,CART,2 ,0, 0, 0, 0, 1
F(PTL3)=FEAT/POINT,CART,3 ,0, 0, 0, 0, 1
F(PTL4)=FEAT/POINT,CART,4 ,0, 0, 0, 0, 1
F(PTL5)=FEAT/POINT,CART,5 ,0, 0, 0, 0, 1
F(PTL6)=FEAT/POINT,CART,6 ,0, 0, 0, 0, 1

MEAS/POINT,F(PTL1),1
ENDMES
MEAS/POINT,F(PTL2),1
ENDMES
MEAS/POINT,F(PTL3),1
ENDMES
MEAS/POINT,F(PTL4),1
ENDMES
MEAS/POINT,F(PTL5),1
ENDMES
MEAS/POINT,F(PTL6),1
ENDMES
(CNCSTART)
VI = OBTAIN/FA(PTL1)[1],5
VJ = OBTAIN/FA(PTL1)[1],6
VK = OBTAIN/FA(PTL1)[1],7
F(BFPL1) = FEAT/PLANE,CART, 0.0, 0.0, 0.0, VI, VJ, VK
VI = OBTAIN/FA(PTL5)[1],5
VJ = OBTAIN/FA(PTL5)[1],6
VK = OBTAIN/FA(PTL5)[1],7
VI2 = OBTAIN/FA(PTL4)[1],5
VJ2 = OBTAIN/FA(PTL4)[1],6
VK2 = OBTAIN/FA(PTL4)[1],7
F(BFLN1) = FEAT/LINE,BND,CART, 0, 0, 0, -VI2, -VJ2, -VK2, VI, VJ, VK
CONST/PLANE,F(BFPL1),BF,FA(PTL1),FA(PTL2),FA(PTL3)
CONST/LINE,F(BFLN1),BF,FA(PTL5),FA(PTL6)
D(GAGG1CRD) = DATSET/FA(BFPL1), ZDIR, ZORIG, FA(BFLN1), -XDIR, YORIG, FA(PTL4), XORIG
PROB = VALUE/SNSLCT
DR_PRBRAD = OBTAIN/SS(PROB), 8
DR_PRBRAD = ASSIGN/(DR_PRBRAD/2)



D(GAGG1CRD) = TRANS/ZORIG, -DR_PRBRAD, YORIG, -DR_PRBRAD, XORIG, -DR_PRBRAD
$$DID(GageBlock) = DEVICE/STOR,'GagaBlockResult.out'
$$OPEN/DID(GageBlock), DIRECT, OUTPUT, APPEND


DECL/COMMON,DOUBLE,STD
M(GAGECRDSETUP) = MACRO/'CRDLABEL', ADVX, ADVZ, GHEIGHT, GWIDTH, GLENGTH, GCLEAR, PRBR
	$$ D(@CRDLABEL) = TRANS/ZORIG, ADVZ, XORIG, ADVX

$$ 抬高的安全距离为43,可以根据实际情况修改此数值,如果修改要替换程序中所有43
$$FEDRAT/MESVEL, MMPS, 5.000000
$$FEDRAT/POSVEL, MMPS, 300.000000
$$
$$ACLRAT/MESACL, MMPSS, 50.000000
$$ACLRAT/POSACL, MMPSS, 500.000000

	GOTO/-15, 5, 18
	F(ZPLANE) = FEAT/PLANE,CART, 0.0, 0.0, 0.0, 0, 0, 1
	F(XLINE) = FEAT/LINE,BND,CART, 0, 0, 0, 1, 0, 0, 0, 1, 0
	F(XORIG)=FEAT/POINT,CART,6 ,0, 0, 1, 0, 0
$$面	
	MEAS/PLANE,F(ZPLANE), 3
	PTMEAS/CART, -GCLEAR-12, -6,0, 0, 0, 1
	GOTO/-GCLEAR-12, -6, 18
	GOTO/-GCLEAR-12,-26, 18
	PTMEAS/CART, -GCLEAR-12, -29, 0, 0, 0, 1
	GOTO/-GCLEAR-12, -26, 18
	GOTO/-(GLENGTH-3),-26, 18
	PTMEAS/CART, -(GLENGTH-ENDCLEAR), -29, 0, 0, 0, 1
	ENDMES
	GOTO/-(GLENGTH-3), -26, 18
	GOTO/-GCLEAR-12,-26, 18	
	GOTO/-10,5, 18
$$线	
	MEAS/LINE,F(XLINE), 2
	PTMEAS/CART, -GCLEAR-5, 0, -5, 0, 1, 0
	GOTO/-GCLEAR,5, 18
	GOTO/-GLENGTH,5, 18
	PTMEAS/CART, -(GLENGTH-GCLEAR)-5, 0,  -5, 0, 1, 0
	ENDMES
	GOTO/-GLENGTH,5, 18
		
$$点		
	GOTO/GCLEAR, -18, (GHEIGHT+8)
	MEAS/POINT,F(XORIG), 1
	PTMEAS/CART, 0, -18,(GHEIGHT/2), 1, 0, 0
	ENDMES
	GOTO/GCLEAR, -18, (GHEIGHT+8)
	
	D(@CRDLABEL) = DATSET/FA(ZPLANE), ZDIR, ZORIG, FA(XLINE), -XDIR, YORIG, FA(XORIG), XORIG
$$ 	D(@CRDLABEL) = TRANS/ZORIG, -PRBR, YORIG, -PRBR, XORIG, -PRBR
ENDMAC

M(GAGECHECK) = MACRO/GHEIGHT, GWIDTH, GLENGTH, PRBR
	DECL/LOCAL, REAL, XS, XE, ACTLENGTH,ERROR1,ERROR2,ERROR3,ERROR4,MAXERROR,MINERROR,MAXIMUM,MINIMUM,JJYYCHANGE,AVERAG,AVERAG1
	DECL/LOCAL, CHAR, 20, SSEP,SSEP1,SSEP2,SSEP3,STESTDATE, STESTTIME,JJYY,NY
	DECL/LOCAL, INTGR, LPCOUNT,LPCOUNT1
	DECL/LOCAL,DOUBLE,JJYY[DONUM]
    ERROR3 = ASSIGN/DONUM
	
$$	SSEP = ASSIGN/'--------------------------------------------------------------------------------'
$$	WRITE/DID(GageBlock), SSEP
$$	WRITE/DID(DEFAULTSCREEN),SSEP
	F(PTS)=FEAT/POINT,CART,0 ,0, 0, 1, 0, 0
	F(PTE)=FEAT/POINT,CART,-GLENGTH ,0, 0,  -1, 0, 0
    STD = ASSIGN/0
    SELECT/BL
    CASE/BLENGTH[1]
    TOL1 = ASSIGN/(TOLERROR+BLENGTH[1]/300)/1000
    ENDCAS
    CASE/BLENGTH[2]
    TOL1 = ASSIGN/(TOLERROR+BLENGTH[2]/300)/1000
    ENDCAS
    CASE/BLENGTH[3]
    TOL1 = ASSIGN/(TOLERROR+BLENGTH[3]/300)/1000
    ENDCAS
    CASE/BLENGTH[4]
    TOL1 = ASSIGN/(TOLERROR+BLENGTH[4]/300)/1000
    ENDCAS
    CASE/BLENGTH[5]
    TOL1 = ASSIGN/(TOLERROR+BLENGTH[5]/300)/1000
    ENDCAS
    ENDSEL
       
	DO/LPCOUNT, 1,DONUM
		GOTO/2.5, -18, (GHEIGHT+8)
		MEAS/POINT,F(PTS), 1
		PTMEAS/CART, 0, -20,(GHEIGHT/2), 1, 0, 0
		ENDMES
		GOTO/2.5, -20, (GHEIGHT+8)
		GOTO/-(GLENGTH+2.5),-20, (GHEIGHT+8)
		MEAS/POINT,F(PTE), 1
		PTMEAS/CART, -GLENGTH, -20, (GHEIGHT/2), 1, 0, 0
		ENDMES

  		XS = OBTAIN/FA(PTS), 3
  		XE = OBTAIN/FA(PTE), 3
$$      WRITE/DID(DEFAULTSCREEN),''
$$		STESTDATE = ASSIGN/SDATE()
$$		STESTTIME = ASSIGN/STIME()
$$		WRITE/DID(GageBlock), 'DATE : ', STESTDATE, '     TIME : ', STESTTIME 
$$		WRITE/DID(DEFAULTSCREEN),'DATE : ', STESTDATE, '     TIME : ', STESTTIME
  		ACTLENGTH = ASSIGN/(XS - XE)
  		ERROR1 = ASSIGN/(ACTLENGTH-GLENGTH)*1000
$$		WRITE/DID(GageBlock), 'RUN ', LPCOUNT, 'Actual Length = ', ACTLENGTH, '     Nominal Length : ', GLENGTH ,$
$$		 '   ERROR:',ERROR1,'   TOL:    ',TOL1
		
		ERROR4 = ASSIGN/ABS(ERROR1)
		IF/(ERROR4.GT.TOL1)
		    NY = ASSIGN/'NG'
		ELSE
		    NY = ASSIGN/'OK'
		ENDIF 
		 
		
		IF/(LPCOUNT.EQ.1)
		  MINERROR = ASSIGN/ERROR1		
		  MAXERROR = ASSIGN/ERROR1
		  AVERAG = ASSIGN/ERROR1/1000
		WRITE/DID(DEFAULTSCREEN),''
		WRITE/DID(DEFAULTSCREEN),'      ','序号 ','              ','理论值','              ','实测值   ','        ','示值误差(u)','            ','允许误差(u)','          ','测试结论'
		ENDIF
           SSEP1 = ASSIGN/'        '
		   SSEP2 = ASSIGN/'           '
		   SSEP3 = ASSIGN/'                     '
		WRITE/DID(DEFAULTSCREEN),'      ',LPCOUNT,'                ',GLENGTH:9:5,SSEP1,ACTLENGTH:10:5,SSEP2,ERROR1:5:2,SSEP3,TOL1:5:2,SSEP3,NY
		
$$		WRITE/DID(DEFAULTSCREEN),'RUN ', LPCOUNT, 'Actual Length = ', ACTLENGTH, '     Nominal Length : ', GLENGTH , $
$$		'   ERROR:',ERROR1,'   TOL:    ','-/+',TOL1
		

		

		IF/(ERROR1 .LT. MINERROR)
		MINERROR = ASSIGN/ERROR1
		ENDIF
		

		IF/(ERROR1 .GT. MAXERROR)
		  MAXERROR = ASSIGN/ERROR1
		ENDIF
          JJYY[LPCOUNT] = ASSIGN/ERROR1
          KNPTR1 = ASSIGN/MINERROR
          KNPTR2 = ASSIGN/MAXERROR
        IF/(LPCOUNT.GT.1)
          AVERAG = ASSIGN/ERROR1/1000 + AVERAG
        ENDIF
        KNPTR3 = ASSIGN/KNPTR2-KNPTR1
    
$$        JJYY[LPCOUNT] = ASSIGN/ABS(JJYY[LPCOUNT])		
$$		STD = ASSIGN/0
$$        ERROR1 = ASSIGN/ABS(ERROR1)		
$$		IF/(ERROR1.GT.STD)
$$		  STD = ASSIGN/ERROR1
$$		ENDIF
		
        GOTO/-GLENGTH, -18, (GHEIGHT+8)
	ENDDO

$$        WRITE/DID(DEFAULTSCREEN),'MAXMUM ERROR IS    ',STD
		IF/(MAXERROR+MINERROR.GT.0)
		MAXIMUM = ASSIGN/MAXERROR
$$		MINIMUM = ASSIGN/MINERROR
		ELSE
$$		MAXIMUM = ASSIGN/MINERROR
		MINIMUM = ASSIGN/MAXERROR
		ENDIF

        AVERAG  = ASSIGN/AVERAG/DONUM+GLENGTH
$$	WRITE/DID(DEFAULTSCREEN),'MAXMUM ERROR IS    ',KNPTR2:5:5,'    MINIMUM ERROR IS    ',KNPTR1:5:5
$$	WRITE/DID(DEFAULTSCREEN),' 	REPEATABILITY ERROR   ',KNPTR3:5:5
    
    WRITE/DID(DEFAULTSCREEN),'     ','实测平均值:    ', AVERAG:5:5
	WRITE/DID(DEFAULTSCREEN),'     ','重复性误差:    ', KNPTR3:2:2
	
ENDMAC
$$ENDFIL
  DECL/COMMON, INTGR, VAR1
  DO/VAR1,1,Doloop

MODE/PROG,MAN
LB = ASSIGN/LB + LSTEP
BL = ASSIGN/LB + BLENGTH[VAR1]/1000
TOL1 = ASSIGN/TOL2 + BL/300
IF/(VAR1.EQ.1)
BL = ASSIGN/LB*Doloop
CALL/M(GAGECRDSETUP), (GAGE1CRD), XP, ZP, GAGEHEIGHT, GAGEWIDTH, BL, ENDCLEAR, DR_PRBRAD
BL = ASSIGN/LB + BLENGTH[VAR1]/1000
ENDIF
CALL/M(GAGECHECK), GAGEHEIGHT, GAGEWIDTH, BL, DR_PRBRAD

ENDDO

RationalDMIS2023步距规程序3_EQ


RationalDMIS2023步距规程序3_前端_02


标签:BLENGTH,RationalDMIS2023,FA,ERROR1,POINT,程序,CART,步距规,ASSIGN
From: https://blog.51cto.com/u_14941238/7399382

相关文章

  • RationalDMIS2023量块程序2025
    DECL/LOCAL,REAL,LPEND,HEIGHT,TOLERROR,LL,CRDVCE,PROBVCEDECL/LOCAL,CHAR,20,BARAXIS,PROB,ANSDECL/COMMON,DOUBLE,DR_PRBRAD,PRO_APPRCH,PRO_RETRCT,MSVELDECL/COMMON,DOUBLE,VI,VJ,VK,VI2,VJ2,VK2,DCX,DCY,DCZ,DX,DY,DZ,BARDIR,DMAX,DMINDECL/C......
  • 小程序和APP备案,到底是在革谁的命?
    明年起,国内的App也要像网站一样进行备案了。想必大家也是早已经听到过这个刷屏的新闻,顺便说一声小程序也是。在管理日益强化的背景下,开发者也会随之而来的面临一些新困境和变化。这项备案政策的出台,似乎是在维护信息安全和合规经营的前提下,但实际上对小公司和独立开发者带来了一......
  • Java——程序包不存在【三种解决方法】
     目录一、问题描述二、解决方案 方法一:maven包管理的clean方法  方法二:清理缓存  方法三:设置配置三、结语 一、问题描述报错:xxx程序包不存在  二、解决方案 方法一:maven包管理的clean方法1、把项目的MavenProject打开2、点击clean,再点击run,即......
  • 抖音小程序源码成品开发
      抖音上的流量现在大部分人都知道,目前用户量达到了8亿多,商家都想在抖音字节平台上开发一个小程序。拥有了这样的小程序就意味着拥有了大把的流量,抖音小程序也属于是新型的渠道,和其他的小程序一样,轻便,高效,无需下载,深受用户的高度关注。  抖音小程序源码如何是完整版的可以......
  • 程序员能否转型为项目经理
    6月的时候,负责的一个小项目驻场开发,猛搞2周,终于告一段落,稍为可以喘息一下了,结果又让负责一个新的项目。但这个项目跟以前的有一些不一样,是集团另一家公司的项目,硬件为主,将软件部分分给我们搞。以往我们直接面对业主,现在是由那家公司安排调度,工作对该公司负责。我过了许久才想清楚自......
  • 使用GO 程序指定IP地址访问 http/https 地址 类似curl --resolve XXXIP:PortYYY
    需求,使用GO程序指定IP地址访问http/https地址传入参数:ipAddr//ipv4地址string值serviceUrl//url地址string值hostContainPort//HostHeader是否带url的端口bool值返回值:responseCode//http状态码int类型,Host//request请求HostHeaderstring类型 ......
  • 【错误记录】exe4j 打包程序无法设置 jar 包依赖的问题 ( 将源码 和 依赖库打包到同一
    文章目录一、问题描述二、解决方案一、问题描述在【错误记录】IntelliJIDEA导出可执行jar包执行报错(java.lang.ClassNotFoundException|打包时没有选择依赖库)博客中遇到java.lang.ClassNotFoundException:com.microsoft.sqlserver.jdbc.SQLServerDrivera......
  • 安装vmware失败,无法进入安装程序?
    如果你在安装VMware时遇到问题,无法进入安装程序,这可能是由于多种原因。以下是一些可能的解决方案:检查你的系统是否满足VMware的最低要求。例如,你需要一个至少2GB内存的处理器,以及足够的硬盘空间。确保你的操作系统是最新的。如果不是,尝试更新它,然后重试安装。禁用任何可能阻止VMwar......
  • 文盘Rust——起手式,CLI程序 | 京东云技术团队
    技术的学习从不会到会的过程是最有意思的,也是体会最多的。一旦熟练了,知识变成了常识,可能就失去了记录学习过程的最佳时机。在我看来学习一门计算机语言和学习人类语言有很多共通之处。我们学习人类语言是从单个的词开始,然后是简单句子,通过不断的与他人交互练习掌握语法和语言习惯。......
  • 文盘Rust——起手式,CLI程序
    技术的学习从不会到会的过程是最有意思的,也是体会最多的。一旦熟练了,知识变成了常识,可能就失去了记录学习过程的最佳时机。在我看来学习一门计算机语言和学习人类语言有很多共通之处。我们学习人类语言是从单个的词开始,然后是简单句子,通过不断的与他人交互练习掌握语法和语言习惯......