|
G-Wizard
Editor: Setup
The GWE Setup Tool is accessed from the button on the far right, or from the Tools Setup menu choice. It contains a variety of sub-tools accessed by a tab bar along the top:

The Setup Tool...
If you do nothing else with the Setup application, be sure to get your Imperial/Metric Units set, a Machine Profile Configured, and download a pre-defined CNC Controller using the "Browse" button next to the CNC Controller field on the Machine Profile. The rest is fine tuning.
The Setup tabs include:
Basics: This is where you decide whether your preferred units are Imperial (inches) or Metric and where you set up Machine Profiles that describe the basic capabilities of your machine tool. The Basics tab is nearly identical to Basics in the G-Wizard Calculator Setup, but the function is slightly different. In particular, you can download a CNC Controller for example. See below for more.
Tool Crib: The Tool Crib lets you define custom tools that are accessible when you go to do tool changes and such. It's also identical to the Tool Crib in the G-Wizard Calculator Setup.
Variables: The Variables tab lets you access the internal variables of your simulated CNC machine. These are variables accessible via programs using a "#" and a number.
Post: The Post tab is used to tell GWE how the dialect of g-code that your controller understands operates. It covers things like incremental or absolute IJK for arcs. Use the CNC Controller "Browse" button on the Machine Profiles to select a pre-defined controller such as Fanuc or Mach3.
G/M-Codes: The G/M-Codes tab tells GWE which G and M codes are enabled for your controller. You can turn every code on or off.
Files: The Files tab tells you where to find the various preferences files and lets you reset them to defaults if needed. It works the same as the Files tab in the G-Wizard Calculator Setup.
About: The About tab tells you a little about GWE, for example which version you're running.
We'll go into a little more depth on each one that's specific or different in GWE below. For Basics, Tool Crib, and Files, refer to G-Wizard Calculator Setup.
From a g-code perspective, be aware that the default for GWE is Mach3, which is very close to Fanuc in most ways. You will want to go through the various settings and change them to match the way your controller operates.
Basics
The Basics tab is all about setting the units, as well as selecting and defining machine profiles. Let's talk units first. When you change the units, it changes the units for the controls in the editor and it changes the grid but it does not change how the simulator interprets coordinate values in g-code. To change the coordinate value units, use G20 (inches) or G21 (mm). You can either use these in your program, or you can use them in the Setup G-Code under the post tab. So, for example, if your CNC comes up by default expecting mm, put a G21 in your startup g-code.
Always remember, G20 and G21 don't do unit conversion, they merely change how the numbers are interpreted. With G20, X0Y1 refers to X = 0 inches and Y = 1 inch. After a G21, X0Y1 refers to X = 0 mm and Y = 1 mm.
When we say it changes the units for the controls in the editor, that means it changes the units for the XYZ coordinate display down on the status bar, for the Info tab, for the Simulator information that appears below the backplot, and so on.
You can download a pre-defined CNC Controller configuration from CNCCookbook to save the effort of defining all the Post parameters. If you press "Browse" next to the CNCController field, you will see the following popup:

A list of pre-defined CNC Controllers that you can download...
For more on machine profiles, check out the G-Wizard Calculator Setup documentation.
Variables
The Variables tab lets you access the internal variables of your simulated CNC machine. These are variables accessible via programs using a "#" and a number and are primarily of interest to programmers writing macros (sometimes called "Parameterized Programming"). But even if you're not writing macros, you may need to access them to set up your work offsets or other offsets so that your g-code program will run properly.
Here is the Variables Tab:

