|
发表于 2025-7-4 09:24:55
|
显示全部楼层
global mom_machine_time
global coolant_timer ;# 定义冷却液计时器
if {![info exists coolant_timer]} {
set coolant_timer 0
}
set coolant_interval 10 ;# 设置冷却开启/关闭间隔时间,单位为秒,可根据需要修改
incr coolant_timer $mom_machine_time
if {$coolant_timer >= $coolant_interval} {
if {[info exists mom_coolant_status] && $mom_coolant_status == "ON"} {
MOM_output_literal "M09" ;# 关闭冷却液
set mom_coolant_status "OFF"
} else {
MOM_output_literal "M08" ;# 开启冷却液
set mom_coolant_status "ON"
}
set coolant_timer 0
} |
|