The Oh-numbers of a gCode program must be unique, and PathPilot will not accept code like
Code:
o 100 repeat [5]
G00 X1
G00 X2
o 100 endrepeat
o 100 if [#1 GT #2]
G00 X3
o 100 endif
If the same Oh-number is used in two different filed subroutines, one might expect either that
- their scopes would be construed as limited to their respective files, so the authors of the two subroutines would have no obligation to coordinate their work, or
- PathPilot would complain about the conflict.
In fact, neither of these happens. What seems to happen (I have not done extensive testing to characterize the bug, but I think this is right) is that the second appearance of the Oh-number is ignored, and references to that Oh-number will be taken to refer to its appearance in the subroutine called earlier.
For example, if the calling program is
Code:
o <first> call
o <second> call
M30
and the two subroutines are
Code:
o <first> sub
(msg, first)
M98 P100
o <first> endsub
o 100 (internal subroutine)
(msg, first)
M99 (return to caller)
and
Code:
o <second> sub
(msg, second)
M98 P100
o <second> endsub
o 100 (internal subroutine)
(msg, second)
M99 (return to caller)
then the output is not first-first-second-second. Instead, it is first-first-second-first.