en:software:mdurosettacncsoftware:pre-defined_named_variables

18. Pre-defined Named Variables

The G-code compiler has a default set of read-only named variables, which can be useful in program and macro editing.
Use these parameters instead of direct constant values, where possible. So you can maintain macro compatibility between the various software versions.

  • Named Parameters represents the CNC state at start compiling phase.
  • Named Parameters for lengths, spaces and angles are expressed in Metric System.

There are eight groups:

  1. #<sys.xxx> which contains info about the system.
  2. #<math.xxx> which contains usefull math constants.
  3. #<cnc.xxx> which contains some of CNC setup settings.
  4. #<compile.xxx> which contains the compile enums.
  5. #<kinematics.model.xxx which contains the kinematics enums.
  6. #<axis.xxx> which contains the axis enums.
  7. #<tool.xxx> which contains the tool enums.
  8. #<probe.xxx> which contains the probe enums.
  9. #<wait_input.xxx> which contains the M66 wait enums.
  10. #<pick_place.xxx> which contains the ATCM enums.
Named Variable Description
#<sys.version.major> Version of CNC Core System: Major version.
#<sys.version.minor> Version of CNC Core System: Minor version.
#<sys.version.release> Version of CNC Core System: Release.
#<sys.version.build> Version of CNC Core System: Build.
#<sys.customer_id> Customer ID (0 for unbranded boards).
#<sys.interface_level> Interface Level (8 for Control Software 1.8.x).


#<math.max> Max value.
#<math.min> Min value.
#<math.nan> Nan value.
#<math.infinity> Infinity value.
#<math.neg_infinity> Negative Infinity value.
#<math.e> Euler's number.
#<math.pi> Archimedes constant.
#<math.ln_2> Natural Log of 2.
#<math.ln_10> Natural Log of 10.
#<math.ln_pi> Natural Log of pi.
#<math.to_mm> Factor to convert inches to mm (25.4).
#<math.to_in> Factor to convert mm to inches (1/25.4).
#<math.to_rad> Factor to convert deg to rad (pi/180).
#<math.to_deg> Factor to convert rad to deg (180/pi).


#<cnc.compile.mode> Compile Mode:
#<compile.mode_mdi> = Compiling an MDI program.
#<compile.mode_macro> = Compiling a Macro program.
#<compile.mode_program> = Compiling the Main G-Code program.
#<compile.mode_program_from_line> = Compiling the Main G-Code program starting from a specific line.
#<compile.mode_program_for_resume> = Compiling the Main G-Code program for a RESUME after STOP command.
#<compile.mode_program_for_resume_from_line> = Compiling the Main G-Code program for a RESUME from Line after STOP command.
#<compile.mode_program_for_analysis> = Compiling the Main G-Code program for analysis.
#<cnc.compile.line> Compile Line: Contains the start Line when #<cnc.compile.mode> = #<compile.mode_program_from_line> otherwise it is 0.

#<cnc.machine_type> Machine Type:
0 = Mill.
#<cnc.kinematics_model> Kinematics Model:
0 = Trivial.
1 = Independent Rotational Axes.
2 = Rotary Table AC.
3 = Rotary Table BC.
4 = Tilting Spindle AC.

#<cnc.x.type> X Axis Type:
0 = Linear Axis
#<cnc.x.max_vel> X Axis Max Velocity [mm/min]
#<cnc.x.acc> X Axis Acceleration [mm/s²]
#<cnc.x.min_lim> X Axis Min Limit [mm]
#<cnc.x.max_lim> X Axis Max Limit [mm]

#<cnc.y.type> Y Axis Type:
0 = Linear Axis
#<cnc.y.max_vel> Y Axis Max Velocity [mm/min]
#<cnc.y.acc> Y Axis Acceleration [mm/s²]
#<cnc.y.min_lim> Y Axis Min Limit [mm]
#<cnc.y.max_lim> Y Axis Max Limit [mm]

#<cnc.z.enabled> Z Axis Enabled State:
0 = Disabled
1 = Enabled
#<cnc.z.type> Z Axis Type:
0 = Linear Axis
#<cnc.z.max_vel> Z Axis Max Velocity [mm/min]
#<cnc.z.acc> Z Axis Acceleration [mm/s²]
#<cnc.z.min_lim> Z Axis Min Limit [mm]
#<cnc.z.max_lim> Z Axis Max Limit [mm]

