linuxcnc 2.8.0 - error on subroutine call

More
17 Apr 2021 23:28 #206239 by dansawyer
The following program errors with a 'near line 11 ... bad charactor 'o' used'. If I substitute the subroutine call with a simple increment it loads without error.
My question is in this case what is the correct syntax to create and to call the subroutine. Is there an issue with #1 being incremented within the subroutine? Must it be incremented outside of the subroutine?
Thanks, Dan

/ comment - 4.2 inch diameter - 1/4 inch tool - no comp
#1 = 0
o1 ; Main program 1
G01 X0.00 Y0.00 Z0.0 F20.0
G01 Z1.0
G01 X0.0 Y[2.1088 + 0.125]
G01 z#1
o2 while [#1 gt -0.5]
/ #1 = [#1 -0.010]
m98 o100 ; Call subprogram 100
o2 endwhile
g01 z1.0 f20
g01 x0 y0
M2 ; End main program

o100 sub
G01 Z#1
G03 X0.00 Y[2.1088 + 0.125] I0.0 J-[2.1088 + 0.125]
#1 = #1 -0.010
o100 endsub

Please Log in or Create an account to join the conversation.

More
18 Apr 2021 01:11 #206251 by dansawyer
The problem seemed to be incrementing #1 within the subroutine. When the increment was moved outside the subroutine then it worked.

Please Log in or Create an account to join the conversation.

More
20 Apr 2021 12:34 #206525 by andypugh
At a guess the issue was
o1 ; Main program 1
Which is an O-word with no SUB or IF etc.
(And it was never closed)

Please Log in or Create an account to join the conversation.

Time to create page: 0.130 seconds
Powered by Kunena Forum