Hello Dusty,
The syntax for the Macro Statements used in your programs looks OK, but the position of
G65 H01 P#502 Q#100
after N100 has the potential of causing an issue if #100 has a wrong value, whilst you have no error trapping in the program. Swap it around so that G65 H01 P#502 Q#100 is immediately before the N100 Block
As a Test:
In your Main program, where the Tool Change is called, change what you currently have,
T_ _ M6
S1000 M3
G4 P5
M30
to the following:
T_ _
G65 H01 P#500 Q#100
M30
%
Where _ _ is a different number between 1 and 10, each time you execute the program.
After each execution of the program, view the value of Variable #500 in the Macro Variable pages. You navigate to those pages via the Offset Button. On each execution of the program, with a different Tool Number each time, #500 should contain the value of the specified Tool Number. This exercise is to ensure that program O9000 is working correctly.
The reason for recording the Tool Number in #500 and not just view #100, is that M30 is usually linked to Reset and depending on parameter setting, #100 will be initialized to Zero when Reset is executed. Variable #500 won't be reset and therefore, you can see that the correct Tool Numbers are being registered in #100 when program O9000 is executed.
If #100 is being allocated the correct value (as confirmed by viewing the value of #500), edit your Main Program to include M06 after the "T" address, so that Program O9001 will be executed.
Again, as a test, in your O9001 program, insert M00 as the first Block of the Program. When O9001 is called via M06, the program will halt when the M00 is executed. When it does, view the value of #100 in the Macro Variable pages to ensure that it still has the correct value. If it doesn't, I'd expect the value to be Zero and in which case, change the configuration of your Main Program to have the Tool Call (T Code) and M06 on separate lines as in:
T_ _
M06
Report back as to the result.
If the above works, you then have two choices. You can either leave as is with the two programs being executed via the "T" code and M06, or copy the content of program O9001 to program O9000 and include the following Block at the start of the program:
G65 H01 P#100 Q#149
You would then change the value in Parameter 240, from 6 to 0, so that program O9001 is no longer called by M06. Your Tool Change Call in the Main Program will now be called by executing only a "T" code and omitting M06.
Initially, you wouldn't have to change the value in parameter 240, as the M06 in the Tool Change Macro won't call O9001 but will be treated as a normal "M" code and processed by the PMC.
Regards,
Bill