VB/CAM
By Chris Lamrock
4/20/03
In this help file you will find a detailed
description of the VB/CAM form as well as some information
on where to look to modify the code to make it post out for
other CNC machines.
The form has several boxes to fill out:
O Number: This field allows you to enter the file name that
will be used to call up the file on your HAAS
mill. Some machines may not use this method
and the code may need to be changed in the VB
code itself. Please note the section on
modifying the code below.
Tool #: In this field enter the tool number you wish to
use for this program. This number will be used
to place a T# and also an H# code in the program
If your cnc mill does not use these codes you may
need to change this in the VB code. See the
section below on modifying the code.
Spindle RPM: In this field enter the RPM you wish to use for this
program. No decimal places are needed as the program
will add one for you.
Z Clearance Ht: This is one of the most important fields to get right.
the first move your tool will make is to this Z clearance
height. Next it will locate to your 1st X and Y location
and then to it's first Z location. This field should be
set a few inches higher than anything on your table,
the part, clamps, or anything else that may interfere
with the tools movement.
Approach Feed: This is the feedrate in inches per minute that the tool
will move from the 1st point on your 3d polyline to the
2nd point. This is generally a vertical lead line and
is usually set at a slower feedrate than the cut feedrate.
In this way the tool will rapid down to the 1st point of
your lead-in line, then feed at approach rate to your Z
depth and then proceed at cut feed.
Cut Feed: This the feedrate at which the tool will travel from the 2nd
point in the 3d polyline until the last point. After
moving to the last point of the 3d polyline the tool
will rapid up in Z to the Z clearance height.
Program Name: Enter the name of the file you wish to create.
Enter the complete path and filename with extension here.
For example: c:\cnc_files\1234.cnc
Comment: In this field you may enter a brief comment for this
program that will be included in the CNC program itself.
This can be anything you wish, a description, a job
number or maybe a tool description.
Modifying code to work on another CNC machine:
Since VB/CAM uses simple G01 codes the majority of the CNC program
it creates should work on any CNC machine. If you do need to modify the
program to make it work chances are you will need to change the first few
lines of the CNC program - and the last few. What I recommend is to print
out a small cnc file that currently works on your CNC machine and also run
a small program through VB/CAM and print that out.
Now compare the programs to see what needs to be changed. Once you
have a good idea of the changes you'd like to make bring up the VBAIDE in
AutoCAD and go to the VB/CAM Form. If you double click on the "Write File"
button you will see all the VB code that is used to create the CNC program.
I have tried to document this area thoroughly for you with comments
in the code. After a few minutes of studying the code you should begin
to understand it's workings.
Be aware that some things may be hard-coded into the code - such
as the G58 work coordinate call. If you need to change this simple change
this line of code in the 1st section of the CNC program generation area.
There are 3 main parts to the CNC program generation area.
The beginnning section - where it posts out the first few lines
that may need to be changed. In this area you will find
setup Gcodes and the O number.
The middle section - This is where it produces most of the CNC
G01 code. You probably won't have to change this area
unless you need to change the amount of decimal places
posted.
The ending section - This is another area you may need to change.
This area includes some ending codes that may be
different than you are used to.
For questions or comments on VB/CAM you may email me at:
chris@blackwidowguitars.com
I will try to help where I can.
-Chris
               (
geocities.com/wpsmoke/acadmdt)                   (
geocities.com/wpsmoke)