Hi I want the spindle to wait before it confirms the tool is in the spindle
but the M66 seems does not wait at all, and I checked the pin does change based on whether the tool is in the spindle or not.
The HAL is
Code:
# --- spindle tool signal ---
net spindle-tool-secured and2.10.in0 motion.digital-in-00 <= hm2_5i25.0.7i76.0.0.input-24
net spindle-tool-open motion.digital-in-01 <= hm2_5i25.0.7i76.0.0.input-25
The ini :
Code:
# ===============
# rack tool changer
[TC]
# this is not named TOOL_CHANGE_POSITION on purpose - canon uses it and will
# interfere
X = 3.0
Y = 3.0
Z = -5.0
X_CLEAR_DELTA = 5.0
Y_CLEAR_DELTA = 0.0
Z_CLEAR = 0.0
#tool slot delta
X_DELTA = 0.0
Y_DELTA = 3.0
Z_DELTA = 0.0
RELEASE_DELAY = 0.5
CAPTURE_DELAY = 1.0
SIGNAL_DELAY = 0.5
TOOL_CONFIRM_DELAY = 20
# motion.digital-out-NN pins power draw bar
PDB = 0
TOOL_IN_SPINDLE = 0
DB_RELEASED = 1
the sub:
Code:
; parameter: current tool
o<get_tool> sub
G90
; value of this pin read is stored in #5399
M66 P#<_ini[TC]TOOL_IN_SPINDLE> L0
o100 if [EXISTS[#<_ini[TC]X>] AND [#5399 EQ 0]]
g53 g0 Z #<_ini[TC]Z_CLEAR>
g53 g0 X [#<_ini[TC]X> + #1 * #<_ini[TC]X_DELTA>] Y [#<_ini[TC]Y> + #1 * #<_ini[TC]Y_DELTA>]
;release tool and confirm
M64 P#<_ini[TC]PDB>
M66 P#<_ini[TC]DB_RELEASED> L3 Q#<_ini[TC]TOOL_CONFIRM_DELAY>
M66 P#<_ini[TC]TOOL_IN_SPINDLE> L4 Q#<_ini[TC]TOOL_CONFIRM_DELAY>
G4 P#<_ini[TC]SIGNAL_DELAY>
g53 g0 Z [#<_ini[TC]Z> + #1 * #<_ini[TC]Z_DELTA>]
;capture tool and wait for confirmation
M65 P #<_ini[TC]PDB>
M66 P#<_ini[TC]DB_RELEASED> L4 Q#<_ini[TC]TOOL_CONFIRM_DELAY>
M66 P#<_ini[TC]TOOL_IN_SPINDLE> L3 Q#<_ini[TC]TOOL_CONFIRM_DELAY>
G4 P #<_ini[TC]SIGNAL_DELAY>
g53 g0 X [#<_ini[TC]X> + #1 * #<_ini[TC]X_DELTA> + #<_ini[TC]X_CLEAR_DELTA>]
g53 g0 Y [#<_ini[TC]Y> + #1 * #<_ini[TC]Y_DELTA> + #<_ini[TC]Y_CLEAR_DELTA>]
g53 g0 Z #<_ini[TC]Z_CLEAR>
o100 endif
o<get_tool> endsub
m2