The “best way” is probably a bit too subjective for something like this.
However when all else fails you can.
1: Pull all the tools out of the machine.
2: Reset the tool table, some machines will have a command to do this, others you need to do manually (pot 1 = tool 1, etc.) the procedure would be in the machine manuals.
I have seen a machine that would get messed up to the point it would show tool 4 in pot 6 and also in pot 11 etc. and tool 7 may not exist anyplace.
3: Load the tools back in thru the spindle.
If you want to keep the tools from moving around you can if you are willing to do extra tool changes. This just simulates the way an umbrella type of changer works and wastes a lot of time.
Code:
O0001
(TOOL N IS SOME UNUSED TOOL NUMBER)
(THIS CAN GET MESSED UP IF TOOL)
(CHANGES ARE DONE USING MDI WITHOUT)
(THE TN M6 CHANGE BEING DONE)
…
TN M6
T01 M6
…
(machine with tool 1)
…
TN M6
T02 M6
…
(machine with tool 2)
…
TN M6
T03 M6
…
(machine with tool 3)
…
TN M6
(ETC.)
G30