WEIHONG ELECTRONIC Ncstudio Owner's manual

Ncstudio
PC-BASED NUMERIC CONTROLLER
PROGRAMMING MANUAL
Where there is motion control
there is WEIHONG

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused i
Thank you for choosing our products!
This manual will help you acquaint with our products and learn the information about
programming command system.
This manual makes a detailed introduction to the thought of system software programming and
the command system of programming, as well as to system software support of PLT, CAM, and DXF.
Before using the products and relative machine equipment, carefully read this manual to have a better
use of them.
Because of continuous update in hardware and software, it is possible that the software and the
hardware you have received differ from the statement in this manual.
Company address, phone number and our website are listed here for your convenience. Any
questions, please feel free to contact us. We will always be here and welcome you.
Company Name: Weihong Electronic Technology Co., Ltd.
CompanyAddress: No. 29, 2338 Duhui Rd., Minhang, Shanghai
Zip Code: 201108
Tel: +86-21-33587550
Fax: +86-21-33587519
Website: http://en.weihong.com.cn
E-mail: sales@weihong.com.cn

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
ii Specialized, Concentrated, Focused
Contents
1 New Functions...........................................................................................................................1
2 Summarization of CNC Programming.....................................................................................2
2.1 Summarization of CNC Programming....................................................................................2
2.2 Summarization of CNC Machine Tool.....................................................................................2
3 Structure of Machining File......................................................................................................5
3.1Address Symbols and Functions ............................................................................................5
3.2 Format of Program Block........................................................................................................6
3.3 Format of Subprogram............................................................................................................6
4 Programming Instruction System............................................................................................7
4.1 Spindle Function (S), Feed Function (F) &Tool Function (T)..................................................7
4.2 Miscellaneous Function M Code.............................................................................................8
4.3 Preparatory Function G Code.................................................................................................8
4.4 Advanced Functions..............................................................................................................51
4.5 Expressions Used in Program Instructions...........................................................................55
4.6 Comments in Program..........................................................................................................56
4.7 Demonstration of Machining File Programming...................................................................56
4.8 G Command Appendix..........................................................................................................61
5 Named Parameters..................................................................................................................63
6 Customize and Extend Command M.....................................................................................68
7 PLT Support..............................................................................................................................69
8 DXF Support.............................................................................................................................70

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 1
1 New Functions
1) New command M802 P458752 is used for clearing the external offset. For detailed
information please refer to chapter 4.4.
2) New command G921 is used for specifying the workpiece coordinates of current point in the
current coordinate system. For detailed introduction please turn to chapter 4.3 ―commands
related to coordinate system and coordinates‖.
3) New command G922 is used for setting the machine coordinate of the origin of the specified
workpiece coordinate system. For detailed introduction please refer to chapter 4.3
―commands related to coordinate system and coordinates‖.
4) New support for circle, bias and chessboard drilling cycle command (G34, G35, G36, and
G37). For detailed introduction please refer to chapter 4.3 ―special canned cycle‖.
5) New rotation function commands G68/G69, for detailed introduction please refer to chapter
4.3 ―G68/ G69 coordinate system rotation function commands‖.
6) New mirror image function commands G50.1/G51.1, for detailed introduction please refer to
chapter 4.3 ―G50.1/ G51.1 mirror image function commands‖.
7) New command G923 is used for direct tool offset setting, for detailed introduction please
refer to chapter 4.3 ―G923 directly set tool offset‖.
8) Strengthened function for command G906 to test if the specified port is timeout. For detailed
introduction please refer to chapter 4.4.
9) New command M903 is used for modifying the current tool number. For detailed introduction
please refer to command M list in chapter 4.4.
10) Command G92 is taken as invalid command in the array machining, and should be deleted
manually. For detailed introduction please refer to chapter 4.3, ―commands related to
coordinate system and coordinates‖.
11) Refer to chapter 4.4 for new function of naming a subprogram.
12) Improvement of command G904: the usage of PLC address; keywords of PX, PY, PZ are
compatible with PLC address and equal mark expression.
13) Improvement of M901 and G906: the usage of PLC address; new keywords ―PLC‖ and
―LEVEL‖; and PLC keywords are compatible with [PLC address] and equal mark expression.
14) New command G992 allows the translation of coordinate system. For detailed introduction
please refer to ―G992 temporarily set WCS according to tool position‖ in chapter 4.3.
15) New command G28 is used for backing to the reference point. For detailed introduction
please refer to chapter 4.3, ―G28 auto back to reference position‖.
16) New commands related with encoder. For details, refer to ―G codes related with encoder‖ in
chapter 4.3.

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
2 Specialized, Concentrated, Focused
2 Summarization of CNC Programming
2.1 Summarization of CNC Programming
Definition of Machining File
Composed of a series of instructions written in a programming language which is specially used
for CNC device, a machining file will be translated into motion actions to control the machine tool by
CNC device. The most commonly used storage mediums are punched tape and disk.
Creation of Machining File
As shown in Fig. 2-1 below, a machining file can be created by traditional manual programming
or CAD/CAM application (Such as the popular MasterCAM application).
Fig. 2-1 Creation of a Machining File
2.2 Summarization of CNC Machine Tool
Machine Tool Coordinate Axes
To simplify programming and guarantee the generality of program, this manual has standardized
the naming of coordinate axes and the direction of CNC machine tool. Linear feeding coordinate axes

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 3
are denoted by X, Y and Z, which are normally referred as basic coordinate axes. The correlation of X,
Y and Z axes follows ―the Right Hand Rule‖, as shown in Fig. 2-2. The thumb points in the +X
direction, the index finger points in the +Y direction, and the middle finger points in the +Z direction.
+Y
+X
+Z
+Y
+C +A
+B
+Z
+X
+Y
+X
+Z
+X+Y+Z
+A+B
+C
Fig. 2-2 Machine Tool Coordinate Axes
Circle feed coordinate axes swiveling around X, Y and Z are respectively denoted byA, B, and C.
According to the Right Hand Screw Rule, the thumb points in +X, +Y and +Z direction, while the index
and middle finger points in +A, +B, and +C direction of circle feed motion. The feed motion of CNC
machine can be realized by spindle driving the tool or the worktable driving the workpiece. The
positive directions of coordinate axes mentioned above are directions of tool feeding relative to the
supposedly stationary workpiece. If the workpiece is kinetic, the coordinate axes are marked with ―’‖.
According to relative motion, the positive direction of workpiece movement is opposite to that of tool
movement, that is:
+X =-X’, +Y =-Y’, +Z =-Z’
+A =-A’, +B =-B’, +C =-C’
Likewise, their negative directions are contrary to each other.
The directions of machine coordinate axes depend on the type of machine tool and the layout of
each component. For a milling machine:
Z: Z-axis coincides with the main spindle axis, and the direction of tool moving away from
workpiece is the positive direction (+Z);
X: X-axis is perpendicular to Z-axis and parallel to the clamped surface of workpiece. For a single
column vertical mill, if the user faces the spindle and looks in the column direction, right moving
direction is the positive direction of X-axis (+X);
Y: Y-axis, X-axis and Z-axis together constitute a coordinate system abiding by right hand rule.

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
4 Specialized, Concentrated, Focused
Machine Origin (MO) and Machine Reference Point (REFER) of
Machine Coordinate System (MCS)
MCS is the intrinsic coordinate system of machine tool. Known as machine origin or machine
zero point, or home position, the origin of MCS is confirmed and fixed after designing, manufacturing
and tuning of machine. The CNC device doesn’t know where machine origin is when power on, and
the mechanical stroke of each coordinate axis is limited by maximum and minimum limit switch. To
correctly set MCS at machining, we normally set a machine REFER point (the initial point of
measurement) within the stroke range of each coordinate axis. After starting the machine, it is
necessary to back to REFER point manually or automatically so as to create the MCS. The REFER
point can coincide with MO or not. If not, the distance frommachine REFER point to MO can be set by
parameter setting. After the machine returns to the REFER point, the machine origin, which is the
reference point of all coordinate axes, is confirmed, so the MCS is established. The stroke of MCS is
defined by the machine tool manufacturer, while the valid stroke of MCS is defined by software limit.
The relationship between machine origin (OM), machine REFER point (Om), the mechanical stroke
and valid stroke of MCS is as shown in Fig. 2-3.
Mechanical Stroke along X-axis (Limit)
Valid Stroke along X-axis
Valid Stroke alongY-axis
Mechanical Stroke along Y-axis
Y
O m
O M
X
Fig. 2-3 Machine Origin OM and Machine REFER Om

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 5
3 Structure of Machining File
A machining file is a group of instructions and data transmitted to the CNC device, and it is
composed of program blocks which follow a certain structure, syntax and format rule, while each
program block is composed of command words. See Fig. 3-1.
N01 G91 G00 X50 Y60
N10 G01 X100 Y500 F150 S300 M03
N……
N200 M02
Program
block
Command
word
Fig. 3-1 Program Structure
3.1 Address Symbols and Functions
Address symbols and definitions are as shown in Form 3-1.
Form 3-1 Address Symbols
Address
Symbol
Description
B: Basic Function
O: Optional Function
D
Cutter radius offset number
B, O
F
Feedrate function
B
G
Preparatory commands
B, O
H
Tool length offset
B
I
Arc center modifier for X axis
B, O
J
Arc center modifier for Y axis
B, O
K
Arc center modifier for Z axis
B
L
Repetition count
B, O
M
Miscellaneous function
B
N
Sequence no. or block no.
B
O
Program no.
B
P
Dwell time in milliseconds, subprogram no.
call, custom macro no. call, block number in
main program when used with M99
O, B
Q
Depth of peck in fixed cycles G73 and G83
Shift amount in fixed cycle G76 and G87
O
R
Retract point in fixed cycles
O, B

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
6 Specialized, Concentrated, Focused
Address
Symbol
Description
B: Basic Function
O: Optional Function
Arc radius designation
S
Spindle speed in r/min
B
T
Tool function
B
X
X axis coordinate value designation
B
Y
Y axis coordinate value designation
B
Z
Z axis coordinate value designation
B
3.2 Format of Program Block
A program block defines a line of instructions to be executed by CNC device. The format of
program block defines the syntax of function word in each program block, as shown in Fig. 3-2.
N.. G.. X.. F.. M.. S..
Program Block No.
Preparatory F.
Dimension W. Feed F.W.
Miscellaneous F.W.
Spindle F.W.
F.: Function
W.: Word
Program Block
Fig. 3-2 Format of Program Block
3.3 Format of Subprogram
A subprogram is a section of machining codes which can be called repeatedly. It must begin with
the address word O and subprogram no. as the first line and end with M17 as the last line. On
principle, commands like M30 and M17 are not allowed to appear among the subprogram, but nested
subprogram is acceptable.

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 7
4 Programming Instruction System
4.1 Spindle Function (S), Feed Function (F) &Tool Function (T)
Spindle Function S
Command Format: S_
Description:
S command is used to control the spindle speed. Its subsequent numerical value denotes the
rotate speed of spindle in rpm.
S is a modal command, and S function is valid only when the spindle speed is adjustable. When
one S command is specified, it will be valid until the next S command is specified.
Note: even though the spindle is off, the value of S remains.
Feed Speed (Feedrate) F
Command Format:F_
Description:
Command F indicates the synthetic feed speed of tool relative to the workpiece being machined.
Its unit is mm/min.
With the help of feedrate override switch on the operation panel, F can be adjusted between
feedrate percent 0% -120%.
F functions differently with different commands:
G00 command, specifying the rapid traverse speed, modal for the current machining procedure.
G01~G03 command, specifying the feed speed, modal for the current machining procedure.
Tool Function (T Feature)
Command Format: T_
Description:
T is used for selecting a tool; the subsequent value denotes the tool no. selected, and the
relationship between T code and a tool is stipulated by machine tool manufacturer.
When a machining center runs T code, tool magazine will rotate to select the required tool, and
wait until command M06 comes into effect to finish automatic tool change.
T command calls in tool compensation value (including length and radius) from the tool

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
8 Specialized, Concentrated, Focused
compensation register. Although T command is a non-modal instruction, the value of tool
compensation invoked is effective until a new value is invoked for the next tool change.
4.2 Miscellaneous Function M Code
Miscellaneous function is composed of address word M and its subsequent number of one to
three digits. It is mainly used to control the running of machining file and on/off of machine
miscellaneous functions.
M function has non-modal and modal forms:
Non-modal M function: it is effective only in the program block containing it.
Modal M function: a group of M functions that can be mutually cancelled; an M function remains in
effect until another M function in the same group appears to cancel it.
Form 4-1 Miscellaneous Function M Code
M Code
Meaning
M Code
Meaning
M00
Compulsory program stop
M11
Spindle unclamp
M01
Optional program stop
M17
Subprogram return
M02
End of the program
M30
End of program, and return to program top
M03
Spindle on (CW rotation)
M98
Subprogram call
M04
Spindle on (CCW rotation)
M99
End of subprogram, and return to the
beginning of main program for continuous
execution
M05
Spindle stop
M801
String info transmission between modules
M06
Automatic tool change
(ATC)
M802
Integer info transmission between modules
M08
Coolant on
M901
Directly control output port
M09
Coolant off
M902
Directly set REF.
M10
Spindle clamp
M903
Change current tool no.
4.3 Preparatory Function G Code
Preparatory function G code is composed of address word G and its subsequent 1-3 digits. It is
used to specify machining operations, such as the moving track of tool relative to workpiece, machine
coordinate system, coordinate plane, tool compensation, coordinate offset, subprogram call, dwell,
and so on.
G function has two forms, which are non-modal and modal G function:
Non-modal G function: only effective in the specified program block, and cancelled at the end of
program block.

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 9
Modal G function: a group of G functions that can be cancelled mutually; a G function remains in
effect until another G function in the same group appears to cancel it.
Commands Related to Coordinate System and Coordinates
G90 Absolute Programming and G91 Incremental Programming
Command Format:G90/G91
Description:
G90: it denotes absolute programming; the programming value on each programming coordinate
axis is with respect to the origin of current WCS.
G91: it denotes incremental programming; the programming value on each programming
coordinate axis is with respect to the previous position, and the value equals the distance that the tool
moves in each axis.
G90, as the default, and G91 are modal functions and can be mutually cancelled. They cannot be
used in the same program block. For example, G90 G91 G0 X10 is unallowable.
Programming Example:
As shown in Fig. 4-1 below, programming with G90, G91: the tool moves in sequence from origin
to point 1, 2, and 3.
20 60
40
Y
X
O
15
25
45
1
2
3N X Y
N01 X20 Y15
N02 X40 Y45
N03 X60 Y25
N X Y
N01 X20 Y15
N02 X20 Y30
N03 X20 Y-20
G90 programming G91 programming
Fig. 4-1 G90/G91 Programming
Selecting the right mode can simplify the programming. If the drawing dimension is given based
on a fixed datum, it is better to adopt absolute programming mode; if the drawing dimension is given
on the basis of space distance between contour apexes, it is better to adopt incremental programming
mode.
G92 Set WCS according to Tool Position
Command Format: G92 X_Y_Z_
Description:
X_Y_Z_: the directed distance between origin of WCS and the beginning point of tool, i.e. the
workpiece coordinates of the beginning point of current tool
A program is compiled based on WCS and begins with the cutter beginning point; before

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
10 Specialized, Concentrated, Focused
machining, the WCS should be learnt by the CNC system so as to link up the WCS with the MCS by
setting the coordinates of cutter beginning point in the MCS.
G92 command can set the REFER point; it can also create a WCS by setting the relative position
of tool beginning point (tool measurement point) to origin of WCS to be created. Once the WCS is
established, the value of the command in absolute programming is the coordinate value in the WCS.
Program Zero 30.0
Y
X30.0
Tool initial point
20.0
Z
G92 X30.0 Y30.0 Z20.0
Fig. 4-2 Creation of Workpiece Coordinate System
Programming Example:
Programming with G92 command to create a WCS is as shown in Fig. 4-2.
The execution of the program block only creates a WCS without cutter movement. As a
non-modal command, G92 is usually put in the first block of machining file to create a WCS and
synchronously offset origins of other WCSs, which can be used to adjust the length of cutter holder.
G921 Specify Work Coordinate Value of Current Point
Command Format:G921 X_Y_Z_
Description:
X_Y_Z_: workpiece coordinates of the current point
G921 is used to set workpiece coordinates of current point in the current WCS; unlisted axes will
not be modified; this setting has effect only on the current WCS.
G921 command can be used for measuring workpiece surface, center or boundary.
G922 Specify the Machine Coordinates of WCS Origin
Command Format: G922 X_Y_Z_P_
Description:
X_Y_Z_: offset values
P_: specifying offset type. -4: external offset; -1: current WCS (default); 0~5: corresponding to
G54~G59
G922 sets the coordinate value of the specified offset, without changing unlisted axes’ offset.
G922 command can be used for measuring workpiece surface, center or boundary.

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 11
G28 Auto Back to Reference Position
Command Format:G28 X_Y_Z_
Description:
X_Y_Z_: coordinates of the middle position (Workpiece Coordinates)
A machine tool returns to REFER point (machine origin) through the middle point, as shown in
Fig. 4-3.
A (0, 0, 10), target position, X and Y
back to origin, Z-axis keeps still. Instruction: G28 X100 Y50
The machine Tool moves from
point C (current position) to
point A (machine origin) via
point B (middle point). Since Z
axis does not appear, Z axis
keeps still without returning to
zero.
C (40, 90, 10)
current position
B (100, 50, 10)
middle point
Fig. 4-3 Back to Reference Position
G992 Temporarily Set WCS according to Tool Position
Command Format: G992 X_Y_Z_ /I_J_K_
Description:
The function of this command is similar to G92 command. Their difference is: G92 command
alters theWCS permanently and takes the same standard to the whole system, while G992 command
alters the WCS temporarily and only influences the coordinate parsing of processing instruction,
which will be restored automatically at the end of machining.
The command can be used for implementing array function. The steps are as shown below.
Method one:
G992 X_Y_Z_
1. Delete M30 command in the processing file.
2. Adding the following contents at the beginning of the processing file:
#1=30 ’X offset value
#2=40 ’Y offset value
#3=30 ’machining quantity along X axis
#4=30 ’machining quantity along Y axis
G65 P3455 L=#4
G00 G90 X=-#1*#3 Y=-#2*#4
G992 X0 Y0
M30
O3455
G65 P3456 L=#3
G00 G90 X=-#1*#3 Y=#2
G906

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
12 Specialized, Concentrated, Focused
G992 X0 Y0
M17
O3456
3. Add the following contents at the end of the processing file:
G00 G90 X=#1
G906
G992 X0
M17
Method two:
G992 I_J_K
1. Delete M30 command in the processing file.
2. Add the following contents at the beginning of the processing file:
#1=30 ’X offset value
#2=40 ’Y offset value
#3=30 ’machining quantity along X axis
#4=30 ’machining quantity along Y axis
G65 P3455 L=#4
G00 G90 X=-#1*#3 Y=-#2*#4
G992 I=-#1*#3 J=-#2*#4
M30
O3455
G65 P3456 L=#3
G00 G90 X=-#1*#3 Y=#2
G906
G992 I=-#1*#3 J=#2
M17
O3456
3. Add the following contents at the end of the processing file:
G00 G90 X=#1
G906
G992 I=#1
M17
Both the above two programs can realize the related array machining. The first 4 parameters can
be adjusted and customized.
Note:
G992 X_Y_Z_ sets the current point as a specified point in the new coordinate system.
G992 I_J_K_ translates the original coordinate system a specified distance to form into a new
coordinate system. Comparatively speaking, G992 I_J_K_ is more efficient because it avoids the
redundant rapid traverse instruction produced by origin offset, while G992 X_Y_Z_ sets an origin after
backing to the original origin. During array machining, G92 command should be deleted manually
because it is not supported by the system.

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 13
G54~G59 WCS Selection
Command Format: G54/G55/G56/G57/G58/G59
Description:
G54~G59 are 6 WCSs prepared by the system (as shown in Fig. 4-4). Any one of them can be
selected.
G54 Origin
Workpiece
Origin Offset
Reference Point
(Machine Zero)
G59 Origin
G59 Workpiece
Coordinate System
G54 Workpiece
Coordinate System
Y
Z
XX
Y
Z
Fig. 4-4 Workpiece Coordinate System Selection (G54~G59)
The origin value of these 6 WCSs in the MCS (offset value of workpiece origin) can be set in the
[Param] setting interface. The setting value will be saved automatically by the controller.
Note:
Once a WCS is confirmed, the following instruction values in absolute programming are all relative to
the origin of WCS.
G54~G59 are modal functions, which can be mutually cancelled. G54 is the default.
Programming Example:
As shown in Fig. 4-5, programming based on WCS to make the tool move from current point to
point A, and then to point B.
N01 G54 G00 G90 X30 Y40
N02 G59
N03 G00 X30 Y30
...
Current Point A B
G59
Machine Origin
30
O
B
A
40
30
30
O
G59
X
Y
Y
X
Fig. 4-5 Programming Based on Workpiece Coordinate System
Set the coordinate value of each WCS origin in the MCS before using this group of instructions.
G53 Machine Coordinate System
Command Format: G53
Description:

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
14 Specialized, Concentrated, Focused
G53: using MCS and disabling zero offset of WCS. It is a non-modal instruction which is only
valid in the current program block.
G17, G18, G19 Coordinate Plane Selection
Command format: G17/G18/G19
Description:
G17: XY plane selection
G18: ZX plane selection
G19: YZ plane selection
This group of instructions is used to select the plane to perform circular interpolation and cutter
radius compensation.
G17 (default), G18 and G19 are modal functions (as shown in Fig. 4-6), which can be mutually
cancelled.
X
Y
Z
G17
G18
G19
Fig. 4-6 Coordinate Plane Selection
G20/G21 OR G70/G71 Inch/Metric Command
Command format:G20/G21/G70/G71
Description:
G20/70: inch
G21/71: metric
This group of G codes is defined at the beginning of the program block. If one of them is specified,
the units of all subsequent operations will be changed. If not specified, the default unit is metric.
G50/G51 Scaling Function
Command Format:G51 X_Y_Z_P_ (I_J_K_)
Description:
X_Y_Z_: the center of scaling. The omitted coordinate axes will inherit the original scaling and
remain the same.
I_J_K_: the scaling of X, Y and Z axes
P_: the scaling of all listed axes. Either P_ or I_J_K_ can appear in a program block.
Workpiece contour that is compiled in the machining file can be reduced or enlarged to scale.

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 15
G51 is scaling on, while G50 is scaling off (Default: G50).
The range of scaling: 0.000001-99.999999
For example:
I0.666666 denotes that X is scaled down to 0.666666 times of the original dimension, while J3
denotes that Y is scaled up to 3 times of the original dimension.
When using the scaling command, pay attention to the followings:
Don’t set the scale factor as 0, or else an alarm will appear.
Scaling function has no effect on compensation value.
When executing cutter radius compensation C, the scaling instruction (G51) can’t be specified.
A canned cycle cannot be executed together with the scaling of Z-axis. If so, an alarm will appear.
These G codes cannot be used in the execution process of scaling function: G28, G29, G53, and
G92, or else the outcome may contain an error.
If there is G51 in the program without G50, the scaling function will be automatically closed at the
end of the program.
Programming Example:
N01 G00 X50.0 Y50.0 ’rapid positioning
N02 G51 X100.0 Y80.0 P0.5 ’specifying X100, Y80 as the scaling center, and 0.5 as scale value
N03 G01 Y150.0 F1000 ’linear cutting with feed rate as 1000mm/min
N04 X175.0 Y50.0
N05 G90 X50.0
N06 G50 ’scaling function off
N07 G00 X0.0 Y0.0 ’returning rapidly
N08 M30 ’end of the program
(50,150)
N07
(50,50) N05
N03
N04
Real path-after scaling
Program path-before scaling
(175,50)
Y
X
N01
Fig. 4-7 Sketch Map of Scaling Function
G68/G69 Coordinate System Rotation Function
Command Format:
G68 X_Y_Z_R_
G69

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
16 Specialized, Concentrated, Focused
Description:
X_Y_Z_: the center of rotation
R_: rotation angle in degree. Negative value is clockwise while positive value counterclockwise.
The instruction can be used for rotary contour machining by making the selected machining
contour rotates degrees specified by R around the center in the specified plane. G68 is rotation on,
while G69 rotation off.
Meaning of R: put a watch on the current plane, and let the watch surface towards the positive
direction of the third axis; positive means counterclockwise rotation, while negative clockwise rotation.
In the process of rotation, coordinate of the third axis perpendicular to the current plane is
constant. Respectively, swiveling in XY plane, the coordinate of Z-axis keeps still; swiveling in YZ
plane, the coordinate of X-axis keeps still; and swiveling in ZX plane, the coordinate of Y-axis keeps
still.
For example:
G17G90 X0Y0Z0
G65P9999L1
G68 X0Y0R-90 ’rotating 90 degrees clockwise around the center of (0, 0)
G65P9999L1
G69 ’rotation off
M30
O9999 ’machining a rectangle
G91 G1X100
Y50
X-100
Y-50
G90
M17
The actual outcome is as shown in Fig. 4-8:
After Rotation
(100,50)
(100,0)
Before Rotation
(0,0)
(50,-100)(0,-100)
X
Y
Fig. 4-8 Sketch Map of Rotation Processing

