The menus in the geometry program are user configurable. Each menu is stored in a file with the menu name and a .MNU extension. These menu files are text files with lists of menu items followed by a comma or semicolon and the command to be executed if that item is selected. Multiple commands can be executed for a given menu item by separating the commands with commas. Menu items are selected by moving the mouse cursor to that item and pressing any mouse key, or pressing the right mouse button (or F3) to select the highlighted item.
The mouse and menu system work together to create a powerful and flexible command processing system. Special commands exist to enhance the interaction of the mouse and menus. These commands allow interactive, prompted inputting of parameters such as geometry selection, names, and X/Y locations from either the mouse, or the keyboard. These commands are: "XN", " YN", " XY","PN", "LN", " CN", " SHAPEN", "SELECTION", "LAYERN", " RAD", " ANG", and "DIST". All of these commands, when used in the command line will prompt the user for an appropriate response, and then replace that command with the user input. The mouse keys work as described below for these commands.
XN asks the user for an X dimension (X/Point ?). This dimension can be typed in at the keyboard, selected with the left button of the mouse, taken as the X coordinate of the object picked with the center button of the mouse, or as the default X0 by pressing either [Enter] or the right mouse button.
YN asks the user for an Y dimension (Y/Point ?). This dimension can be typed in at the keyboard, selected with the left button of the mouse, taken as the Y coordinate of the object picked with the center button of the mouse, or as the default Y0 by pressing either [Enter] or the right mouse button.
XY asks the user for an XY position (X,Y/Point ?). This position can be typed in at the keyboard as two numbers (the X and Y dimensions) separated by a comma, selected with the left button of the mouse, taken as the X/Y coordinate of the object picked with the center button of the mouse, or as the default X0/Y0 by pressing either [Enter]. An [intersection] option is also available as indicated at the bottom right of the screen. This option is selected with the right mouse button. The user is then prompted for two selections, the X/Y input being taken as the intersection of the two.
ANG asks the user for an angle (Angle ?). The angle can be typed in at the keyboard, or a line can be selected with any mouse button. The angle of the line is then taken as the input angle.
RAD asks the user for an radius (Radius ?). The radius can be typed in at the keyboard, or a circle can be selected with any mouse button. The radius of the circle is then taken as the input radius.
DIST asks the user for a distance (Distance ?). The distance can be typed in at the keyboard, or a point can be digitized with the left mouse button, or an existing point picked with the center mouse button, and its distance from X0/Y0 will be the input distance. If either [Enter] is pressed or the right mouse button is pressed, then the default distance is used.
PN, CN, LN, SHAPEN, and LAYERN ask the user for an existing element of geometry (such as Point ?). The element number can be typed in on the keyboard (such as 3 for P3), or the element can be selected with either of the left two mouse buttons. This last element is selected by pressing the right mouse button or pressing [Enter].
SELECTION asks the user for an existing piece of geometry (Selection ?). This element name can be typed in on the keyboard as it would normally be specified (such as P2 for point number 2), or selected with the two left mouse buttons. A [window] option also exists as indicated at the bottom right of the screen. This option is selected by pressing the right mouse button and then inputting the two points defining the window. When window is selected, all elements completely in the window are chosen.
In addition to these commands, if a string of characters is enclosed in square brackets, then that string of characters will be used for the prompt, and anything typed as a response will be inserted into the command line in place of the square brackets and their contents.
The file MACH.CAM is a list of the machines supported by the system. Each machine will be listed in this file as the machine name, a search line number and string, and the machine type, all separated by commas. The machine names are used to identify the different N/C machines by name. The search line number and search string are used to identify a particular tape as being for a given machine. The tape will be searched for the search string on the specified line (or the entire tape if the search line is 0) for each machine one by one, until a match is found between that tape and a machine listed in MACH.CAM. The Machine type can be either MILL, LATHE, PUNCH, or CUTTER and tells the system which post-processor or check program to run for that machine.
Each machine has it own machine definition file with a file name of MACHn.DEF where the n indicates its position in the MACH.CAM file. for example, the second machine in MACH.CAM will use MACH2.DEF. This part of the manual explains the contents of the machine definition files.
The contents of the MACHn.DEF files can be broken up into three sections. The first section is the list of parameters and function names for that machine (such as maximum feedrate and the name of the rapid function), speed and tool change tables, and the SUB's that define the tape format for a given function. The following is a list of the parameters and function definitions found in the beginning of the MACHn.DEF file, with a description of each.
SMIN:nn Min spindle speed SMAX:nn Max spindle speed TAPSPEED:.5 Ratio of tap to drill spindle speed BORESPEED:3 Ratio of boring speed to drilling speed REAMSPEED:3 Ratio of reaming speed CARBSPEED:4 Ratio of speed for carbide tool TAPMAX:800 Max spindle speed used for tapping FMIN:nn Min feed rate FMAX:nn Max feed rate XMIN:nn Min X dimension XMAX:nn Max X dimension YMIN:nn Min Y dimension YMAX:nn Max Y dimension FIX:4 Number of places to use for converting numbers in POST ZFEED:.5 Ratio of Zfeedrate to X/Y feedrate BORE:.004 Inches per revolution for boring REAM:3 Ratio of reaming feedrate to drilling feedrate HOLETOL:.005 Tolerence for checking if a hole is the specified size CIRCTOL:.0005 Tolerence for linear moves approximating circular move ROTARY COMP:ON/OFF Turns on/off rotary X/Y compensation leaving edge of tool on centerline of cylinder COMMENTS:ON/OFF Enables/disables comments in source becoming comments in tape CHAMFER:.005 Chamfer amount automatically used when SPOT DRILL is used CLEARANCE:.1 Clearance for Drilling, Offset to bring in cutter comp TAPRAP:.4 Rapid height used for tapping ZTOOL:1 Default tool Z height after tool change LINEMODE:1 1 = normal, 2 = pt to pt CIRCMODE:1 1 = multiple quadrants, 2 = quadrants, 3 = pt to pt NUM:1,1 Number of places for line numbers, step ROTARY AXIS:X/Y Tells which axis is rotary
The following function definitions are strings of characters to be substituted for the function name when the SUB is executed.
ABS = G90 Go to absolute mode INC = G91 Go to incremental mode RAPID = G0 Go to rapid mode FEED = G1 Go to feed mode (NO + RAPID$ if default is FEED) CCW = G3 Circular move counter clockwise CW = G2 Circular move clockwise COMPLEFT = G41 Pull in cutter comp to the left COMPRIGHT = G42 Pull in cutter comp to the right COOLANTON = M8 Turn coolant on COOLANTOFF = M9 Turn coolant off SPINDLECWISE = M3 Turn spindle on clockwise SPINDLECCWISE = M4 Turn spindle on counter clockwise CONSTSPEED = G97 Run at constant speed (drilling etc.) SETSPEED = G96 Vary speed to maintain a set SFM DRILL = G81 Drill canned cycle PECK = G83 Peck canned cycle REAM = G82 Ream canned cycle BORE = G86 Bore canned cycle TAP = G84 Tap canned cycle
The following are used only to tell the CHECK program how to identify the specified function in the tape:
BLOCKDLT = / Do not execute this line in tape REF = G72 Define reference pt PUNCHLINE = G79 Punch line NIBBLELINE = G69 Nibble line NIBBLEARC = G68 Nibble arc PUNCHRCT = G66 Punch rectangle WD = I Width HT = K Height XSTP = P X step YSTP = Q Y step ANG1 = J 1st angle ANG2 = K 2nd angle TOOLANG = C Rotation angle of tool CANCANCEL = G80 Cancel canned cycle THREAD = G76 Threading canned cycle ROUGHTURN = G71 Rough turn cycle CHANGETOOLS = M6 Start tool change XCODE = X X coordinate YCODE = Y Y coordinate ZCODE = Z Z coordinate ICODE = I X ctr JCODE = J Y ctr KCODE = K Z ctr RAP = R Rapid level SCODE = S Spindle speed FCODE = F Feedrate ECODE = E Feedrate per revolution TCODE = T Specifies tool number STEP = Q Step for pecking ZMOVE = Z Start showing tool after tool Change HCODE = H Bring in tool height offset (AUTO means do it at tool change) INITON = G98 Return to intial point INITOFF = G99 No return to intial point TOOLNUM = NORMAL Describes tool # location change (also LATER, LAST) TOOLFORMAT = T0101 if like lathe TOOLSET = TOOL - Show tool description in tape TOOLDLT = FALSE TRUE if toolchanges have block delete char SETPOS = G92 Set position CALLSUB = M98 Call subroutine LINESUB = P Line number of subroutine NUMSUB = L Number of times to execute sub RETSUB = M99 Return from sub ZERORET = G28 Return axis to machine zero PROGSTOP = M0 Program stop PROGEND = M30 Marks end of program
The tables in the machine definition files hold the data for looking up speed codes and tool change parameters. Machines with speed codes that are not capable of taking actual spindle speeds specified as S codes need a speed table. When choosing the speed code for a particular speed, the table is searched forward for a drilling or milling operation, and backward for tapping. This is intended to give the POST a chance to use the highest torque for milling and drilling, and the smallest torque for tapping.
A table is also used for tool holders on the PUNCH type machines. This table shows the minimum and maximum sizes of the tools that can be held by a certain holder, and whether it is rotatable.
The format of these tables is as follows:
SPEED TABLE
n:speed n:speed
...
n:speed
END TABLE
TOOL TABLE
TOOLn MIN:nn MAX:nn ROT
TOOLn MIN:nn MAX:nn
...
TOOLn MIN:nn MAX:nn
END TABLE
SUB Declarations:
The SUB declarations are used to define the format of certain basic command lines in the finished tape. The format of the SUB declaration is as follows:
SUB name
executed lines...
END SUB
Where name is the name of the basic function represented by this SUB routine. The following is a list of the functions supported by the POST's and the SUB's in MACHn.DEF that will be executed for each of these.
Function SUB executed by POST (from MACHn.DEF)
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
StartUp StartUp TOOL ToolChange MILL RapidXY, RapidZ, FeedZ, StartComp, FeedXY Ccw Cw, CancelComp, RapidZ ROUGH TURN RoughTurn, RapidXY, StartComp, FeedXY, Ccw, Cw, CancelComp, RapidXY TURN RapidXY, StartComp, FeedXY, Ccw, Cw, CancelComp, RapidXY THREAD Thread FACE RapidXY, FeedXY, RapidXY CUT OFF RapidXY, FeedXY, RapidXY GRID GridDef, GridStart, GridEnd, Grid PUNCH NibbleLine, NibbleArc PUNCH PunchXY DRILL Drill first time, then RapidXY TAP Drill first time, then RapidXY BORE Drill first time, then RapidXY REAM Drill first time, then RapidXY STOP ProgramStop END EndProgram MANCODE ManCode
Lines in SUB routines are executed by replacing certain strings with their determined values and then making that line from the SUB the next line of the finished tape. Lines in these SUB's can be conditionally executed by using the IF function. If the expression after IF is non-zero, then the next lines are executed, otherwise they are not. ELSE can also used to break up IF statements into two parts, one to be executed if IF is true and one to be executed if IF is FALSE. IF statements follow this format:
IF expr THEN
executed lines...
ENDIF
IF expr THEN
executed lines...
ELSE
executed lines...
ENDIF
Possible IF statement parameters are:
NOT INSIDE OUTSIDE > < = "user string" - True if user string found in tool name or command. For example, IF "TAP" will be TRUE if TAP is found in the tool name or the command being executed.
firsttool - True if this is the first tool
rotary - True if rotary axis enabled
Executed Lines in a SUB routine are handled as follows: First substitutions are made for the following strings:
x1 -> 1st X y1 -> 1st Y z1 -> 1st Z x2 -> 2nd X y2 -> 2nd Y z2 -> 2nd Z xpos -> Current X position ypos -> Current Y position zpos -> Current Z position i1 -> Incremental X to Xctr j1 -> Incremental Y to Yctr r1 -> Rapid height a1 -> 1st angle (in degrees) a2 -> 2nd angle (in degrees) lasttool -> Last tool number nexttool -> Next tool number changetools -> Code that starts a tool change tool1 -> Tool number of first tool toolname -> Current tool name tool -> Current tool number partname -> Part name specified on first line of SOURCE speedcode$ -> ConstSpeed$ or SetSpeed$ (Lathe) speed -> RPM (or SFM for SetSpeed$ on lathe) zfeedrate -> inches / minute for Z feed feedrate -> inches / minute (inches per rev on lathe) smax -> Max spindle speed allowed cut -> Amount of each cut for threading on lathe depth -> Depth of cut for threading on lathe threads -> threads per inch width -> PassWidth thread -> Thread$ (Lathe) roughturn -> RoughTurn$ (Lathe) stnum -> Start Number for RoughTurn (Lathe) subnum -> Number of lines for RoughTurn (Lathe) grid -> Grid number (Punch) clp -> Amount trimmed off edge (Punch) dst -> Distance of Punch/Nibble Line (Punch) trx -> 2nd tool radius (Punch) tr -> Tool radius spindleon -> SpindleCw$ or SpindleCcw$ can -> Drill$, Peck$, Bore$, Ream$, Tap$ step -> Step$ if incr <> 0 incr -> Pecking amount if incr <> 0 comp -> CompLeft$ or CompRight$ coolanton -> CoolantOn$ if COOLANT enabled coolantoff -> CoolantOff$ if COOLANT enabled abs -> Abs$ if not already absolute mode inc -> Inc$ if not already incremental mode rapid -> Rapid$ if not already rapid mode feed -> Feed$ if not already linear feed mode ccw -> Ccw$ if not already ccw feed mode cw -> Cw$ if not already cw feed mode // -> / after domath
Then if the line is not a comment, all math expressions are executed:
domath: (): PI SIN COS TAN ATN SQR * / - + FIXnn,n INTnn TRAILnn,n LEADnn,n []
The POST always keeps track of X,Y,Z,F trim dimensions. It then expands Nn into N and the line number of that line in the tape according to the NUM parameter. The line then becomes a line in the tape code.
Send mail to webmaster@swe-eng.com with questions or comments about this web site.
Please read our Usage Rules before using any information from this site.
Copyright © 2000 SWE Engineering
Last modified: June 10, 2002