Save as G-code

  Conversion and Print >

Save as G-code

Previous pageReturn to chapter overviewNext page

Ribbon:  Output -> CAD to G-code

The program allows creating a control program (CP) in the G-code file format for CNC machines. G-code files are generated directly from DWG/DXF drawings. The following entities can be converted to G-code: lines, polylines, circles, arcs, ellipses, splines, texts, multiline texts and hatch.

To convert a file to G-code use the following instruction:

1.Open a DWG/DXF file and edit it if required.

2.On the Output tab in the Conversion group select the CAD to G-code command.

3.In the opened G-code window specify the contour for conversion. By default all drawing contours are converted. If you do not need to convert any particular contours, uncheck their names in the field on the left.

4.By default ABViewer generates a control program for a milling machine. To generate G-code for a laser machine select the required machine type in the G-code settings window on the General tab.

5.Click the button . G-code will be generated automatically.

6.Click the Save button . In the opened window enter the output file name and click Save. The file will be saved with the NC extension.

 

 

 

 

 

There is a toolbar under the G-code window name:

 

G-code settings. Opens the G-code settings window.

Save as. Opens the window to save the *.nc file.

Set a start point. Sets a new start point in the selected contour. To set a point select a contour in the preview pane. The option is available only for closed contours.

Convert to G-code. Generates a control program in the G-code format from the drawing.

 

Contour selection


Only contours selected with a check mark in the contour list are converted. When a contour name is selected in the contour list, the corresponding contour is highlighted in green in the preview pane.

 

Preview pane


On the CAD tab the preview pane displays the opened drawing, the workpiece zero point, the start point of the tool movement, tool direction, the tool lead in/lead out method and the tool. The elements display in the preview pane can be adjusted on the Color legend tab. The G-code tab displays the control program code.

The user can select the required contour by clicking it in the preview pane. The context menu is called with the right mouse button.

The Properties and Color legend tabs include tool settings and the preview pane legend.

Properties


The tab includes extended tool settings: tool direction, lead in/lead out method, tool radius compensation. These settings are displayed in the preview pane.

Change direction

Changes tool direction from the start point along the selected contour. To change direction click the button

Radius comp.

Tool radius compensation. The Off (G40) option discards tool radius compensation. The Leftward (G41) option compensates tool radius on the left of the trajectory. The Rightward (G42) option compensates tool radius on the right of the trajectory.

Lead in

Sets the tool lead in method. The user can select one of the following lead in methods: tangent, normal, arc.

To change the tool lead in direction click the button . Changes of the tool lead in method are displayed in the preview pane.

Change direction

Lead out

Sets the tool lead out method. The user can select one of the following lead out methods: tangent, normal, arc.

To change the tool lead in direction click the button . Changes of the tool lead out method are displayed in the preview pane.

Change direction

Tool params

The drop-down list includes the tool and its parameters. The list is completed with the data from the Tools tab of the G-code settings window.

Color legend


Additional elements that will be displayed in the preview pane are selected by checking the corresponding element in the Color legend tab. To change the element color the user needs to click the corresponding color square. After it the standard Color window in which the user can select the required color will be opened.

G-code settings


The G-code settings window includes the following tabs with settings: General, Milling machine, Laser (Cutting) machine, Workpiece zero point and Tools.

 

 

Settings

Description

CP Code Example

 

General

 

Forward direction

The tool moves in the direction pointed by the arrow in the preview pane.

-

Both directions alternately

At first the tool moves in the pointed direction and then backwards.

-

Machine type

Sets the machine type: Milling/Cutting.

-

Precision

Sets the number of digits after the decimal point.

-

Drawing units

Sets drawing units.

-

Machine units

Sets machine units are set. If units do not coincide, they are converted.

-

Add block numbering

Adds numbering of blocks in the control program code.

N5

 

Starting number

Initial number of block numbering (default value: 5).

Step of numbering

Step of numbering.

Add program name

Adds program name to the control program code.

O001

Show comments

Shows commentaries in the control program code.

(Layout "Model"), (Contour 0), (Contour 1)

Show percent sign (%)

Adds the sign % to the control program code.

%

 

Milling machine


Feed along Z

Speed of Z-direction cutting feed.

F150

Feed along XY

Speed of XY-direction cutting feed.

F450

Spindle speed

Rotation frequency of the spindle.

S3000

Feed depth along Z

Depth of penetration into a workpiece.

G1 Z-2

Retract height

Z-direction feed per one pass. The number of passes is calculated automatically.

M10 Q128/M11

Pass depth

Shifting of the tool from the workpiece in Z-direction.

G0 Z5

 

Laser (cutting) machine


ON command

Command used to turn on the laser. Default value: M3.

M3

OFF command

Command used to turn off the laser. Default value: M5.

М5

Dwell (G4)

Delay of the program run.

G04 P100

Feed along XY

Speed of the XY-direction feed. If the value is equal to 0, the feed value is not included into the control program.

F450

Add power commands (M10, M11)

Turns on/off power commands.

M10 Q128/M11

Number of passes

The number of tool passes along the contour.

-

 

Workpiece zero point

 

Drawing zero point

Setting the workpiece zero point.

-

Top left point

-

Top right point

-

Bottom left point

-

Bottom right point

-

Additional offset

Additional offset in X- and Y-directions.

-

 

Tools


No.

Number of the tool.

T1 M6

Diameter, mm

Diameter of the tool.

Length, mm

Length of the tool.

Go to ABViewer