上海维宏电子科技股份有限公司
Weihong Electronic Technology Co., Ltd.
Specialized, Concentrated, Focused 17
The instruction can be nested:
G68 X_Y_Z_R_ ’………A
…
G68 X_Y_Z_R_ ’………B
…
G68 X_Y_Z_R_ ’………C
…
G69 ’………C’
G69 ’………B’
G69 ’………A’
Rotation that appears earlier will influence the following rotation instruction. The subsequent
rotation center is not the one in the machining file, but the position after transformation due to the
previous rotation.
The function of G69 is to cancel the previous rotation command. In the above-mentioned
program, line C’ cancels the G68 of line C, line B’ the G68 of line B, and line A’ the G68 of line A. If
G69 not used, all rotation commands will be automatically cancelled at the end of current machining.
The following example contains the nesting of rotation command and scaling command.
G90 G0 x0 y0 z0
G91G65 P9999 L1
G65 P9998 L10
M30
O9999
G1 x200
y-100
x-200
y100
M17
O9998
G68 x50 y50 R45
G65 P9999 L1
G51 x50 y50 p0.5
G65 P9999 L1
M17
The outcome is as shown in Fig. 4-9.
Table of contents
Popular Controllers manuals by other brands

AEG
AEG RTi 101 EP Operating and installation instructions

Dynamatic
Dynamatic 4000 instruction sheet

Mankenberg
Mankenberg UV 3.9 ATEX Original operating manual

L-TEK
L-TEK Dance Base MINI quick start guide

CaterSense
CaterSense CaterSense -01 Installation and commissioning instructions

Kkmoon
Kkmoon BT14 user manual

Hinkley
Hinkley 980008 installation instructions

KBR
KBR multicomp D6 Series Connection manual

SMC Networks
SMC Networks ITV2010-X155 Installation and maintenance manual

Contronics
Contronics HTR-10 user manual

Greenheck
Greenheck MP-310 Installation instructions and use

TECOMAT FOXTROT
TECOMAT FOXTROT CP-1005 Basic documentation