The Variables Tab...
As you can see, the Variables Tab consists of a scrolling list of all the variables together with a set of controls at the top to help you quickly find the variable you're looking for. If you know its number, you can type that into the "Scroll to #" box and get there immediately. If you only know the general category of the variable, you can filter the list using the following buttons:
Locals: These are the so-called Local variables that run from #1 - #33. They're only used within macros to hold intermediate results (hence they are "local" to the macro). When power is turned off, local variables go back to a null value. See your controller manual for more on Local Variables.
Commons: Common variables run from #100 - #199 and #500 - #999. Common variables can be shared among your different macro programs, hence they are "Common". Their status when power is turned of is controlled by the "Volatility" setting under the "Post" tab. See your controller manual for more on Common Variables.
G53-G59 Work Off.: Work offsets are a powerful tool for letting the same program work on multiple parts (as well as many other users). The offsets for G53-G59 are accessible via this button. See your controller manual for more on Work Offsets.
+48 Work Off.: Some controllers add another 48 work offsets beyond G53-G59
+300 Work Off.: And some controllers have still more work offsets, another 300!
System Vars: System variables can be used to read and write a variety of information when programming such as the machine's current position or tool compensation values. See your controller manual for more on System Variables.
Macro Parms: Macro parameters run from #6050 to #6089 and offer a way of passing parameters to your macro programs. See your controller manual for more on writing macro programs.
Tool Comp:These variables hold the offset values for Tool Length and Tool Diameter Wear compensation. See the Tool Data Managment page for more details.
Note: At the moment, the Variables Tab doesn't affect program execution at all and GWE doesn't yet understand macros!
Post
The Post Tab is where we really get into the guts of what makes each CNC Controller different. It's called the "Post" tab because its modelled on the "Post-Processor" concept common to CAM programs. They have to be able to cope with controller differences too. Here is the Post Tab:

The Post Tab has 2 sub-tabs:
General: General has everything not on the other tabs. Start with General when customizing GWE for your controller.
Numbers: Numbers controls what sorts of numbers can follow the individual letters that are the words in a g-code program. For example, is a decimal point required, can a number be negative, and so on.
Post | General Tab
Let's dive into the General Tab's options:
Startup G-Code
This is a one-line g-code program that is run to allow you to customize the simulator's initial state.
You may modify these as needed to initialize for your controller's initial state. Before the one line startup g-code is executed, the initial state is equivalent to the following:
- Machine initial position and motion mode: G0 X0 Y0 Z1 A0. You can override this position using G0 XYZ, for example.
- Feedrate: F0 G94 (Units/Minute Feed)
- Spindle: S0 M5 (0 rpm, spindle stopped)
- Coolant: M9 (Coolant off)
- Tool: No tool in the spindle
- Length and Cutter Comp: None
- Other: G17 (XY Plane) G54 (Starting work offset) G52 X0Y0Z0 (Local work offsets = 0) G20 (Units = Inches) G90 (XYZ are in absolute mode) G91.1 (IJK are relative) G64 (Best speed path) G99 (retract mode for canned cycles)
You should only execute codes that change these defaults as it would be redundant to reinstitute them (for example by putting an "M9" in the startup g-code). These codes will not appear on the backplot, but they will show up as currently active options in the simulator.
A typical use of the Startup G-Code would be to specify a G18 for a lathe. Many lathe controllers select G18 by default at startup.
G02/G03 Options
These are the options for how I, J, and K are interpreted for G02/03 arcs. Some controllers see these as incremental values, meaning they are relative to the current position. Some see them as absolute values. If you check the box, GWE expects incremental values. Uncheck it for absolute.
If you load a g-code file and see lots of crazy circles that are not what you expect in the backplot, you likely need to change the status of this box to match what your controller expects.
G51 Scaling Style
The exact syntax for G51 as well as its capabilities differ from controller to controller. GWE supports 3 styles:
Fanuc: "P" scales all axes or you can use IJK to provide a different scaling factor for each axis. XYZ gives the scaling center.
Haas: "P" scales all axes by that amount. IJK gives the scaling center.
Mach3: X, Y, and Z are scale factors for individual axes. The scaling center is the origin at 0, 0, 0.
See your controller manual to understand which file your machine expects.
Canned Cycles
There are lots of differences from one machine to the next in how canned cycles work. GWE offers two options you can change:
Mach3-style Canned Z: Before each initial move, this option will adjust Z to be >= R.
Canned Cycle Repeat: Fanuc uses "K" for repeat while Mach3 uses "L".
See your controller manual for more on how your canned cycles work.
#Var Volatility
This option controls which of the #-Variables are saved to disc when you exit GWE. Two styles are available:
Fanuc: Saves #500-#999
Haas: Saves #100-199, #500-699, and #800-999
Check your controller for more information.
M98 Subprogram Call
There are a lot of different syntaxes for an M98 subprogram call. Check your controller to see how yours works.
Note: At the moment, GWE doesn't handle M98 at all and most of these options are not implemented.
Post | Numbers Tab
The Numbers tab under Post is used to set the options for how the numbers found throughout a g-code program are to be interpreted. Each g-code word is a letter such as "G", "M", "F", or "S". Associated with each letter or group of letters is a set of options that determine what kinds of numbers can go with the letter.
Here is the Numbers tab:

