DMIS SYNTAX Some DMIS rules
1. DMIS is not case sensitive
2. Major words 2 to 6 characters, Minor words 1 to 6 characters
3. Major word may be a DMIS statement or a class of command
4. All variables are declared , start with a letter should not used , DMIS reserved words.
5. Maximum # of characters per lines is 80 and per statement is 256.
6. Maximum # of characters of the variable name is 16 .
Messages:
Operator message: TEXT/OPER, PLACE SENSOR CLOSE TO LEFT CORNER'
Output file message: TEXT/OUTFIL,' CIRCLE 1'
VARIABLES DECLARATION
DECL/REAL, AA Declare variable , real data type.
DECL/CHAR, 10, AA Declare variable , Character data type.
DECL/INTGR, AA Declare variable , Integer data type.
Variable Input:
TEXT/QUERY, (AA) , 20, AN, L,' Insert the value of ........'
AN: ALPHANUMERIC response
A: ALPHABETIC response
N: NUMERIC response
L : Left justified response
R : Right Justified response
1. Arithmetic Operators:
+ Addition=========> WW=ASSIGN/BB+CC
- Subtraction or Negation =========>WW=ASSIGN/BB-CC
* Multiplication =========> WW=ASSIGN/BB* CC
/ Division=========> WW=ASSIGN/BB/CC
* * Exponentiation=======> WW=ASSIGN/((BB-CC) * EE) ** AA)
LOOPING
DO/index, initial, limit, increment
Executable statements
ENDDO
Note: index , initial and increment have to be integer variable.
If the increment is omitted it's value will 1.
Ex:
DECL/REAL, XX, YY, ZZ, DD
DECL/INTGR, II
Do/II,1,8,1
F(CR1)=FEAT/CIRCLE, OUTER, CART, XX, YY, ZZ, 0, 0, 1, DD MEAS/CIRCLE, F (CR1),8
ENDMES
ENDDO
CONDITIONAL BRANCHING
IF Conditional branching:
TF/ (loqical expression)
Executable statement
ELSE
Executable statement
ENDIF
OPERATORS
1. Simple Logical Operators
EQ. Equal to ======> IF/(B1. EQ.C1)
. NE. Not Equal to ====> IF/(B1. NE.C1)
. LT. Less Than ========> IF/(B1. LT.C1)
. LE. Less Than or Equal to ===> IF/(B1. LE.C1)
.GT. Greater Than ========> IF/(B1. GT.C1)
. GE. Greater Than or Equal to =======> IF/(B1. GE.C1)
2. Compound Logical Operators
. AND. will be true if both operands are true
. OR. will be true if either one operand is true.
. NOT. will be true if the operand is false.
SELECT Conditional branching:
SELECT/ arg
CASE/arg1
Executable statement
ENDCAS
CASE/ arg2
Executable statement
ENDCAS
DFTCAS
Executable statement
ENDCAS
ENDSEL
OBTAIN
DECL/REAL,X1, Y1, Z1
DECL/INTGR, II
f (pt1)=feat/point,cart, 0,0,0,0, 0, 1
meas/point, f (pt1), 1
endmes
X1 = obtain/fa (pt1),3
Y 1= obtain/fa (pt1) ,4
Z1= obtain/fa (pt1), 5
EVAL
Note: Where tolerance apply , OBTAIN will evaluate the tolerance statement in the last EVAL and /or OUTPUT command.
DECL/REAL, AA
T (DTB1) = TOL/DISTB, NOMINL, 35.000000,0.000000, 0.000000, XAXIS, AVG EVAL/FA (CR1), FA (CR3), T (DTB1)
AA=OBTAIN/TA (DTB1), 4
VALUE
Assign a measurement or calculation result to a variable.
Example:
$s---MEASURING AND TOLERANCING A FEATURE CIRCLE --------
F(CR1) = FEAT/CIRCLE, INNER, CART, 101, 102, 103, 0, 0,1, 41
MEAS/CIRCLE, F(CR1), 3
PTMEAS/CART, 93.704, 121.158, 103.000, 0.356, -0.935, 0.000
PTMEAS/CART, 88.057, 86.103, 103.000, 0.631, 0.775, 0.000
PTMEAS/CART, 121.239, 98.739, 103.000, -0.987, 0.159, 0.000
ENDMES
T (TOLX) =TOL/CORTOL, XAXIS, -0.200, 0.200
T(TOLY) = TOL/CORTOL, YAXIS, -0.300, 0.300
T (TOLZ) =TOL/CORTOL, ZAXIS, -0.400, 0.400 ,
T (TOLDIAM) TOL/DIAM, -0.500, 0.50
DECL/REAL, RLDEV, RLACT, RLAMT, RLSIZE, DDIAM, DDIST
DECL/INTGR, INTOOT
DDIAM=VALUE/FA (CR1), SIZE $$ Assign the diameter value of CR1 to the
variable DDIAM
T(DTB2) TOL/DISTB, NOMINL, 200.000000,-0.010000, 0.010000, XAXIS, AVG EVAL/FA (CR1), FA (CR2) ,T (DTB2)
DDIS-VALUE/TA (DTB2) , ACT $$ Assign the distance actual between CR:
and CR2 to variable DDIST
$s This command will evaluate the feature (CR1) according to the
tolerance (TOLX) specified before.
EVAL/FA (CR1) , T (TOLX)
ss this command will assign the value of the deviation to a variable
RLDEV=VALUE/TA (TOLX) , DEV
$s this command will assign the value of out of tolerance to a
variable
RLAMT=VALUE/TA (TOLX), AMT
$ş this command will return the value 1 if x of (CR1) is in tolerance
and o if it is out of tolerance
INTOOT-VALUE/TA (TOLX) , INTOL
$$ P.S. : the variable INTOOT has to be declared as INTEGER because
it will have the value o or 1 only
MACRO
MACRO DEFINTITION
M (TEST)-MACRO/X1, Y1, Z1, I, J, K, 'LABEL'
F (LABEL)-FEAT/POINT, CART, X1, Y1, Z1, I,J, k
MEAS/POINT, F (LABEL), 1
PTMEAS/CART,X1,Y1, Z1,I,J, K
ENDMES
ENDMAC
CALL INTERNAL MACRO:
CALL/M (TEST) , 200, 100, 200, 0, 0, 1, (POINT1)
DECLARATION OF EXTERNAL FILE:
XTERN EXTFIL/DMIS, 'C:\ DMIS\ TEST. dms'
..
ENDXTN CALL MACRO FROM EXTERNAL DMIS FILE:
CALL/EXTERN, DMIS, M (TEST1) CALL EXTERNAL SYSTEM FIIE:
CALL/EXTERN, SYS, '/WINDOWS/PBRUSH. EXE C:\ CAD\175.
BMP'
DIRECT READ AND WRITE FROM FILE
DID (CAP) =DEVICE/STOR, 'C:\ IVAN\ TT. TXT'
DECL/REAL,X1, X2
DECL/INTGR, NN
OPEN/DID (CAP), DIRECT, OUTPUT, APPEND WRITE/DID (CAP),X1,X2, NN
OPEN/DID (CAP), DIRECT, INPUT, APPEND READ/DID (CAP),X1,X2, NN
LOADING SENSOR DATA BASE FROM THE PROGRAM
DID (SNSBASE)=DEVICE/STOR, 'C:\ Vms \ Users\ YOUR LOGIN NAME\ sensor\ YOUR
PROJECT NAME WHERE SENSORS EXIST. sns'
OPEN/DID(SNSBASE),SNS
LOADING COORDINATE REFERENCE SYSTEMS DATA BASE FROM THE PROGRAM
DID (BASE) =DEVICE/STOR, 'c:\ AA\ COORD\ TEST. CRD'
OPEN/DID (BASE), PCS
DMIS INTRINSIC FUNCTIONS