The most controller are using as a job control
language the symbols from the DIN66025.
After this the partprogram are contains a
sequence of lines.
A line contains several words.
A word contains a letter and a number.
Technical information.
F = Feedrate
T = Tool
S = Spindlespeed
M = additional function
For example:
F – command = F0.25 ( mm/rpm )
T – command = T0101 ( Tool no. 1 )
S – command = S1000 ( 1000 rpm )
M – command = M03 ( spindle direction CW )
25
OKUMA
Main Address Characters
Main Address Characters
•N Block Number
•GPreparatory Function (See List)
•XDiameter Value
•ZLength Value
•FFeedrate (mm/min or mm/rev)
•(or Dwell time in seconds)
•SSpindle Speed (m/min or rev/min)
•TTurret Station/Offset Number
•MMiscellaneous Function (See List)
M––
M
M – function are help function, just to
switch on some additional function, e.g.
coolant on or off, C –axis on or off.
Function
Function
25
OKUMA
Lesson with G01
Lesson with G01
Program construction for 2 axis lathe machine
G50 S4500
G00 X500 Z500
G00 X0 Z2 T0101 G96 S250 M03 M08
G01 Z0 F0.15
G01 X40
G01 Z-20
G01 X60
G01 Z-50
G01 X100 Z-80
G01 X140
G01 Z-110
G01 X160
G01 Z-130
G00 X500 Z500 M09
M02
Tool command
G Code for constant cutting speed
M- code coolant on
M-code for spindle direction
Cutting speed in m/min
Note
The G00 command means that the machine will move with rapid feedrate , the rapid feedrate
is dependent on the machine. The unit for rapid feedrate is m/min.
The G01 command means that the machine will move with feedrate, therefore it is necessary
to program in the first line with G01 a feedrate command.
The address for feedrate is ”F ” for example F0.25 = 0.25mm by one rotation of the spindle
OKUMA
Lesson with G85 Lap cycle
Lesson with G85 Lap cycle
Program construction for G85 Lap cycle
G50 S4500
G00 X500 Z500
G00 X160 Z2 T0101 G96 S250 M03 M08
G85 NAP1 D5 U0.5 W0.1 F0.35
F = Feedrate
W = Stock removal in Z
U = Stock removal in X
D = Cuttingdepth in diameter
NAP1 G81G81 = Cutting direction in Z - axis
G01 X0 Z0
X40
Z-20
X60
Z-50
X100 Z-80
X140
Z-110
X160
G80
G00 X500 Z500 M09
M02
27
OKUMA
Exercise G85 /G81
Exercise G85 /G81
28 ( 29 )
OKUMA
Lesson G85 Lap Cycle in X --
Lesson G85 Lap Cycle in X
Blank material D= 162
Direction
Direction
Program construction for G85 Lap cycle in X -Direction
In case of G71 cycle it is not possible to use G96 command.
45
OKUMA
Lesson G71 thread cutting cycle
Lesson G71 thread cutting cycle
B60 M32
Straight Infeed along thread
Face ( left Face )
Cuttingdepth calculation:
B60 M33
Zig zag Infeed
B60 M34
Straight Infeed along thread
Face ( right Face
)
M73 Infeed is made by D ( in diameter ) in each thread cutting cycle up
to the point D mm away from ” H –U (W) position. After that point is
reached, Infeed amount change to D/2 D/4 D/8, leaving stock
removal U (W) if specified. And in the finishing cycle, Infeed is made as
much as the specified amount U (W). ( until 800 Kg / mm² )
M74 Infeed is made by D ( in diameter ) until the point is away from ” H –U
(W) position . ( Aluminium, Brass, plastic )
M75 Infeed is made always by the same chip section . ( from 800 Kg / mm² )
To call an Subprogram in a main program it is necessary the use the command ” CALL ”
The subprogram name must begin with an " O " and may have not more than 4 signs.
The subprogram must end with command ” RTS ” .
52
OKUMA
Macro’s
Macro’s
What is a Macro?
A group of instructions, which are
possible to store and called as an
unit, this make it possible the reduce
the time of programming for
repeatable jobs or family parts.
53
OKUMA
Variables Function:
In OSP controller it is possible to use 5 kind of Variable.
1.)Common variables
2.)Local variables
Common Variables
The term ”common” in ”common variables” can be literally understood as common; they can be used in
common for main and subprograms. When the same variable is used in two or more programs, the
variable number used in those programs must be identical. Therefore, a common variable, the result of
calculation in one program, can be referred to in other programs.
[Format]
V numerals = numerical data or expression
Common variable designations consist of up to three digits following ”V”. The usable common variables
are V1 through 200.
Examples:
N101 V5 = 10
N101 V5 = V5 + 1
[Details]
- Common variables are effective both in main programs and subprograms.
- Common variables are not affected by resetting the control or turning power off. That is, the
data are retained unless they are re-set or a control software is installed.
- Besides setting or changing them in a program, common variables can be set or changed by
setting a parameter. For detailed information on parameter setting, refer to SECTION
PARAMETER SETTING, DATA OPERATION in OPERATION MANUAL.
Local Variables
As is apparent from the term ”local”, local variables are the variables that a user can set as desired with
meaningful names assigned to them. Up to 127 local variables each can be used for the A and B saddles.
[Format]
Letter Letter two alphanumeric = Numerical data or expression
O, N and V cannot be used.
Example: ‘DlA1’ ‘ITH5’
54
OKUMA
[Details]
A local variable cannot be assigned the same name as already used for a
function name, comparison operator, Boolean operator, or extended address
character.
Extended address characters are provided to realise LAP, pattern processing,
and user-specific fixed cycles. They are necessary because there are not
enough letters in the alphabet to cover the required number of extension
names. The following extended address characters are currently used.
<AA> <AB> <DA> <DB> <FA> <FB> <IA> <IB> <KA> <KB>
<LA> <LB> <RA> <RB> <SA> <SB> <TA> <TB> <UA> <UB>
<WA> <WB> <XA> <XB> <ZA> <ZB> <BC> <BR>
Characteristics of Local Variables
- Local variables are cleared when the control is reset.
- When a new local variable is set in a main program, that is, when data is
assigned to a new local variable name, that local variable name and
corresponding data are registered in the memory.
NOTICE
If a local variable name is used without
- When new data is assigned to a local variable already registered with other
data, that old data is updated.
N0010DIA1 = 160
In N0010, numerical data "160" is assigned to local variable
:
name "DIA1", and this data remains effective up to sequence
:
:
N0049. In N0050, the new numerical data "200" is assigned
to the same local variable name "DlA1". This clears the old
setting any data for it, an alarm results.
N0049
data "160" and replaces it with the new data "200"
This function allows arithmetic operation using variables. The programming can be
done in the same way as for general arithmetic expressions.
Address character, Extended address character, Variable = Expression
The expression on the right-hand side, requesting an arithmetic operation, is made
up of constants, variables, comparison expressions, and operators.
The arithmetic and comparison expressions are described below.
1. )Arithmetic Expression
2.) Comparison Expression
58
OKUMA
3. ) Function
V1= V1 * SIN [V3]
V1= V1 * COS [V3]
V1= V1 * TAN [V3]
V1 = ATAN [V2]
V1 = ATAN2 [2]
V1 = SQRT [V2]
V1 = ABS [V2]
V1 = BIN [V2]
V1 = BCD [V2]
V1 = ROUND [V2]
V1 = FIX [V2]
V1 = FUP [V2]
V1 = DROUND [V2]
V1 = DFIX [V2]
V1 = DFUP [V2]
V1 = MOD [V2/V3]
59
OKUMA
Lesson for triangle calculation
Lesson for triangle calculation
Formula for calculate the sides of a triangle: A² + B²=C² ( Pythagorean )
A = 25
B = 55
C = ?
One possibility for calculation.
V1=25
V2=55
V10=V1*V1 (625)
V11=V2*V2 (3025)
V12=V10+V11 (3650)
V13=SQRT[V12] (60.415)
M2
Another possibility for calculation
V1=25
V2=55
V3=SQRT[[V1*V1]+[ V2*V2]]
M2
A maximum of seven pairs of [ ] can used.
60
OKUMA
Lesson for triangle calculation
Lesson for triangle calculation
D
Tan D = -----SinD = -----CosD = -----
A = 25
B = 55
C = 60.415
D = ?
V1=25
V2=55
V3=60.415
Formula for angle calculation:
AAB
BCC
V10=V1/V2 ( 0.454545)
V11=ATAN[V10] (24.444°)
M2
61
OKUMA
Exercise for triangle calculation
Exercise for triangle calculation
E
D
Exercise:
Please calculate
Side A and B and angle E
We have:
C = 75.716
D = 32.335
Solution:
62
OKUMA
Practical Exercise
Practical Exercise
Please make a macro for the workpiece shape above.