What's new
What's new

Macro Programming Fundamentals

I came here to ask if anyone knows if it's illegal to make a chip breaking threading macro that mocks Sandvik's optithreading
I was doing this with a Macro Program back in the mid 1980's and many of my clients now use it. I also put a Sandvik Ejector Drill on a CNC lathe in 1979, after I was told by Sandvic it wasn't possible.
 
I was doing this with a Macro Program back in the mid 1980's and many of my clients now use it. I also put a Sandvik Ejector Drill on a CNC lathe in 1979, after I was told by Sandvic it wasn't possible.
Good to know it's not their original idea then and therefore they can't protect it. I will probably post it here once I get around doing and testing it. Unless the mods are against it?
 
G71 type1 toolpath (if this is what you wanted to see) ...

View attachment 407395
I know how to use it and how it works when using it but I would like to know if it's possible to make all this functionality into a macro I can write myself. For example How to figure out the boundary made by a toolpath that's determined by movement G-codes, do I have to convert it all to math functions somehow or something
 
I know how to use it and how it works when using it but I would like to know if it's possible to make all this functionality into a macro I can write myself. For example How to figure out the boundary made by a toolpath that's determined by movement G-codes, do I have to convert it all to math functions somehow or something
It is possible to write a G71-type macro, but it would be too tedious, to the extent of being impractical. A lot of mathematical calculations would be involved.
 
But, people do it in some cases, for better functionality. For example, peck-drilling cycle for progressively decreasing peck length is not available on Fanuc, as a standard canned cycle. Such a macro has to be developed.
 
I might do something like a profile roughing cycle for a milling machine if it wasn't too difficult. But it would be just for fun as confusion 360 would sweep the floor with it any day anyway
 
It's mentioned in Sinha's book and in the first post of this thread to name a couple sources
Its not correct. By definition, a Macro is a single instruction that expands automatically into a set of instructions to perform a particular task, therefore any Software could be defined as a Macro, but its the Programming Language that makes the difference in speed and efficiency. The Macro Language that is provided by the Control Builders is for the benefit of the user to create their own features, but to create something like a G71 Multi-repetitive Cycle, the result would be hellishly slow, and these Cycles aren't created using the Macro Language.

Many of the Fanuc Controls in the 80's had the Macro Executable contained on a cassette. The User Macro was an option and Turning Centres that didn't have the option, didn't have the cassette, yet they had the Multi-repetitive Cycles. However, the Mill Conversational Program of that era was created using User Macro, but the Lathe Conversational Program was a Fanuc version APT.

Regards,

Bill
 
With this definition, all canned cycles qualify to be called macros.
That' s what I said in my previous Post with the following:
therefore any Software could be defined as a Macro, but its the Programming Language that makes the difference in speed and efficiency

But they are not created using the User Macro Language. Many machines that have neither Macro A or Macro B, have canned cycles.
 
On many controls the Macro B functionality is also just enabled by an option parameter and everything needed for it is already existing in the machine.
 
On many controls the Macro B functionality is also just enabled by an option parameter and everything needed for it is already existing in the machine
Yes, but with those controls before the Macro B Function is enabled, still have Canned Cycles. The Cycles supplied with the control are not created by the Macro function.
 
Irrespective of the method of creation, the logic/flow chart remains the same, and it is not incorrect to say that canned cycles are internal macros.
 
Many Mitsubishi mill controls have the canned cycles written in user macro. They are hidden programs in the great majority of cases. There are some parameters that allow them to be viewed and edited. When I’m next at my shop I’ll try to remember to post more info about them.
 
Irrespective of the method of creation, the logic/flow chart remains the same, and it is not incorrect to say that canned cycles are internal macros.
But not in the same manner that I believe Moriseikiman and others may be interpreting that comment. The standard set of Canned and Multi-repetitive Cycles aren't written using the User Macro Executable.

Many Mitsubishi mill controls have the canned cycles written in user macro.
Hell Kevin,
The same goes with Fanuc Controlled machines. They're referred to as Built In Macros, and there are parameters to set the Program Number Range that is used and further parameters to password protect these programs. But they are different to the standard set of Canned and Multi-repetitive Cycles. Built In Macros tie up both the 8000 and 9000 field of programs (those program numbers in the range that are allocated via parameter to Built In Macros), that are normally available for use by the end user to write their own Custom Macros, as well as any Common, Nonvolatile Variables used in them.

Built in Macros, require that the machine is optioned with Macro B, but machines without this option still have the standard Canned and Multi-repetitive Cycles not written using the User Macro executable. I've been involved with writing CAD/CAM software and to think that an outfit such as Fanuc would write a Multi-repetitive Cycle such as G71 using their Macro Executable is laughable.

A simple profile with only a few elements would be feasible, but something with a profound number of geometric elements, there simply wouldn't be enough variables. In more sophisticated software languages, Arrays can be created to hold such data as geometric values for use when calculating a tool path, but the Fanuc User Macro has none of that.

Regards,

Bill
.
 
The users can define 10 new G codes. The control designers may define 100 new G codes. Obviously, the method cannot be the same. But, the algorithm for a particular task remains unchanged. It is our limitation that we cannot use any method other than user-macro. No CNC machine understands APT-type language at the users' end.
Still, canned cycles can be called macros or subroutines, in the broader sense.
 
The users can define 10 new G codes. The control designers may define 100 new G codes. Obviously, the method cannot be the same. But, the algorithm for a particular task remains unchanged. It is our limitation that we cannot use any method other than user-macro. No CNC machine understands APT-type language at the users' end.
You don't seem to get it. Writing, the G71 cycle by Fanuc using the User Macro Language is tantamount to having a modern F1 Race Car fitted with Wagon Wheels. The control doesn't have to understand a Language to be able to run a compiled routine, such as a Canned Cycle, the same as a PC doesn't have to understand C or any other software programming language to be able to run an installed executable.

Fanuc FAPT is Fanuc's version of APT.
 








 
Back
Top