View Single Post
  #5   Report Post  
Posted to alt.machines.cnc,rec.crafts.metalworking,comp.lang.basic.powerbasic,alt.lang.basic
F. George McDuffee
 
Posts: n/a
Default CNC GM file format help needed

On Tue, 24 Jan 2006 05:45:51 -0500, Cliff
wrote:
On Mon, 23 Jan 2006 14:54:34 -0600, F. George McDuffee
wrote:
I am looking for information on the most popular [G/M] cnc file
layouts.
It's indeed rather varied. Which is why we have postprocessors.

OTOH There is also the basic RS-274D standard which is a subset
of many sets of commnads these days.
See also the "Gerber" or RS-274D/X standard.

=================================
Thanks to Cliff and every one else that replied directly [emails]
about the output file formats.

I have just about completed coding for the actual conversion of
the preprocessed ( using the gpl hp2xx ) HPGL and HPGL/2 files.

Your suggestion to operationally create a simple post appears to
be the best solution to the file format question.

Also I am doing range checking [min/max values] and would
appreciate advise on the following points, assuming you are using
small endmills for sign creation, etc.
(1) What are the min/max vertical feedrates and units that you
would ever use?
(2) What are the min/max horizontal feedrates and units you would
ever use?
(3) What is the min/max distance above the surface you would ever
use?
(4) What is the min/max plunge below the surface you would ever
use?

Items 1-4 will be input when you convert a processed hpgl file.

If you use a cad program, you can turn layers on/off before
plotting, so lettering in the bottom of a pocket is easy. Mirror
immage is also simple.

Units [mm/inch] will be determined in the configuration file.

A proforma output configuration file follows. Please review and
let me know what variables I have omitted, or other features you
would like.

=== possible configuration file for hpgl == G-CODE translator ==
*
* « CONFIGURATION FILE »
* for hpgl2cnc.exe -- a GPL public domain program.
*
* by default hpgl2cnc uses the hpgl2cnc.cfg config file.
*
* you can use different configuration files
* by specifying on the command line
* for example hpgl2cnc fanuc01.cfg or hpgl2cnc hurco.cfg
* these will need to be in the same directory as
* hpgl2cnc.exe unless you specify drive/directory.
*
* NOTE: hpgl2cnc generates only 2_1/2D moves, i.e. only 1 or 2
axis change in any one block.
*
* Lines begining with an astrisk are comments.
*
* All alpha values converted to upper case by the program.
*
* Settings shown are for an Emco F1 educational machining center,
and most and
* == MOST LIKELY NEED TO BE EDITED FOR YOUR CONTROLLER.==
*
* Be sure to use an editor program such as notepad or edit or
edlin that writes
* ==only plain ascii text== files with no formatting or other
control codes.
*
* Save a copy of this configuration file
* *BEFORE* you edit it as hpgl2cnc.org and set attributes to read
only.
*
* It is suggested that you complete the comment lines below
indicating
* what controller your configuration file suports when you modify
it.
* (and keep back-up versions)
* -- gmcd 07FEB2006 )
*
* edited configuration file data
* edited by: your name
* on: date
* for: your controller or machine name
*
* ==========================================
*
I , "unit output -- Inch/Imperial or Metric -- valid
values are I/M "
*
* ==========================================
*
% , "character used for controller comment line [ignore block]
9999 supresses comments"
*
* ==========================================
*
P , "decimal point character -- valid values are None, Point
for . and Comma for ,"
* NOTE: cannot input , directly
*
* ==========================================
*
3 , "number of digits in line number -- 0 suppresses [no N],
valid values are 0,3,4,5,6"
*
250 , "max number of lines you can cut-n-paste into your cnc
control program at one time"
* program will withdraw tool and home, write comment line, reset
line number counter to 25
* return tool to previous position and continue. Because
hpgl2cnc uses only straight line
* moves, cnc programs can be very large when arcs/curves are
involved.
*
* with 3 digit line numbers, max number of lines is 975 in any
one sub program
* with 4 diget line numbers, max number of lines is 9975 in any
one sub program
* with 5 digit line numbers, max number of lines is 99975 in any
one sub program
* with 6 diget line numbers, max number of lines is 999975 in any
one sub program
*
* ==========================================
*
1, " number of spaces between line number and 1st parameter? --
valid values are 0,1,2"
*
* =========================================
*
1 , "number of spaces between parameters? -- valid values are 0 ,
1, 2"
*
3 , "number of digits in XYZ cordinates -- valid values are
1,2,3,4,5,6"
*
4 , "number of decimals in XYZ cordinates -- valid values are
0,1,2,3,4,5,6"
*
Y , "leading zeros required for XYZ coordinates -- valid values
are Yes/No"
*
A , "does the minus sign [-] go before or after a negative
coordinate value -- Before /After
*
N , "include a plus sign [+] for positive coordinate values? --
Yes / No"
*
B , "Does the axis designator [XYZ] go Before or After the
axis vlaue?"
*
N , "space between XYZ axis designator and value? valid values --
Yes , No"
*
* ==========================================
*
A , "show all 3 coordinates or only changed coordinates in cnc
block -- All or Changed only"
*
* ==========================================
*
F , "feed rate designator -- generally F but any ascii string
255 characters or less"
*
2 , "number of digits in feed rates [F] -- valid values are
2,3,4,5"
*
1 , "number of decimal places in feed rate [F] -- valid values
are 0,1,2,3"
*
Y , "leading zeros required in feed rate? -- valid values Yes /
No"
*
N , "space required between F designator and feed rate value? --
valid entries are Yes / No"
*
B , "does the F go before or after the feed rate value? -- valid
entries are Before / After"
*
1 , "spaces between axis cordinate and feed rate -- valid vaues
are 0,1,2
*
E , "Feed rate specified for Each machining move or Modal --
valid values are E & M"
*
* ==========================================
*
G00 , "point-to-point straight line rapid traverse command --
generally G0 (G-zero)
* or G00 (g-zero-zero) but can be any ascii string 255
characters or less
*
*
G01 , "point-to-point straight line controlled feed command --
generally G1 G-one
* or G01 (G-zero-one) but can be any ascii string 255 characters
or less
*
* ==========================================
*
0.000 , "granularity or minimum move from X1,Y1,Z1 == X2,Y2,Z2"
*
* units are what ever you selected above Inch/Imperial or
Metric
* set to zero for best possible resolution. larger values will
produce smaller,
* faster running programs but detail and smoothness of curves may
be degraded.
* NOTE: HPGL plotter units are 40 per m/m or 1016 per inch, so
best possible
* accuracy is 0.001 inches or 0.025 m/m per axis.
*
* ========= NOTES =================
*
* NOTE: HPGL2CNC outputs 2_1/2D moves, i.e. only 2 axis moves in
any one block.
*
* Internally, HPGL2CNC uses PowerBasic long-word [unsigned long
integer]
* variables for the plotter value storage
* and converts to the desired inch/imperial or metric units using
double precesion variables
* before rounding to your indicated accuracy.
*
* PowerBasic's website is http://www.PowerBasic.com if you would
like more details
* Their manual is on-line.
*
* maximum unsigned long-word PowerBasic value is 4,294,967,295.
*
* At 1016 plotter units per inch this is a maximum size per side
of
* 4225361.511 inches, 352113.4592 feet or 66.68815516 miles.
*
* At 40 plotter units per m/m this is a maximum size per side of
107324182.4 m/m,
* 107324.1824 meters or 107.3241824 KM.
*
* ==========================================