#<cnc.a.type> A Axis Type:
0 = Linear Axis
1 = Rotary Axis Free
2 = Rotary Axis for Head
3 = Rotary Axis for Table
#<cnc.a.max_vel> A Axis Max Velocity [mm/min]
#<cnc.a.acc> A Axis Acceleration [mm/s²]
#<cnc.a.min_lim> A Axis Min Limit [mm]
#<cnc.a.max_lim> A Axis Max Limit [mm]
#<cnc.a.motion_mode> A Axis Motion Mode:
0 = Continuous
1 = Indexing
#<cnc.a.convention> A Axis Convention:
0 = Normal
1 = Inverse
#<cnc.a.wrapped_rotary> A Axis Wrapped Rotary State:
0 = Disabled
1 = Enabled
#<cnc.a.parallel_to> A Axis Parallet to:
0 = X
1 = Y
2 = Z
#<cnc.a.origin_mode> A Axis Origin Mode:
0 = Custom
1 = WCS 1 - G54
2 = WCS 2 - G55
3 = WCS 3 - G56
4 = WCS 4 - G57
5 = WCS 5 - G58
6 = WCS 6 - G59
7 = WCS 7 - G59.1
8 = WCS 8 - G59.2
9 = WCS 9 - G59.3
#<cnc.a.origin_x> A Axis Origin X [mm]
#<cnc.a.origin_y> A Axis Origin Y [mm]
#<cnc.a.origin_z> A Axis Origin Z [mm]

#<cnc.b.type> B Axis Type:
0 = Linear Axis
1 = Rotary Axis Free
3 = Rotary Axis for Table
#<cnc.b.max_vel> B Axis Max Velocity [mm/min]
#<cnc.b.acc> B Axis Acceleration [mm/s²]
#<cnc.b.min_lim> B Axis Min Limit [mm]
#<cnc.b.max_lim> B Axis Max Limit [mm]
#<cnc.b.motion_mode> B Axis Motion Mode:
0 = Continuous
1 = Indexing
#<cnc.b.convention> B Axis Convention:
0 = Normal
1 = Inverse
#<cnc.b.wrapped_rotary> B Axis Wrapped Rotary State:
0 = Disabled
1 = Enabled
#<cnc.b.parallel_to> B Axis Parallet to:
0 = X
1 = Y
2 = Z
#<cnc.b.origin_mode> B Axis Origin Mode:
0 = Custom
1 = WCS 1 - G54
2 = WCS 2 - G55
3 = WCS 3 - G56
4 = WCS 4 - G57
5 = WCS 5 - G58
6 = WCS 6 - G59
7 = WCS 7 - G59.1
8 = WCS 8 - G59.2
9 = WCS 9 - G59.3
#<cnc.b.origin_x> B Axis Origin X [mm]
#<cnc.b.origin_y> B Axis Origin Y [mm]
#<cnc.b.origin_z> B Axis Origin Z [mm]

#<cnc.c.type> C Axis Axis Type:
0 = Linear Axis
1 = Rotary Axis Free
2 = Rotary Axis for Head
3 = Rotary Axis for Table
#<cnc.c.max_vel> C Axis Max Velocity [mm/min]
#<cnc.c.acc> C Axis Acceleration [mm/s²]
#<cnc.c.min_lim> C Axis Min Limit [mm]
#<cnc.c.max_lim> C Axis Max Limit [mm]
#<cnc.c.motion_mode> C Axis Motion Mode:
0 = Continuous
1 = Indexing
#<cnc.c.convention> C Axis Convention:
0 = Normal
1 = Inverse
#<cnc.c.wrapped_rotary> C Axis Wrapped Rotary State:
0 = Disabled
1 = Enabled
#<cnc.c.parallel_to> C Axis Parallet to:
0 = X
1 = Y
2 = Z
#<cnc.c.origin_mode> C Axis Origin Mode:
0 = Custom
1 = WCS 1 - G54
2 = WCS 2 - G55
3 = WCS 3 - G56
4 = WCS 4 - G57
5 = WCS 5 - G58
6 = WCS 6 - G59
7 = WCS 7 - G59.1
8 = WCS 8 - G59.2
9 = WCS 9 - G59.3
#<cnc.c.origin_x> C Axis Origin X [mm]
#<cnc.c.origin_y> C Axis Origin Y [mm]
#<cnc.c.origin_z> C Axis Origin Z [mm]

#<cnc.u.type> U Axis Type:
4 = Gantry Axis for X
5 = Gantry Axis for Y
6 = Gantry Axis for Z
#<cnc.u.max_vel> U Axis Max Velocity [mm/min]
#<cnc.u.acc> U Axis Acceleration [mm/s²]
#<cnc.u.min_lim> U Axis Min Limit [mm]
#<cnc.u.max_lim> U Axis Max Limit [mm]

#<cnc.v.type> V Axis Type:
4 = Gantry Axis for X
5 = Gantry Axis for Y
6 = Gantry Axis for Z
#<cnc.v.max_vel> V Axis Max Velocity [mm/min]
#<cnc.v.acc> V Axis Acceleration [mm/s²]
#<cnc.v.min_lim> V Axis Min Limit [mm]
#<cnc.v.max_lim> V Axis Max Limit [mm]

#<cnc.w.enabled> W Axis Enabled State:
0 = Disabled
1 = Enabled
#<cnc.w.type> W Axis Type:
4 = Gantry Axis for X
5 = Gantry Axis for Y
6 = Gantry Axis for Z
#<cnc.w.max_vel> W Axis Max Velocity [mm/min]
#<cnc.w.acc> W Axis Acceleration [mm/s²]
#<cnc.w.min_lim> W Axis Min Limit [mm]
#<cnc.w.max_lim> W Axis Max Limit [mm]


#<cnc.spindle.max_speed> Spindle Max Speed [rpm].

#<cnc.rotary_table.d_x> Rotary Table D:X [mm].
#<cnc.rotary_table.d_y> Rotary Table D:Y [mm].
#<cnc.rotary_table.d_z> Rotary Table D:Z [mm].

#<cnc.tilting_head.h_x> Tilting Head H:X [mm].
#<cnc.tilting_head.h_y> Tilting Head H:Y [mm].
#<cnc.tilting_head.h_z> Tilting Head H:Z [mm].
#<cnc.tilting_head.j_x> Tilting Head J:X [mm].
#<cnc.tilting_head.j_y> Tilting Head J:Y [mm].
#<cnc.tilting_head.j_z> Tilting Head J:Z [mm].


#<compile.mode_mdi> Compile Mode: MDI (1).
#<compile.mode_macro> Compile Mode: Macro (2).
#<compile.mode_program> Compile Mode: Program (3).
#<compile.mode_program_from_line> Compile Mode: Program from Line (4).
#<compile.mode_program_for_resume> Compile Mode: Program for Resume (5).
#<compile.mode_program_for_resume_from_line> Compile Mode: Program for Resume (6).
#<compile.mode_program_for_analysis> Compile Mode: Program for Analysis (7).


#<axis.type.disabled> Axis Type: Disabled (0).
#<axis.type.linear> Axis Type: Linear (1).
#<axis.type.rotary_free> Axis Type: Rotary Free (2).
#<axis.type.rotary_head> Axis Type: Rotary Head (3).
#<axis.type.rotary_table> Axis Type: Rotary Table (4).
#<axis.type.gantry_1> Axis Type: Gantry 1 (5).
#<axis.type.gantry_2> Axis Type: Gantry 2 (6).


#<tool.type.generic> Tool Type: Generic (0).
#<tool.type.flat_end_mill> Tool Type: Flat End Mill (1).
#<tool.type.ball_nose_end_mill> Tool Type: Ball Nose End Mill (2).
#<tool.type.drill> Tool Type: Drill (3).
#<tool.type.probe> Tool Type: Probe (4).
#<tool.type.saw> Tool Type: Saw (5).
#<tool.type.plasma> Tool Type: Plasma (6).
#<tool.type.drag_knife> Tool Type: Drag Knife (7).
#<tool.type.lathe> Tool Type: Lathe (8).


#<probe.state.succeed> Probe State: Succeeded (0). Probe state is available at #5700.
#<probe.state.not_tripped> Probe State: Not Tripped (-1). Probe state is available at #5700.
#<probe.state.already_tripped> Probe State: Already Tripped (-2). Probe state is available at #5700.


#<wait_input.low> M66 L parameter: Waits for the selected input to reach the LOW state (0).
#<wait_input.high> M66 L parameter: Waits for the selected input to reach the HIGH state (1).
#<wait_input.fall> M66 L parameter: Waits for the selected input to perform a FALL event (2).
#<wait_input.rise> M66 L parameter: Waits for the selected input to perform a RISE event (3).
#<wait_input.immediate> M66 L parameter: Return immediately and the input value is stored in #5720 (4).
#<wait_input.alarm_low> M66 L parameter: Waits for the selected input to reach the LOW state and generate a CNC alarm if timeout elapses while waiting (10).
#<wait_input.alarm_high> M66 L parameter: Waits for the selected input to reach the HIGH state and generate a CNC alarm if timeout elapses while waiting (11).
#<wait_input.alarm_fall> M66 L parameter: Waits for the selected input to perform a FALL event and generate a CNC alarm if timeout elapses while waiting (12).
#<wait_input.alarm_rise> M66 L parameter: Waits for the selected input to perform a RISE event and generate a CNC alarm if timeout elapses while waiting (13).
#<wait_input.success> Status of the last M66 in #5722: “Wait Input” operation ended with success state (0).
#<wait_input.failure> Status of the last M66 in #5722: “Wait Input” operation ended with failure state (1).


#<pick_place.mode_pick> In #<atcm.pick_place.mode> is requested a pick action (1).
#<pick_place.mode_place> In #<atcm.pick_place.mode> is requested a place action (2).
#<pick_place.mode_place_pick> In #<atcm.pick_place.mode> is requested a place & pick action (3).
  • Last modified: 2023/03/22 09:07
  • by 127.0.0.1