You notice I did write:
"probably the only way you can do it incrementally " with reference to G10.
But using G10 means that the G54 datum is changed and you have to know how much it has changed in order to reverse the changes.
Incidentally if you stop the program part way through, before you have reversed the changes to G54, you can have real problems if you restart at the beginning.
With G52 the G54 location is not changed. G52 simply creates a secondary work zero that is referenced from the G54. The machine has a G52 field on the work offsets page and the way it works is the controller adds the values in the G52 field to the G54 values and uses that for the secondary work zero location. Normally the G52 values are all zeroes so the secondary work zero is not moved away from G54.
The G52 command puts a value into the G52 coordinates and this means the secondary work zero location is moved by this value. I have modified your example to use G52 with extra comments.
O0001
.
.
G54
.
.
G52 X-100. (the secondary work zero is 100mm to the left)
(Deleted G54 command, not needed now the one above is modal)
M98 P7001 (sub pgm)
.
.
G52 X-155. (Second work zero is 155mm to left, see comment at bottom)
(Delete G54)
M98 P7002
.
.
G52 X0. (G52 values are now zero so secondary work zero is not moved)
(Delete G54)
.
.
M30
COMMENT: As far as I have been able to figure out it is impossible to change the G52 values incrementally, you cannot do X100. then X55. to get X155. you have to do X155.
But it is easy to get back to using only G54 because all you need is G52 X0.
Also, provided Setting 33 is on FANUC the value in the G52 register is zeroed by M30 or RESET so if you stop part way through a program and restart at the beginning you have no problems.
Obviously you can also have Y, Z and A values in the G52 command so you can move the secondary work zero anywhere.
The secondary work zero created by G52 is referenced from whatever main work zero you have active. It does not have to be G54, all the others G55, etc work the same way.
Now I have a question for you. Why do you use M98 not M97?
M98 means you have to have separate programs for all your subprograms. M97 means all the subs can be tacked on at the end of the calling program after the M30. this makes them easier to find and edit and transfer in and out of the machine because they form a single program file.