DIN 66025 Fundamentals

Structure of a DIN 66025 program

The DIN 66025 program consists of individual motion blocks. The block number is located at the beginning of each block.

['%' <program name>]
<block>{<block>}

The blocks can be structured as follows:

  • N<block number> G<expression> <G code words>

  • N<block number> <G code words> (the G<expression> of the previous block apply)

  • N<block number> M<expression> <G code words>

  • N<block number> <subroutine name> ( <ActualParamList> )

  • Additional block structures for subroutines:

    • SUBPROGRAM <name> {<FormalParamList>} <RESTORE_OPT>

    • N<block number> RETURN

    • END_SUBPROGRAM

Example

Path from two lines and an arc, followed by a subroutine call.

% MyProgram
N10 G01 X100 Y100 E100 F100 E-200
N20 G01 Z40 F20
N30 G03 X-100 R200 F100
N40 SubPrg{5}

Syntax

['%' <program name>]

Header

Optional

Starts with %, followed by the program name separated by a space or TAB

<block>

The block is processed word by word from right to left.

/

Step suppression If a block starts with / and the CNC ‣ Step Suppression command is selected, then the block is not executed.

N<block number>

The block number is used as a marker for defining jump targets.

Example: N01

G<expression>

Travel command

  • If no travel command is specified in a block, then the travel command in the previous block is supplemented automatically.

  • Uppercase and lowercase is ignored.

  • Leading zeros are ignored. Therefore, G01 is treated the same as g1.

  • Corresponds to a path element or path object.

    Example: G1 (linear), G2 (arc)

  • The velocity at which the path objects are interpolated; in principle corresponds to the set path velocity, path acceleration, and path deceleration. The interpolator makes sure that these limiting values are not exceeded.

<G code word>

G code word

  • Consists of one address (example: E) and one expression (example: 100); together E100)

  • Uppercase and lowercase is ignored.

  • Leading zeros are ignored.

  • Writes the number of the word to a variable. The letter of the word is the variable name. The travel command accesses this.

  • All numbers can be floating point values. This does not apply to travel command G<expression>, M function M<expression>, and switch point H<expression>.

  • The words of a block are separated by a space or tab.

<expression>

See 'Expressions' chapter

()

Comment

  • The characters between the parentheses are interpreted as a comment.

Note: Comments can be redefined by means of the input bParenthesesAsComments (FB SMC_ReadNCFile2).

Interpolation between two consecutive blocks

The velocity when transitioning two adjacent objects is determined by the following rules:

  • If one of the two objects is a positioning of G0, then the transition velocity = 0.

  • If the angle between the tangents of both path elements at the transition is greater than the angle tolerance, then the transition velocity = 0.

  • Otherwise, the transition velocity is the least specified velocity of both path elements.

  • As a rule, the travel command is responsible for an interpolation of the target position of the last travel command to the target position, which was specified by the current travel command, to be performed. The first travel command starts at the position that was defined in the decoder or CNC editor. If this position is not defined, then the starting point is X=0, Y=0, Z=0.

See also

Travel commands and corresponding path elements

Travel Command

Description

Path element

G0

Direct movement without tool operation; linear motion

Positioning

G1

Linear movement with tool operation

Linear Motion

G2

Circular segment or circle, clockwise

Arc

G3

Circular segment or circle, counterclockwise

Arc

G4

Dwell time

Dwell Time

G5

Point of a 2D cardinal spline

Spline

G6

Parabola

Parabola

G8

Elliptical arc or ellipse, clockwise

Ellipse

G9

Elliptical arc or ellipse, counterclockwise

Ellipse

G10

Point of a 3D cardinal spline

Spline

G15

Switch to 2D

3D mode

G16

Switch to 3D by activating 3D mode with the normal vector I/J/K to the plane

3D mode

G17

Switch to 3D by activating 3D mode in X/Y plane

3D mode

G18

Switch to 3D by activating 3D mode in Z/X plane

3D mode

G19

Switch to 3D by activating 3D mode in Y/Z plane

3D mode

G20

Conditional jump to L, if K <> 0

Jump

G36

Write value D to variable O

Changing Variable Values

G37

Increment variable O by value D

Changing Variable Values

G40

End of tool radius compensation

Preprocessing

G41

Start of tool radius compensation, left of travel direction

Preprocessing

G42

Start of tool radius compensation, right of travel direction

Preprocessing

G43

Start of tool length compensation.

Preprocessing

G50

End of angle rounding/smoothing

Preprocessing

G51

Start of angle smoothing

Preprocessing

G52

Start of angle rounding

Preprocessing

G53

Ends the coordinate transformation and resets the decoder coordinate system to the original position (= machine coordinate system).

Shifting, Rotating, and Scaling the Coordinate System

G54

Absolute transformation of the coordinates.

