Software/Zaber Console/GCode Translator Tab
The G-Code Translator tab for Zaber Console allows G-Code (also known as RS-274) commands to interface with Zaber devices using streamed motion commands.
Compatible Devices
The G-Code translator outputs Zaber ASCII stream commands. Stream commands are only available on the following Zaber devices:
3-axis:
- X-MCC3
2-axis:
- A-MCB2 (fw version 6.12+)
- X-MCB2
- X-MCC2
1-axis:
- A-Series devices (fw version 6.16+)
- X-Series devices
Setup
|
Operation
Translating
- Press "Open" then select the file that contains your G-Code. It will be displayed in the dialog on the left.
- Press "Translate".
- If there are any warnings or errors, they will be highlighted in your code. While warnings won't prevent translation, it's recommended that you check each one. Errors will prevent translation and must be fixed.
- Move your mouse over any highlighted warnings or errors for details. Press the left or right arrows to move to the previous or next highlighted section.
- Resolve any warning or errors, then press "Translate" again. Contact Zaber Technical Support if you are unsure how to resolve a warning or error.
- If you have made changes to the G-Code to resolve errors, it's recommended that you save it to a new file using the "Save As" button
Exporting & Running
- If you would like to run the output from the plug-in, you must have the compatible device connected with the Serial Port open.
- Press "Run" to execute the entire program. To stop during movement, press "Stop".
- Press "Step" to execute the next line of the program, starting from the beginning.
- If you would like to create a script for Zaber Console that can be run through the Scripts tab, make sure that Script is selected from the dropdown list and press "Export as..." to save it. Currently only C# scripts are supported.
- If you would like to use the list of commands in other software, choose "ASCII Commands" from the dropdown list and press "Export as..." to save the list as a text file.
Examples
A folder with example files is available here: G-Code Examples. It contains G-Code files with sample shapes (*.ngc format), as well as a sample configuration for the ASR100B120B-T3 (*.cfg format) that can be imported through the "Edit Config" menu. This configuration has several examples of M-Codes mapped as well to control digital outputs.
Notes
- All programs must start with a G00, G01 or G28 command in order to establish a reference position.
- A G00 or G01 command that is used to establish reference position must specify a position for all axes. For example, in a configuration with the X and Y axis enabled and Z disabled,
G90 G0 X0 Y0
would be a valid reference-establishing command butG90 G0 X0
would be invalid. - A G28 command that is used to establish reference position must either specify a position for all axes or specify no axis parameters at all. For example, in the same configuration as above, both
G90 G28 X10 Y10
andG90 G28
would be valid reference-establishing commands butG90 G28 X10
would be invalid.
- A G00 or G01 command that is used to establish reference position must specify a position for all axes. For example, in a configuration with the X and Y axis enabled and Z disabled,
- All programs must begin with a F command to set the feed rate.
- All axes used in the G-Code must be mapped to axes of the connected Zaber device, or set to be ignored, in the Configuration Manager. For example if your Zaber device has 2 axes that are mapped to X and Y in the Configuration Manager, and the G-Code has commands to move axis Z, these commands must either be removed or the behaviour of the Z axis must be set to "Ignored".
Configuration Settings
General Settings
The device address is the address of the device that will be used to carry out commands. This number is 1 if no other devices are connected and the address has not been modified.
The stream number is the index of the stream that will be used to carry out commands. This number is 1 in most cases.
The traverse rate is the speed that will be used during G00 and G28 motion. This measurement is in device units, which is equivalent to (value / 1.6384) μstep/s.
The feed rate override is the multiplier that will be applied to all feed rates given. A multiplier of 100% is the default, and causes the feed rate to remain at its normal value.
If optional block delete is selected, lines in the source code starting with the '/' (forward slash) character will be ignored.
M-Codes can be remapped to custom functions.
It is highly recommended to use stream commands in the remapping, as non-stream commands will not be executed in sequence with the rest of the stream, causing extremely unpredictable behaviour.
For example, to remap M3
(Spindle On Clockwise) to turning on external I/O pin 4 and then pausing 100 ms, select M3 and enter /stream 1 io set do 4 1 /stream 1 wait 100
.
Work Coordinate Systems can be defined by selecting the name of the offset and entering a set of offsets for the axes.
By default, coordinate system G54 is identical to machine coordinates, with offsets of 0 from Machine Home (Machine Zero).
For example, to set coordinate system G58 to offset the X axis by 2.0, enter 2.0, 0.0, 0.0
in the box.
If any of the given axes are not enabled, the corresponding coordinate offset will be ignored.
The units of the offset are determined by the selection of G20 and G21. Therefore, if the units are changed in the middle of the program, offsets will change as well.
Axis Settings
Individual axis settings can be changed by first selecting the desired axis from the "Axis" drop-down.
The behaviour setting of the axis describes how the axis behaves.
Enabled
enables the axis for regular use.Disabled
produces an error if the axis is used in any movement.Ignored
no error will be produced for movements this axis is used in, but no output corresponding to that axis will be produced. It is still an error to interpolate an arc on a plane that contains anignored
axis.Passthrough
movements this axis is used in will be passed through to the output, with a # symbol prefixing the line in exported code. The movement size will be converted to microsteps. For example, the GCode lineG0 Z3
may be output as# G0 Z19200
. The purpose of this is to enable 'slice' type 3-axis movements, where two axes create a slice, then the third axis moves to the next slice. Please contact Zaber Customer support if you need assistance using this feature.
The axis number is the address that the axis will be addressed with.
The microstep size is the physical length of one microstep and is used to translate between real-world units to microsteps. This value can be found on the product's specification page.
The min position is the minimum position that the axis can move to, and is equivalent to the axis' limit.min setting. This value doubles as the machine home, or machine zero for that axis.
The max position is the maximum position that the axis can move to, and is equivalent to the axis' limit.max setting.
Using the Translator Outside Zaber Console
It is also possible to access the translator functionity from a .NET project.
Please refer to https://zaber.com/support/docs/api/gcodetranslator-csharp/ for the API documentation.
Using Flow Control in G Code translator
Currently no form of flow control is supported in our G Code translator.
- Example: While loops, For loops, Repeat Until
RS274 Standard Implementation Reference
G00
Linear Interpolated Traverse
Group: Motion
Moves the device in a line, at traverse speed to the destination which is defined by X, Y, and Z parameters. This movement must specify parameters for all enabled axes in order to establish a reference position.
G01
Linear Interpolated Feed
Group: Motion
Moves the device in a line, at feed speed to the destination which is defined by X, Y, and Z parameters. This movement must specify parameters for all enabled axes in order to establish a reference position.
G02
Circular Clockwise Interpolated Feed
Group: Motion
Moves the device in a clockwise arc, at feed speed to the destination which is defined by X, Y, and Z parameters. The circle will be on the plane defined by one of G17, G18, or G19. If the axis perpendicular to the plane is made to move, the circle will be a helical motion where the third axis is interpolated linearly to its destination. NB: Helical movement is NOT supported by Zaber devices at the time of writing. The circle’s origin can be defined in two ways:
- Radius format, by specifying an R parameter that corresponds to the radius of the circle that will be drawn out.
- If R is positive, the arc will take the route that is less than 180 degrees; otherwise, the arc will take the route that is greater than 180 degrees.
- Using radius format arcs for near-semicircles and near-circles is highly discouraged as small changes in parameters cause large changes in the path.
- It is an error if R is less than half the distance between the starting position and end position.
- It is an error if the starting position is equal to the end position.
- Center format, by specifying the location of the center of the circle with I, J, and/or K parameters for the X, Y, and Z axes, respectively.
It is an error to interpolate a circle on a plane with an ignored axis (see the Configuration Settings section).
G03
Circular Counterclockwise Interpolated Feed
Group: Motion
See G02.
G04
Dwell
Group: None
Pauses the controller for a duration of time specified by the P parameter, in seconds. It is an error if P is negative.
G17 G18 G19
G17: XY Plane Select
G18: XZ Plane Select
G19: YZ Plane Select
Group: PlaneSelection
Chooses the plane on which circular interpolation (G02, G03) happens.
The default plane is G17
(XY Plane Select).
G20 G21
G20: Inches Select
G21: Millimeters Select
Group: Units
Chooses the units that are used in measurements. This affects all distance parameters, including, but not limited to, X, Y, Z, I, J, K, and F. If the unit is changed, the feed rate will remain at its previous value until another F command is given. It is not recommended to change this setting at any location in the program other than the beginning.
G28
Return to Machine Zero
Group: Non-Modal Motion
When specified with no X, Y, or Z parameters, moves at traverse speed to machine zero. When specified with distance parameters, moves the selected axes first to the designated position, then moves only the selected axes to their axis zero.
To move only the Z axis to machine zero, enter the command G28 G91 Z0
.
G30
Return to Secondary Machine Zero
Group: Non-Modal Motion
See G28. Some machines have additional (secondary) machine zero positions, which can be selected using a P parameter. NB: No Zaber devices have secondary machine zeroes.
G40 G41 G42
G40: Tool Radius Compensation Cancel
G41: Tool Radius Compensation Left
G42: Tool Radius Compensation Right
Group: RadiusCompensation
Specifies the side of radius compensation that will happen. NB: The translator does not support radius compensation at the time of writing this manual.
G43 G44 G49
G43: Tool Height Compensation Positive
G44: Tool Height Compensation Negative
G49: Tool Height Compensation Cancel
Group: LengthCompensation
Specifies the direction of length compensation that will happen. NB: The translator does not support length compensation at the time of writing this manual.
G53
Machine Coordinate System
Group: CoordinateSystem
Clears the coordinate system selection for only the current block, and interprets all distances relative to machine zero.
Subsequent blocks will return to the coordinate system that was selected before issuing G53
.
G54 G55 G56 G57 G58 G59 G59.1 G59.2 G59.3 G54.1
Work Coordinate System Select
Group: CoordinateSystem
Sets the current coordinate system. G54
is selected by default. See the Configuration Settings section.
G61
Exact Stop Select
Group: PathControl
Turns on exact stopping. Upon reaching a corner between path segments that is not "smooth", the device will slow down to ensure that the corner is sharp. This is enabled by default.
G64
Corner Rounding Select
Group: PathControl
Turns off exact stopping. Upon reaching a corner between path segments that is not "smooth", the device will trim the corner in an arc to maintain continuity and velocity. NB: The translator does not support corner rounding at the time of writing this manual.
G90
Absolute Positioning Select
Group: Distance
Sets X, Y, and Z parameters to be interpreted as absolute distances from the current work offset. This affects G00, G01, G02 and G03.
G91
Incremental Positioning Select
Group: Distance
Sets X, Y, and Z parameters to be interpreted as incremental distances from the current position. This is selected by default. This affects G00, G01, G02 and G03.
G90.1
Absolute Arc Positioning Select
Sets I, J, and K parameters to be interpreted as absolute distances from the current work offset. This affects G02 and G03.
G91.1
Incremental Arc Positioning Select
Sets I, J, and K parameters to be interpreted as incremental distances from the current position. This is selected by default. This affects G02 and G03.
M2 M30
Program Stop
Stops the program. All commands that appear after M2
or M30
are ignored.
F
Feed Rate Set
Sets the feed rate to the value specified with the F command. The value is in units of units per minute, where the unit is determined based on the selection of G20 or G21. It is an error if the value specified is less than or equal to 0.
%
Percent Demarkation
All lines that start with a '%' (percent sign) are ignored. To delimit a file, use M2 or M30 instead.