The Numbers tab...
To use the Numbers tab, first select the letter you want to customize. Here are your choices:
O: The "O" word identifies programs. It is generally followed by a number that identifies a particular "N" line, so you typically want to use the same options with "O" that you use with "N".
N: The "N" word is used to label a particular block (a line of g-code) using a number. The number is typically 4 or 5 digits and must be positive.
G: "G" is for G codes like G01 and G2. Note the leading "0" when I wrote "G01". Some controllers care about that leading zero and some don't. You can tell G-Wizard whether to force a leading zero or not here.
F: "F" is for feedrate.
X: "X" is for any coordinate word including X, Y, Z, I, J, and K.
S: "S" is for spindle rpm.
M: "M" is for M codes (Miscellaneous codes). They're usually formatted just like G codes, so for example, you need a mandatory leading zero for single digit m-codes on your controller.
After selecting the desired letter, the Numbers will show the options associated with numbers for that letter in the left column and some examples on the right.
Let's go through our list of options:
| Option |
Purpose |
| "+" Required |
Determines whether a "+" sign is required for positive numbers. Some controllers require one. |
| "-" Allowed |
Determines whether the number can be negative. If so, it requires you to designate negative numbers with the minus sign. |
| Left of decimal "up to" checkbox |
If the "up to" box is checked, it means the number of digits can be any number up to the specified number. If it is not checked, the number of digits must be equal to the number specified, with leading or trailing zeros required to make up any shortfall. |
| Left of decimal digits |
The number of digits left of the decimal point. The whole number part. |
| Decimal mode |
|
| Right of decimal "up to" checkbox |
If the "up to" box is checked, it means the number of digits can be any number up to the specified number. If it is not checked, the number of digits must be equal to the number specified, with leading or trailing zeros required to make up any shortfall. |
| Right of decimal digits |
The number of digits right of the decimal point. The fractional number part. |
| Divisor |
After the number has been captured, but before it is used by the controller, it is internally divided by this value. |
In the righthand column are some tools designed to help you understand what the options you set are doing. You can enter samples into the "Try" box and see what G-Wizard thinks the value of the number is and whether it has any errors.
Below the "Try" box are a series of examples that show what will happen in various cases.
"Pattern" is a shorthand way of writing out the options that is used by a great many CAM programs as well as by utilities for postprocessing such as Posthaste. If you know the pattern of your number, being able ot see what pattern G-Wizard thinks you have set up should help you to match the two up.
When you've got the options the way you want them, press the "Save" button below. Note that each letter must be individually saved. You can also reset the options to the default letter by letter, or at the top is a button labelled "Reset All Letters" that will go through and change all of them to the original G-Wizard defaults.
Note that there is also a default format, which is chosen at the top right of the screen. When no format is defined for a particular address (letter), the format associated with the default is used.
G/M-Codes
The purpose of the G/M-Codes tab is to let you tell GWE which g-codes your controller actually implements. You can turn each one on or off in the "Enabled" column. If you turn off a g-code, GWE will do two things. First, it will ignore the code during program execution. Second, it will attach an error to that line to remind you the code is not allowed.
|