Re: [Emc-developers] Fanuc compatibility: m98/m99 feature branch

2018-09-28 Thread John Morris



On 09/29/2018 12:07 AM, andy pugh wrote:
> On Fri, 13 May 2016 at 19:18, John Morris  wrote:
> 
>> This branch [1] is ready for review.  Would someone mind taking a look?
> 
> There was a query on the forum yesterday about nested subroutines in
> M98 format. Is that possible?
> 
> https://forum.linuxcnc.org/40-subroutines-and-ngcgui/35293-are-nested-subroutines-possible#118085
> 
> He re-coded in O-word format and has it working, but did he need to?

Are your questions about the recent M98/M99 work that recently went into 
the LCNC master branch?  If so:

Of course the OP would have had to been running recent master to have 
this feature.  There's no indication the OP was or wasn't running 
master, unless it's a clue that the program with M98/M99 didn't work.

Nested subs are supported; see `tests/interp/m98m99/07-nested-subs`.

I didn't actually test the OP's program, but it looks good to me.

I've seen you helping out a lot of users on the forum.  That adds 
tremendous value to the community, and I appreciate all the time and 
effort you put into it, Andy.

John

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Fanuc compatibility: m98/m99 feature branch

2018-09-28 Thread Gene Heskett
On Friday 28 September 2018 12:07:06 andy pugh wrote:

> On Fri, 13 May 2016 at 19:18, John Morris  wrote:
> > This branch [1] is ready for review.  Would someone mind taking a
> > look?
>
> There was a query on the forum yesterday about nested subroutines in
> M98 format. Is that possible?
>
> https://forum.linuxcnc.org/40-subroutines-and-ngcgui/35293-are-nested-
>subroutines-possible#118085
>
> He re-coded in O-word format and has it working, but did he need to?

Maybe its just me, but the o-word version seems much more readable.
And I may have done something like that in the past while sharpening a 
saw blade without knowing I  wasn't supposed to. But it worked 3 or 4 
years ago. ;-)


-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Fanuc compatibility: m98/m99 feature branch

2018-09-28 Thread andy pugh
On Fri, 13 May 2016 at 19:18, John Morris  wrote:

> This branch [1] is ready for review.  Would someone mind taking a look?

There was a query on the forum yesterday about nested subroutines in
M98 format. Is that possible?

https://forum.linuxcnc.org/40-subroutines-and-ngcgui/35293-are-nested-subroutines-possible#118085

He re-coded in O-word format and has it working, but did he need to?

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Fanuc compatibility: m98/m99 feature branch

2016-05-13 Thread John Morris
On 12/18/2015 01:13 PM, John Morris wrote:
> On 10/28/2015 04:31 PM, John Morris wrote:
>> Hello again!
>>
>> I'm nearly done with two feature branches to add Fanuc compatibility.
>> This first branch implements Fanuc-style m98/m99 subroutine calls.
>> Another branch, nearly ready, will add Fanuc g52 'local coordinate
>> offsets'.  Many thanks to Tormach for sponsoring this work!
>>
>> I just pushed a feature branch [1] for m98 and m99.  For details, see
>> the top commit log.
>>
>> Related, some of the Fanuc subroutine examples I found online placed
>> subroutines after the main program.  I originally thought this was
>> simply a difference in Fanuc g-code, but while investigating how to the
>> feature, it became clear it was just a regression!  The second-to-top
>> commit is a one-liner fix, plus tests.
>>
>> Assuming the Buildbot passes, I'd appreciate a review.
>   >
>   > [1]:
>   > http://git.linuxcnc.org/gitweb?p=linuxcnc.git;h=refs/heads/zultron/m98m99
>
> I'll soon push an update to the m98/m99 feature branch that adds
> Fanuc-style main program numbers.  See Smid's "CNC Programming Handbook
> 3rd. Ed.", p. 66, describing how main programs may begin with numeric
> O-words in the same way as subprograms (but end with M02 or M30 instead
> of M99).  This is an extra feature for compatibility with some CAM
> software that generates G code for Fanuc controllers.  Example:
>
>   O1000 (MY PART PROGRAM)
>   G0 X1 Y2
>   M30
>
> Thanks-
>
>   John

This branch [1] is ready for review.  Would someone mind taking a look?

The commit log documents itself pretty well.  Since the previous emails, 
numbered main programs are implemented, as well as a special case of M99 
causing a main program to loop endlessly.

The patch has also been simplified in a few places, since it turns out 
that the semantics of M98/M99 subs are a bit different from rs274ngc 
subs.  What would look like a sub at the beginning of a file is instead 
a main program, and in fact subs and main programs are 
indistinguishable.  In rs274ngc G-code, when the interpreter finds a 
`O100 sub` block, it will skip ahead to the corresponding `O100 endsub`, 
not executing anything in between.  By contrast, when the interpreter 
finds a `O100` block (followed later by e.g. `M99`, `M02` or `M30`), it 
simply continues executing right into the (sub)program definition.

This code has been successfully tested with programs generated by CAM 
software for a while now, so it seems to be achieving the goal of 
compatibility.

Thanks for looking.  Also, I see that the G52 temp. offsets work is now 
in master.  Thanks to Chris and Seb for the reviews!

John

[1]: 
http://git.linuxcnc.org/gitweb?p=linuxcnc.git;h=refs/heads/zultron/m98m99

--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Fanuc compatibility: m98/m99 feature branch

2015-12-18 Thread John Morris
On 10/28/2015 04:31 PM, John Morris wrote:
> Hello again!
>
> I'm nearly done with two feature branches to add Fanuc compatibility.
> This first branch implements Fanuc-style m98/m99 subroutine calls.
> Another branch, nearly ready, will add Fanuc g52 'local coordinate
> offsets'.  Many thanks to Tormach for sponsoring this work!
>
> I just pushed a feature branch [1] for m98 and m99.  For details, see
> the top commit log.
>
> Related, some of the Fanuc subroutine examples I found online placed
> subroutines after the main program.  I originally thought this was
> simply a difference in Fanuc g-code, but while investigating how to the
> feature, it became clear it was just a regression!  The second-to-top
> commit is a one-liner fix, plus tests.
>
> Assuming the Buildbot passes, I'd appreciate a review.
 >
 > [1]:
 > http://git.linuxcnc.org/gitweb?p=linuxcnc.git;h=refs/heads/zultron/m98m99

I'll soon push an update to the m98/m99 feature branch that adds 
Fanuc-style main program numbers.  See Smid's "CNC Programming Handbook 
3rd. Ed.", p. 66, describing how main programs may begin with numeric 
O-words in the same way as subprograms (but end with M02 or M30 instead 
of M99).  This is an extra feature for compatibility with some CAM 
software that generates G code for Fanuc controllers.  Example:

 O1000 (MY PART PROGRAM)
 G0 X1 Y2
 M30

Thanks-

 John

--
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers