Thats a weird Macro someone wrote. To empty the spindle on a Mori, all you need to do is call M33. That will make the spindle tool zero. There is no way I know of unless you assign the tool number to the ATC registry (pot) to get it to display the tool number. Should still work with the H and D code you want though.
I have a 18i-MA too and can change tools with and without the ATC. Requires turning the carousel off. An M code and 9000 program run the nonATC (manual) tool change. I can also swap tools with another, it will pick up whatever tool I call.. grab it with the arm.. spin around.. and instead of
placing it in the spindle it will put it in any pot number I reassign it, as long as it's empty (or can be emptied).
200 tools is an option.
That macro, well.. never seen one like that. I have a library of 50 or so CAT40 tools of different types and sizes but this carousel has less than 30 pots.