Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: rkonnen on May 28, 2013, 09:48:20 PM

Title: Adding G-code move on the fly
Post by: rkonnen on May 28, 2013, 09:48:20 PM
This is probably an odd question, but can you add g-code on the fly from your HMI screen. Example:
G00 Z.1
G01 F20 -.5
G00 Z.1
G91
( This line would read from a text box on the main screen. Say it is normally set to 0, but the next go around you want to add another .1 to the Z)
G90
Title: Re: Adding G-code move on the fly
Post by: BR549 on May 29, 2013, 05:22:57 PM
Sorry but NO you cannot add Gcode ON THE FLY. BUT you can program with parametrics and #vars in the Gcode and change the # vars on the fly.

(;-) TP
Title: Re: Adding G-code move on the fly
Post by: rkonnen on May 29, 2013, 08:46:09 PM
Could you point me in a direction that would give an explanation how to do this.
Title: Re: Adding G-code move on the fly
Post by: BR549 on May 29, 2013, 11:59:50 PM
How about the Mach3 manual ?

Just a thought, (;-) TP
Title: Re: Adding G-code move on the fly
Post by: TOTALLYRC on May 30, 2013, 08:00:03 AM
Hi Terry,
Really? Read the manual? What are you thinking??????????????

(just having some fun)

Mike
Title: Re: Adding G-code move on the fly
Post by: rkonnen on May 31, 2013, 10:38:59 AM
Thanks guys. I always enjoy people talking to me like I am an idiot.

I have read the manual. I have been using Mach for 8yrs or so. Unfortunately I do not have any experience with Brains, Macros or VB scripting. I have determinded the Brains might be the choice. The one problem I have with Brains is the documentation is minimal and I have not found anywhere it gives a better description on the different elements. Would kind of like a Mach Brains programming for Dummies.

Brg,
  Richard
Title: Re: Adding G-code move on the fly
Post by: BR549 on May 31, 2013, 11:30:04 AM
Sorry but brains are not going to help you IF I understand what you are wanting to do. Your only option wil be to use parametric Gcode and #variables.

AND that usage is described in the manual.

(;-) TP
Title: Re: Adding G-code move on the fly
Post by: TOTALLYRC on May 31, 2013, 11:39:47 AM
I was not talking to you like you were an idiot. I was just making a funny.
I do however think that Terry has a point. Read the manual. Maybe he should have said REREAD the manual. I have been using Mach3 for at least 5 years and I still have to go back to the manual from time to time to pick up those things that I forgot or never really understood.

One of those things that I don't understand is that people come here looking for free advice and then get all huffy when the advice is not what they want to here.

Learning how to program variables is one of those things that I have never learned because I use CAD/CAM and with Mach3 the file limitation is so large that I have never even come close to the limits. People that grew up with older controls soon learned how to write programs as small as possible using vars and parametrics. Vars and parametrics are on the todo list as it can be very helpful when doing "weird" stuff.



http://www.machsupport.com/docs/Mach2_6.11_Custom.pdf (http://www.machsupport.com/docs/Mach2_6.11_Custom.pdf)   Page 35 has an example that might be helpful.

Mike
Title: Re: Adding G-code move on the fly
Post by: TOTALLYRC on May 31, 2013, 11:47:55 AM
As always Google is your friend.

http://www.cnczone.com/forums/parametric_programing/95395-milling_macros.html

Has a few examples of parametric programing.

HTH

Mike
Title: Re: Adding G-code move on the fly
Post by: rkonnen on May 31, 2013, 12:07:00 PM
Thank you for the Macro link. After re-reading, it looks like Scripting might be the fit.

Also I was not getting huffy or looking for free advise, but after watching video, searching google  and reading blogs, your head starts to swim and you don't know what direction to head.

Instead of an answer Like " program with parametrics and #vars", A better answer might have been : VB scripting might be the choice or Macros, Brains probable won't do it. Give section 4.4 in the manual a look .

Like you I do not do programming directly, I use a cad/cam program becuase I profile mill alot, so I no nothing on Varable and parametrics.
Title: Re: Adding G-code move on the fly
Post by: BR549 on May 31, 2013, 04:28:12 PM
Macro Scripting won't get you there either(;-) A script cannot interupt the buffer load where as a variable is open to change right up to the point that the steps are loaded into the buffer.  It is a s close as you can get and not be realtime.  Sometimes you get very strange reactions when you mix scripting and Gcode together.

Parameterics and #vars are pretty much bullet proof in MACH3.

NOW to help explain what they were chidding you about , here you asked a specific question and I gave you the top answer right off the bat BUT you wanted to change it twice to something else first to brains then to scripting. WE hear this all the time so I just referred you to where you really needed to go/be. BUT you still resist the force and want to do it any other way but the suggested way.

SIGH, (;-)

SO lets readdress your original QUESTION.

NO YOU CANNOT DO THAT in mach3.

Just a thought, (;-) TP