0% found this document useful (0 votes)
89 views

DMIS Short Tutorial

The document provides instructions and examples for using a language for programming measurement and inspection tasks. It defines basic programming elements like macros, variables, logical operators, and functions. Examples show how to create features, read and write files, and perform calculations and conditional logic. The overall document serves as a tutorial for the programming language.

Uploaded by

Dallas Winston
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views

DMIS Short Tutorial

The document provides instructions and examples for using a language for programming measurement and inspection tasks. It defines basic programming elements like macros, variables, logical operators, and functions. Examples show how to create features, read and write files, and perform calculations and conditional logic. The overall document serves as a tutorial for the programming language.

Uploaded by

Dallas Winston
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Language tutorial.

!"# ! " " "

F(CIRC3)=FEAT/CIRCLE,INNER,CART,-32.5000,38.3494,-25.0000,0.0000,0.0000,1.0000,10.0000
MEAS/CIRCLE,F(CIRC3),3
PTMEAS/CART,-32.5000,33.3494,-25.0000,0.0000,1.0000,0.0000
PTMEAS/CART,-36.8301,40.8494,-25.0000,0.8660,-0.5000,0.0000
PTMEAS/CART,-28.1699,40.8494,-25.0000,-0.8660,-0.5000,0.0000
ENDMES
$ ! " ! ! %& % ! " !! %
' ( ! " % % %)! " "

