UP: Technological programming
1. Introduction
1. Structure of the control program
2. Axis names and transmission of their coordinates
3. Command parameters
2. Description of G-codes
1. G00: Positioning
2. G01: Linear interpolation
3. G02/03: Circular interpolation
4. G04: Time delay
5. G10: Data adjustment
6. G17/G18/G19: Selection of the Cartesian plane
7. G28/G28.1/G30: Return to the main position
8. G29/G29.1: Return from the main position
9. G30.1…G30.9: Transition to the reference position
10. G31: Measurement command
11. G36: Enabling the height map
12. G36.1: Height map initialization
13. G36.2: Setting the height offset of the height map point
14. G36.3: Height map measurement cycle
15. G36.9: Disabling the height map
16. G40/G41/G42, D: Tool diameter correction
17. G43/G49, H: Tool length correction commands
18. G52/G52.9: Coordinate system offset
19. G53: Movement to machine coordinates
20. G54…G59: Workpiece coordinate systems
21. G61/G64: Precise/Rough machining
22. G68/G68.9: Rotation of the coordinate system in the plane
23. G69/G69.2/G69.9: TCP mode
24. G83: Drilling cycle
25. G85: Thread milling cycle
26. G90: Absolute coordinate mode
27. G91: Relative coordinate mode
28. G90.1: Absolute coordinate mode for parameters I, J, K
29. G91.1: Relative coordinate mode for parameters I, J, K
30. G92/G92.9: Defining an arbitrary coordinate system
3. "T": Command to declare a new tool
3. "S": Spindle speed setting command
4. "K": Working in different channels
5. Description of M-commands
1. M0: Unconditional UP stop
2. M1: Conditional UP stop
3. M3/M4/M5/M5.1: Spindle control commands
4. M6/M6.1/M6.2/M6.3/M6.4/M6.5/M6.9: Tool management
5. M7/M8/M9: Cooling control commands
6. M30: End of UP
7. M68.X: Chuck/Vise and vacuum table control
6. Macro programming
1. Variables
2. Variable scope
3. Operators
4. Arithmetic functions
5. Getting coordinates along the axes "#WORK_X, #MACH_X..."
6. Getting measurement coordinates along the axes using the G31 command "#PROBE_X, #PROBEMACH_X, #PROBEREAL_X, #PROBEMACHREAL_X"
7. Channel number "#CHANNEL"
8. Current feed rate in the channel "#FEED"
9. Current spindle speed in the channel "#SPEED"
10. Current coordinate system in the channel "#G54"
11. Getting the coordinate of the reference point "GetReferencePoint()"
12. Input/Output control "GetInput()/SetOutput()"
13. Tool variables
17. G-flags of modal groups
18. "PRINT" operator
19. Unconditional jump operator "GOTO"
20. Subprogram call "CALL" / "RETURN"
21. Conditional operator "IF" / "ELSEIF" / "ELSE" / "ENDIF"
22. Loop operator "WHILE" / "DONE"
1. Introduction
This documentation is intended for machine operators and CNC and UP adjusters.
The instructions provide information on programming control programs (UP), according to which the part will be processed.
Information on programming UP macros is also provided.
Abbreviations/explanations used:
• {xxxx} - Optional parameter/value/Command is indicated in curly brackets
1.2 Control program structure:
Each UP consists of lines (hereinafter) frames
The UP frame consists of:
• {Frame number} = Format: Nxxxxx, where "xxxx" is a number - the frame number
• Letters and numbers of the command
The following can also be passed to the command:
• Letter of the machine axis and a number after it< - coordinate to which the axis should move
• Parameter letter and a number after it< - parameter value
Example:
N568 G02 X20 Y10 Z50 R30
It is recommended to specify the frame number only in cases where a transition from another part of the UP must be made to the UP frame
In other cases, we recommend not specifying the frame number at all
1.2 Axis names and transmission of their coordinates
Records of the format X__, Y__, Z__, etc. indicate the indication of axis names and arguments and their values.
For example, X is the name of the G-code axis.
Instead of the "_" symbol, you need to substitute the numerical values of the coordinate to which the machine AXIS should move
Example:
G01 X20.000 Y 10.000 Z 50.000
Axis names of the first channel available for interpolation:
• X - Linear axis, required
• Y - Linear axis, required
• Z - Linear axis, required
• A - Axis of rotation around the X axis, optional
• B - Axis of rotation around the Y axis, optional
• C - Axis of rotation around the Z axis, optional
Axis names of the second channel available for interpolation:
• U - Linear axis, required
• V - Linear axis, required
• W - Linear axis, required
• Q - Axis of rotation around the U axis, optional
• E - Axis of rotation around the V axis, optional
• L - Axis of rotation around the W axis, optional
If the "15. Translate XYZ..to UVW.. in channel 2" setting is enabled in the settings, then in the second channel you can use the same axis names as in the first channel.
This makes it easier to configure the post-processor for the CAM system.
And in some cases it allows you to quickly change the processing channel in the UP.
When specifying axis coordinates, it is allowed to specify the symbols "Δ/d" b "¤" before the coordinates
Example:
G01 XΔ20 Yd10 ; Movement in relative coordinates G01 X¤100 Y¤200 ; Movement to machine coordinates
• The symbol "d" or "Δ" after the axis letter means that the coordinates are specified as relative to the previous coordinates.
• The symbol "¤" after the axis letter means that the coordinates are specified as "Machine" coordinates.
1.3 Command parameters
Command parameters are indicated by an arbitrary letter (usually not coinciding with the letters of the axes).
The parameter letter is followed by a number - the parameter value.
2. Description of G-codes:
G-commands define commands - usually responsible for the movement of the tool.
G-commands consist of the letter G and the number following it.
G-commands are modal and single.
Modal G-commands retain their value until the end of the program,
until they are canceled by another G-command or a macro language command.
Single G-commands are executed once within the current frame.
Modal G-commands are divided into groups. Each group includes combined
G-commands for functional purposes, of which only one can be activated at a time.
2.1 G00: Positioning
The G00 command moves the tool to the specified position.
The position can be specified in absolute values or in increments relative to the current coordinates.
Command format:
G00 X__ Y__ ...
The arguments specify the names of the axes and the coordinates to which you want to move.
Example:
G90; enabling the absolute coordinate system G00 X10 Y10 Z10 ;movement to coordinates X=10, Y=10, Z=10 ; G00 - modal command, G00 is enabled in the previous frame and is valid until canceled by another G-command from this group X0 Y0 ; movement to coordinates G00 X=0, Y=0, Z=10 Z0 ;movement to coordinates G00 X=0, Y=0, Z=0
Where:
• {X_} {Y_} {Z_} {A_} {B_} {С_} - Coordinates of movement along the axes
Note:
The movement speed for positioning is set in the settings and cannot be changed by the Fxxxxx command
Be sure to ensure that the tool does not hit the workpiece when positioning using G00/G28/G30.
When specifying axis coordinates, it is allowed to specify the symbols "Δ/d" b "¤" before the coordinates
Example:
G00 XΔ20 Yd10 ; Movement in relative coordinates G00 X¤100 Y¤200 ; Movement to machine coordinates
• The symbol "d" or "Δ" after the axis letter means that the coordinates are specified as relative to the previous coordinates.
• The symbol "¤" after the axis letter means that the coordinates are specified as "Machine" coordinates.
2.2 G01: Linear interpolation
The G01 command moves the tool strictly along a straight line, the coordinates of which are specified by the arguments of the G01 command
The position can be specified in absolute values or in increments relative to the current coordinates.
Different axes - which are involved in the movement of the tool - move strictly depending on the position of other axes (interpolated) - so that the resulting trajectory is strictly a straight line.
Command format:
G01 X__ Y__ ...
The arguments specify the names of the axes and the coordinates to which you want to move.
To use the G01 command, you need/can specify the feed rate using the {Fxxxxx} command.
Feed determines the speed at which the tool will move in a straight line.
The feed rate specified in F is valid until the next {Fxxxxx} command.
Example:
G01 X10 Y10 Z10 F2000 ;movement to coordinates X=10, Y=10, Z=10 ; G01 - modal command, G01 is enabled in the previous frame ; and is valid until canceled by another G-command from this group X0 Y0 ; movement to coordinates G01 X=0, Y=0, Z=10 Z0 ;movement to coordinates G01 X=0, Y=0, Z=0
Where:
• {X_} {Y_} {Z_} {A_} {B_} {С_} - Coordinates of movement along the axes
• {F_} - Feed rate during processing
Note:
If the Fxxxxx command is not specified, the feed rate is considered to be zero.
When specifying axis coordinates, it is allowed to specify the symbols "Δ/d" b "¤" before the coordinates
Example:
G01 XΔ20 Yd10 ; Movement in relative coordinates G01 X¤100 Y¤200 ; Movement to machine coordinates
• The symbol "d" or "Δ" after the axis letter means that the coordinates are specified as relative to the previous coordinates.
• The symbol "¤" after the axis letter means that the coordinates are specified as "Machine" coordinates.
2.3 G02/03: Circular interpolation
Circular interpolation moves the tool along the axes
of the selected plane along an arc of a circle. At the same time, along the remaining axes,
if they are specified, linear interpolation is performed.
Direction of circular interpolation:
• G02 Clockwise
• G03 Counterclockwise
Command format in the XY plane:
G17 G2 X__ Y__ I__ J__ P__ ;indication of the coordinates of the center of the arc
G17 G2 X__ Y__ R__ P__ ;indication of the radius of the arc
Where:
• I - Coordinate of the center of the circle along the X axis
• J - Coordinate of the center of the circle along the Y axis
• P - Total number of revolutions around the circle
• R - Radius of the arc of the circle
Command format in the ZX plane:
G18 G2 X__ Z__ I__ K__ P__ ;indication of the coordinates of the center of the arc
G18 G2 X__ Z__ R__ P__ ;indication of the radius of the arc
Where:
• I - Coordinate of the center of the circle along the X axis
• K - Coordinate of the center of the circle along the Cartesian Z axis
• P - Total number of revolutions around the circle
• R - Radius of the arc of the circle
Command format in the YZ plane:
G19 G2 Z__ Y__ J__ K__ P__ ; indication of the coordinates of the center of the arc
G19 G2 Z__ Y__ R__ P__ ; indication of the radius of the arc
Where:
• J - Coordinate of the center of the circle along the Y axis
• K - Coordinate of the center of the circle along the Cartesian Z axis
• P - Total number of revolutions around the circle
• R - Radius of the arc of the circle
For the G3 command, the format is similar.
The P argument specifies the total number of revolutions that the
tool should make around the specified circle. The specified revolutions begin to be performed after the tool reaches the end point of the arc. The P argument
is not required. If the P argument was not specified, then its value is equated to zero.
Coordinates I, J, K are by default specified as relative to the starting point of the arc - specified in the previous frame
They can be changed by the commands:
• G90.1 Coordinates I, J, K are specified as absolute
• G91.1 Coordinates I, J, K are specified as relative
To use the G02/G03 command, you need/can specify the feed rate using the {Fxxxxx} command.
Feed determines the speed at which the tool will move around the circle.
The feed rate specified in F is valid until the next {Fxxxxx} command.
2.4 G04: Time delay
The G04 command allows you to pause the program execution for a certain duration.br />
Command format/example:
G04 P1.265 ; Pause 1.265 seconds
Where:
• P - pause duration in seconds
2.5 G10: G10: Data adjustment
Option:
• G10 L1 Setting tool offsets and correctors
Command format/example:
G10 L1 T3 B0 H0.2 D0.1 Z100 S5 N1;
Where:
• L1 - Version of the command to Set tool offsets and correctors
• {T3} - Tool number - for which the data is being corrected (if not specified - for the current tool)
• {B0} - Tool binding number - for which the data is being corrected (if not specified - for the current binding)
• {H0.2} - Tool length corrector (not to be confused with tool length)
• {D0.1} - Tool diameter corrector
• {S5} - Tool slot number
• {N1} - The need to measure the tool, Measurement is not needed: -1, Measurement is needed: 1.
• {Z100} - Tool length offset (measured tool length)
For angular heads, you can set a lateral offset:
• {X30} - Tool offset along X
• {Y45} - Tool offset along Y
Option:
• G10 L2 Binding of the G54-G59 coordinate system
Command format/example:
G90 G54 ; Workpiece coordinate system 1 G10 L2 P1 X0 Y0 Z0 ; New working coordinates for the current position
Where:
• L2 - Version of the command to Bind the G54-G59 coordinate system
• {P1} - The P parameter indicates in which workpiece coordinate system the binding will be carried out:
1 - G54
2 - G55
3 - G56
4 - G57
5 - G58
6 - G59
If the parameter is not specified, the binding is carried out to the current coordinate system (G54-G59).
• {X0} {Y0} {Z0} {A0} {B0} {С0} - Coordinates along the axes to which the current coordinate will be bound.
Binding is carried out only along those axes that are specified within the command.
In G90 mode, the current coordinate is bound to the one that is specified as the value of the corresponding axis.
In G91 mode, the workpiece coordinate system is shifted by the values specified as the value of the axes.
Option:
• G10 L3 Loading tool description
Command format/example:
G10 L3 T67 H57 D6.0 Q2 R0.5 P33 I4 N[6D 57L Gray Steel]
Where:
• L3 - Version of the command - Loading tool description
• T67 - Tool number
• [H57] - Tool length
• [D6.0] - Tool diameter
• [Q2] - Tool type:
1 - End mill
2 - Radius end mill
3 - Conical mill
4 - Radius mill
5 - Ball mill
6 - Angular groove mill
7 - Groove mill
8 - Face mill
9 – Drill
10 - Thread mill
11 – Countersink
12 – Center drill
13 – Engraver
14 - Sinosor probe
15 - Shaping cutter
16 - Tap
• [R0.5] - Rounding radius
• [P33] - Length of the cutting part
• [I4] - Number of cutting teeth
• [N[‹Text›]] - String name of the tool
When loading the UP for execution, the CNC will check the presence and correspondence of the tool in the command and in the CNC tool table.
If a difference is detected, it will be proposed to either add the tool to the CNC table (if it is not there), or correct the tool parameters in the CNC table
At the same time, it is possible to refuse to change the CNC table.
Further, when the UP is running, this command is ignored.
Option:
• G10 L4 Workpiece reinstallation
Command format/example:
G10 L4 P1 X-104.5 Y0 Z40 A-90 B180 C0 N[Bottom]
Where:
• L4 - Version of the command - Workpiece reinstallation
• P1 - Installation number in order
• {X0} {Y0} {Z0} {A0} {B0} {С0} - Coordinates of the offset along the axes
Does not affect the operation of the UP on the machine
Only affects the display of the trajectory in the CNC graphics window
Option:
• G10 L5 Setting the current (installed) tool
Command format/example:
G10 L5 T3 B0
Where:
• L5 - Version of the command to Set the current (installed) tool
• {T3} - Tool number - for which the data is being corrected (if not specified - for the current tool)
• {B0} - Tool binding number - for which the data is being corrected (if not specified - for the current binding)
2.6 G17/G18/G19: Selection of the Cartesian plane
Selection of the Cartesian plane for constructing arcs using the G02/G03 command
• G17 The arc is built in the XY plane
• G18 The arc is built in the ZX plane
• G19 The arc is built in the YZ plane
See the description of the G02/G03 command
2.7 G28/28.1/G30: Return to Home Position
The G28/28.1/G30 command moves the tool to the machine's home position.
The G28/28.1/G30 command is similar to the G0 command.
It moves at rapid traverse to the coordinates specified by the G28 command arguments (an intermediate point),
and then moves to the home position.
The home position coordinates for G28/G30.X are specified in the CNC on the "Offsets" page.
G28.1 Command - Machine-Specific G28 Exit Strategy
The G28.1 command does the same as G28, but through a cycle described in the NC program and accessible for editing.
In the script, the rotation axes are "spinned up" at a safe height.
The script can also describe obstacle avoidance, such as bypassing tool magazine areas.
The script also specifies the order of G28 entry for different axes.
Typically, this is first a Z-axis ramp, then an XY-axis ramp with ABC unwinding.
It is highly recommended to use G28.1 for all axes at once.
Command format/example:
G28 X__ Y__ ... G28.1 G28.1 X__ Y__ ... G30.1 X__ Y__ ...
Where:
• {X0} {Y0} {Z0} {A0} {B0} {C0} - Axis movement coordinates
Typically, after machining, the first move should not be to specific coordinates,
but rather to raise the tool to a certain height above the part, and only then move to the main position.
For such a move, you can use relative coordinate movement.
Example:
G91 ; Enable relative coordinate mode G28 Z50 ; Raise the tool 50 mm above the part and then move to the home position along all axes. G90 ; Don't forget to enable absolute coordinate mode. ; To shorten the command to one line, you can specify the command as follows: G28 Zd50 ; The "d" symbol after the axis letter indicates that the coordinates are specified as relative. G28 ZΔ50 ; The "Δ" symbol after the axis letter also indicates that the coordinates are specified as relative.
It is recommended to always retract the tool with the G28 command at the end of machining.
This allows the CNC to correctly calculate the displayed machining area and remove idle movements from the track when plotting the graph.
2.8 G29/G29.1: Return from Home Position
The G29 command moves the tool to the position before machining.
The G28 command is similar to the G0 command.
It moves at rapid traverse to the coordinates specified by the G29 command arguments (an intermediate point).
The coordinates of the home position for G28 are specified in the CNC on the "Offsets" page.
G29.1 Command - Machine-Specific G29 Starting Point Approach Strategy
G29.1 does the same as G29, but through a cycle described in the NC program and accessible for editing.
In the script, the rotation axes are "spinned up" at a safe height.
The script can also describe obstacle avoidance, such as tool magazine areas.
The script also specifies the order in which G29 is entered for different axes.
Typically, this is first XY with ABC spinning up, and then Z descent.
It is highly recommended to use G29.1 for all axes at once.
Command format/example:
G29 X__ Y__ ... G29.1 G29 X__ Y__ ...
Where:
• {X0} {Y0} {Z0} {A0} {B0} {C0} - Axis movement coordinates
It is recommended to always move the tool using the G29 command - this allows the CNC to correctly calculate the displayed machining area and remove idle movements from the track when plotting the graph.
2.9 G30.1…G30.9: Move to Reference Position
The command acts similarly to the G28 command, but moves to
1 - 9 reference positions specified via parameters
The coordinates of the reference coordinates for G30 are set in the CNC on the "Offsets" page.
2.10 G31: Measurement Command
The G31 command is similar to the G1 command, except that its operation can be interrupted by an external signal.
When an external signal is received, the command stops its operation (without reaching the end), and
the next block starts executing.
This function can be used to measure the dimensions of the workpiece if a corresponding sensor is installed on the tool.
Command format:
G31 Z−1 F50 ; Move down until the sensor touches the surface
The measurement result can be obtained through variables:
• #PROBE_{X/Y/Z/A/B/C/U/V/W/Q/E} - Getting the measured working coordinates along the axes
• #PROBEMACH_{X/Y/Z/A/B/C/U/V/W/Q/E} - Getting the measured machine coordinates along the axes
• #PROBEREAL_{X/Y/Z} - Obtaining measured real working coordinates along the axes (taking into account the size of the probe 'ball')
• #PROBEMACHREAL_{X/Y/Z} - Obtaining measured real machine coordinates along the axes (taking into account the size of the probe 'ball')
#Probe01X = [#PROBE_X] #ProbeMach01Z = [#PROBEMACH_Z] #Probe01X_Real = [#PROBEREAL_X] #ProbeMach01Z_Real = [#PROBEMACHREAL_Z]
Mechanism for calculating real coordinates for the variables #PROBEREAL_{X/Y/Z} and #PROBEMACHREAL_{X/Y/Z}:
- The probe ball size is taken from the diameter of the current tool.
- The tool offset is assumed to be defined by the 'bottom' of the ball.
- The probe motion vector is calculated using the coordinates from the previous command and the coordinates from the G31 command.
- Corrections for the measured coordinates are calculated using the ball diameter and the motion vector.
2.11 G36: Enable Height Map
The G36 command enables correction along the Z axis of the machine according to the height map.
The height map must first be initialized with the G36.1 command and filled with the G36.2 commands.
Command format:
G36; Enable height map
2.12 G36.1: Initialize Height Map
The G36.1 command is used to initialize the height map.
By command:
• old data is erased,
• new data on the start and end coordinates of the grid along X/Y are saved
• new data on the number of steps along X/Y are saved
• the coordinates of the height grid measurement points are calculated
When executing the command, coordinate offset by G68 is prohibited
Command format:
G36.1 X10 Y0 I50 J20 N5 H3 ;Initialize height map
Where:
• {X..} {Y..} - Coordinates of the starting point of the height map grid
• {I..} {J..} - Coordinates of the end point of the height map grid (I-X, J-Y)
• {N..} {H..} - Number of measurements along the axes (N-X, H-Y)
2.13 G36.2: Set Height Offset of Height Map Point
The G36.2 command is used to record the offset of the height map grid point.
By command:
• old data is erased,
• a new Z offset is saved for the grid coordinates along X/Y
When executing, it is checked that the XY coordinates correspond to the specified height map grid
When executing the command, coordinate offset by G68 is prohibited
Command format:
G36.2 X10 Y0 Z0.03 ;Set height offset of height map point
Where:
• {X..} {Y..} - Coordinates of the height map grid point
• {Z..} - Recorded offset (delta) along the Z axis
2.14 G36.3: Height Map Measurement Cycle
The G36.1 cycle is used to initialize and measure the height map .
By command:
• old data is erased,
• new data on the start and end coordinates of the grid along X/Y are saved
• new data on the number of steps along X/Y are saved
• the coordinates of the height grid measurement points are calculated
• the control program is executed - which runs the probe through all the points of the height grid and records the offsets along Z
When executing the command, coordinate offset by G68 is prohibited
The first height at the starting point will be considered the base height Z - relative to which the offsets along Z will be calculated for the remaining points
Command format:
G36.3 X10 Y0 I50 J20 N5 H3 Z20 ;Height map measurement cycle
Where:
• {X..} {Y..} - Coordinates of the starting point of the height map grid
• {I..} {J..} - Coordinates of the end point of the height map grid (I-X, J-Y)
• {N..} {H..} - Number of measurements along the axes (N-X, H-Y)
• {Z..} - The amount (delta) - by which the probe will lower when measuring the offset along Z
2.15 G36.9: Disable Height Map
The G36.9 command disables correction along the Z axis of the machine according to the height map.
Command format:
G36.9 ; Disable height map
2.16 G40/G41/G42, D: Tool Diameter Compensation
Radius compensation involves changing the blocks in such a way
to take into account the tool radius when machining the part. There are two types of
radius compensation:
• G41 - Tool diameter compensation to the left in the direction of movement
• G42 - Tool diameter compensation to the right in the direction of movement
Radius compensation means shifting the tool relative to the specified path by
the amount of the radius perpendicular to the movement path.
If G41 is changed to G42, the new path will be on the other
side of the original part contour.
For example, if the outer contour is machined with G41, then replacing G41 with G42 will machine not
the outer, but the inner contour. The same goes for the direction of movement. If
for the entire contour of the part machined with G41, change the direction
of movement to the opposite, provided that the contour of the part remains the same
, then the contour corrected with G41 will already be on the other side of
the part contour. For correct operation of the correction, individual movements
must be at least the length of the cutter diameter.
• G40 - Cancel tool diameter compensation
In the CNC setting "Include tool radius in G41/42" you can modify the execution of this command
Possible choices:
• Include tool radius
The tool radius will be included in the compensation value for the cutting tool on the left/right
This setting is usually used to compensate for tool wear.
Advantages - The track in the control program does not depend on the tool used.
That is, you can choose a tool of a different diameter and the track will be calculated correctly.
Disadvantages - if the tool radius in the CNC table and the real tool differ, the track will be incorrect.
• Exclude tool radius
The tool radius will not be included in the compensation value for the cutting tool on the left/right
This setting is used for ACCURATE selection of the path (often for selecting a fit for a bearing)
Disadvantages - The track in the control program strictly depends on the tool used.
Default value - "Include tool radius"
• ATTENTION! - The value must strictly correspond to a similar value in your CAM system
The tool radius can be set both in the tool table using the CNC interface, and using correctors:
• {D__} , - diameter correction value.
It should be taken into account that the radius specified in the tool table for the current tool, and the radius
specified by the corrector, are summed (if this is enabled in the CNC settings).
Command format:
G0 X0 Y0 Z0 G41 G1 X100 F100 ;Radius compensation on the left, the correction value is taken from the tool table G1 Y−100 F100 D0.1 ; Setting a new correction value, the value from the tool table is ignored G40 X0 Y0 ;Cancel radius compensation
2.17 G43/G49, H: Tool Length Compensation Commands
The G43 command enables tool compensation in the positive direction, i.e. the corrector value is subtracted from the tool coordinate.
The correction value is taken from the tool table - the "Offset" field for various axes.
For the Z and W axes, the tool length compensation value is added to the offset value.
This correction value is taken EITHER from the tool table OR from the H assignment:
• {H__} , - length correction value.
In the case of using an angular head, the G43 command also applies offsets along the X/Y/U/V axes - to compensate for the lateral offset of the cutting point.
Example:
G0 G90 ;Offset along Z in the tool table = 20 G43 H-0.2 Z0 ; Move to absolute coordinate 20 (0 + 20 - 0.2 = 19.8) G49 Z0 ;Cancel compensation by G43
2.18 G52/G52.9: Coordinate System Offset
The machine coordinate system can be offset by a specified amount using the G52 command.
Example:
G52 X__ Y__ ...
Where:
• {X0} {Y0} {Z0} {A0} {B0} {С0} - Axis offset coordinates
Setting the coordinate system offset using the G52 command in G90 mode overwrites the offset specified earlier.
In G91 mode, the offsets are added to those specified earlier.
• G52.9 - Cancel coordinate system offset
Examples:
G0 X1000 Y200 ;Moved to coordinates X1000 Y200 G52 X1000 Y200 ;Offset the coordinate system so that X=0 and Y=0 G0 X0 Y0 ;We are already at this point, so there will be no movement G91 G52 X1 Y1 ; New coordinates: X=-1, Y=-1 G90 G0 X0 Y0 ;Moved 1 mm along each of the axes in the positive direction G52.9 ;Cancel coordinate system offset
2.19 G53: Move to Machine Coordinates
The G53 command selects the machine coordinate system (machine coordinates)
Suitable for moving to the tool change position or for moving to any
specific point for maintenance.
Only valid for the current control program block
The coordinates specified in the G53 coordinate system are valid only if a
return to «0» was performed after turning on the machine, or if absolute position sensors are used (incremental sensors are usually used).
Example:
G53 G0 X100 Y100 ;Move to a known position in machine coordinates G0 X100 Y100 ;Move to a known position in working coordinates from G54-G59
2.20 G54…G59: Workpiece Coordinate Systems
The workpiece coordinate system is used when machining a workpiece.
The offset of each coordinate system relative to the «0» of the machine is specified via
the CNC interface or recorded using the G10 L2 command.
The G54…G59 commands are modal, i.e. they also apply to subsequent blocks.
Example. Switching between coordinate systems:
G54 G0 X0 Y0 Z0 ; Move to X0 Y0 Z0 in the G54 coordinate system G1 Z10 ; Machining in the G54 coordinate system G55 G0 X0 Y0 Z0 ; Move to X0 Y0 Z0 in the G55 coordinate system G1 Z50 ; Machining in the G55 coordinate system G54 ; Return to the G54 coordinate system
2.21 G61/G64: Exact/Rough Machining
• G61 - Exact path mode (valid until changed by the G64 command).
Applies to subsequent blocks as well.
The CNC calculates the path smoothing with the maximum possible mismatch from the CNC setting Max. mismatch for G61
• G64 - Rough path mode (valid until changed by the G61 command).
Applies to subsequent blocks as well.
The CNC calculates the path smoothing with the maximum possible mismatch from the CNC setting Max. mismatch for G64
The maximum mismatch can be specified in the parameter:
• {P__} - Value of the maximum path mismatch.
Example:
G64 P0.2 ; enabled rough machining mode with a maximum possible mismatch of 0.2 mm G1 X100 Y100 F2000 ; machining G61 ; enable exact path mode for finishing passes G1 X150 Y100 ; machining
2.22 G68: Coordinate System Rotation in Plane
The coordinate system is rotated using the modal G68 command.
The rotation is performed within the current interpolation plane (G17, G18, G19).
When calling the G68 command, it is necessary to specify the coordinates of the point around which the coordinate system will be rotated
(center of rotation).
The R parameter specifies the angle by which the coordinate system must be rotated.
Example:
G17 G68 X__ Y__ R__ ;rotation in the XY plane G18 G68 Z__ X__ R__ ;rotation in the XZ plane G19 G68 Y__ Z__ R__ ;rotation in the ZY plane
The coordinate system rotation is canceled using the G69.9 command
2.22 G68: Coordinate System Rotation along Axes
The coordinate system is rotated using the modal G68 command.
When calling the G68 command, it is necessary to specify the coordinates of the point around which the coordinate system will be rotated
(center of rotation).
The angle of rotation of the coordinate system is specified in the ABC axes.
Example:
G68 X__ Y__ Z__ A__ B__ C__ ;Rotation in an arbitrary plane
The coordinate system rotation is canceled using the G69.9 command
2.23 G69/G69.2/G69.9: TCP Mode
• G69 Enable full TCP mode
Depending on the angle of inclination of the spindle, corrections are generated along XYZ - to compensate for the displacement of the coordinates of the cutting point.
Depending on the angle of rotation of the workpiece, corrections are generated along XYZ - to compensate for the displacement of the coordinates of the cutting point.
• G69.2 Enable TCP mode for spindle tilt
Depending on the angle of inclination of the spindle, corrections are generated along XYZ - to compensate for the displacement of the coordinates of the cutting point.
• G69.9 Disable TCP mode
Example:
G69 ; Enable TCP G1 X100 Y100 A0.5 F2000 ; machining G69.9 ; Disable TCP
2.24 G83: Drilling Cycle
• G83 - Multi-pass drilling cycle with chip breaking
Example:
G83 Z__ R__ {Q__} {D__} {P__} {F__}
Where:
• Z__ - coordinate along Z of the lower drilling plane
• R__ - coordinate along R of the upper drilling plane
• {Q__} - drilling step along the Z axis, if not specified - then to the entire depth
• {D__} - return distance from the previously drilled depth - if not specified then 0.5
• {P__} - pause in seconds, maintained at the end of the drilling step - if not specified then zero.
• {F__} - tool feed rate.
• G98 - Return to the Z plane after the cycle.
• G99 - Return to the R plane after the cycle.
• G80 - Cancel cycle.
The command can be executed in a cycle:
G1 X0 Y0 Z10 F1000 ;Exit to the starting point of the G84 cycle G98 ; Return to the R plane after the cycle. G83 X10 Z-10 R5 Q3 D10 P0.1 F200 G83 X20 Z-10 R5 Q3 D10 P0.1 F200 G80 ;Cancel cycle, return to the Z plane
2.25 G85: Thread Milling Cycle
• G85 - Multi-pass thread milling cycle using a thread mill
Example:
G85 M__ {N__} {J__} R__ Z__ {L__} {I_} {F__}
Where:
• M__ - Thread diameter
• {N__} - Inch thread diameter, example: M0 N1.4 - 1/4 inch.
Possible values:
M0 N1.16 - 1/16 inch.
M0 N1.8 - 1/8 inch.
M0 N1.4 - 1/4 inch.
M0 N3.8 - 3/8 inch.
M0 N1.2 - 1/2 inch.
M0 N3.4 - 3/4 inch.
M1 N0.0 - 1 inch.
M1 N1.4 - 1 1/4 inch.
M1 N1.2 - 1 1/2 inch.
M2 N0.0 - 2 inches.
M2 N1.2 - 2 1/2 inches.
M3 N0.0 - 3 inches.
M3 N1.2 - 3 1/2 inches.
M4 N0.0 - 4 inches.
M5 N0.0 - 5 inches.
M5 N0.0 - 6 inches.
God bless the metric system!
• {J__} - Thread pitch - if not specified - the standard thread pitch for the diameter will be applied (if the standard thread diameter is specified)
• R__ - coordinate along R of the upper drilling plane
• Z__ - coordinate along Z of the lower drilling plane
• {L__} - Thread lead-in length along Z from the upper thread plane (from #R - down)
• {I__} - number of roughing passes - if 0 or not specified - one finishing pass
• {F__} - tool feed rate.
• G98 - Return to the Z plane after the cycle.
• G99 - Return to the R plane after the cycle.
• G80 - Cancel cycle.
The command can be executed in a cycle:
G1 X0 Y0 Z10 F1000 ;Exit to the starting point of the G84 cycle G98 ; Return to the R plane after the cycle. G85 X10 Y5 M6 Z0 R10 L1 G85 X20 Y5 M6 Z0 R10 L1 G80 ;Cancel cycle, return to the Z plane
2.26 G90: Absolute Coordinate Mode
The absolute coordinate system means specifying coordinates relative to the origin of the current coordinate system.
The flag is valid until the end of the program, or until canceled by the G91 command.
2.27 G91: Relative Coordinate Mode
The relative coordinate system means specifying coordinates in increments, i.e. in distances relative to the current point.
This coordinate system is convenient to use when performing any cyclic, similar operations when machining a part.
The flag is valid until the end of the program or until canceled by the G90 command.
2.28 G90.1: Absolute Coordinate Mode for Parameters I, J, K
If the modal command G90.1 is specified, then the arguments I, J, K specify the coordinates of the center in absolute coordinates.
The flag is valid until the end of the program, or until canceled by the G91.1 command.
2.29 G91.1: Relative Coordinate Mode for Parameters I, J, K
If the G91.1 flag is specified, then the arguments I, J, K represent the offsets of the center of coordinates relative to
the coordinates of the beginning of the arc (the current tool position).
The flag is valid until the end of the program or until canceled by the G90.1 command.
2.30 G92/G92.9: Defining an Arbitrary Coordinate System
You can define an arbitrary machine coordinate system using the G92 command.
Example:
G92 X__ Y__ ...
Where:
• {X0} {Y0} {Z0} {A0} {B0} {C0} - Axis zero point coordinates
Defining an Arbitrary Coordinate System Using the G92 Command.
• G92.9 - Cancel arbitrary coordinate system
Examples:
G92 X1000 Y200 ; Define a new coordinate system G0 X0 Y0 ; Move to the zero point of the new coordinate system G92.9 ; Cancel coordinate system offset
3. "T": New Tool Declaration Command
Command format:
• T__.{__} - The first number is the tool number, the second number is the tool binding number
The tool change function is NOT activated by the command.
If after this command you give a command to change the tool М06 then:
If the storage slot number is not defined for the old or new tool (or there is no automatic changer at all), the CNC will display a tool change dialog box.
In this case, it is possible to specify the tool slot or perform the change manually:'
If storage slots are specified for the old and new tool and there is an automatic tool changer, the replacement will occur automatically.
Example:
T23.2 M06 ; Select the 23rd tool in the second binding and replace it with the M06 command
3. "S": Spindle Speed Setting Command
Command format:
• S______ - Spindle speed (rpm)
S12000 ; Set spindle speed to 12000 rpm
4. "K": Working in Different Channels
Command format:
• K1 - After this command, the entire control program code is executed in the first channel - until the next K command
• K2 - After this command, the entire control program code is executed in the second channel - until the next K command
• K0 - Channel synchronization. When this command is reached in any channel, the execution of the control program in another channel is awaited
The control programs in the first and second channels are executed in parallel.
When the control program is executed in a specific channel - only the axes of this channel are available
After K0 There is no channel - all axes are available. But circular interpolation G02/G03 is only available on the axes of the first channel (XYZ)
Example:
G01 X0 Y0 Z0 U0 V0 W0 ; working without a channel - all axes are available K1 ; Next, the code is executed in the first channel (in parallel with the 2nd) … G01 X10 Y10 Z10 ; working in the first channel … K2 ; Next, the code is executed in the 2nd channel (in parallel with the 1st) … G01 U10 V10 W10 ; working in the second channel G01 X10 Y10 Z10 ; working in the second channel, the XYZ axes are automatically translated into UVW … K0 ; Synchronization point - waiting for completion in both channels G01 X0 Y0 Z0 U0 V0 W0 ; working without a channel - all axes are available
5. Description of M-commands:
M-commands control the electrical automation systems of the machine.
They are executed either in the PLC or as a separate control program program.
Before executing M-commands, there is usually a complete feed braking - machine stop
5.1 M0: Unconditional Program Stop
The M0 command executes a program stop with the possibility of subsequent resumption of program operation via the start button.
After executing this command, the program should enter a paused state.
The command can be used in those places of the control program where
it is necessary to perform a manual tool change, workpiece change, etc.
5.2 M1: Conditional Program Stop
The M1 command executes a program stop similarly to the M0 command, if the PLC module has allowed a conditional stop (Conditional stop is enabled).
The command can be used when debugging a control program.
5.3 M3/M4/M5/M5.1: Spindle Control Commands
• M3 - Turns on the spindle and starts it accelerating in the clockwise direction
• M4 - Turns on the spindle and starts it accelerating in the counterclockwise direction (reverse)
• M5.1 - Program stop, check - that the spindle has reached the set speed, program continuation
After issuing the M3/M4 command, the CNC allows the execution of G00/G28/G29 commands until the spindle is fully accelerated.
At the first G01/G02/G03 command, the CNC automatically executes the M5.1 command - to control the spindle acceleration
• M5 - Turns off the spindle and starts it braking
M3 S1000 F2000 ; turned on the spindle, started its acceleration G0 X10 Y10 ; idle movement {M5.1} ; Program stop, check - that the spindle has reached the set speed, program continuation ; Command added automatically G1 X20 Y30 ; Part processing M5 ; turned off the spindle, started braking
5.4 M6/M6.1/M6.2/M6.3/M6.4/M6.5/M6.9: Tool Management
• M6 - Tool change
Before the command, you need to declare a new tool using the T command.
After that, issue a command to change the tool M6
If the storage slot number is not defined for the old or new tool (or there is no automatic changer at all), the CNC will display a tool change dialog box.
In this case, it is possible to specify the tool slot or perform the change manually:'
If storage slots are specified for the old and new tool and there is an automatic tool changer, the replacement will occur automatically.
ATTENTION: - The command is not implemented in the CNC. It must be implemented by the user for his auto-changer.
Auxiliary commands:
• M6.1 - Unclamping the tool holder in the spindle
• M6.2 - Clamping the tool holder in the spindle
• M6.3 - Placing the tool in the magazine slot. ATTENTION: The command is not implemented - depends on the auto-changer
• M6.4 - Retrieving the tool from the magazine slot. ATTENTION: The command is not implemented - depends on the auto-changer
• M6.5 - Open the tool change dialog (for manual tool change)
• M6.9 - Measuring the tool height offset via the probe
Example:
T23.2 M6 ; Selecting tool 23 in the second binding and replacing it with the M6 command
5.5 M7/M8/M9: Cooling Control Commands
• M7 - Turns on MQL cooling
• M8 - Turning on the supply of coolant
• M9 - Turns on all cooling systems
5.6 M30: End of Program
The program is completely stopped by the command
5.7. M68.X: Chuck/Vise and Vacuum Table Control
• M68.1 - Clamp Chuck/Vise
• M68.2 - Unclamp Chuck/Vise
• M68.3 - Turn on vacuum to the table
• M68.4 - Turn off vacuum to the table
6. Macro Programming:
6.1. Variables
• Name:
The variable name must always begin with the '#' symbol
Then alphabet characters, numbers, or the '_' symbol can follow in any order.
• Variable value:
Double number, range of values: ±2.2250738585072014 * 10-308 ± 1.7976931348623157 * 10−308
• Expressions:
Expressions must always be enclosed in square brackets []
Exception - when the expression consists of one number.
Examples:
#SDF = 10.1458 #S_1 = 50 #TEST = [#SDF * #S_1 - 10]
6.2. Variable Scope
Variables declared in the control program are only visible in the top-level control program.
When calling a loop command (G83/G85, etc.), these variables will not be visible.
When channels start working, variables are copied to each channel and exist there separately.
I.e. a variable with the same name in different channels can have different values.
When the channel finishes working, its variables are copied to the main control program.
Accordingly, if there was a variable with the same name, the value from the channel that finished its work last will come to the main control program.
6.3. Operators
• + - Addition operator
• - - Subtraction operator
• * - Multiplication operator
• / - Division operator
• % - Remainder of integer division
• == - Logical comparison
• != - Inequality check
• > - "Greater than" comparison
• < - "Less than" comparison
• >= - "Greater than or equal to" comparison
• <= - "Less than or equal to" comparison
6.4. Arithmetic Functions
Arithmetic functions:
• SIN(_) - Sine calculation
• SINH(_) - Hyperbolic sine calculation
• ASIN(_) - Arc-sine calculation
• ASINH(_) - Hyperbolic arc-sine calculation
• COS(_) - Cosine calculation
• COSH(_) - Hyperbolic cosine calculation
• ACOS(_) - Arc-cosine calculation
• ACOSH(_) - Hyperbolic arc-cosine calculation
• TAN(_) - Tangent calculation
• TANH(_) - Hyperbolic Tangent calculation
• ATAN(_) - Arc-Tangent calculation
• ATANH(_) - Hyperbolic Arc-Tangent calculation
• CTG(_) - Cotangent calculation
• FLOOR(_) - Returns the largest integer value less than or equal to the specified number
• CEILING(_) - Returns the smallest integer that is greater than or equal to the given number.
• ROUND(_) - Rounds a value to the nearest integer, using default rounding mode.
• MIN(_,_) - Compares two values with the calculation that is smaller.
• MAX(_,_) - Compares two values with the calculation that is larger.
• CLAMP(_,_,_) - The first value is brought to the Min-Max range specified in the second and third values.
• SQRT(_) - Square root calculation.
• CBRT(_) - Returns the cube root of the specified number.
• LOG(_) - Calculates the natural logarithm of a value.
• ABS(_) - Returns the absolute value of a given number.
• RAD(_) - Returns the angle passed in degrees in radians.
• DEG(_) - Returns the angle passed in radians in degrees.
• TRUNC(_) - Returns the integer part of the parameter.
• MODF(_) - Returns the fractional part of the parameter.
• FUP(_) - Returns the value of the parameter rounded to the nearest integer greater than or equal to the specified one..
Logical functions:
• ISSET(_) - Checks whether a value has been set.
The name of the functions can be written in all registers.
Examples:
#S01 = 90 #SDF = [SQRT(#S01)] #3001 = [MIN(#SDF, #S01)]
6.5. Getting coordinates along the axes "#WORK_X, #MACH_X"
• #WORK_{X/Y/Z/A/B/C} - Getting the calculated (at the time of execution of this frame) working coordinates along the axes
• #MACH_{X/Y/Z/A/B/C} - Getting the calculated (at the time of execution of this frame) machine coordinates along the axes
Examples:
#W01X = [#WORK_X] #M02Z = [#MACH_Z]
6.6. Getting measurement coordinates along the axes using the G31 command "#PROBE_X, #PROBEMACH_X"
• #PROBE_{X/Y/Z/A/B/C} - Getting working measurement coordinates using the G31 command along the axes
• #PROBEMACH_{X/Y/Z/A/B/C} - Getting machine measurement coordinates using the G31 command along the axes
• #PROBEREAL_{X/Y/Z} - Obtaining measured real working coordinates along the axes (taking into account the size of the probe 'ball')
• #PROBEMACHREAL_{X/Y/Z} - Obtaining measured real machine coordinates along the axes (taking into account the size of the probe 'ball')
Examples:
#W01Z = [#PROBE_Z] #M02Z = [#PROBEMACH_Z] #Probe01X_Real = [#PROBEREAL_X] #ProbeMach01Z_Real = [#PROBEMACHREAL_Z]
6.7. Channel number "#CHANNEL"
• #CHANNEL - Returns the current channel number
6.8. Current feed rate in the channel "#FEED"
• #FEED - Current feed rate in the channel
6.9. Current spindle speed in the channel "#SPEED"
• #SPEED - Current spindle speed in the channel
6.10. Current coordinate system in the channel "#G54"
• #G54 - Current coordinate system in the channel, Possible values 54…59
6.11. Getting the coordinate of the reference point "GetReferencePoint()"
• GetReferencePoint("Id_ReferencePoint", "Char_Axis") - Getting the coordinate of the reference point
Where:
"Id_ReferencePoint" - Id of the reference point specified in the PLC by the ReferencePoint declaration
Value from the standard PLC delivery:
• "Houm" - Home position
• "MachineNullChannal" - Zero machine coordinates
• "MachineMinLimitChannal" - Negative axis limit
• "MachinePlusLimitChannal" - Positive axis limit
• "Probe1" - Position before measuring the length of the 1st sensor tool
• "Probe2" - Position before measuring the length of the 2nd sensor tool
• "ToolChangeManual" - Position before manual tool change
• "ToolChangeAuto" - Position before automatic tool change
"Char_Axis" - Letter of the desired axis
Return value - the coordinate of the requested point.
#PosX = [GetReferencePoint("Probe1", "X")]
6.12. Input/Output Control "GetInput()/SetOutput()"
• GETINPUT("Id_Input/Output") - Reading the value of the input/output
• SETOUTPUT("Id_Input/Output") - Writing the output value. Returns 1 if the operation is successful
Where: "Id_Input/Output" - Id Input/Output - declared in the PLC
You can read both the input values and the set output values
You can only write outputs
If the Input/Output is discrete - the value is either 1 or 0.
If the Input/Output is analog - the value is a number.
Attention! If the Output is controlled from the PLC - then changing it from the control program is useless - the PLC will still overwrite the output value
; Reading the output value #Rez = [GetInput("Out_Machine_Test")] ; Writing the output value #Rez = [SetOutput("Out_Machine_Test", 1)]
6.13. Tool Variables
• #TOOLNUM - The current number of the declared (which may not yet be installed) tool in the channel
• #TOOLD - The current diameter of the declared (which may not yet be installed) tool in the channel
• #TOOLH - The current length of the declared (which may not yet be installed) tool in the channel
• #TOOLSLOT - The assigned slot for the declared (which may not yet be installed) tool
• #TOOLCORD - The value of the corrector for the diameter of the declared (which may not yet be installed) tool in the channel
• #TOOLCORH - The value of the corrector for the length of the declared (which may not yet be installed) tool in the channel
• #TOOLTEETH - The number of cutting teeth of the declared (which may not yet be installed) tool
• #TOOLBIND - The binding number of the declared (which may not yet be installed) tool
• #TOOLCORRECTORSX - Tool corrector along the X axis
• #TOOLCORRECTORSY - Tool corrector along the Y axis
• #TOOLCORRECTORSZ - Tool corrector along the Z axis
• #TOOLCORRECTORSU - Tool corrector along the U axis
• #TOOLCORRECTORSV - Tool corrector along the V axis
• #TOOLCORRECTORSW - Tool corrector along the W axis
• #CURTOOLNUM - The current number of the current (which is in the spindle) tool in the channel
• #CURTOOLD - The current diameter of the current (which is in the spindle) tool in the channel
• #CURTOOLH - The current length of the current (which is in the spindle) tool in the channel
• #CURTOOLSLOT - The assigned slot for the current (which is in the spindle) tool
• #CURTOOLBIND - The binding number of the current (which is in the spindle) tool
Examples:
#01 = [#TOOLNUM]
6.17. G-flags of modal groups
• #GROUP_G0_G3 - Group of modal commands G00/G01/G02/G03/G31 - Possible values 0/1/2/3/31
• #GROUP_G17_G19 - Group of modal commands G17/G18/G19 - Possible values 17/18/19
• #GROUP_G40_G42 - Group of modal commands G40/G41/G42 - Possible values 40/41/42
• #GROUP_G43_G49 - Group of modal commands G43/G49 - Possible values 43/49
• #GROUP_G52 - Group of modal commands G52/G52.9 - Possible values 52/0
• #GROUP_G54 - Group of modal commands G54…G59 - Possible values 1…6
• #GROUP_G61_G64 - Group of modal commands G61/G64 - Possible values 61/64
• #GROUP_G68 - Group of modal commands G68/G68.9 - Possible values 68/0
• #GROUP_G69 - Group of modal commands G69/G69.2/G69.9 - Possible values 69/692/0
• #GROUP_G90_G91 - Group of modal commands G90/G91 - Possible values 90/91
• #GROUP_G90.1_G91.1 - Group of modal commands G90.1/G91.1 - Possible values 901/911
• #GROUP_G93_G95 - Group of modal commands G93/G95 - Possible values 93/94/95
• #GROUP_G98_G99 - Group of modal commands G98/G99 - Possible values 98/99
Examples:
#01 = [#GROUP_G54] #02 = [#GROUP_G17_G19]
6.18. PRINT operator
The operator is designed to send messages (notifications).
Sent messages can be viewed in the "Log" window
Examples:
#01 = [#GROUP_G54] PRINT #RezZ PRINT [#RezZ - #ToolProbe1_ZCoord] PRINT ["Label #1"] PRINT ["Offset tool on Z = " + #RezZ] PRINT ["Offset tool on Z = " + [#RezZ - #ToolProbe1_ZCoord]]
6.19. Unconditional jump operator "GOTO"
Format:
GOTO Label
Where:
• Label - Frame label to which the transition will occur.
Examples:
GOTO N100 ; Jump to frame N100 #01 = [#GROUP_G54] ; This frame will be skipped N100 PRINT [Label #1] ; The control program will continue from this frame
6.20. Subprogram call "CALL "CALL" / "RETURN"
Format:
CALL Label {P[Pass Name]}
Where:
• Label - Frame label to which the function call will occur.
• P[_] - Name - which will be displayed in the log.
Return from the function occurs using the operator:
RETURN
Example:
CALL N100 P[Test pass]; Jump to frame N100 #01 = [#GROUP_G54] ; This frame will be executed after the function is executed M30 ; Program stop N100 ; Start of subroutine PRINT [Label #1] RETURN ; Return from subroutine
6.21. Conditional operator "IF" / "ELSEIF" / "ELSE" / "ENDIF"
The condition operator is divided into three parts:
• IF…ElseIF/ELSE/ENDIF block (if the condition is true)
• ElseIF…ELSE/ENDIF block (if the condition is true)
• ELSE…ENDIF block (if the condition is false).
The parameters of IF specify a logical expression.
Format:
IF [Logical expression]
  operators that are executed if the condition is true
ELSEIF [Logical expression]
  operators that are executed if the second condition is true
ELSE
  operators that are executed if the condition is false
ENDIF
Example:
IF [!ISSET(#SDF)] PRINT "Variable #SDF is not defined"] ELSEIF [#SDF != 0] PRINT "Variable #SDF is not equal to zero" ELSE PRINT "Variable #SDF is equal to zero" ENDIF
6.22. Loop operator "WHILE" / "DONE"
WHILE is a loop with a pre-condition.
Any expression that returns a BOOL type value can act as a condition.
The loop will execute as long as the expression returns TRUE.
If the expression returns false, the loop will stop.
Example (Loop that executes 4 times):
#X = 0 WHILE [#X < 4] PRINT "Loop iteration #" #X #X = [#X+1] DONE PRINT "Loop completed."