Can anyone help me with the following issue.

I have a number of new trainees that are doing basic setting up and operating milling machine.
We have had a couple instances where a trainee has machined the bed by not setting Z correctly.

I would like to come up with some coding to stop this from happening but not sure where to start.
I assume you can pull data for the tool length from the tool table and then take the actual machine co-ordinates to specify bed location.

Controller - iTNC530

If anyone can help it would be really appreciated.

Thank you