The Line "IF (#9402 != 0) THEN GOTO 200" was to determine if an input was assigned by the user or not, if the user did have an input then we would wait for the input to change states, otherwise wait 3 seconds. However, 9402 was never implemented (and instead was used for an axis pairing feature). This was left over code in the macro that has been overlooked.
However, i do have some updated macros that will be part of the next version of acorn released.
Code: Select all
;------------------------------------------------------------------------------
; Filename: mfunc15.mac
; Description: Tool Unclamp Macro
; Notes: Uses MEM 261 and MEM266 to determine if user has an active input.
; Requires: CNC12 V4.66 ACORN
; Revision Date: 26 JUL 2021
; Please see TB300 or the following link for tips on writing custom macros.
; https://www.centroidcnc.com/centroid_diy/downloads/acorn_documentation/centroid_cnc_macro_programming.pdf
;------------------------------------------------------------------------------
; PLC Variables:
; ToolUnclampedState_M IS MEM12 (#70012)
; DrawBarReleasedDisable_M IS MEM261 (#70261)
; ToolIsUnclampedDisable_M IS MEM266 (#70266)
;------------------------------------------------------------------------------
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
N100 ;Insert your code between N100 and N1000
M94 /15 ;Turn on ToolUnclamp request
IF #70261 && #70266 THEN GOTO 200 ;Determine if input is used.
M101 /70012 ;Wait until tool is Unclamped.
GOTO 1000
N200
G4 P3 ;Wait 3 seconds
N1000 ;End of Macro