- Posts: 16
- Thank you received: 0
Are nested subroutines possible?
I've written a couple of linux subroutines using the repeat function, so I get the basics, but it doesn't appear that you can call a sub from within another sub?
here is a Fanuc example, distilled to the basics that works but I can't wrap my head around making this work in linux syntax.
If anyone could provide a simple example like this I'd appreciate it!
Thx.
Please Log in to join the conversation.
o1234 sub
o111 repeat [#1]
;nccode
o5678 call [#2]
o111 endrepeat
o1234 endsub
o5678 sub
o112 repeat [#1]
;nccode
o112 endrepeat
o5678 endsub
; M A I N
o1234 call [17][12]
M2
Please Log in to join the conversation.
Have you tried LinuxCNC-style? ( O100 SUB / O100 ENDSUB / O100 CALL )
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
The M98 / M99 subroutine format was only added to the LinuxCNC development branch very recently (for compatibility with some other controls). Is that the version you are using?
Please Log in to join the conversation.
I'm using Tormach's Pathpilot version 2.1.3 (on a tormach mill). I haven't seen good documentation of what they are doing with their builds vs. what the rest of the linuxcnc community is doing, but it does seem that Tormach is doing it's own thing.
In general, their support is terrible which is why I'm posting here instead of asking them. MaHa's above example was very helpful and more detailed then anything I would have gotten from Tormach. They just copy and paste sections of their manual when you ask for any help, lol.
Please Log in to join the conversation.
linuxcnc.org/docs/html/gcode/o-code.html
Section 3 : The maximum subroutine nesting level is 10.
Don't forget to set your program prefix in your ini file, section [DISPLAY], otherwise it won't work :
PROGRAM_PREFIX = /home/holzman/.....
Good luck !!
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22008
- Thank you received: 3
Mach3 has nothing industrial about it, or in it, it is a motion controller and very limited at best.helmholtz wrote: I wish I was using a version that supported M98/99 as I'm more familiar with industrial controls, which is why I had been using Mach3 on my hobby machines at home.
I would venture a guess at it having about 10% of capabilities Linuxcnc has, and that is me being generous, very.
Back on topic,
Fanuc uses some nice features on a punch press i often used, LAA ( line at angle ), GRID ( well grid ), NIB ( nibble ), etc that are very easy to use but not easy to learn for normal people, as each of them has it's own variables and parameters.
Adding something like that to Linuxcnc would help a lot to people who have that type of machines running under Linuxcnc, but so far i know of 2 on this forum ( one is from Serbia and he does not share any info, the other did try to contact him for help but i do not know if he got any help ) and a third one on youtube.
KUKA uses some similar short cuts for programming robots like LIN ( linear move with settable speed ), PTP ( point to point move at normal speed so the tool tip will move at any given speed regardless to get to a point ) etc.
Still all of the above mentioned examples have to be programmed by hand in their respective editors.
Please Log in to join the conversation.
- eneias_eringer
- Offline
- Junior Member
-
- Posts: 24
- Thank you received: 0
andypugh wrote: Something that you didn't mention is what version of LinuxCNC you are using.
The M98 / M99 subroutine format was only added to the LinuxCNC development branch very recently (for compatibility with some other controls). Is that the version you are using?
Really ??? !!! and a GOTO will be implanted too ??? LOL !!!
Please Log in to join the conversation.
