julianwss 发表于 2025-8-29 19:42:38

tombai691019 发表于 2025-8-29 19:21
这是判断正牙反牙攻丝,判断三种机器类型,判断是否输出Q值的代码吧。

对的,但是在DRILL模块报警,manking下不会

像风一样飞 发表于 2025-8-30 07:53:26

报警信息也要拿出来啊

julianwss 发表于 2025-8-30 09:24:44

像风一样飞 发表于 2025-8-30 07:53
报警信息也要拿出来啊

报警这个出错

julianwss 发表于 2025-8-30 09:34:22

像风一样飞 发表于 2025-8-30 07:53
报警信息也要拿出来啊

# Use this command to determine and output proper plane code
# when G17/18/19 is used in the cycle definition.
#
# <04-15-08 gsl> - Add initialization for protection
# <03-06-08 gsl> - Declare needed global variables
# <02-28-08 gsl> - Make use of mom_spindle_axis
# <06-22-09 gsl> - Call PB_CMD_set_principal_axis
#

#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This option can be set to 1, if the address of cycle's
# principal axis needs to be suppressed. (Ex. Siemens controller)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   set suppress_principal_axis 0


#++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This option can be set to 1, if the plane code needs
# to be forced out @ the start of every set of cycles.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++
   set force_plane_code 0

global mom_cycle_spindle_axis afterG68 afterG68_A afterG68_C drill_G682
global mom_out_angle_pos dpp_ge roaAMA roaAMC dri_A
global mom_sys_adjust_code dri_C G80_A_C
global mom_tool_pitch h_d_wa out_G69
global mom_prev_out_angle_pos
global mom_kin_machine_type
global mom_pos
global dpp_ge
global mom_cycle_rapid_to_pos mom_cycle_rapid_to
global mom_cycle_retract_to_pos mom_cycle_retract_to
global mom_cycle_feed_to_pos mom_cycle_feed_to
global mom_out_angle_pos
global mom_cycle_feed_to_pos
global mom_mcs_goto
global mom_prev_pos un_cl
global mom_prev_out_angle_pos
global mom_kin_machine_type
global save_mom_kin_machine_type
global mom_tool_axis drill_angle
global mom_result no_G682 dri_A_C_Z roaA_A roaC_C roaA_C
set dri_A
set dri_C
set G80_A_C 0
set drill_angle 0

   PB_CMD_set_principal_axis


   switch $mom_cycle_spindle_axis {
      0 {
         set principal_axis X
      }
      1 {
         set principal_axis Y
      }
      2 {
         set principal_axis Z
      }
      default {
         set principal_axis ""
      }
   }


   if { $suppress_principal_axis && > 0 } {
      MOM_suppress once $principal_axis
   }


   if { $force_plane_code } {
      global cycle_init_flag

      if { && } {
         MOM_force once G_plane
      }
   }

# 钻孔坐标位置:
if { $roaA_A == 1 || $roaC_C == 1 } {
if { != 0 } {
if { > $dri_A_C_Z} {
MOM_output_literal "Z"
}
}
set roaA_A 0
set roaC_C 0
}

if { $roaA_C == 1 } {
if { != 0 } {
MOM_output_literal "output_MAX_Z"
}
set roaA_C 0
}

if {$afterG68 == 1} {
if { != $afterG68_A} {
MOM_do_template output_caxis_unclamp1
}
if { != $afterG68_C} {
#MOM_do_template output_caxis_unclamp2
}
if { != $afterG68_A || != $afterG68_C} {
if { == 0.0} {
MOM_output_literal "output_MAX_Z"
MOM_do_template move_stop_time
#MOM_force once X Y
MOM_do_template machine_axis_A_C_Drill
MOM_do_template output_clamp1 ;# 如果前面加“#”,第四轴就不会频繁出现夹紧命令(钻孔)。
#MOM_do_template output_clamp2 ;# 如果前面加“#”,第五轴就不会频繁出现夹紧命令(钻孔)。
} else {
MOM_do_template move_stop_time
#MOM_force once X Y
MOM_do_template machine_axis_A_C_Drill
MOM_do_template output_clamp1 ;# 如果前面加“#”,第四轴就不会频繁出现夹紧命令(钻孔)。
#MOM_do_template output_clamp2 ;# 如果前面加“#”,第五轴就不会频繁出现夹紧命令(钻孔)。
}
}

set afterG68 0
}


julianwss 发表于 2025-8-30 09:35:11

像风一样飞 发表于 2025-8-30 07:53
报警信息也要拿出来啊

是不是这一串变量引起的

像风一样飞 发表于 2025-8-30 10:58:20

报警显示找不到C轴的值,这是刀轴矢量报警,看你后处理名字是个四轴后处理,应该是用3+2套的,可以试一下把set dri_C 前面加个#,还有涉及到第五轴的行内容改一下,即屏蔽或删除第五轴的信息试试。实在不行就把你的后处理传上来,大家谁有空可以帮你改一下。

xlyou 发表于 2025-8-30 11:23:57

能把编程好的部件发出来吗?

julianwss 发表于 2025-8-30 15:16:25

xlyou 发表于 2025-8-30 11:23
能把编程好的部件发出来吗?

自己画的,这边删错了变量

julianwss 发表于 2025-8-30 15:19:27

像风一样飞 发表于 2025-8-30 10:58
报警显示找不到C轴的值,这是刀轴矢量报警,看你后处理名字是个四轴后处理,应该是用3+2套的,可以试一下把 ...

网上下载的,学习的后处理,想把M29S,和自动判断提取出来,结果出错了

tombai691019 发表于 2025-8-30 18:14:35

julianwss 发表于 2025-8-30 15:19
网上下载的,学习的后处理,想把M29S,和自动判断提取出来,结果出错了
...

你发出来这个后处理是谁在XLYOU坛友前面分享过的4轴后处理基础上改的,里面加了点东西,没什么新东西。
页: 1 [2] 3
查看完整版本: 队友们,DRILL攻牙报警,MAKING不会,有董的,帮我改下可以吗