Do you manufacture and inspect
Part Families? Meaning, variety of parts having similar overall geometry but with varying dimensional characteristics? Instead of cresting one program for each unique part, you can realize significant time savings by creating one parametric program that can inspect a variety of parts.
The following KB article describes a simple parametric program that will inspect cubes (blocks) or varying size. This article will serve as an example that can be expanded upon as needed. In this simple example we will only vary 3 dimensions for the work-piece, of course a more complex parametric program is possible. The short video below shows the results of the example we'll review.
First we'll consider, how should we specify the parameters? We could prompt the CMM operator to enter individual dimensions, we could prompt for a Rev Number and then lookup parameters that have been pre-configured in the VB Script, or we could refer to an outside data source such as a Sql database or simple text file. The third option is best as it allows you to add new part configurations by simply adding data to this external data source. In our example we'll use a simple text file. Contents of three unique files as shown below:
File # 1 contents:
File # 2 contents:
File # 3 contents:
Part # / ID
MyPart123,
MyPart246,
MyPart112,
Length, Upper & Lower Tolerance
76.2,0.5,0.5,
152.4,0.5,0.5,
50.8,0.25,0.25,
Width, Upper & Lower Tolerance
50.8,0.5,0.5,
101.6,0.5,0.5,
15,0.75,0.75,
Height, Upper & Lower Tolerance
25.4,0.5,0.5
50.8,0.5,0.5
12.5,0.75,0.75
We'll need to give the CMM program operator a chance to specify which file should be used. This can be done with VB Script as follows:
This will create a VB variable "MyFile" that contains the complete file path / name of file picked by operator using standard Windows dialog.
Better yet, we can prompt user to enter part ID and then look for file xxxx.txt in the specified folder, then fall back to file picker method if file cannot be located, like this:
'Locate Job Config Txt File
Set objFSO = CreateObject("Scripting.FileSystemObject")
Now that we know what file to open / read, we can open the file and extract contents to VB Script variables - these variables will be used to adjust measured feature sizes and report tolerances:
Parsing the input file could be done more efficiently using the VB
Split() functionfor comma separated files. The example below has overhead Script to deal with inconsistent line format, some ending in comma, others do not.
Finally, we'll create the variables that drive the motion of each measured feature. In this case Length, Width, Height, and some associated clearance and edge offsets:
'set variables for PtMeas and Move Points
XLeft = 3
XRight = Length - 3
XCenter = Length / 2
YFront = 3
YRear = Width - 3
YCenter = Width / 2
Z = Height
ZClear = Height + 10
XClear = Length + 5
YClear = Width + 5
Now to apply VB Variables to the Measurement and Reporting Operations. Look for the
Set Variable button. This can be used both for Features Nominal but also for underlying Path and Point locations. Note - the Measurement Commands that facilitate VB Variable will begin with "@" - this will serve as a quick visual indicator when reviewing the measurement operation. In the example below, the X & Y location of Move Point is set by VB Variables
XLeft and
YClear when program runs.
While i
n this example, the reported Length by VB Variable Length when program runs.
We recommend that you pick one part from the similar part family and write the initial program. Create a program for this one part, then after it's tested and operates as expected add the VB Script and references to Variables as described above. See the attached CMM-Manager Project file and associated job config files. You can run this program easily if you have access to a 1,2,3 and 2,4,6 block. Alternately, you could modify the attached job files to accommodate any sized blocks- i.e. gage blocks - that you have available.
What can I do with VB Scripting? CMM-Manager VB Scripts run in line with program execution and can be used to perform loops and flow control, display custom messages, prompt user for input that then influences program execution - i.e. skip section of ...
The main advantage of utilizing the fixture CAD file in conjunction with the part model is that CMM-Manager will generate a measurement path to avoid both details, eliminating any manual adjustments. For example, programming the part shown in the ...
When looping Program steps by use of VB Script loop - i.e. For Loop, Do Until, etc. - Features that have been executed more than one time will automatically be renamed using standard convention as such - Circle1, Circle1...1, Circle1...2, ...
Many times a CMM program may have a manual alignment followed by a DCC alignment. In some cases, the manual alignment does not need to be executed each time the program is run. This is true if subsequent running of the program is done with each part ...
It is possible to run another CMM-Manager Program from the External Command operation. This is useful if you'd like to create a simple launching program - i.e. main program that prompts user for next program, and then runs accordingly to user ...