Strange subroutine error

More
5 years 1 month ago #219594 by viesturs.lacis
Strange subroutine error was created by viesturs.lacis
Hello!

I am trying to write some subroutines for ngcgui. The thing is that when I try to create a feature in ngcgui, I get an error that makes absolutely no sense to me. I get that error message only if I check "expand subroutines".
I would appreciate any hints, what exactly am I missing or doing incorrectly. The thing is that I get very similar error for subroutines that I downloaded from this forum.

Here is the subroutine
Code:
[code]o<drill1> sub (info: Drilling bottom edge with horizontal spindle) #<X_Coord> = #1 (X Coordinate) #<Y_Coord> = #2 (Y Coordinate) #<Z_Coord> = #3 (Z Coordinate) #<Safe_Z> = #4 (=0 Safe Z height) #<Y_StepBack> = #5 (= 5 Step back from edge along Y) #<Bore_depth> = #6 (=20 Depth) #<FeedRate> = #7 (=300 Feedrate mm/min) #<ToolNumber> = #8 (=1 Tool Number) #<Peck> = #9 (=6 Peck Increment) #<X_Park> = #10 (=0 X Park) #<Y_Park> = #11 (=0 Y Park) ;set global parameters ;#<_remain_depth> = #<Bore_depth> ;#<_temp_depth> = 0 T#<ToolNumber> M6 G43 T#<ToolNumber> #<remain_depth> = #<Bore_depth> #<temp_depth> = 0 S100 M3 F#<FeedRate> G0 Z#<Safe_Z> G0 X#<X_Coord> Y[#<Y_Coord> - #<Y_StepBack>] G0 Z#<Z_Coord> o<y100> while [#<remain_depth>]     o<y1100> if [#<remain_depth> GT #<Peck>]       #<temp_depth> = [#<temp_depth> + #<Peck>]       G1 Y[#<Y_Coord> + #<temp_depth>]       G1 Y#<Y_Coord>       #<remain_depth> = [#<remain_depth> - #<Peck>]      o<y1100> else         #<remain_depth> = 0         G1 Y[#<Y_Coord> + #<Bore_depth>]         G1 Y[#<Y_Coord> - #<Y_StepBack>]     o<y1100> endif o<y100> endwhile G0 Z#<Safe_Z> o<drill1> endsub
[/code]
Code:
[code]Here is the error message:
[/code]
Code:
[code][code][code][code]Near line 57 of /home/cnc/linuxcnc/nc_files/0.auto.ngc: 57:duplicate O-word label: 'o<001y1100> while [#<remain_depth>]' - defined in line 52
[/code][/code][/code]
[/code]
Code:
[code][code][code][code]Here is the 0.auto.ngc file that was generated by ngcgui:
[/code][/code][/code][/code]
Code:
[code][code][code][code][code][code][code][code](pyngcgui: FEATURE 210904:14.53.47) (pyngcgui: files: </home/cnc/linuxcnc/nc_files/ngcgui_lib/utilitysubs/mm_std.ngc,/home/cnc/linuxcnc/nc_files/drill1.ngc,>;) (pyngcgui: feature line added) #<_feature:> = 0 (pyngcgui: remaining_features line added)  #<_remaining_features:> = 0 (pyngcgui: preamble file: /home/cnc/linuxcnc/nc_files/ngcgui_lib/utilitysubs/mm_std.ngc) g17 (xy plane) g21 (mm) g40 (cancel cutter radius compensation) g49 (cancel tool lengthoffset) g90 (absolute distance mode) g94 (units/min feedrate) g54 (Coordinate system 1 default) #<tol>  = 0.001 g64 p#<tol> (path control stop) (Positional parameters for /home/cnc/linuxcnc/nc_files/drill1.ngc)         #1 = 50         #2 = 15         #3 = 9         #4 = 0         #5 = 5         #6 = 20         #7 = 300         #8 = 1         #9 = 6         #10 = 0         #11 = 0 (expanded file: /home/cnc/linuxcnc/nc_files/drill1.ngc)             (info: Drilling bottom edge with horizontal spindle)             #<X_Coord> = #1 (X Coordinate)             #<Y_Coord> = #2 (Y Coordinate)             #<Z_Coord> = #3 (Z Coordinate)             #<Safe_Z> = #4 (=0 Safe Z height)             #<Y_StepBack> = #5 (= 5 Step back from edge along Y)             #<Bore_depth> = #6 (=20 Depth)             #<FeedRate> = #7 (=300 Feedrate mm/min)             #<ToolNumber> = #8 (=1 Tool Number)             #<Peck> = #9 (=6 Peck Increment)             #<X_Park> = #10 (=0 X Park)             #<Y_Park> = #11 (=0 Y Park)             ;set global parameters             ;#<_remain_depth> = #<Bore_depth>             ;#<_temp_depth> = 0             T#<ToolNumber> M6             G43 T#<ToolNumber>             #<remain_depth> = #<Bore_depth>             #<temp_depth> = 0             S100 M3 F#<FeedRate>             G0 Z#<Safe_Z>             G0 X#<X_Coord> Y[#<Y_Coord> - #<Y_StepBack>]             G0 Z#<Z_Coord>  o<001y100>  while [#<remain_depth>] o<001y1100>  while [#<remain_depth>]                   #<temp_depth> = [#<temp_depth> + #<Peck>]                   G1 Y[#<Y_Coord> + #<temp_depth>]                   G1 Y#<Y_Coord>                   #<remain_depth> = [#<remain_depth> - #<Peck>] o<001y1100>  while [#<remain_depth>]                     #<remain_depth> = 0                     G1 Y[#<Y_Coord> + #<Bore_depth>]                     G1 Y[#<Y_Coord> - #<Y_StepBack>] o<001y1100>  while [#<remain_depth>]  o<001y100>  endwhile             G0 Z#<Safe_Z> (pyngcgui: m2 line added) m2 (g54 activated)
[/code][/code][/code][/code][/code][/code][/code]
[/code]

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

More
5 years 1 month ago #219596 by viesturs.lacis
Replied by viesturs.lacis on topic Strange subroutine error
Sorry about those duplications of code tags, no idea, where they came from, I did put them correctly. Firefox version too old in the LinuxCNC iso image?

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

More
5 years 1 month ago #219601 by tommylight
Replied by tommylight on topic Strange subroutine error
I would blame the forum editor, it is a bit iffy lately ! :)

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

More
5 years 1 month ago - 5 years 1 month ago #219604 by viesturs.lacis
Replied by viesturs.lacis on topic Strange subroutine error
any idea about the subroutine error?
Last edit: 5 years 1 month ago by viesturs.lacis.

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

More
5 years 1 month ago #219608 by viesturs.lacis
Replied by viesturs.lacis on topic Strange subroutine error
BTW this subroutine also triggers the same error about duplicate O-word label:
forum.linuxcnc.org/subroutine-library/27...gle3-for-mill-router

I have 2.8.2 version installed

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

More
5 years 1 month ago #219614 by viesturs.lacis
Replied by viesturs.lacis on topic Strange subroutine error
Forgot to mention, that I did find this thread:
forum.linuxcnc.org/20-g-code/27728-dupli...-version-2-6?start=0

But I get the error also when I call the subroutine more than once without editing. Restarting LinuxCNC between attempts also was tried without success.

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

Time to create page: 1.185 seconds
Powered by Kunena Forum