Tell the machine the part zero
Code G10 P0
you have a numerus of way to do this, here is one.
G10 tells the machine to set a zeropoint
P0 tells the machine where to put it (Work shift).
Programming exemple:
N20 G10 P0 Z-134
The negative Z is the distans from your working zero, in from of the workingpiece to the machine zero, often placed behind the chuck, in the spindle end.
The value that you set is more than MODAL and stays the same until you change it, even if you restart the machine. If you use this, do it every time or reset P0 last in every program.
Exemple:
N234 G10 P0 Z0
Work shift done by P0 shown in the picture
The MODAL codes stay on until some commando in the same group is commanded, for G01, the commands that cange this code is G00, G02 and G03