Hello Guest it is March 29, 2024, 12:58:28 AM

Author Topic: conditional execution  (Read 7147 times)

0 Members and 1 Guest are viewing this topic.

conditional execution
« on: May 14, 2011, 12:28:38 PM »
About time some conditional execution features were added to Mach - I found to my horror today that even the latest release does not support even the most basic of conditional functions.  :o

I really cant believe that in this day and age we're reduced to the equivalent of trying to programme the internet in Assembler and doing web page graphics by manually setting every bit in a bitmap image - this sort of thing went out over 30 years ago in the rest of the computing world.

Every other 'dialect' of gcode supports these functions, and to be taken seriously in the future Mach needs to support at least the obvious capabilities - 'IF-THEN-ELSE' and 'DO WHILE' along with the logical comparison functions (GT, GE, LT, LE, NE, EQ).

 I need to machine some parts that have repetitive reatures and thus simple to do in a loop - six lines of code - but bloat to a couple of hundred lines if I have to expand it out manually. Yuk. Not to mention the vastly increased chances of an error (typo) and additional maintenance overhead.

Named variables (rather than #1 etc) would not go amiss either. Collectively these changes would at least bring Mach up to par with 1970's programming languages - and maybe sometime we might even catch up with the 21st Century!

Rick
« Last Edit: May 14, 2011, 12:32:54 PM by rickturner646 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: conditional execution
« Reply #1 on: May 14, 2011, 04:46:06 PM »
You CAN do conditional Gcode IF you are creative. That and a couple of simple macros.

(;-) TP
Re: conditional execution
« Reply #2 on: May 22, 2011, 04:11:57 AM »
I know - that's what I have ended up doing. VBS does at least support sensible language features.

Offline Deano

*
  •  15 15
    • View Profile
Re: conditional execution
« Reply #3 on: July 09, 2011, 09:43:20 AM »
I know - that's what I have ended up doing. VBS does at least support sensible language features.


 This is my first post, still putting together my CNC router and exploring Mach3,  also have hit the wall on conditional Gcode problem. I have very little programming practice, but enough to be dangerous.  I am searching for an entry level tutorial on Mach3 version of Gcode. could you please elaborate on your creativity?  I'm trying to make a "quick" program to mill (true the face of) the sacrificial board over the entire working area.  Somewhere on this forum (Gcode thread, I think) someone referenced  NIST RS274 NGC standard for Gcode. I read that and pieced together a short subroutine, tried to run in Mach and was stalled by numerous errors (my code seemed to conform to the standard). Where is the documentation in Mach that reveals all the exceptions to NIST RS274?  Perhaps there is a better thread to post my questions ?

Offline Deano

*
  •  15 15
    • View Profile
Re: conditional execution
« Reply #4 on: July 09, 2011, 10:50:57 AM »
Ahh, relief.  for the immediate facing problem, I came across the entry in "Share your Gcode" Multi pass facing program. Thank you.  Still looking for the more complete documentation for Mach3 gcode.
Re: conditional execution
« Reply #5 on: August 02, 2011, 05:59:04 PM »

Every other 'dialect' of gcode supports these functions, and to be taken seriously in the future Mach needs to support at least the obvious capabilities - 'IF-THEN-ELSE' and 'DO WHILE' along with the logical comparison functions (GT, GE, LT, LE, NE, EQ).


Yes please

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: conditional execution
« Reply #6 on: August 02, 2011, 06:16:50 PM »
Quote
Where is the documentation in Mach that reveals all the exceptions to NIST RS274?
I don't know of a single controlling program out there that has that information in it's manual, but could be wrong.... ???

 
Mach's Gcode follows the standard rather closely,but, there are manny dialects of Gcode and companies like to have that way.
Try a read of the Mach manual and you will find almost all the Gcodes dellineated. ;)

I can't speak for Brian but heard that  the future Gcode will adhear to what the most prominent authority in the world has to say.
 Buy a Smid Book.

RICH

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: conditional execution
« Reply #7 on: August 02, 2011, 08:58:21 PM »
(;-) Thankfully the NIST RS274 is not the STANDARD it is but a reference. There are many dialects of gcode and many good reasons for it.

Unfortunatly Mach3 is about the only one that does not support condition Gcode in one form or the other.

Mach3 does a very good job for what it is.  I believe its original design was for the hobby world where exoctic parametric conditional Gcode was a rarity not the norm.  Being that Mach3 is a buffered system it may have took a great hit in performance to have it do condition Gcode. Mach3 stacks the moves into the que buffer and then runs them as continous moves. Interrupting that stream to do condition correction would have been asking a lot from Mach3 under windows AND have a fast and accurate system.

Along with Mach3's push in the hobby market came more low cost Cam systems that petty much circumvented the basic need for condition Gcode in this market.

Just my opinion on this one, (;-) TP