Need clean subroutine like on industrial controls

More
10 Jan 2024 12:27 #290352 by dinamik
I need a clean subroutine like on industrial controls like fanuc, heidenhain... with multiple loops that I can use multiple times in the main program without renaming, scripts and other nonsense...
I've tried almost all the posts and nothing works properly on LinuxCNC without some errors, even on stupid mach3 this works without any corrections and brainstorming!
Is there a fix for this serious software hole?

o1
G90 G94 G17 G91.1
G21
G54
T1 M6 G43
.....
....
...
M98 P100 L50
G90
.....
....
...
M98 P100 L50
G90
.....
....
...
M98 P100 L50
G90
.....
....
...
M98 P100 L50
G90
.....
....
...
M98 P100 L50
G90
.....
....
...
M98 P100 L50
G90
.....
....
...
M98 P100 L50
G90
.....
....
...
M98 P100 L50
G90
G0 Z50. M9
M5
T4 M6 G43
M00
M8
G0 X40.26 Y-28.04 Z50.
S150 M3
G0 X40.26 Y-28.04                                                                                                                                                                                                        G0 Z10.
G1 Z2. F500
G1 Z-22. F30
G1 Z-37. F500
G1 Z-65. F30
G0 Z50.
G0 X145.81 Y-59.
G0 Z10.
G1 Z2. F500
G1 Z-22. F30
G1 Z-37. F500
G1 Z-65. F30
G0  Z50. M9
G0 X0. M9  Y80.
M5
M30

o100
G91
G1 Z-1.
G4 P0.3
M99

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

More
10 Jan 2024 13:03 #290357 by Aciera

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

More
10 Jan 2024 13:34 #290363 by dinamik
Only from the O page that works is repeat/endrepeat approximately with some modification.. but after a few loops LINUXCNC STOPS because it cannot read more loops, i.e. blocks.

FRUSTRATING!!

o1
G90 G94 G17 G91.1
G21
G54
T1 M6 G43
........
.....
....
...
G91
o100 repeat [27]
G1 Z-1.
G4 P0.3
o100 endrepeat
G90
........
.....
....
...
G91
o101 repeat [27]
G1 Z-1.
G4 P0.3
o101 endrepeat
G90
........
.....
....
...
G91
o102 repeat [27]
G1 Z-1.
G4 P0.3
o102 endrepeat
G90
........
.....
....
...
G91
o103 repeat [27]
G1 Z-1.
G4 P0.3
o103 endrepeat
G90
........
.....
....
...
G91
o104 repeat [27]
G1 Z-1.
G4 P0.3
o104 endrepeat
G90
........
.....
....
...
G91
o105 repeat [27]
G1 Z-1.
G4 P0.3
o105 endrepeat
G90
....
....
...
...
M5
M30

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

More
10 Jan 2024 14:26 #290367 by Aciera
Not really sure what you are trying to do but are you saying that this code is not working for you? Because it seems to work fine on my simulation:
G90 G94 G17 G91.1
G21
G54
T1 M6 G43
F3000
G91
o100 repeat [27]
G1 Z-1.
G4 P0.3
o100 endrepeat
G90

G91
o101 repeat [27]
G1 Z-1.
G4 P0.3
o101 endrepeat
G90

G91
o102 repeat [27]
G1 Z-1.
G4 P0.3
o102 endrepeat
G90

G91
o103 repeat [27]
G1 Z-1.
G4 P0.3
o103 endrepeat
G90

G91
o104 repeat [27]
G1 Z-1.
G4 P0.3
o104 endrepeat
G90

G91
o105 repeat [27]
G1 Z-1.
G4 P0.3
o105 endrepeat
G90

M5
M30

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

More
10 Jan 2024 14:58 #290373 by dinamik
Its not same in simulation mode and working mode!

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

More
10 Jan 2024 15:15 #290376 by Mecanix

Its not same in simulation mode and working mode!

?! Confused. Worried. Clueless. What do you mean by that? Lcnc can run indefinitely given the main breaker servicing current don't trip and/or power outage.  

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

More
10 Jan 2024 15:32 #290378 by Aciera
Yea, I'm not sure where your problem is but I just went through the trouble of running my code above on my mill and it worked just fine. As expected.

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

More
10 Jan 2024 16:06 - 10 Jan 2024 16:13 #290379 by Mecanix
Unlike other silly mach3/industrialwhatever you can gcode this until the end-of-worlds using countless ways & logic with lcnc. It's good stuff.

e.g. 
while (universe != blackhole):
    self.c.mdi("G91")
    self.c.mdi("G1 Z-1.")
    self.c.mdi("G4 P0.3")
    self.c.mdi("G90")
Last edit: 10 Jan 2024 16:13 by Mecanix.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum