Return to Wilcox Associates, Inc. Home Page
View News and Press ReleasesDownload FilesGet Technical SupportAccess the Users AreaContact Wilcox Associates, Inc.View Offsite Links
Created on: September 24, 2002
Last modified: July 09, 2008
Return to Home Page Contact Us

Variable Examples

With the introduction of PC-DMIS version 2.1 came variables and all the fun and capabilities that come with them. What variables allow you to do is create variable features and dimension which can change from run to run, loop to loop, or with each operator input. You can also now access individual components of both features and dimensions. Such as he measure "X" of a feature. EX: CIR1.X or the TruePosition deviation of a feature dimension EX: DIM1.TP.DEV.

Consider these examples:


Example 1: (Using variables to remeasure a hole out of Tolerance)

Following is an example of the use of variables and dimension components to force the re-measurement of a circles if it is out of tolerance.

You will notice that the number of hits for "CIR1" is determined by the value of the variable "V1", and if you scroll down towards the bottom you will see that it is changed right before the circle is re-measured if it is "out of tolerance". You will also notice that the routine does a check on the dimension "OUTTOL" values to determine if "CIR1" needs to be re-measured. The basic idea here is that if "OUTTOL" is "0" then it returns "FALSE" if it isn't "0" then it returns "TRUE", and if "V1" is less than or equal to eight "CIR1" is re-measured.

Back to Top


Example 2: (Measuring a Bolthole pattern)

The next example demonstrates the use of variables in features, dimensions, and comments.

Note: It is assumed that the coordinated system origin is currently at the center of the BoltHole pattern.

Step 1: In command mode, type "Comment/YESNO" to ask the user if they want to measure the "BoltHole pattern".

Step 2: Use an IF/END_IF control pair to test the value of "COM1.INPUT". If the user typed "NO" the flow control uses the "GOTO" command to jump to the label named "SKIPPATT".

Step 3: Next set up a series of variables that you will use in the following code. They are: Pattern diameter(PD), Number of holes(NUM), Hole diameter(HD), Starting angle(SA), Measurement Depth(DP), Hole Z value(HZ), Incrementing angle(V1), Pattern radius(PR), and Increment(INC).

Sterp 4: Start the loop with the number of loops set to the "NUM", and the angle offset set to "V1".

Step 5: Now measure a Auto/Circle in Polar coordinates using my varaibles to determine where to measure.

Step 6: Dimension your Circles using my variables to determine the Nominal values.

Step 7: After your dimension, increment the variable "INC" by 1 causing the measurement location to rotate by "V1", and start the loop again.

Step 8: Place the Label "SKIPPATT" at the end of the section of code as a jump point for the initial "COMMENT/YESNO".

Back to Hints

 

sales@wilcoxassoc.com | webmaster@wilcoxassoc.com
Copyright © 2002-2012, Wilcox Associates, Inc.
Part of Hexagon Group