$ % ( " *
+, " %" + *
+-," %" - +
F(CIRC3)=FEAT/CIRCLE,INNER,CART,-32.5000,38.3494,-25.0000,0.0000,0.0000,1.0000,10.0000
$ * ", " " " ! " # "#" ! " * . / -0$.,
! " ( % "' % !( ' " ( ' (% "#" ! "
* . / 1.2, $ /- ( 3 % %' % # ! !( ' "
"' %
MEAS/CIRCLE,F(CIRC3),3
$ * ! ", " ' " ( ' (% # '" % ''
%
PTMEAS/CART,-28.1699,40.8494,-25.0000,-0.8660,-0.5000,0.0000
$ *
/ %! ", " ! ! " ! % "

!
DECL/CHAR,80,TCDIRS
DECL/INTGR,TCNSLT
DECL/DOUBLE,TCDIFX,TCDIFY,TCDIFZ
DECL/CHAR,80,RESULTS[10]
4#! " /5 !! %# % 6 ( "

DECL/INTGR,IND
DECL/CHAR,80,RESULTS[10]
DO/IND,1,10,1
RESULTS[IND]=ASSIGN/''
ENDDO
7 % #' " 6 ( "&
BOOL
CHAR
INTGR
REAL
VECTOR
LONG
$ 6 ( " (&
COMMON
GLOBAL
LOCAL
"
$ "" 6 6 ( 9 " " *
:,
TCDIRS=ASSIGN/'C:\Programmi\Coord3\ARCO\Data\'
TCNSLT=ASSIGN/6

"
TEXT/OPER,'MAKE SURE THE PART IS ON THE FIXTURE' text OPER must be closed pressing OK
TEXT/MAN,'MEAS UPPER HOLE' text MAN disappear automatically when you measure the 1st point

# $
TEXT/QUERY,(NMVAR),20,A,L,'Write your name'

!
6 ( ; #' ! % % ( <
+ %
<
+- < %<- 9
$ !( ' " '" ! %
F(POI_1)=FEAT/POINT,CART, 1.111,2.222,3.333, 0,0,0
F(POI_2)=FEAT/POINT,CART, 4.444,5.555,6.666, 0,0,0
F(POI_3)=FEAT/POINT,CART, 7.777,8.888,9.999, 0,0,0
FA(POI_1)=FEAT/POINT,CART, 1.111,2.222,3.333, 0,0,0
FA(POI_2)=FEAT/POINT,CART, 4.444,5.555,6.666, 0,0,0
FA(POI_3)=FEAT/POINT,CART, 7.777,8.888,9.999, 0,0,0
DECL/INTGR,i
DECL/CHAR,20,elnm
DECL/DOUBLE,xx,yy,zz
DO/i,1,3
elnm=ASSIGN/CONCAT('poi_',STR(i))
xx=OBTAIN/FA(@elnm),3
yy=OBTAIN/FA(@elnm),4
zz=OBTAIN/FA(@elnm),5
elnm=ASSIGN/CONCAT('newpoi_',STR(i))
F(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
FA(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
ENDDO

" "% ! "


FILENAME=ASSIGN/CONCAT(PART1,NAME,'.TXT')

%
$$————————————————————————————————————————————————————————————
$$ write points coordinates to file
$$————————————————————————————————————————————————————————————

DECL/CHAR,50,filnm,elnm
DECL/INTGR,i
DECL/DOUBLE,xx
DECL/DOUBLE,yy
DECL/DOUBLE,zz

TEXT/QUERY,(filnm),50,A,L,'insert file name'


filnm=ASSIGN/CONCAT('C:\',filnm,'.TXT')
DID(F1)=DEVICE/STOR,filnm
OPEN/DID(F1),DIRECT,OUTPUT,OVERWR

F(POI_1)=FEAT/POINT,CART, 1.111,2.222,3.333, 0,0,0


F(POI_2)=FEAT/POINT,CART, 4.444,5.555,6.666, 0,0,0

8
F(POI_3)=FEAT/POINT,CART, 7.777,8.888,9.999, 0,0,0
FA(POI_1)=FEAT/POINT,CART, 1.111,2.222,3.333, 0,0,0
FA(POI_2)=FEAT/POINT,CART, 4.444,5.555,6.666, 0,0,0
FA(POI_3)=FEAT/POINT,CART, 7.777,8.888,9.999, 0,0,0

DO/i,1,3
elnm=ASSIGN/CONCAT('poi_',STR(i))
xx=OBTAIN/FA(@elnm),3
yy=OBTAIN/FA(@elnm),4
zz=OBTAIN/FA(@elnm),5
WRITE/DID(F1),xx
WRITE/DID(F1),yy
WRITE/DID(F1),zz
ENDDO

CLOSE/DID(F1)

$$————————————————————————————————————————————————————————————
$$ read from file
$$————————————————————————————————————————————————————————————
DECL/CHAR,50,filnm
DECL/CHAR,50,xyz
DECL/DOUBLE,xx
DECL/DOUBLE,yy
DECL/DOUBLE,zz
TEXT/QUERY,(filnm),50,A,L,'insert file name'

filnm=ASSIGN/CONCAT('C:\',filnm,'.TXT')

DID(F1)=DEVICE/STOR,filnm
OPEN/DID(F1),DIRECT,INPUT

READ/DID(F1),xx
READ/DID(F1),yy
READ/DID(F1),zz
F(POI_10)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
FA(POI_10)=FEAT/POINT,CART, xx,yy,zz, 0,0,0

READ/DID(F1),xx
READ/DID(F1),yy
READ/DID(F1),zz
F(POI_20)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
FA(POI_20)=FEAT/POINT,CART, xx,yy,zz, 0,0,0

READ/DID(F1),xx
READ/DID(F1),yy
READ/DID(F1),zz
F(POI_30)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
FA(POI_30)=FEAT/POINT,CART, xx,yy,zz, 0,0,0

result=ASSIGN/CONCAT(STR(xx),' , ',STR(yy),' , ',STR(zz))


TEXT/OPER,result

CLOSE/DID(F1)

" #
.AND.
.OR.
.NOT.

#
.EQ. equal to
.NE. NOT equal to
.LT. less than
.LE. less than or equal
.GT. greater than
.GE. greater than or equal to

%
IF/(NCYCLE .EQ. 10)
$$instructions
ELSE
$$instructions
ENDIF

#
DECL/INTGR,i
DECL/CHAR,20,elnm
DECL/DOUBLE,xx,yy,zz
DO/i,1,3,1
elnm=ASSIGN/CONCAT('poi_',STR(i))
xx=OBTAIN/FA(@elnm),3
yy=OBTAIN/FA(@elnm),4
zz=OBTAIN/FA(@elnm),5
elnm=ASSIGN/CONCAT('newpoi_',STR(i))
F(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
FA(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
ENDDO

DECL/INTGR,i
DECL/CHAR,50,tx
i=ASSIGN/10
SELECT/i
CASE/10
tx=ASSIGN/CONCAT('THE ACTUAL VALUE OF X IS: ',STR(i))
TEXT/OPER,tx
ENDCAS
CASE/20
tx=ASSIGN/CONCAT('THE ACTUAL VALUE OF X IS: ',STR(i))
TEXT/OPER,tx
ENDCAS
DFTCAS
TEXT/OPER,'X is not equal to the 2 cases'
ENDCAS
ENDSEL

& #
JUMPTO/(CONTINUEFROMHERE)
$$ instructions
$$ instructions
(CONTINUEFROMHERE)
$$ instructions
$$ instructions

'
ABS(X) absolute value
ACOS(X) arccosine
ASIN(X) arcsine
ATAN(X) arctangent
ATAN2(Y,X) arctangent of y/x, the sign of y and x determinate the quadrant
DTOR(X) convert degrees to radians
RTOD(X) convert radians to degrees

=
EXP(X) exponential
INT(X) return an integer
NINT(X) return an integer rounding the nearest value
LEN(str1) length of a string
INDX(str1,str2) location of a substring in a string
SDATE() return the date ‘yyyy/mm/dd’
STIME() return the date ‘hh:mm:ss’
COS(X) Real or Double (argument in radians)
SIN(X) Real or Double (argument in radians)
TAN(X) Real or Double (argument in radians)
SQRT(X) square root
STR(X) convert a number in a string
VAL(X) convert a string in number

( ! ' ! 3
# ' ! # 6 ( (
M(foro)=MACRO/off_x,off_y,'nome_ci'
DECL/LOCAL,DOUBLE,r_foro,z_mis
r_foro=ASSIGN/6.25
z_mis=ASSIGN/-2.5
F(@nome_ci) = FEAT/CIRCLE, INNER, CART, off_x, off_y, z_mis, 0, 0, 1, r_foro*2
MEAS/CIRCLE, F(@nome_ci), 4
GOTO/off_x, off_y, 7
PTMEAS/CART, off_x+r_foro, off_y, z_mis, -1, 0, 0
PTMEAS/CART, off_x, off_y+r_foro, z_mis, 0, -1, 0
PTMEAS/CART, off_x-r_foro, off_y, z_mis, 1, 0, 0
PTMEAS/CART, off_x, off_y-r_foro, z_mis, 0, 1, 0
GOTO/off_x, off_y, 7
ENDMES
ENDMAC
$$ instructions
$$ instructions
CALL/M(foro),12.5,12.5,(foro1)
$$ instructions
$$ instructions

4#! " <


/>$+ !! %# " ! " "' % 3
EXTFIL/DMIS,'c:\cim\MACRO.dmi'
$ 3 ! "* , 3 " ( " < % " <
/? +
"% "# 3 " (" # "! ! ' !
DMISMD/'module_name'

M(macro_1)=MACRO/passedtext
TEXT/OPER,CONCAT('You passed the following text to the macro: ',passedtext)
ENDMAC

M(macro_2)=MACRO/num1,num2
DECL/DOUBLE,sumres
sumres=ASSIGN/num1+num2
TEXT/OPER,CONCAT('The sum of the 2 numbers is: ',STR(sumres))
ENDMAC

ENDFIL

'$ !
$ " " ! "' (" % "#" !" 6 ( @# 6 "
*A,( 6 ( !
F(@nome_po) = FEAT/POINT, CART, off_x-8.25, off_y, 0, 0, 0, 1
MEAS/POINT, F(@nome_po), 1
PTMEAS/CART, off_x-8.25, off_y, 0, 0, 0, 1
ENDMES

You might also like