Hello Guest it is May 20, 2019, 01:01:29 PM

Author Topic: G65 and Macro Variables  (Read 8515 times)

0 Members and 1 Guest are viewing this topic.

G65 and Macro Variables
« on: March 09, 2012, 07:30:59 PM »
One of the most powerful combinations of programming functions is found in the typical Fanuc use of G65 to pass information into "nests" and use system, common, and local variable table contents for a multitude of tasks to make machining safer and more productive.

I have taken a keen interest in the home CNC possibilities. The Mach system looks to be the best option for me except that, the last time I checked, G65 was a function that is not currently available. Any chance that "nesting" of variable tables and G65 capabilities being developed?

A co-worker and I have written some awesome macro's that have been the reason for stopping wreck after wreck and preventing baskets of scrap parts. The key to much of the capabilities of the logic we used is the ability to pass information and execute a sub routine from the same line using G65. Simply passing information into variables is not enough. The key to creating safety features is in the ability to execute and pass information together. The reason? When you start on a line intended as a safe start line, and there is more than one line required to get the logic to work there is a really good chance that someone will pick the wrong line when they perform a restart.

RDCline

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: G65 and Macro Variables
« Reply #1 on: March 09, 2012, 08:45:52 PM »
IF you are referring to subs, nested subs and #vars then yes MAch3 does it to a point.  Look in the manual for info on M89/99 sub programming. 

NOW be aware that Mach3 does NOT do any conditional gcode.  There is some limited support for this thru the macro subsystem

AND there are restrictions as to what is possible from the #var side. You cannot directly access the ALL the System DROs for example. BUT you can supply the system values through a macro subsystem. It just gets complicated and sometimes unpredictable (CB).

(;-) TP
« Last Edit: March 09, 2012, 08:48:13 PM by BR549 »
Re: G65 and Macro Variables
« Reply #2 on: March 10, 2012, 07:12:12 PM »
I suppose I am looking for what you refer to as Conditional G Code. In typical Fanuc style I do use M98/M99, which, I assume is similar to the M89/M99 you mentioned.

I use G65 conditional logic all the time. The ability to make CNC programs a lot safer, and ultimately less costly, is something I want to build into whatever machine I decide to put together. G65 conditional callout lines really make this safer and much easier to accomplish.

I am not at all versed in programming the underlying developer language used in the Mach... But I'm not in a hurry. I am ready to start learning something new. What is system is used in the source code? Where would you recommend I start?

Thanks,
RDCline

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: G65 and Macro Variables
« Reply #3 on: March 10, 2012, 10:29:10 PM »
WIth mach3 there is NO G65 function. #vars have full math functions and can be loaded at any time.

M98/99 deals with Sub programming

Mcode (m1001) are available to use special internal functions and mixed with Gcode inside the macro and does give conditional INSIDE the macro only.

Mach3 Gcode does not have conditional Gcode .

I wouold start with teh Mach3 manul then goe the Mach3 /CB (Cypress Basic, similar to VB) programmers manual and the Mach3 macro programmers manul.

That should get you going.

(;-) TP
Re: G65 and Macro Variables
« Reply #4 on: March 11, 2012, 05:28:23 AM »
Quote
Mach3 Gcode does not have conditional Gcode.
That's not to say you can't fake conditionals in gcode, up to a point. It's an old question which Terry and I have discussed before, and the way I use is messy.
I agree that using CB is much neater - if you know how to program in Basic.
The solution, we HOPE, is the much anticipated Mach V4.

Cheers

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: G65 and Macro Variables
« Reply #5 on: March 11, 2012, 11:43:23 AM »
HIYA ROGER, I would not hold your breath for Conditional in MACH4. (;-(

Even using CB it is not dependable at times and certain processes. I try to get the job done staying strictly in Gcode whenever possible. ROGER has a method that he can make work ,I get lost in its logic. BUT it works for him.

(;-) TP
Re: G65 and Macro Variables
« Reply #6 on: March 11, 2012, 04:29:23 PM »
Quote
HIYA ROGER, I would not hold your breath for Conditional in MACH4. (;-(
Sigh.
I agree - it is difficult to make a completely general conditional for gcode, given the asynchronous nature of the program execution.

Cheers

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: G65 and Macro Variables
« Reply #7 on: March 11, 2012, 09:18:58 PM »
Well actually IF you had true conditional Gcode with access to the system parameters it would not really be a problem AS you would not have to depend on the CB Macro system for such.  Conditional along with SUBS provide everything you would need.

Just do like everyone else does, route all the dros and sys parameters to a #var. Then call them as needed in the Gcode as a #var. There IS a segment of #vars already linked to a set oemdros. BUT there is no easy way to fill the Dros with known systems values and keep them current OTHER than a macro pump or a large brain.  BUT both of those are SLOW with updates.

One can dream, (;-) TP

« Last Edit: March 11, 2012, 09:22:36 PM by BR549 »
Re: G65 and Macro Variables
« Reply #8 on: March 13, 2012, 09:40:28 PM »
Thanks everyone, for a direction to start. Time to start adding to my nite stand reading pile and consider playing with Mach 3.

RDCline