In a previous article, we discussed how to create Custom M-Codes for the
SIEMENS 840D sl CNC Control. We will now discuss the process of
creating Custom Cycles for the SIEMENS 840 sl. As with Custom M-codes, Custom Cycles are driven by an underlying
sub-program file (*.SPF). Custom Cycles commissioned by a Machine Tool
Builder will be located in the 'Cycles' area under 'Manufacturer
cycles'. Custom Cycles written by the end-user of the machine tool
should be placed in in the 'Cycles' area under 'User cycles'. The 'Cycles' area under 'NC Data' has a specific hierarchy with a
specific priority. When a Custom Cycle is called, the SIEMENS system
will first search the 'User cycles' area for the program. If it is not
found, it will then search the 'Manufacturer cycles' area and finally
the 'Standard cycles' area. The 'Standard cycles' area is everything
that is native to the core SIEMENS NC system. This data is 'protected'
meaning that any SIEMENS Native Cycle SPF files deleted will
automatically be recreated by the system. Users should leave this area
alone. The first task in creating the Custom Cycle is writing the underlying
macro program for the Cycle. In this case we'll create a Custom Cycle
that will perform a 5-Axis Deep-Hole Peck Drilling Cycle for a 5-Axis
CNC Mill with a C/A Head/Head configuration. We start by creating a new
SPF program in the 'User cycles' area. We'll call this program CYCLE183
for our Custom Cycle, CYCLE183. The naming of Custom Cycle Programs and Custom M-Code Programs is
important. Like all other Sub-Programs, the name may NOT start with a
number. Furthermore, the first two characters in the name must be an
Alpha Character or an Underscore ( _ ). In this case we chose to follow
the standard SIEMENS Cycle naming convention. Once the editor window has opened, we then type in our program. There
are two important requirements for a program that will be used for a
Custom Cycle. The first line that will be executed must be the procedure
declaration for the Custom Cycle. The next requirement is that each
argument of the Custom Cycle must have a variable declared as the proper
type. These scope of these variables will be LOCAL to the Custom Cycle only. The graphic below shows the variable types that are available. In our example, our procedure declaration will start with 'PROC
CYCLE183' and will be followed by 13 variable declarations separated by a
comma ( , ) and nested between parenthesis ( ). With this cycle, all of
the variables will be declared as REAL. As with all Cycle arguments,
any argument not assigned a value will be treated as a value of zero. NOTE: Parameter MD10600 $MN_FRAME_ANGLE_INPUT_MODE should be set to 1 (Default Value) as RPY Angles are used. In this program I have chosen to use SIEMENS native cycles CYCLE800 and
CYCLE83 to do the 'heavy lifting' for us. Each hole point being drilled
will be creating a Tilted Work Plane at that drill point and will be
using the CYCLE83 to perform the drilling at the X0.0 Y0.0 origin of the
LCS created by CYCLE800. I chose to use the MCALL mode for nothing more
than clarity for those following the code. Please notice that TRAORI is active before the CYCLE 183 and is
cancelled before the CYCLE800 call within the CYCLE183. TRAORI is then
reactivated after CYCLE800 is cancelled and control returns to the main
program. Please also pay attention to the fact that if we choose open the
CYCLE800 and CYCLE83 calls within Program Guide, we will see the
variables declared in the procedure declaration for CYCLE183. Once we have completed the program, we then close the editor. At this
point we must perform an NCK power down and re-boot in order for the
control to be fully aware of the Custom Cycle, CYCLE183. At this point we are now ready to use the custom cycle within a program.
The program shown in the graphic below can be downloaded and reviewed
in a text editor. Here is the download link for the file 5X_DRILL_NEW.MPF. Please note that the positioning between CYCLE183 calls is done using the SIEMENS Vector Format. ![]() Here is a video of the program being executed through the SIEMENS Run-Time Simulation.
Some may find it useful to perform a direct comparison between the above
sample program using our Custom Cycle and a program using the more
traditional and explicit method of having CYCLE800 and CYCLE83 called
within the program directly. Here is the link to a more traditional
program for comparison. 5X_DRILL.MPF. The program using our Custom Cycle, CYCLE183 contains only 88 blocks.
The more traditional program contains 207 blocks. By judicious use of
SIEMENS Custom Cycles, users can achieve greater efficiencies by
reducing the code required to perform the needed operations. Anyone interested in further information regarding Custom Cycles,
M-Codes and Macros should request the SIEMENS Programming Guide Advanced
Manual directly from SIEMENS or your Machine Tool Distributor. The
information is also available within the SIEMENS DOConCD package Investing the time to learn the power of SIEMENS Custom programming is time well spent! |
↧
SIEMENS 840D - Creating Custom Cycles
↧