- Posts: 56
- Thank you received: 0
linuxcnc 2.8.0 - error on subroutine call
5 years 6 months ago #206239
by dansawyer
linuxcnc 2.8.0 - error on subroutine call was created 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
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 to join the conversation.
5 years 6 months ago #206251
by dansawyer
Replied by dansawyer on topic linuxcnc 2.8.0 - error on subroutine call
The problem seemed to be incrementing #1 within the subroutine. When the increment was moved outside the subroutine then it worked.
Please Log in to join the conversation.
5 years 6 months ago #206525
by andypugh
Replied by andypugh on topic linuxcnc 2.8.0 - error on subroutine call
At a guess the issue was
Which is an O-word with no SUB or IF etc.
(And it was never closed)
Code:
o1 ; Main program 1
(And it was never closed)
Please Log in to join the conversation.
Time to create page: 0.077 seconds
