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

Reply via email to