王榕慧 发表于 2025-8-28 20:41:16

元泰精密华中8型数控系统2.42版本NX后处理定制方案

今天接到元泰精密购置华中AC结构数控系统版本为8型2.42版本,NX后处理参数定制如下,请大家参考:
记事本打开YSUG5_HNC.ini文件
按如下修改
set L1 {%\nO 1 4]}
set L13 {#53620=$mom_tool_number\n($mom_operation_name)}备注:可以不修改,默认
set L16 {N$NP T#53620 M06} 备注:可以不修改,默认
set L36 {G00 G90 G53 Y0.}
set L37 {M141\nM146}
set L38 {G00 G90 A0. C0.}
set L120 {A}
set L121 {X}
set L122 {4+}
set L123 {120}
set L124 {0}
set L125 {M141}
set L126 {M40}
set L130 {C}
set L131 {Z}
set L132 {5+}
set L133 {360}
set L134 {-360}
set L135 {M146}
set L136 {M45}
set L137 {G00 G90 G53 Z0.\nG00 G90 G53 Y0.}

然后记事本打开YSUG5_HNC.def文件
ctrl+C搜索
BLOCK_TEMPLATE cycle_off

修改前                                 

BLOCK_TEMPLATE cycle_off
{
       G_motion[$mom_sys_cycle_off]
      
}


修改后
BLOCK_TEMPLATE cycle_off
{
       G_motion[$mom_sys_cycle_off]
       Text[\nG109 B=0]
}

搜索 BLOCK_TEMPLATE cycle_tap
修改前
BLOCK_TEMPLATE cycle_tap
{
       G_feed[$mom_sys_feed_rate_mode_code($feed_mode)]\opt
       G_return[$mom_sys_cycle_ret_code($mom_cycle_retract_mode)]\opt
       tap_string[$final_tap_mode]
       G_adjust[$mom_sys_adjust_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       fourth_axis[$mom_out_angle_pos(0)]
       fifth_axis[$mom_out_angle_pos(1)]
       H[$mom_tool_adjust_register]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_dwell[$mom_cycle_delay]\opt
       F[$feed]
}

修改后

BLOCK_TEMPLATE cycle_tap
{
       G_feed[$mom_sys_feed_rate_mode_code($feed_mode)]\opt
       G_return[$mom_sys_cycle_ret_code($mom_cycle_retract_mode)]\opt
       tap_string[$final_tap_mode]
       G_adjust[$mom_sys_adjust_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       fourth_axis[$mom_out_angle_pos(0)]
       fifth_axis[$mom_out_angle_pos(1)]
       H[$mom_tool_adjust_register]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_dwell[$mom_cycle_delay]\opt
       F[$feed/$mom_spindle_speed]
}

搜索 BLOCK_TEMPLATE cycle_tap_3

修改前
BLOCK_TEMPLATE cycle_tap_3
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       tap_string[$final_tap_mode]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       Q_cutcom[$mom_cycle_delay]\opt
       F[$feed]
}

修改后

BLOCK_TEMPLATE cycle_tap_3
{
       Text
       Text[ \n]\nows
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       tap_string[$final_tap_mode]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       Text
       Text
       Q_cutcom[$mom_cycle_delay]\opt
       F[$feed/$mom_spindle_speed]
}

搜索BLOCK_TEMPLATE cycle_tap_4

修改前

BLOCK_TEMPLATE cycle_tap_4
{
       G_feed[$mom_sys_feed_rate_mode_code($feed_mode)]\opt
       G_return[$mom_sys_cycle_ret_code($mom_cycle_retract_mode)]\opt
       tap_string[$final_tap_mode]
       G_adjust[$mom_sys_adjust_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       fourth_axis[$mom_out_angle_pos(0)]
       fifth_axis[$mom_out_angle_pos(1)]
       H[$mom_tool_adjust_register]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_dwell[$mom_cycle_delay]\opt
       F[$feed]
}

修改后
BLOCK_TEMPLATE cycle_tap_4
{
       G_feed[$mom_sys_feed_rate_mode_code($feed_mode)]\opt
       G_return[$mom_sys_cycle_ret_code($mom_cycle_retract_mode)]\opt
       tap_string[$final_tap_mode]
       G_adjust[$mom_sys_adjust_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       fourth_axis[$mom_out_angle_pos(0)]
       fifth_axis[$mom_out_angle_pos(1)]
       H[$mom_tool_adjust_register]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_dwell[$mom_cycle_delay]\opt
       F[$feed/$mom_spindle_speed]
}

搜索 BLOCK_TEMPLATE cycle_tap_break_chip
修改前
BLOCK_TEMPLATE cycle_tap_break_chip
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       tap_string
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_dwell[$mom_cycle_delay]\opt
       cycle_step[$mom_cycle_step1]\opt
       F[$feed]
}


修改后
BLOCK_TEMPLATE cycle_tap_break_chip
{
       Text
       Text[ \n]\nows
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       tap_string
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       Text
       Text
       cycle_dwell[$mom_cycle_delay]\opt
       cycle_step[$mom_cycle_step1]\opt
       F[$feed/$mom_spindle_speed]
}


搜索 BLOCK_TEMPLATE cycle_tap_deep
修改前
BLOCK_TEMPLATE cycle_tap_deep
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       tap_string
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_dwell[$mom_cycle_delay]\opt
       cycle_step[$mom_cycle_step1]\opt
       F[$feed]
}

修改后
BLOCK_TEMPLATE cycle_tap_deep
{
       Text
       Text[ \n]\nows
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       tap_string
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       Text
       Text
       cycle_dwell[$mom_cycle_delay]\opt
       cycle_step[$mom_cycle_step1]\opt
       F[$feed/$mom_spindle_speed]
}

搜索 BLOCK_TEMPLATE cycle_tap_float
修改前
BLOCK_TEMPLATE cycle_tap_float
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       tap_string[$final_tap_mode]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       F[$feed]
}

修改后
BLOCK_TEMPLATE cycle_tap_float
{
       Text
       Text[ \n]\nows
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       tap_string[$final_tap_mode]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       Text
       Text
       F[$feed/$mom_spindle_speed]
}



搜索BLOCK_TEMPLATE initial_move_G00_XYAC_M08
修改前
BLOCK_TEMPLATE initial_move_G00_XYZAC_M08
{
       G_motion[$mom_sys_rapid_code]
       G_mode[$mom_sys_output_code($mom_output_mode)]
       X[$mom_pos(0)]
       Y[$mom_pos(1)]
       Z[$mom_pos(2)]
       fourth_axis[$mom_out_angle_pos(0)]
       fifth_axis[$mom_out_angle_pos(1)]
       M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt
}
修改后
BLOCK_TEMPLATE initial_move_G00_XYAC_M08
{
      
       G_motion[$mom_sys_rapid_code]
       Text
       G_mode[$mom_sys_output_code($mom_output_mode)]
       X[$mom_pos(0)]
       Y[$mom_pos(1)]
       fourth_axis[$mom_out_angle_pos(0)]
       fifth_axis[$mom_out_angle_pos(1)]
       M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt
}

搜索 ADDRESS cycle_orient块

ADDRESS cycle_orient
{
      FORMAT      Coordinate
      FORCE       off
      MAX         99999.999 Truncate
      MIN         -99999.999 Truncate
      LEADER      "Q"
      ZERO_FORMAT Zero_real
}
复制一份,粘贴为
ADDRESS cycle_orient1
{
      FORMAT      Coordinate
      FORCE       off
      MAX         99999.999 Truncate
      MIN         -99999.999 Truncate
      LEADER      "I"
      ZERO_FORMAT Zero_real
}

继续搜索 BLOCK_TEMPLATE cycle_bore_no_drag
修改前
BLOCK_TEMPLATE cycle_bore_no_drag
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       G_motion[$mom_sys_cycle_bore_no_drag_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_orient[$mom_cycle_orient]\opt
       F[$feed]
}

修改后:
BLOCK_TEMPLATE cycle_bore_no_drag
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       G_motion[$mom_sys_cycle_bore_no_drag_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_orient1[$mom_cycle_orient]\opt
       F[$feed]
}

继续搜索 BLOCK_TEMPLATE cycle_drill_break_chip
修改前
BLOCK_TEMPLATE cycle_drill_break_chip
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       G_motion[$mom_sys_cycle_drill_break_chip_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_step[$mom_cycle_step1]
       F[$feed]
       KKK
}
修改后
BLOCK_TEMPLATE cycle_drill_break_chip
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       G_motion[$mom_sys_cycle_drill_break_chip_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_step[-$mom_cycle_step1]
       F[$feed]
       KKK
}
继续搜索:BLOCK_TEMPLATE cycle_drill_deep
修改前:
BLOCK_TEMPLATE cycle_drill_deep
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       G_motion[$mom_sys_cycle_drill_deep_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_step[$mom_cycle_step1]
       F[$feed]
       KKK
}
修改后:
BLOCK_TEMPLATE cycle_drill_deep
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       G_motion[$mom_sys_cycle_drill_deep_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_step[-$mom_cycle_step1]
       F[$feed]
       KKK
}

继续搜索:BLOCK_TEMPLATE cycle_drill_dwell
修改前:
BLOCK_TEMPLATE cycle_drill_dwell
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       G_motion[$mom_sys_cycle_drill_dwell_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_dwell[$mom_cycle_delay]\opt
       F[$feed]
}
修改后:
BLOCK_TEMPLATE cycle_drill_dwell
{
       G_return[$mom_sys_cycle_ret_code(AUTO)]\opt
       G_motion[$mom_sys_cycle_drill_dwell_code]
       X[$mom_cycle_feed_to_pos(0)]
       Y[$mom_cycle_feed_to_pos(1)]
       Z[$mom_cycle_feed_to_pos(2)]
       R[$mom_cycle_rapid_to_pos($mom_cycle_spindle_axis)]
       cycle_dwell[-$mom_cycle_delay]\opt
       F[$feed]
}

搜索 BLOCK_TEMPLATE initial_move_G43ZH (备注:此项根据厂家机床格式可以默认,不修改)
修改前
BLOCK_TEMPLATE initial_move_G43ZH
{
       G_adjust[$mom_sys_adjust_code]
       Z[$mom_pos(2)]
       H[$mom_tool_adjust_register]
}
修改后
BLOCK_TEMPLATE initial_move_G43ZH
{
       G_adjust[$mom_sys_adjust_code]
       Z[$mom_pos(2)]
       H[#53620]
}

搜索BLOCK_TEMPLATE initial_move_G43ZH_M08
修改前
BLOCK_TEMPLATE initial_move_G43ZH_M08
{
       G_adjust[$mom_sys_adjust_code]
       Z[$mom_pos(2)]
       H[$mom_tool_adjust_register]
       M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt
}

修改后
BLOCK_TEMPLATE initial_move_G43ZH_M08
{
       G_adjust[$mom_sys_adjust_code]
       Z[$mom_pos(2)]
       H[#53620]
       M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt
}

搜索 BLOCK_TEMPLATE initial_move_Z_cycle
修改前
BLOCK_TEMPLATE initial_move_Z_cycle
{
       G_adjust[$mom_sys_adjust_code]
       Z[$mom_cycle_retract_to_pos(2)]
       H[$mom_tool_adjust_register]
}

修改后
BLOCK_TEMPLATE initial_move_Z_cycle
{
       G_adjust[$mom_sys_adjust_code]
       Z[$mom_cycle_retract_to_pos(2)]
       H[#53620]
}

搜索 BLOCK_TEMPLATE length_compensation
修改前
BLOCK_TEMPLATE length_compensation
{
       G_adjust
       H[$mom_tool_adjust_register]
}
修改后
BLOCK_TEMPLATE length_compensation
{
       G_adjust
       H[#53620]
}

搜索 BLOCK_TEMPLATE length_compensation_fanuc
修改前
BLOCK_TEMPLATE length_compensation_fanuc
{
       Text[$MCS\n]\nows
       Text
       rotate_X[$mom_pos(0)]
       rotate_Y[$mom_pos(1)]
       Text\nows
       G_adjust
       H[$mom_tool_adjust_register]
}
修改后
BLOCK_TEMPLATE length_compensation_fanuc
{
       Text[$MCS\n]\nows
       Text
       rotate_X[$mom_pos(0)]
       rotate_Y[$mom_pos(1)]
       Text\nows
       G_adjust
       H[#53620]
}

最终效果:
%
O0001
(2025/08/28 20:51 DAY4)
(TIME=190.75 MIN)
(==========TOOL LIST START=========)
(刀号--刀补--径补--切削深度--刀具名称)
(T13 | H13 | D00 | -13.95 | TAP-M5X0.8)
(==========TOOL LIST END===========)
G17 G40 G49 G80
G00 G90 G53 Z0.
#53620=13
(攻丝)
N1 T#53620 M06
S200 M03
(TAP-M5X0.8 D=5.00 R=0.00)
G49
M141
M146
G54
G00 G90 A0.0 C0.0
G43.4 H#53620
G68.2 X0.0 Y0.0 Z0.0 I0.0 J0.0 K0.0
G53.1
G00 G94 G90 X44.7857 Y-2.2941 M08
M40
M45
Z30.
G108 B0=0
G98 G84 X44.7857 Y-2.2941 Z-13.958 R1. J2 E2 Q2. F.8
G108 B0=0
Y7.8659 J2 E2
G108 B0=0
X7.1427 Y15.1237 J2 E2
G108 B0=0
X-22.557 Y-1.6727 J2 E2
G108 B0=0
X-26.5094 Y6.9935 J2 E2
G108 B0=0
G98 G84 X-38.9144 Y22.3179 Z-12.7139 R-8.3764 J2 E2 F.8
G80
G109 B=0
G69
G49
M05
M09
G00 G90 G53 Z0.
G00 G90 G53 Y0.
G00 G90 G53 Y0.
M141
M146
G00 G90 A0. C0.
M30
%
已经修改好的模板:


难得糊涂33 发表于 2025-8-28 21:07:07

牛,看着一头雾水
页: [1]
查看完整版本: 元泰精密华中8型数控系统2.42版本NX后处理定制方案