Mach 3 syntax checking?

NCPlot questions or comments

Mach 3 syntax checking?

Postby equack » Wed Jan 13, 2010 2:02 pm

There is certain G-Code syntax which works fine in NCPlot but which produces errors when loaded into Mach3.

I do not know which program is "correct"... and I don't really care. What I care about is work flow. Right now I write and debug my G-code programs in NCPlot before transferring them via flash drive to my Mach3 machine (a Tormach which is not networked).

I almost always have to fix something once the program is transferred over. Then I have to transfer the fixes back to my development machine or risk repeating the mistake. Time is money.

Is there a way to have NCPlot flag these syntax errors for me the first time around? NCPlot is a great development tool- worth the price (I wish I could justify the convenience of buying a second license for the Mach 3 computer) and I'm looking forward to the upcoming 3D graphics simulation feature.

Examples of Mach 3 versus NCPlot:

1. "#110=#110+40.0"
This line is OK in NCPlot but generates an error in Mach3. In Mach 3 I have to enclose the left side with brackets "#110=[#110+40.0]"

2. "(xxxx" NCPlot allows comment lines with only an opening parenthesis. Mach3 gives an error unless there is a matching closing parenthesis.

3. "[-#110]" works fine in NC plot but not in Mach3. In Mach 3 I use "[0-#110]".

4. NCPlot by default treats "10" as ".010". Mach3 treats it as "10.0". (OK- I fixed this one by changing the machine configuration)

Thank you!
equack
 
Posts: 14
Joined: Wed Jan 13, 2010 1:51 pm

Re: Mach 3 syntax checking?

Postby scottmartinez » Wed Jan 13, 2010 2:39 pm

Hello,

The Macro syntax that NCPlot follows is based on the Fanuc CNC control, so I tried to make it as close as possible to it. For the issue with the comments, I have to agree that NCPlot should flag an error when no closing parenthesis is present. Even if the control will accept it, it is sloppy programming to leave it out.

For your issues #1 and #3, these are items I would have to create option settings for. Obivously I would like to still be able to handle these the way I do now while giving you the option of flagging an error instead. Of course that's assuming that there are other controls that would give an error under the same conditions, If Mach is the only one then perhaps a request should be made for Mach to handle these conditions without errors. Even so, I'll look and see if this can be added to NCPlot.

Thanks,
Scott
User avatar
scottmartinez
Site Admin
 
Posts: 215
Joined: Sat Mar 11, 2006 8:49 pm

Re: Mach 3 syntax checking?

Postby equack » Wed Jan 13, 2010 7:33 pm

Thanks for the reply Scott!

I made a similar post in the Mach3 forum and was basically told "Mach3 uses fanuc, the standard doesn't even define #, and I should use search and replace." (sigh)

I dug into the EIA-RS-274-D standard which seems to specify the stricter forms that Mach 3 requires (and which does define #).
http://www.isd.mel.nist.gov/personnel/kramer/pubs/RS274NGC_3.web/RS274NGC_33a.html

A "strict RS-274 mode" would take care of all 4 points by disallowing various fanuc shortcuts (assuming I'm reading the spec correctly).

That said:

Most ANSI C compilers will happily accept C++ style comments even though they're not standard. They usually have a "strict ANSI" switch for portability. Every once in a while I have to use a compiler which requires old fashioned /* comments */ and it drives me nuts.

C++ style comments are just BETTER and so are the reasonable G-code shortcuts which NC Plot allows (like being able to say "#100=-#100" instead of #100=[0.0-#100]").

Since I can't change Mach3 I need the g-code equivalent of a "strict ANSI" switch in NC Plot... or I need to dust off my regular expressions reference and build a G-code version of "lint".



-Erik
equack
 
Posts: 14
Joined: Wed Jan 13, 2010 1:51 pm


Return to Questions / Comments

Who is online

Users browsing this forum: No registered users and 3 guests

cron