Cimco Edit Siemens 840D Macro Programming Examples
Cimco Edit Siemens 840D Macro Programming Examples
1
Macro Programming Examples using Siemens Arithmetic Variables & Programming Aids
and Cimco Editor, NC-Assistant, and Backplot
Example 1
There is a requirement to produce a range of plates with radial Keyhole Slots for a family of motor products. The
larger range require more slots in the radial array and the slot sizes vary dependent on the plate size. See below
the diagram of the keyhole slots and the variable sizes.
See below a section of the Header from the Program with the basic assignment of variables. The arithmetic R
variables can be edited to the sizes that are required for the current production run of parts. All sizes here are in
mm. The diagram is set at 0 degrees (3PM)
;------------------------------------------
;-------------------------------------
2
When we have entered the variable details, we can test the program using the Cimco Editor Backplot facility.
Note the two screen shots below with different numbers of slots at different sizes.
Let’s look at the structure of the program that uses the ROT rotation of coordinates to achieve the multiple radial
keyhole slots and incremental depth cuts to machine through the plate. We need to have the end point
3
coordinates in X and Y to create the profile, we need to have the angle to rotate the coordinates depending on
the number of keyhole slots and we need to have the incremental depth from the number of cuts we have
decided on. See below the section of the program that assigns the variable and calculates the points we need to
make the program run. We are using the variables in the low digits for the basic assignment, and we are using
variables starting at R50 for the profile points and calculations. There are variables Savailable from R0 to R999.
See below the basic assignment and the description of the calculation blocks.
;------------------------------------------
;-------------------------------------
IF R7>=R1 ;TEST IF CUTTER IS TOO BIG GO TO LABEL "ERR" There is a requirement to test for errors in the
entry of variables in this type of programming.
GOTOF ERR1 Here is a simple example of a test to see it the
ELSE cutter selected is too big for the slot. A fully
formed program would have several tests to
GOTOF N1 safeguard the running of the program and the
correctness of part geometry, etc.
G0 Z100
4
X0 Y0
T11
D1
ANGLE: ;LABEL
G0 Z10
SLOT: ;LABEL
X=R56
G1 X=R57
G3 Y=-R51 I0 J=-R51
G1 X=R50
ELSE
ENDIF
ELSE
ENDIF
END:
G0 Z100
M00 ; STOP PROGRAM AND THE MSG ABOVE WILL BE EVIDENT ON THE CNC HMI
6
Example 2
There is a requirement to produce an elliptical hole in a plate to accept a pipe to be welded to the plate that has
been cut at an angle. See drawing below.
From the start of the program, you can see the basic R variable assignment that will be used to control the size
and shape of the Ellipse.
R1=125 ;CENTRE IN X
R2=80 ;CENTRE IN Y
R3=61.5 ;RADIUS IN X
R4=47 ;RADIUS IN Y
See below the resulting Solid Animation Backplot. The program to create the ellipse is listed below with
comments attached to the blocks with explanations. We have only considered the elliptical shape here and some
area clearance or pilot holes may be required for Z axis entry etc.
7
%_N_0110_MPF
;$PATH=/_N_WKS_DIR/_N_SIEMENS_TEST_JB_WPD
;PROGRAMMER-JOE SMITH
;DATE/TIME-08/10/2021 10:50:44
;---------------
R1=125 ;CENTRE IN X
R2=80 ;CENTRE IN Y
Variable Assignment
R3=61.5 ;RADIUS IN X
R4=47 ;RADIUS IN Y
;-----------------------------
LBL1: ;LABLE
10
Example 3
There is a requirement to produce multiple profiled parts from a sheet on material in rows and columns. See
below the profile programmed here that can be found within the body of the program. A sub program machining
a more complex part could be called from this program instead of the profile here. From the diagram below see
the points as indicated 0-14 used to create the program blocks that will change family shape dependent on the
variables entered. A program that can be seen below further down the will facilitate the simple editing of these
variables to create multiple parts form a given sheet of material.
R1=80 ;WIDTH
R2=80 ;DEPTH
11
R8=2 ;R PLANE Z POSITION
From the entries above the program can be tested. See the Tool path Backplot below showing the correct number
of depth cuts and regular spacing as per the entries …..
12
If we now wish to test the program in Solid Animation the Solid Setup must be set to depict the sheet size to test
the nesting of the multiple parts. To do this we need to fix the first part using variables R11 and R12 and then set
the Solid Setup X, Y, Z, plus and minus to represent the area of sheet material that our Rows and Columns will fit.
To set R11 and R12 see the guide below: The simple formula below will fix the first part on the sheet and other
parts will be spaced as per the other variables.
In Solid Animation, Solid Setup needs setting to represent the sheet so that the resultant sheet size shown on the
Editor screen, will accommodate all the parts. To achieve a sensible Solid Setup block size, use the formula below
and enter the Solid Setup box as indicated below:
13
See the resulting Solid Animation from the Cimco Editor below.
See the whole program set out below with comment descriptions on each block.
%_N_0110_MPF
;$PATH=/_N_WKS_DIR/_N_SIEMENS_TEST_JB_WPD
;DESCRIPTION-MULTIPAL PROFILES
;CPN-000
Program Header
;DRAWING NO-00000 ISSUE-0
;PROGRAMMER-JOHN BRIDGE
;DATE/TIME-21/10/2021 10:47:45
;------------------------------
R1=80 ;WIDTH
R2=80 ;DEPTH
14
R6=3 ;NO. OF CUTS TO DEPTH
R8=2 ;R PLANE
;----------------------
;----------------------
Z0 ;MOVE TO Z ZERO
COL1: ;LABEL
G0 Z0 ;RESET TO Z0
G0 X0 ;MOVE TO X0 Y0
Z0 ;MOVE TO Z0
;--------------------
;--------------------
;-- PROFILE --
PROF1: ;LABEL
G0 G41 X0 Y0 ;POINT 0
G1 X=R114 Y0 ;POINT 1
G1 X=R114 Y0 ;POINT 14
G0 G40 X0 Y0 ;POINT 15
;-------------
END: ;LABEL
17
G0 Z=R7 ;GO TO RETRACT HEIGHT
18