Shifting, Rotating, and Scaling the Coordinate System

G55

Relative transformation of the coordinates.

Shifting, Rotating, and Scaling the Coordinate System

G56

Sets the current orientation, position, and scaling of the DCS is set as a reference point.

Shifting, Rotating, and Scaling the Coordinate System

G60

End of loop suppression

Preprocessing

G61

Start of loop suppression

Preprocessing

G70

End of smoothing additional axes. (see SMC_SmoothAddAxes)

Preprocessing

G71

Start of smoothing additional axes. (see SMC_SmoothAddAxes)

Preprocessing

G75

Timing synchronization with the interpolator

Timing Synchronization with Interpolator

G90

The coordinates (X/Y/Z/A/B/C/P/Q/U/V/W) are interpreted as absolute values. (This is the default setting.)

Modes

G91

The coordinates (X/Y/Z/A/B/C/P/Q/U/V/W) are interpreted as values relative to the current position.

Modes

G92

Positioning by jump

Positioning

G98

The axis midpoints (I/J/K) are interpreted as absolute values.

Modes

G99

The axis midpoints (I/J/K) are interpreted as values relative to the start position. (This is the default setting.)

Modes

G code word recognition

A

Target position of the additional spline axis.

For a coordinate transformation in the decoder coordinates system, the word contains an angle.

B

C

D

  • Tool radius for compensation G40-G42

  • Tool distance for angle rounding G50-G51

  • Variable value G36/G37

E

Maximum path acceleration/deceleration in [u/sec2]. Value > 0: acceleration; value < 0: deceleration

EF

Path acceleration/deceleration for G0 motion.

E<axis>

Individual acceleration/deceleration (>0/<0) of the specified additional axis <axis>.

Additional axes are A, B, C, P, Q, U, V, W, and also Z in 2D mode.

If this G code is used, then the path processing block SMC_ExtendedVelocityChecks has to be used for restricting the velocity.

F

Velocity (in [u/sec]). "Feed"

FF

Velocity for G0 movements

F<axis>

Individual velocity of specified additional axis <axis>.

Additional axes are A, B, C, P, Q, U, V, W, and also Z in 2D mode.

If this G code is used, then the path processing block SMC_ExtendedVelocityChecks has to be used for restricting the velocity.

G

Path condition

H

Switch point (H function). Positive: Switch on. Negative: Switch off.

I

  • X-coordinate of the circle/ellipse midpoint for G02/G03/G08/G09

  • X-coordinate of the vertex of the parabola for G06

  • Normal vector (X) for the 3D plane function

  • Parameters for activating extended preprocessing functions for G38/G39

  • Scaling in the X-direction for G54/G55/G56

  • Tool offset in the X-direction for G43

J

  • Y-coordinate of the circle/ellipse midpoint for G02/G03/G08/G09

  • Y-coordinate of the vertex of the parabola for G06

  • Normal vector (Y) for the 3D plane function

  • Parameters for activating extended preprocessing functions for G38/G39

  • Scaling in the Y-direction for G54/G55/G56

  • Tool offset in the Y-direction for G43

K

  • Direction of the primary ellipse axis; mathematically: 0° = O, 90° = N, ...

  • Jump condition for G20

  • dT1 parameter value for M function

  • Z-coordinate of the circle midpoint for G02/G03 in 3D mode

  • Normal vector (Z) for the 3D plane function

  • Parameters for activating extended preprocessing functions for G38/G39

  • Scaling in the Z-direction for G54/G55/G56

  • Tool offset in the Z-direction for G43

L

  • Absolute switch position for H function, measured from the start of the path element (if position > 0) or measured from the end of the path element (if position < 0).

  • Jump target for G20.

  • dT2 parameter value for M function.

  • Number of the additional axis for G70 and G71.

M

Additional option for machinery; also M function

O

  • Relative switch point position with value range [0..1] for H function.

  • Variable value G36/G37.

  • Data structure for the parameters for an M function.

P

Target position of the additional linear axis P.

P<axis><period>

Configuration of the modulo axes.

If Period = 0 applies (example: PA0), then the behavior of the axis is linear. (modes).

Q

Target position of the additional linear axis Q

R

  • Circle radius alternative to I, J with G02/G03.

  • Length ratio of the elliptical secondary/primary axis in the value range of [0..1] with G08/G09.

S

S profile for linear axes. Positive: Switch on. Negative: Switch off.

Axis

  • 3: Z, if Z is in 2D mode

  • 7: P

  • 8: Q

  • 9: U

  • 10: V

  • 11: W

T

Command-specific parameter

U

Target position of the additional linear axis U

V

Target position of the additional linear axis V

W

Target position of the additional linear axis W

X

X-coordinate of the target position

Y

Y-coordinate of the target position

Z

Z-coordinate of the target position