okuma osp-p300s p300l gauging systems instruction manual application le61-497-r01a

191
CNC SYSTEM OSP-P300S/P300L GAUGING SYSTEMS INSTRUCTION MANUAL-APPLICATION - (1st Edition) Pub No. 5972-E (LE61-497-R1) Dec. 2011

Upload: theguru999

Post on 08-Nov-2014

998 views

Category:

Documents


102 download

TRANSCRIPT

Page 1: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

CNC SYSTEM

OSP-P300S/P300L

GAUGING SYSTEMS

INSTRUCTION MANUAL-APPLICATION -(1st Edition)Pub No. 5972-E (LE61-497-R1) Dec. 2011

Page 2: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-(i)SAFETY PRECAUTIONS

SAFETY PRECAUTIONS

This machine is equipped with safety equipment to protect persons and machinery from any danger that might happen unexpectedly. However operators are requested to operate the equipment in such a way that no person will use the equipment in the following unsafe manner and cause an accident without knowing the following safety precautions.This instruction manual and the warning sings attached to the machine cover only those hazards which Okuma can predict.Be aware that they do not cover all possible hazards.

1. Precautions Relating to Installation

(1) Please be noted about a primary power supply as follows.

Do not draw the primary power supply from a distribution panel that also supplies a major noise source (for example, an electric welder or electric discharge machine) since this could cause malfunction of the CNC unit.

If possible, connect the control enclosure to a ground independently. If there is no choice but to use a common ground, the other equipment must not generate a large amount of noise (such as an electric welder or electric discharge machine).

(2) Installation EnvironmentObserve the following points when installing the control enclosure.

Make sure that the CNC unit will not be subject to direct sunlight.

Make sure that the control enclosure will not be splashed with chips, water, or oil.

Make sure that the control enclosure and the operation panel will not be subject to excessive vibration or shock.

The permissible ambient temperature range for the control enclosure is 5 to 40 °C (41 to 104 °F).

The permissible ambient humidity range for the control enclosure is relative humidity 50% or less at 40 °C (104 °F) (no condensation).

The maximum altitude at which the control enclosure can be used is 1000m (3281 ft).

2. Points to Check before Turning on the Power

(1) Close all the doors of the control enclosure and operation panel to prevent the entry of water, chips, and dust.

(2) Make absolutely sure that there is nobody near the moving parts of the machine, and that there are no obstacles around the machine, before starting machine operation.

(3) When turning on the power, turn on the main power disconnect switch first, then the CONTROL ON switch on the operation panel.

Page 3: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-(ii)SAFETY PRECAUTIONS

3. Precautions Relating to Manual/Continuous Operation

(1) Follow the instruction manual during operation.

(2) Do not operate the machine with the front cover, chuck cover, or another protective cover removed.

(3) Close the front cover before starting the machine.

(4) When machining the initial workpiece, check for machine operations, run the machine under no load to check for interference among components, cut the workpiece in the single block mode, and then start continuous operation.

(5) Ensure your safety before rotating the spindle or moving a machine part.

(6) Do not touch chips or workpiece while the spindle is rotating.

(7) Do not stop a rotating part with hand or another means.

(8) Check that the condition of hydraulic chuck jaws as mounted, operating pressure, and maximum permissible revolving speed.

(9) Check the condition and location of the cutting tool as mounted.

(10) Check the tool offset value.

(11) Check the zero offset value.

(12) Check that the SPINDLE OVERRIDE and FEEDRATE OVERRIDE dials on the NC operation panel are set to 100%.

(13) When moving the turret, check the software limits for X- and Z-axes or the locations of limit switch dogs to prevent interference with the chuck and tailstock.

(14) Check the location of the turret.

(15) Check the location of the tailstock.

(16) Cut workpieces with a transmitted power and torque within the permissible range.

(17) Check each workpiece firmly.

(18) Check that the coolant nozzle is properly located.

4. Precautions When Finishing Work

(1) When finishing work, clean the area around the machine.

(2) Return the turret to the predetermined retraction position.

(3) Always turn off the power to the machine before leaving it.

(4) To turn off the power, turn off the CONTROL ON switch on the operation panel first, then the main power disconnect switch.

Page 4: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-(iii)SAFETY PRECAUTIONS

5. Precautions during Maintenance Inspection and When Trouble Occurs

In order to prevent unforeseen accidents, damage to the machine, etc., it is essential to observe the following points when performing maintenance inspections or during checking when trouble has occurred.

(1) When trouble occurs, press the emergency stop button on the operation panel to stop the machine.

(2) Consult the person responsible for maintenance to determine what corrective measures need to be taken.

(3) If two or more persons must work together, establish signals so that they can communicate to confirm safety before proceeding to each new step.

(4) Use only the specified replacement parts and fuses.

(5) Always turn the power off before starting inspection or changing parts.

(6) When parts are removed during inspection or repair work, always replace them as they were and secure them properly with their screws, etc.

(7) When carrying out inspections in which measuring instruments are used - for example voltage checks - make sure the instrument is properly calibrated.

(8) Do not keep combustible materials or metals inside the control enclosure or terminal box.

(9) Check that cables and wires are free of damage: damaged cables and wires will cause current leakage and electric shocks.

(10) Maintenance inside the control enclosure

a. Switch the main power disconnect switch OFF before opening the control enclosure door.

b. Even when the main power disconnect switch is OFF, there may some residual charge in the MCS drive unit (servo/spindle), and for this reason only service personnel are permitted to perform any work on this unit. Even then, they must observe the following precautions.

MCS drive unit (servo/spindle)The residual voltage discharges two minutes after the main switch is turned OFF.

c. The control enclosure contains the NC unit, and the NC unit has a printed circuit board whose memory stores the machining programs, parameters, etc. In order to ensure that the contents of this memory will be retained even when the power is switched off, the memory is supplied with power by a battery. Depending on how the printed circuit boards are handled, the contents of the memory may be destroyed and for this reason only service personnel should handle these boards.

Page 5: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-(iv)SAFETY PRECAUTIONS

(11) Periodic inspection of the control enclosure

a. Cleaning the Cooling UnitThe cooling unit in the door of the control enclosure serves to prevent excessive temperature rise inside the control enclosure and increase the reliability of the NC unit. Inspect the following points every three months.

Is the fan motor inside the cooling unit working?The motor is normal if there is a strong draft from the unit.

Is the external air inlet blocked?If it is blocked, clean it with compressed air.

Page 6: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-(v)SAFETY PRECAUTIONS

6. General Precautions

(1) Keep the vicinity of the machine clean and tidy.

(2) Wear appropriate clothing while working, and follow the instructions of someone with sufficient training.

(3) Make sure that your clothes and hair cannot become entangled in the machine. Machine operators must wear safety equipment such as safety shoes and goggles.

(4) Machine operators must read the instruction manual carefully and make sure of the correct procedure before operating the machine.

(5) Memorize the position of the emergency stop button so that you can press it immediately at any time and from any position.

(6) Do not access the inside of the control panel, transformer, motor, etc., since they contain high-voltage terminals and other components which are extremely dangerous.

(7) If two or more persons must work together, establish signals so that they can communicate to confirm safety before proceeding to each new step.

7. Symbols Used in Manual

The following warning indications are used in this manual to draw attention to information of particular importance. Read the instructions marked with these symbols carefully and follow them.

Page 7: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-(i)INTRODUCTION

INTRODUCTION

Thank you very much for purchasing our numerical control unit OSP-P300L.Before using this NC unit (hereafter simply called NC), read this programming manual (hereafter called this manual) thoroughly in order to ensure correct use. This manual explains how to use and maintain the NC so that it will deliver its full performance and maintain accuracy over the long term. You must pay particular attention to the cautions given in this manual, read them carefully, and make sure you fully understand them before operating the NC.

Display Screens

The NC display screens vary with the selected NC specifications. Therefore, the screens used on your CNC system may differ from those shown in this manual.

Page 8: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-(i)TABLE OF CONTENTS

TABLE OF CONTENTS

SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)...............................1

1-1. Notes for Using Gauging MSB .......................................................................................... 1

1-1-1. Precautions ......................................................................................................... 1

1-1-2. Control Statements.............................................................................................. 3

1-2. Touch Setter Gauging and Touch Sensor Gauging .......................................................... 7

1-2-1. Outline ................................................................................................................. 7

1-2-2. Variable Tables ................................................................................................... 7

1-2-3. Print ................................................................................................................... 17

1-2-4. Program............................................................................................................. 21

1-2-5. Flow Chart ......................................................................................................... 24

1-2-6. Program List ...................................................................................................... 59

1-3. Touch Sensor Gauging (Automatic Zero Offset Function)............................................... 75

1-3-1. General Description of MSB.............................................................................. 75

1-3-2. Variable Tables ................................................................................................. 75

1-3-3. Program............................................................................................................. 78

1-4. Automatic C-axis Zero Offset Function............................................................................ 81

1-4-1. General Description of MSB.............................................................................. 81

1-4-2. Variable Tables ................................................................................................. 81

1-4-3. Program............................................................................................................. 86

1-5. Y-axis Gauging Function ............................................................................................... 111

1-5-1. General Description of MSB............................................................................ 111

1-5-2. Variable Tables ............................................................................................... 111

1-5-3. Program........................................................................................................... 114

1-6. Automatic Gauging System Using Five Level Signals (BCD System)........................... 139

1-6-1. General Description of MSB............................................................................ 139

1-6-2. Variable Tables ............................................................................................... 139

1-6-3. Program........................................................................................................... 145

1-7. Automatic Gauging System Using Five Level Signals................................................... 151

1-7-1. General Description of MSB............................................................................ 151

1-7-2. Variable Tables ............................................................................................... 151

1-7-3. Program........................................................................................................... 156

1-8. Automatic Gauging System by Seven Level Signals..................................................... 162

1-8-1. General Description of MSB............................................................................ 162

1-8-2. Variable Tables ............................................................................................... 162

1-8-3. Program........................................................................................................... 167

1-9. CEJ MATIC Gauging MSB ............................................................................................ 173

1-9-1. CEJ MATIC Gauging Subprograms ................................................................ 173

1-9-2. Common Variables.......................................................................................... 173

1-9-3. System variables ............................................................................................. 173

1-9-4. Program........................................................................................................... 174

1-10. MSB for Post-process Gauging Using RS-232C ........................................................... 177

Page 9: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-(ii)TABLE OF CONTENTS

1-10-1. Gauging Subprogram...................................................................................... 177

1-10-2. System Variables ............................................................................................ 177

1-10-3. Common Variables.......................................................................................... 177

1-10-4. Program........................................................................................................... 178

Page 10: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-1SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-1. Notes for Using Gauging MSB

1-1-1. Precautions

General notes for using maker subprograms (MSB) for gauging are presented below.

NOEX Command

In the single block mode, sequences preceded by NOEX are excluded in single block operation. This speeds up internal processing for checking and correcting the program in single block operation.When specifying the NOEX command, the restrictions stated below apply.

NOEX cannot be specified before axis movement commands.NOEX G00 Z100......................×

NOEX cannot be specified before an IF statement.NOEX IF [AA EQ 0] N004........×

NOEX cannot be specified before a GOTO statement.NOEX GOTO N004..................×

NOEX cannot be specified before a sequence number/label.NOEX can be specified after a sequence number/label.NOEX N001 V1A=A100..............×N001 NOEX V1 = 100.............○

NOEX cannot be specified before a CALL statement.NOEX CALL OWMXA...............×

In modes other than the single block mode, NOEX has no influence on the execution of a program.If NOEX is specified in a variable setting sequence, the execution time is shortened since the sequence is excluded from single block processing. (The operation itself does not vary regardless of whether or not NOEX is specified.)

Page 11: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-2SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Judging Local Variable Definition Using IF Statement

(1) Specify the sequence name of this block.

(2) This indicates that this sequence is the IF statement sequence.

(3) Specify the local variable name whose defined/undefined status is to be checked. Note that a local variable name may not be enclosed by brackets ([ ]).

(4) Specify the sequence name of the destination block to which the program jumps if the specified local variable has been defined.

The IF statement judges whether or not the specified local variable has been defined and causes a jump to the N3 block if it has been defined.If undefined, the next block is executed.Example: N1000 IF ABC N2000If local variable ABC has been defined, the program jumps to the N2000 block. If not, the program proceeds to the next block.

Calculating the Measured Value (Sensor Contact Point, Program Coordinate System) (Gauging in the Z-axis Direction)

Measured value = VSKPZ [*] - VZOFZ - VZSHZ - VETFZ (* = 1 or 2) After the execution of the G30 gauging cycle, the coordinate value of the contact point (in the machine coordinate system) is set at VSKPZ.

Measured value - Target value (MSP): The difference between the “measured value” and the “target value (MSP)” is calculated as the amount of variation and judgment is carried out based on this amount of variation.

N2 IF Local-variable-name N3

(1) (2) (3) (4)LE61497R0100700030001

X

Z

Machine zero

Zero offsetZero shift value

Measured value

Tool offset value

Contact point VSKPZ [*]

LE61497R0100700040001

Page 12: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-3SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

[Supplement]

1-1-2. Control Statements

In gauging programs, the following control statements are used:

(1) GOTO statement

(2) IF statement

(3) CALL statement

(4) RTS statement

These control statements are all entered at the beginning of a block or immediately after the “sequence name” which comes first in a block. They must be followed by a space or a tab code. If no space or tab code is entered following a control statement, an alarm occurs.However, note that since a left bracket “[“ is specified following IF statement, no space or tab code is required after an IF instruction.Example:

Specify either a space or a tab code immediately after an element consisting of two or more consecutive address characters such as a sequence name or control code.

[Supplement]

The coordinate value of the contact point is set at either variable VSKPZ [1] or VSKPZ [2]. In the touch setter gauging cycle, the contact point coordinate value is set at VSKPZ [2]. In the touch sensor gauging cycle (master ring gauging cycle, work gauging cycle), it is set at VSKPZ [1]. This is also true for VSKPX [1] and VSKPX [2].

A sequence name means a code that is used to identify a block in a program. It consists of four alphanumeric digits following address N.Sequence names can be expressed in two ways: [N] [4-digit number] and [N] [Alphabet] [3-digit alphanumerics]. In this manual, sequence names include both of these two types of expression.

Enter a space or a tab code

N1001 GOTO N2000

NLAP1 GOTO NLAP2LE61497R0100700050001

Page 13: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-4SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

GOTO Statement (Unconditional Branch)

(1) Programming format

[Supplement]

(2) FunctionProgram branches to the specified block (N1) unconditionally.With a two-saddle model, branching from the turret A side program to the turret B side program or from the turret B side program to the turret A side program is not allowed.

IF Statement (Conditional Branch)

(1) Programming format

(2) FunctionThe program jumps to the specified block if the result of [qualification] is true.If the result if false, the next block is executed.Example:

In the example program above, if “10” is set for variable V1 (V1 = 10), the program jumps to the N2000 block.In other cases, the next block is executed.

The branch destination sequence name “N1” must be present in the same block where the control statement (GOTO) is specified.

N0 GOTO N1

(a) Sequence name of this block. The sequence name may be omitted.(b) Indicates a GOTO statement.(c) Sequence name of the destination of branching. A branch destination sequence name must always be specified.

(a) (b) (c)

LE61497R0100700060001

N0 IF [Qualification] N1

(a) Sequence name of this block. The sequence name may be omitted.(b) Indicates an IF statement.(c) There are two qualification states resulting from the comparison operation: "true" and "false." The qualification must be enclosed by brackets ([ ]).(d) The sequence name of the destination of branching that occurs if the result of qualification is "true". The branch destination sequence name must always be specified.

(a) (b) (c) (d)

LE61497R0100700070001

N1000 IF [V1 EQ 10] N2000

This stands for "EQUAL".LE61497R0100700070002

Page 14: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-5SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

(3) Judging Local Variable Definition Using IF Statement

Example:

In the example program above, if local variable ABC has been defined, the program jumps to the N2000 block.If not, the program proceeds to the next block.

CALL Statement (Program Call)

(1) Programming format

(2) FunctionThe CALL statement calls and executes the specified subprogram (O1).If variables are set in “variable setting set”, the specified variables are all registered.Example: N1000 CALL O1234 XP1=150 ZP1=100Calls and executes subprogram O1234 and registers variables XP1 and ZP1.

N2 IF Local-variable name N3

(a) (b) (c) (d)

(a) Sequence name of this block.(b) Indicates an IF statement.(c) Local variable name whose defined/not defined status is to be evaluated. A variable name may not be enclosed by brackets ([ ]).(d) Sequence name of the destination of branching that occurs if the specified local variable

has been defined. Whether the specified local variable has been defined or not is judged; if it has been

defined, the program jumps to the N3 block. If it has not been defined, the next block is executed.

LE61497R0100700070003

:N1000 IF ABC N2000 : :N2000

LE61497R0100700070004

N0 CALL O1 Q1 Variable-setting-part

(a) (b) (c) (e)(d)

(a) Sequence name of this block. The sequence name may be omitted.(b) Indicates a CALL statement.(c) Program name of the subprogram to be called. The program name must always be specified.(d) The number of times the called subprogram should be repeated. The programmable range of

this repetition is from 1 to 9999. If the Q word is omitted, "Q1" is assumed.(e) Set variables that are used in the subprogram to be called.

LE61497R0100700080001

Page 15: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-6SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

RTS Statement (Subprogram End Code)

(1) Programming format

(2) FunctionThe RTS statement must always be specified at the end of a subprogram.When this block is executed, the called subprogram ends and the program returns to the block next to the CALL statement block.Variables registered by the execution of the CALL statement and those registered in the called subprogram are discarded.Example:

When N1000 in the main program is executed, program execution jumps to O1234 in the subprogram and that subprogram is executed. After that, when the RTS statement in N050 is executed, program execution jumps to the N1001 block and the blocks in the main program are executed from N1001.Variables XP1 and ZP1 are discarded.program sequence

The sequence name specified as the jump destination must be present in the same subprogram.Designation of G13 and G14 is not allowed in a subprogram.

(a) Sequence name of this block. The sequence name may be omitted.(b) Indicates the end of the subprogram (RTS statement).

N0 RST

(a) (b)

LE61497R0100700090001

N1000 CALL O1234 XP1=150ZP1=100N1001 G00 X Z : : : :

O1234N001 G00 X=XP1 Z=ZP1N002 : :N050 RTS

SubprogramMain program

LE61497R0100700090002

N1000 O1234 N001 N050 N1001→ →→ →

LE61497R0100700090003

Page 16: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-7SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-2. Touch Setter Gauging and Touch Sensor Gauging

1-2-1. Outline

General Description of MSB

This section covers the list, flow chart, variable table and other information relating to touch setters M/A and the touch sensor gauging function, using the following maker subprogram (MSB) as an example.

LMSA300A.MSB

The name of gauging control software is indicated as described below.

In this manual, the gauging control software is represented by “MSB”.The MSB largely differs from the other control software in the contents.Other control software is used to control signals from the machine and also input/output of part programs and/or user’s commands.However, the MSB is created in the same format as that of the part program, and so it can be considered as the control software that implements gauging cycle instead of the user.In the explanation below, LMSA300A.MSB (tool nose gauging using a touch sensor) is used as an example. A variety of MSBs exist in addition to this program and the internal specification is specific to the individual programs. However, the basic programming format, variables to be used, etc. are common to all MSBs.

1-2-2. Variable Tables

The variables used in MSBs are explained in this section.

(1) Common variables (different from common variables V1 to V200 used for parameter setting)

(2) System variables 1 (used for reading and correcting various types of data)

(3) System variables 2 (used for transmitting data between turret A and turret B)

(4) System variables 3 (used as counter for gauging functions)

(5) System variables 4 (used for screen display)

(6) Input/output variables (used for input/output)

LMS*????.MSB

*: Contents of each gauging software

????: Version of each gauging software

Page 17: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-8SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

ng

ing

ing

ing

ing

ing

ng

ng

Common Variables (VS01 to VS32)

The common variables are not displayed on the screen unlike the common variables (V1 to V200) used in parameter setting.

VariableNo.

Function RemarksVariable

No.Function Remark

VS01Tool nose, position, tool number

For printer output VS17 Not used

VS02 Target value For printer output VS18Absolute value of judgment result

Work/touch setter gauging

VS03Gauging (measured value)

For printer output VS19Sensor input number(1 or 2)

Master ring/work/touch setter gaugi

VS04 Offset value (previous) For printer output VS20

Touch setter gauging cycle start condition judgment (=1: Gauging)

Touch setter gaug

VS05 Offset value (new) For printer output VS21Diameter gauging, diameter gauging value

Work gauging

VS06 Result of judgment For printer output VS22Diameter gauging, upper diameter gauging value

Work gauging

VS07Maximum tool group number

VS23 Tool number Work gauging

VS08 Tool nose, tool number Not used VS24Diameter gauging, OD/ID judgment flag(=0: OD, =1: ID)

Work gauging

VS09 Not used VS25NG double-contact flag

Touch setter gaugWork gauging

VS10 Not used VS26 NG processing flag Touch setter gaug

VS11Absolute value of amount of variation

Work/touch setter gauging

VS27

Gauging direction judgment flag(= 0: X-axis, = 1: X-axis)

Touch setter gaugWork gauging

VS12 Not used VS28

Read out, tool breakage detection cycle judgment flag(= 0: read out cycle, = 1: tool breakage detection cycle)

Touch setter gaug

VS13 Not used VS29 Target pointMaster ring/work/touch setter gaugi

VS14 Not used VS30 Result of judgmentWork/touch setter gauging

VS15Gauging cycle starting point X (Z) coordinate value

Master ring/work/touch setter gauging

VS31Gauging (measured value)

Master ring/work/touch setter gaugi

VS16 Not used VS32 Compensation valueWork/touch setter gauging

Page 18: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-9SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

(1) Common variables V1 to V200 used for setting parameters are used in common for turrets A and B. On the other hand, the common variables VS01 to VS32 indicated above are turret dependent.That is, turrets A and B have an independent VS01, for example, and the VS01 for turret A must be specified and called out from turret A, while the VS01 for turret B must be specified and called out from turret B.

(2) Note that these common variables (VS01 to VS32) will be used in other MSBs in addition to the gauging cycle discussed here. Therefore, if these common variables are used as variables transferred between subprograms, numerical values might be changed during the transfer.When these common variables are used, their processing must end within the same subprogram.

G13N1 NOEX VS01=100

N2 NOEX VS02=10 VS03=20N3 CALL OSUB1N4N5N6N7 CALL OSUB2N8N9N10G14

N1 NOEX VS01=100 VS02=50

N2 CALL OSUB1N3N4N5N6 NOEX VS01=100 VS03=60N7 CALL OSUB3N8N9M02

Do not use common variables for transferring numerical values from OSUB1 to OSUB2.

Variables used in common in G14 side program

* Not used for transferring numerical values

When calling more than one subprogram from a subprogram, pay attention to the transfer of variables betweensubprograms.

Variables used in common in G13 side program

Within a subprogram, they can be used as desired.

LE61497R0100700120001

Page 19: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-10SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 1

System variables 1 are used in in-process gauging operations.These are variables with values automatically predetermined at the NC.Data can be read, output and corrected using there variables.* The subscript expression is the numerical value that can be specified following a variable name in the format [*].

Variable Name

Function Min - Max. - ValuesSubscript

Expression

VSIOXActual position of X-axis (program coordinate system)

-99999.999 to 99999.999

VSIOZActual position of Z-axis (program coordinate system)

-99999.999 to 99999.999

VSKPXSensor contact position of X-axis (machine coordinate system)

-99999.999 to 99999.999 1 to 2

VSKPZSensor contact position of Z-axis (machine coordinate system)

-99999.999 to 99999.999 1 to 2

VETFX Presently used tool offset data (X-axis) -99999.999 to 99999.999

VETFZ Presently used tool offset data (Z-axis) -99999.999 to 99999.999

VDETN Presently used tool offset number 1 to 32

VETLN Presently used tool number 1 to 12

VRNGXMaster ring position (X-axis) (program coordinate system)

-99999.999 to 99999.999

VRNGZMaster ring position (Z-axis) (program coordinate system)

-99999.999 to 99999.999

VSNXSensor position (X-axis) (machine coordinate system)

-99999.999 to 99999.999 1 to 2

VSNZSensor position (Z-axis) (machine coordinate system)

-99999.999 to 99999.999 1 to 2

VGRSL Tool number selected within a tool group 0 to 12 1 to 12

VGRIDFlag indicating an occurrence of automatic indexing in a tool group

0 to 1 1 to 12

VDTNGFlag indicating the result in a gauging cycle was NG

0 to 1 1 to 12

VTLGN Group number the tool belongs to 0 to 12 1 to 12

VDTSN Tool life - preset count number 0 to 9999 1 to 12

VDTCN Actual machined number 0 to 9999 1 to 12

VDTST Tool life - preset time 0 to 359999 1 to 12

VDTCT Actual cutting time 0 to 359999 1 to 12

VDTSA Tool life - preset wear amount 0 to 999.999 1 to 12

VDTCA Actual tool wear amount 0 to 99999.999 1 to 12

VTLLF Flag indicating the tool life status 0 to 1 1 to 12

VZOFX X-axis zero offset data -99999.999 to 99999.999

VZOFZ Z-axis zero offset data -99999.999 to 99999.999

VZSHX X-axis zero shift data -99999.999 to 99999.999

VZSHZ Z-axis zero shift data -99999.999 to 99999.999

VDTFX Tool offset data (X-axis) -99999.999 to 99999.999 1 to 32

Page 20: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-11SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

VDTFZ Tool offset data (Z-axis) -99999.999 to 99999.999 1 to 32

VSKFA

Setting for OPTIONAL PARAMETER (GAUGING) Feed rate 2 for gauging cycle 2 (Feed rate for the first contact detection in double-contact gauging cycle)

1 to 500

VSKFB

Setting for OPTIONAL PARAMETER (GAUGING) Feed rate 1 in gauging cycle 1 (Feed rate for the second contact detection in a double-contact gauging cycle; feed rate for the contact detection in a single-contact gauging cycle)

1 to 500

VDNRX Nose radius compensation data (X-axis) -99999.999 to 99999.999 1 to 32

VDNRZ Nose radius compensation data (Z-axis) -99999.999 to 99999.999 1 to 32

Variable Name

Function Min - Max. - ValuesSubscript

Expression

Page 21: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-12SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 2

System variables 2 are used for transferring data between turret A and turret B. They cannot be displayed on the screen.They are used in common for the two turrets.

The system variables for data transfer, indicated above, may be used in programs other than gauging subprograms.They can be used in the same manner as parameter setting common variables.

Variable Name

Function Remarks

VMDT [1] Compensation value Master ring gauging

VMDT [2] Target value Work gauging

VMDT [3] Gauging (measured value) Work gauging

VMDT [4] Judgment Work gauging

VMDT [5] Compensation value Work gauging

VMDT [6] Tool life management specification flag(=1: Specification supported, =0: Specification not supported)

Tool nose gauging, Work gauging

VMDT [7] Diameter gauging, upper diameter gauging value

VMDT [8] Diameter gauging, lower diameter gauging value

VMDT [9] Diameter gauging, diameter gauging value

VMDT [10] Not used

VMDT [11] Not used

VMDT [12] Not used

Page 22: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-13SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 3

System variables 3 are used as counters for gauging cycles.They are used for counting the specified events and also for setting the intervals between gauging cycle executions.They are used in common for turret A and turret B.

Subprogram OCNCK is used for automatically incrementing a counter; when the counter data reaches the preset value, it is cleared.When the setting is “0”, the corresponding counter does not operate.System variables VMCN[1] to VMCN[32] correspond to counters No. 1 to No. 32, respectively.

Variable Name

FunctionVariable

NameFunction

VMCN [1] Master ring gauging cycle ON preset value VMCN [17] Not used

VMCN [2] Master ring gauging cycle ON counter VMCN [18] Not used

VMCN [3] Work gauging cycle ON preset value VMCN [19] Not used

VMCN [4] Work gauging cycle ON counter VMCN [20] Not used

VMCN [5] Read-out cycle ON preset value VMCN [21] Not used

VMCN [6] Read-out cycle ON counter VMCN [22] Not used

VMCN [7] Tool breakage detection cycle ON preset value VMCN [23] Not used

VMCN [8] Tool breakage detection cycle ON counter VMCN [24] Not used

VMCN [9] Not used VMCN [25] Not used

VMCN [10] Not used VMCN [26] Not used

VMCN [11] Not used VMCN [27] Not used

VMCN [12] Not used VMCN [28] Not used

VMCN [13] Not used VMCN [29] Not used

VMCN [14] Not used VMCN [30] Not used

VMCN [15] Not used VMCN [31] Not used

VMCN [16] Not used VMCN [32] Not used

LE61497R0100700150001

Page 23: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-14SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System variables not assigned specific functions may be used and displayed in the same manner as common variables.Note that the range of numerical values that can be handled by these parameters is 0 to 9999 (positive integer).

System Variables 4

System variables 4 are used for display.When a numerical value is set for the system variables indicated below, the set numerical value is displayed at the specified field in the display screen.They are independent for each of the turrets.

Variable Name

Function Remarks

VIMDX [1] ID master ring gauging, upper surface gauging valueOD master ring gauging, X gauging value

Master ring gauging

VIMDX [2] ID master ring gauging, lower surface gauging value

Master ring gauging

VIMDX [3] Compensation value Master ring gauging

VIMDX [4] Work gauging, Gauging (measured) value in the X-axis direction

Work gauging

VIMDX [5] Touch setter gauging, Gauging (measured) value in the X-axis direction

Touch setter gauging

VIMDX [6] Tool offset, Compensation data in the X-axis direction (amount of variation)

Work/touch setter gauging

VIMDX [7] Diameter gauging, Upper diameter gauging (measured) value in the X-axis direction

Work gauging

VIMDX [8] Diameter gauging, Lower diameter gauging (measured) value in the X-axis direction

Work gauging

VIMDX [9] Not used Display available

VIMDX [10] Not used Display available

VIMDX [11] SpareNo display with standard

specification

VIMDX [12] Absolute value of amount of variationNo display with standard

specification

Variable Name

Function Remarks

VIMDZ [1] Master ring gauging, gauging (measured) value in the Z-axis direction

Master ring gauging

VIMDZ [2] Not used Display available

VIMDZ [3] Zero offset, gauging (measured) value in the -Z direction

Master ring gauging

VIMDZ [4] Work gauging, gauging (measured) value in the Z-axis direction

Work gauging

VIMDZ [5] Touch setter gauging, gauging (measured) value in the Z-axis direction

Touch setter gauging

VIMDZ [6] Tool offset, compensation data in the Z-axis direction (amount of variation)

Work/touch setter gauging

Page 24: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-15SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

The data is displayed by selecting the IN-PROCESS GAUGING screen in the operation mode (automatic, MDI, manual).

The data set for VIMDX [*] and VIMDZ [*] (*: 1 to 10) is displayed on the screen shown above.For VIMDX [*] and VIMDZ [*] (*: 11 and 12), data is not displayed with the standard specification.The data input at the turret A side is displayed in the XA and ZA columns and the data input at the turret B side is displayed in the XB and ZB columns.Variables VIMDX [*] and VIMDZ [*] (*: 11, 12), which are not displayed on the screen, can be used as variables.

VIMDZ [7] Not used Display available

VIMDZ [8] Not used Display available

VIMDZ [9] Not used Display available

VIMDZ [10] Not used Display available

VIMDZ [11] SpareNo display with standard

specification

VIMDZ [12] SpareNo display with standard

specification

Variable Name

Function Remarks

LE61497R0100700160001

Page 25: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-16SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Input/Output Variables

These variables are used to input and output signals to and from the MSB.VDOUT is used for outputs and VDIN is used for inputs. The subscript determines the contents of the inputs and outputs.

Output Variables

Special Input/Output Variables

The inputs and outputs of the input/output variables indicated below correspond to each other and when the output variable is set ON (=1), the corresponding input is also set ON.

Variable Name

Function

VDOUT [1] = 1:+NG indicating lamp is turned ON.

VDOUT [2] = 1:+OK indicating lamp is turned ON.

VDOUT [3] = 1:OK indicating lamp is turned ON.

VDOUT [4] = 1:-OK indication lamp is turned ON.

VDOUT [5] = 1:-NG indicating lamp is turned ON.

VDOUT [9] = 0:All judgment indicating lamps are turned OFF.

VDOUT [991] = ####: Outputs “ALARM C user reserve code ####”.

VDOUT [992] = ####: Outputs “ALARM B user reserve code ####”

VDOUT [993] = ####: Outputs “ALARM A user reserve code ####”.

Variable Name

Function

VDOUT [31] The master ring gauging cycle ON lamp is turned on and “1” is set for VDIN [31].

VDOUT [32] = 1: The work gauging cycle ON lamp is turned on and “1” is set for VDIN [32].

VDOUT [33] = 1: The trial-cut gauging cycle ON lamp is turned on and “1” is set for VDIN [33].

VDOUT [34] = 1: The touch setter gauging cycle ON lamp is turned on and “1” is set for VDIN [34].

VDOUT [35] = 1: The touch setter breakage detection cycle ON lamp is turned on and “1” is set for VDIN [35].

VDIN [31] = 1: The master ring gauging cycle is turned ON.This is checked within a subprogram.

VDIN [32] = 1: The work gauging cycle is turned ON.This is not checked within a subprogram.

VDIN [33] = 1: The trial-cut gauging cycle is turned ON.This is not checked within a subprogram.

VDIN [34] = 1: The touch setter gauging cycle is turned ON.This is checked within a subprogram.

VDIN [35] = 1: The touch setter breakage detection cycle is turned ON.This is checked within a subprogram.

Page 26: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-17SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-2-3. Print

The print (PRNT) command can be used when the gauging data print function is selected.When PRNT* (*: 1 to 14) is specified, the measured data is output to the printer.The number to be specified with the PRNT command is fixed for each type of data to be output.

Print Out Data

Set the measured data at the corresponding common variables (VS01 to VS06).Items indicated by “○” are printed.

Command No.

Function

PRNT 1 Work gauging cycle; turret A, X-axis

PRNT 2 Work gauging cycle; turret A, Z-axis

PRNT 3 Work gauging cycle; turret B, X-axis

PRNT 4 Work gauging cycle; turret B, Z-axis

PRNT 5 Master ring gauging cycle; turret A, X-axis

PRNT 6 Master ring gauging cycle; turret A, Z-axis

PRNT 7 Master ring gauging cycle; turret B, X-axis

PRNT 8 Master ring gauging cycle; turret B, Z-axis

PRNT 9 Touch setter gauging cycle; X-axis; data of the designated turret

PRNT 10 Touch setter gauging cycle; Z-axis; data of the designated turret

PRNT 11 Work gauging cycle; X-axis; data of the designated turret

PRNT 12 Work gauging cycle; Z-axis; data of the designated turret

PRNT 13 Master ring gauging cycle; X-axis; data of the designated turret

PRNT 14 Master ring gauging cycle; Z-axis; data of the designated turret

Output Variable

FunctionMaster Ring

Gauging

Work Gauging

Touch Setter

Gauging

VS01Tool nose, position and tool number for tool offset data to be corrected

× ○ ○

VS02 Target value ○ ○ ○

VS03 Gauging (measured value) ○ ○ ○

VS04 Offset data before compensation ○ ○ ×

VS05 Offset data after compensation ○ ○ ×

VS06Result of judgment: 0 for OK, ±1 for ±OK, ±2 for ±NG

× ○ ○

Page 27: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-18SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Print Format

Output format is indicated below.

Master Ring Gauging

In the printout of the data for turret B, the data for COMMAND and ACTUAL are both “0”.This is because the actual gauging cycle is carried out by turret A and the data for turret B tools is corrected using these data.For the measured value in the X-axis direction in the ID master ring gauging cycle, the target value with the amount of variation added is output to facilitate checking of the amount of variation.

(1) Name of file in which gauging cycle has been called(2) Data set at VS02 (0 for turret B)(3) Data set at VS03 (0 for turret B)(4) Data set at VS04(5) Data set at VS05

A-TURRET X-AXIS for PRNT5 (PRNT13 for turret A)A-TURRET Z-AXIS for PRNT6 (PRNT14 for turret A)B-TURRET X-AXIS for PRNT7 (PRNT13 for turret B)B-TURRET Z-AXIS for PRNT8 (PRNT14 for turret B)

* * * MASTER RING GAUGING * * * A.MIN A-TURRET X-AXIS

COMMAND

50.000 50.050 1568.000 1568.050 +OK

1997.8.28 THURSDAY 16:18:20

(1)

(2) (3) (4) (5)

ACTUAL LAST-DATA NEW-DATA JUDGE

LE61497R0100700200001

Page 28: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-19SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Work gauging cycle

PRNT1 (PRNT11 on turret A) A-TURRET X-AXISPRNT2 (PRNT12 on turret A) A-TURRET Z-AXISPRNT3 (PRNT11 on turret B) B-TURRET X-AXISPRNT4 (PRNT12 on turret B) B-TURRET Z-AXIS

Set any of 0, ±1 and ±2 for VS06, the variable for judgment.The output is as indicated below according to this setting.

Setting Output Result

0 OK

+1 +OK

+2 +NG

-1 -OK

-2 -NG

(1) Data set at VS01(2) Data set at VS02(3) Data set at VS03(4) Data set at VS04(5) Data set at VS05(6) Data set at VS06

* * * WORK GAUGING * * * B.MIN A-TURRET X-AXIS

TOFF.NO. COMMAND ACTUAL LAST-DATA NEW-DATA JUDGE

1010007 50.000 50.050 10.000 9.950 +OK

(1) (2) (3) (4) (5) (6)

1997.8.28 THURSDAY 16:18:20

LE61497R0100700200002

Page 29: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-20SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Touch setter

Turret APRNT9..........A-TURRET X-AXISPRNT10.........A-TURRET Z-AXIS

Turret BPRNT9...........B-TURRET X-AXISPRNT10.........B-TURRET Z-AXIS

(1) Data set at VS01(2) Data set at VS02(3) Data set at VS03(4) Data set at VS06 (The judgment result is displayed in the same manner as in the work gauging cycle.)

* * * TOUCH SETTER GAUGING * * * B.MIN A-TURRET X-AXIS

TOFF.NO. COMMAND ACTUAL JUDGE

12200008 50.000 50.050 +OK

1997.3.24 THURSDAY 17:25:31

(1) (2) (3) (4)

LE61497R0100700200003

Page 30: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-21SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-2-4. Program

Table of Subprograms

The subprograms and their functions are briefly described below.

Subprogram number

Subprogram

NameFunction

(1) ORGIAMaster ring gauging ID: To be called from turret AUsed for correcting the zero offset data of the X- and Z-axis for turret A. If called while the chuck is closed, an alarm occurs.

(2) ORGOAMaster ring gauging OD: To be called from turret AUsed for correcting the zero offset data of the X- and Z-axis for turret A.

(3) ORNGBMaster ring gauging - processing at turret B: To be called from turret BUsed for correcting the zero offset data of the X- and Z-axis for turret B based on the data for turret A.

(25) OZTM

Judgment cycle for master ring gauging cycleThis subprogram is called from a gauging cycle subprogram.The result of measurement is classified into five levels: OK, ±OK and ±NG.

(4) OWMXAWork gauging - Turret A in the X-axis direction: To be called from turret AMeasures the dimension of a workpiece machined by a tool on turret A in the X-axis direction and corrects the X offset data.

(5) OWMZAWork gauging - Turret A in the Z-axis direction: To be called from turret AMeasures the dimension of a workpiece machined by a tool on turret A in the Z-axis direction and corrects the Z offset data.

(6) OWXBA

Work gauging - Turret B in the X-axis direction: To be called from turret AMeasures the dimension of a workpiece machined by a tool on turret B in the X-axis directionFor turret B, OWXBB must be called.

(7) OWZBA

Work gauging - Turret B in the Z-axis direction: To be called from turret AMeasures the dimension of a workpiece machined by a tool on turret B in the Z-axis directionFor turret B, OWZBB must be called.

(8) OWXBB

Work gauging - Turret B in the X-axis direction: To be called from turret BTo be called from turret B when OWXBA is called at turret A.Based on the data measured at turret A, the X direction tool offset data is corrected for tools on turret B.

(9) OWZBB

Work gauging - Turret B in the Z-axis direction: To be called from turret BTo be called from turret B when OWZBA is called at turret A.Based on the data measured at turret A, the Z direction tool offset data is corrected for tools on turret B.

(10) OWXZWork gauging - processing of measured data: This subprogram is called from a gauging cycle subprogram.Measured data is processed according to the result of judgment.

(12) OTDSL

Checks ATDG and TDFN commands, and Indexes the tool nose, position and tool number.To be called within a gauging subprogram Determines whether the tool life management function is used or not. An alarm occurs if an ATDG or TDFN command is not correct.

Page 31: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-22SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

(14) OMSSFCancels the gauging cycle START conditions: To be called from both turrets A and BTurns off all gauging cycle START conditions.

(15) OTRCK

Checks conditions for starting the trial-cut gauging cycle: To be called from both turrets A and BTurns ON the conditions for starting the trial-cut gauging cycle when automatic tool indexing is conducted by the tool life management function.

(16) OTST

Checks conditions for starting the touch setter gauging cycle: To be called before touch setter gaugingTurns ON the conditions for starting the touch setter gauging cycle when they are turned on by the counter or when automatic tool indexing has been executed by the tool life management function.

(13) OCNCK

Counter for checking the gauging cycle START conditions: To be called from either turret A or turret B.Compares the value set at the gauging cycle counter with the counter data and turns on the gauging cycle START conditions if the counter data has reached the preset value.

(17) OTLLS

Touch setter gauging - tool breakage detection cycle: To be called from the turret on which the tool to be measured is set.Checks chipping or breakage of the tool both in the X- and Z-axis directions.

(18) OTFRD

Touch setter gauging - tool offset data read-out cycle: To be called from the turret on which the tool to be measured is set.Checks the wear amount of the tool both in the X- and Z-axis directions and corrects the tool offset data.

(19) OTMXZTouch setter gauging cycle - processing cycle: To be called from OTFRD or OTLLS. Executes a gauging cycle by calling OWTM and processes the obtained data.

(20) OSKPX

Executes an actual gauging cycle in the X-axis direction with the gauging cycle start command (G30). This subprogram also determines whether the cycle programmed is the “single-contact” cycle or the “double-contact” cycle. This determination is based on whether argument APPS (argument that specifies the second approach point in the double-contact gauging cycle) is specified or not. This subprogram is called from a gauging cycle subprogram.

(21) OSKPZ Executes the same processing as OSPKPX in the direction of Z-axis.

(22) OSPCXConverts the coordinate value for the X-axis direction sensor “touch” point into a program coordinate value. This subprogram is called from a gauging cycle subprogram.

(23) OSPCZ Executes the same processing as OSPCX in the Z-axis direction.

(24) OT1ME Executes a 0.1 sec dwell.

(11) OWTMWork gauging/Touch setter gauging - Measuring and judgment cycle:This subprogram is called from a gauging cycle subprogram.The result of actual measurement is classified into OK, ±OK and ±NG.

(26) ODOAADiameter gauging - OD by turret A: To be called from turret AMeasures the dimension (OD in the X-axis direction) of the workpiece machined by a tool on turret A and corrects the X-axis tool offset data.

Subprogram number

Subprogram

NameFunction

Page 32: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-23SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

(27) ODIAADiameter gauging - ID by turret A: To be called from turret AMeasures the dimension (ID in the X-axis direction) of the workpiece machined by a tool on turret A and corrects the X-axis tool offset data.

(28) ODOBA

Diameter gauging - OD by turret B: To be called from turret AMeasures the dimension (OD in the X-axis direction) of the workpiece machined by a tool on turret B.For turret B, ODMBB must be called.

(29) ODIBA

Diameter gauging - OD by turret B: To be called from turret AMeasures the dimension (ID in the X-axis direction) of the workpiece machined by a tool on turret B.For turret B, ODMBB must be called.

(30) ODMBBDiameter gauging - Turret B: To be called from turret BBased on the data measured at turret A, the tool offset data on turret B is corrected.

(31) ODWTM

Measuring and judgment cycle for diameter gauging:This subprogram is called from a gauging cycle subprogram.The result of actual measurement is classified into five levels: OK, ±OK and ±NG.

(32) OTGNM Obtains the maximum value of the tool group No.

(33) OSNCATouch setter gauging for correcting the sensor position.This subprogram measures and compensates the sensor position.

(34) OSNMZTouch setter gauging called by OSNCA.This subprogram measures and corrects the sensor position in the Z-axis direction.

(35) OSNMXTouch setter gauging called by OSNCA.This subprogram measures and corrects the sensor position in the X-axis direction.

Subprogram number

Subprogram

NameFunction

Page 33: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-24SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-2-5. Flow Chart

Master Ring Gauging

Master ring ID gauging cycle

These subprograms are called from turret A.

ORGIA

VRSTT=0NO

NO

YES

M100

TD=TDF1

TD=TDF2

VDIN[31]=0

YES

YES

YES

NO3B

3C

XSTP=VSIOXZSTP=VSIOZ

VDIN[1255]AND32¹32

NA1

NO

G00 X=-[VDTFX[TDF1]-VDTFX[TDF2]/2 Z=ZP1M155

G00 X=-[[VDTFX[TDF1]+VDTWX[TDF1]] -[VDTFX[TDF2]+VDTWX[TDF2]]]/2 Z=ZP1 M155

NA2

Z=ZP2

VS29=VRNGX

VS19=1

OSKPX

VIMDX[1]=VS31

VDIN[1255]AND32¹32 NO

G00 X=[VDTFX[TDF1]-VDTFX[TDF2]]/2 G00 X=[[VDTFX[TDF1]+VDTWX[TDF1]] -[VDTFX[TDF2]+VDTWX[TDF2]]]/2

YESNA3

NA4

2A

Sequence restart OFF?

Gauging cycle is not ON

Storing the start position

Bringing the sensor tothe center of master ringTLN: tool number onlyMoving the sensor to P2

Setting the gauging target value(X-coordinate of ring upper face)Determining the sensor input number

Calling the X-direction gauging subprogram

CRT display (measured value 1)

Is chuck NO.1 open?

LE61497R0100700220001

Page 34: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-25SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

VS29=-VRNGX

OSKPX

VIMDX[2]=VS31VS32=[VIMDX[1]+VS31]/2

VS27=0

OZTM

VIMDX[3]=VS32

VS02=VRNGXVS03=VIMDX[3]+VS02VS04=VZOFXVS06=VS30

VZOFX=VZOFX+VIMDX[3]VS05=VZOFX

PRNT 13

VMDT[1]=-VIMDX[3]

M100

TD=TDF1

G00 Z=ZP3

X=XP3

VS29=VRNGZ

OSKPZ

3A

Setting the gauging target value(X-coordinate of ring lower face)

Calling the X-direction gauging subprogram

Measured value 2Variation in zero offset X

Judging the gauging result

Compensation data in X direction

Target value 2Measured valuePrevious zero offset valueResult of judgment

Zero offset in X directionNew zero offset value

Setting the variation at the system variable common toturrets A and B (to transfer the variation to turret B)

Waiting for synchronization with turret B

Moving the sensor to P3

Setting the sensor offset value at TOF1

Setting the target value (Z-coordinate of master ring)

Calling the Z - direction gauging subprogram

Print command

LE61497R0100700220002

Page 35: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-26SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

3A

VMIRZ=0 YES

NOVS31=-VS31NA5

VIMDZ[1]=VS31VS32=VS31-VRNGZ

VS27=1

OZTM

VIMDZ[3]=VS32

VS06=VS30

VS02=VRNGZVS03=VS31VS04=VZOFZ

VZOFZ=VS04+VIMDZ[3]VS05=VZOFZ

PRNT 14

VMDT[1]=VIMDZ[3]

M100

VDIN[1255]AND32≠32 NO

NA6 YESG00 X=-[TOFX[TOF1]-VTOFX[TOF2]]/2 G00 X=[[VTOFX[TOF1]+VTWOX[TOF1]]

-[VTOFX[TOF2]+VTWOX[TOF2]]]/2NA7

Z=ZP1

X=XSTP Z=ZSTP M154NA9

M1003B

RTSNA10

NA8

3C

VMDT[1]=0VDOUT[992]=1100

Do machine coordinate system and program coordinate system have the same Z-axis direction?

Measured value Variation

CRT display

Judging the gauging result

Setting the printing data

Target value Measured value Previous zero offset value

Zero offset in Z direction New zero offset value

Print commandSetting the variation at the system variable common to turrets A and B (to transfer the variation to turret B)

Waiting for synchronization with turret B

Retracting the sensor to the start point M154: air blow OFF

Terminating the gauging cycle after synchronization with turret B

Alarm B chuck is not closed

LE61497R0100700220003

Page 36: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-27SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Master ring OD gauging cycle

These subprograms are called from turret A.

ORGOA

VRSTT=0 NO

YES

YES

NO

M100

VDIN[31]=0

XSTP=VSIOXZSTP=VSIOZ

G00 X=XP1 Z=ZP1 M155

TD=TDFN

X=XP2 Z=ZP2

Z=ZP3

VS29=VRNGX

VS19=1

OSKPX

VIMDX[1]=VS31

VS32=VS31-VRNGX

VS27=0

OZTM

VIMDX[2]=0VIMDX[3]=VS32

VS02=VRNGXVS03=VS31VS04=VZOFXVS06=VS30

2A

3B

Sequence restart OFF?

Gauging cycle is not ON

Storing the start position

Waiting for synchronization with turret B

Moving the sensor to P2

Setting the gauging target value (X-coordinate of ring upper face)

Determining the sensor input number

Calling the X-direction gauging subprogram

Measured value

CRT display (variation)

Setting the printing data

Target value Measured value Previous zero offset

LE61497R0100700220004

Page 37: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-28SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

VZOFX=VZOFX+VIMDX[3]VS05=VZOFX

PRNT 13

VMDT[1]=-VIMDX[3]

M100

G00 Z=ZP2

X=XP3

VS29=VRNGZ

OSKPZ

VMIRZ=0 YES

NOVS31=-VS31NB2

VIMDZ[1]=VS31VS32=VS31-VRNGZVS27=1

OZTM

VIMDZ[3]=VS32

VS02=VRNGZVS03=VS31VS04=VZOFZVS06=VS30

VZOFZ=VZOFZ+VIMDZ[3]VS05=VZOFZ

3A

Zero offset in X direction New zero offset

Print commandSetting the variation at the system variable common to turrets A and B (to transfer the variation to turret B)

Waiting for synchronization with turret B

Moving the sensor to P2

Setting the target value (Z-coordinate of master ring)

Calling the Z-direction gauging subprogram

Do machine coordinate and program coordinate system have the same Z-axis direction?

CRT display Measured value Variation

Setting the printing data

Target value Measured value Previous zero offset

LE61497R0100700220005

Page 38: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-29SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Master Ring Gauging

These subprograms are called from turret B.

3A

PRNT 14

VMDT[1]=VIMDZ[3]

M100

G00 X=XP2

X=XP1 Z=ZP1

X=XSTP Z=ZSTP M154

M100NB1

RTS

3B

Print commandSetting the variation at the system variable common to turrets A and B (to transfer the variation to turret B)

Waiting for synchronization with turret B

Moving the sensor to P2

Retracting the sensor to P1

Retracting the sensor to the start point M154: air blow OFF

Terminating the gauging cycle after synchronization with turret B

LE61497R0100700220006

ORNGB

NO

YES

VRSTT=0

YES

NO

M100

M100

M100

M100

VDIN[31]=0

VS04=VZOFXVZOFX=VS04+VMDT[1]VS05=VZOFXVIMDX[3]=VMDT[1]

PRNT 13

VS04=VZOFZVZOFZ=VS04+VMDT[1]VS05=VZOFZVIMDZ[3]=VMDT[1]

PRNT 14

NC1RTS

Sequence restart OFF?

Waiting for synchronization with turret A

Gauging cycle is not ON

Waiting for completion of Z-direction gauging on turret A

Setting the previous zero offset X (for printing)Zero offset in X-direction on turret BSetting the new zero offset X (for printing)Setting the variation in X-direction displayed on CRT at the system variable common to turrets A and B (gauging result obtained on turret A)

Print command

Print command

Waiting for completion of Z - direction gauging on turret A

Setting the previous zero offset Z (for printing)Zero offset in Z-direction on turret BSetting the new zero offset Z (for printing)Setting the variation in Z-direction displayed on CRT at the system variable common to turrets A and B (gauging result obtained on turret A)

Terminating the gauging cycle after synchronization with turret A

LE61497R0100700220007

Page 39: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-30SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Work gauging cycle

Work gauging cycle (Turret A, in the X/Z-axis direction)

These subprograms are called from turret A.

OWMXA OWMZA

VS27=0 VS27=1ND1

M155

VRSTT=0NO

YESVDOUT[9]=0

VS25=0VS29=MSP

VS19=1

OTDSL

VS17=0

OWTM

VMDT[2]=MSPVMDT[3]=VS31VMDT[4]=VS30VMDT[5]=VS32

YESVS27=0

NO ND4

VDIN[1255]AND32¹32 VDIN[1255]AND32¹32NO NO

ND2 YES ND5 YESVIMDX[4]=VS31VS04=VDTFX[VS01]

VIMDX[4]=VS31VS04=VDTWX[VS01]

ND3 ND6

VIMDZ[4]=VS31VS04=VDTFZ[VS01]

VIMDZ[4]=VS31VS04=VDTWZ[VS01]

OWXZ OWXZ

VIMDX[6]=-VMDT[5] VIMDZ[6]=-VMDT[5]

PRNT 11 PRNT 12

M154

RTS

ND7

Setting the flag for judging the gauging direction

Gauging in X direction Gauging in Z direction

Air blow ON

Sequence restart OFF?

Judgment indicator lamp OFF

Flag for NG double-touch gaugingSetting the gauging target point

Determining the sensor input number

Determining whether the tool life management function is used or not, checking ATG and AOG commands, and selecting the tool number and the tool offset number

Executing the gauging cycle and judging the measured data

Target pointMeasured valueJudgmentCompensation data

X directionZ direction

Calling the subprogram for processing measured data

Variation in tool offset

Print command

Air blow OFF

LE61497R0100700230001

Page 40: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-31SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Work gauging cycle (Turret B, in the X/Z-axis direction)

These subprograms are called from turret A.

OWXBA OWZBA

VS27=0 VS27=1NE1

M155

VRSTT=0NO

YESM100

M100

VDOUT[9]=0VS25=0VS29=MSP

VS17=0

VS19=1

OWTM

VMDT[2]=MSPVMDT[3]=VS31VMDT[4]=VS30VMDT[5]=VS32

VS18=ABS[VS30]

VS18=2YES ±NG

NO

NE2

NE3

M100

M100

M100

M154

RTS

NE4

VMDT[6]=0YES

NO

NO

VDIN[21]=1

Setting the flag for judging the gauging direction

Gauging in X direction

Gauging in Z direction

Air blow ON

Sequence restart OFF?

Starting the gauging cycle in synchronization with turret B

Waiting for the tool offset number to be selected on turret B

Judgment indicator lamp OFFFlag for NG double-touch gaugingSetting the gauging target point

Target point Setting the left values at the systemMeasured value variables common to turrets A and BJudgment (to transfer the values to turret B)Compensation data

Determining the sensor input number

Executing the gauging cycle and judging the measured data

Using the absolute value of the result for the subsequent processing executed after synchronization

Is the result ±NG?

Tool life management function OFF?

OK or ±OK

Ignoring NG YES NG ignore button ON?

Starting the gauging data processing on turret B

Waiting for the data processing on turret B

Waiting for synchronization when the result is ±NG

Air blow OFF

M100 code (waiting for synchronization) is issued to turret B only twice when the result is NG through it is issued three times when the result is OK.This is to prevent the turret A from finishing the gauging subprogram and executing the next sequence before the alarm occurs on turret B. If NG is ignored (no alarm occurs), however, M100 is issued three times as in the case where the result is OK or ±OK.

LE61497R0100700230002

Page 41: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-32SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Work gauging cycle (Turret B, in the X/Z-axis direction)

This subprogram is called from turret B in combination with OWXBA or OWZBA.

OWXBB OWZBB

VS27=0 VS27=1NF1

VRSTT=0NO

YESM100

M100

VS27=0

VIMDX[4]=VMDT[3]VS04=VDTFX[VS01]

OWXZ

OTDSL

M100

NO

OWXZ

VIMDX[6]=-VMDT[5] VIMDZ[6]=-VMDT[5]

PRNT 11NF3

M100

M100NF4

RTS

VIMD4[4]=VMDT[3]VS04=VDTFZ[VS01]

PRNT 12

YES NF2

Setting the flag for judging the gauging direction

Gauging in X direction Gauging in Z direction

Determining whether the tool life management function is used or not, checking ATG and AOG commands, and selecting the tool number and the tool offset number

Starting the gauging cycle by turret A

Waiting for completion of the turret A gauging cycle

X direction

Waiting for synchronization with turret A

Waiting for synchronization when the result is NG

CRT displaySetting the measured value (gauging result on turret A) through the system variable common to turrets A/B Tool offset (for printing)

Calling the gauging data processing subprogram

CRT displaySetting the variation in tool offset (gauging result on turret A) through the system variable common to turrets A and B

Sequence restart OFF?

Z direction

LE61497R0100700230003

Page 42: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-33SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Work gauging cycle (Measured data processing, screen output, printer output)

OWXZ

VS02=VMDT[2]VS03=VMDT[3]VS06=VMDT[4]VS18=ABS[VS06]

YESVS18=1

VS05=VS04VMDT[5]=0

VS18=2

NO

YES(±NG) VMDT[6]=0YES

NG1

VS06>=0 NO(-NG)

YES(+NG)M154 M154

VDOUT[992]=1001+VS27*2

1

VDIN[21]=1NO VDTNG[VS08]=1

VDOUT[992]=1000+VS27*2

NG3

VDIN[1255]AND32¹32 NO

NO NONG5 YES

NG6 YES NG4 YESVS27=0 VS27=0

VDTFX[VS01]=VDTFX[VS01] -VMDT[5]VS05=VDTFX[VS01]

VDTFZ[VS01]=VDTFZ[VS01] -VMDT[5]VS05=VDTFZ[VS01]

VDTWX[VS01]=VDTWX[VS01] -VMDT[5]VS05=VDTWX[VS01]

VDTWZ[VS01]=VDTWZ[VS01] -VMDT[5]VS05=VDTWZ[VS01]

NG7

VMDT[6]=0 YES

YES

NONO

NO

YES

NG9

TRCT

TRCT=1

VDTCA[VS08]=VDTCA[VS08] +ABS[VMDT[5]]

RTS

1

NO (OK processing, ±NG processing)

VS02 to VS06: variables used for output to the printer

Target valueMeasured valueResult of judgmentUsing the absolute value of the result to determine the processing to be executed

Printing the new offset data (previous data if the result is ±NG or OK)Setting the variation at the system variable common to turrets A and B (variation is 0 if the result is ±NG or OK)

±OK processing No action is

taken when the result is OK

Alarm No.1001 for X-direction gauging (VS27=0)Alarm No.1003 for Z-direction gauging (VS27=1)

Alarm No.1000 for X-direction gauging (VS27=0)Alarm No.1002 for Z-direction gauging (VS27=1)

NO (Tool life management) YES (NG ignored)

Setting the NG flag at the tool life management table without causing any alarm

Tool life management function OFF?

TRCT specified?

Addition of compensation data ignored?

Adding the compensation data to the accumulated wear in the tool life management table C

LE61497R0100700230004

Page 43: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-34SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Work gauging data judgment cycle

OWTMNH1

VS27=0 NO

NO

NO

YES

YES

YES

NH2

OSKPX

VS25=1

1

VS17=0

VS27=1 NH3A

VS32=VS29-VS31 VS32=VS31-VS29NH3B

VS11=ABS[VS32]

VIMDX[12]=VS11

VIMDZ[12]=DNG

VIMDX[12] >VIMDZ[12]

NO

YESYES

YES

YES YES

APPS

1

VS25=0

NO

NO

NO NH5

NH4

VS32>0+NGVDOUT[1]=1VS30=2

NH9

RTS

-NGVDOUT[5]=1VS30=-2

NH6

VIMDZ[12]=DOK

VIMDX[12] >VIMDZ[12]

YES

NO

NO

NH7

VS32>0+OK

VDOUT[2]=1VS30=1

NH8

-OKVDOUT[4]=1VS30=-1

OKVDOUT[3]=1VS30=0

Regarding that the sensor has touched the work twice

OSKPZCalling the X-direction gauging and judging subprogram

Calling the Z-direction gauging and judging subprogram

Is the turret-B program for touch setter IA gauging unused?

Gauging in X direction?

Variation = Measured value - Target value

Using the absolute value of the variation for the subsequent judgment

±NG?

NG double-touch gauging?

Judgment indicator lamp ON

±OK?

+OK?

The touch sensor gauging may be performed simultaneously on turret A and turret B(though work gauging is performed only on turret A), and so the target value, measured value, ,judgment, and compensation data are set at the common variables prepared separately for turrets A and B. For work gauging, these values are set at the variables common to turrets A and B to transfer the data from turret A to turret B.

LE61497R0100700230005

Page 44: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-35SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Tool nose, position, tool number indexing

OTDSL

VS01=0

ATDGNO

NO

NO

NO

NO

YES

YES

YES

N14N12VMDT[6]=0

TDFNN13 YES

VS01=TDFN

VMDT[6]=1

VS07=9999VS09=VDSTN[ATDG]

0<VS09<VS07

VS23=VGRSL[VS09]

VS23=0

VS01=ATDG

VS08=VDSEN[VS01]*10000+VDSTN[VS01]

N17

VS01=0YES

N19

N18

VDOUT[992]=1008

M154M126

RTS

OTDSL: subprogram for checking ATDG command values and selecting tool offset numberVS01: variable used to output the tool nose, position, tool number to the printer

Tool offset number?

Is ATDG (tool group number) specified?

Setting the maximum tool group number at VS07

Is ATDG tool group No. command value within allowable range?

Are tools registered in the specified tool group?

Tool offset number unregistered?

When ATDG is specified, data is processed assuming the tool life management specification. If one of the commands is omitted, the tool nose, position, tool number is obtained from TDFN assuming that the tool life specification is not supported.VDMT[6]..Tool life management function flag =0: Tool life management specification is not supported. =1: Tool life management specification is supported.

LE61497R0100700230006

Page 45: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-36SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Gauging cycle START condition check counters

OCNCK

VRSTT=0NO

NO

NO

NO

NO

NO

NO

NO

NO

YESYES

YES

YES

YES

YES

YES

YES

YES

VMCN[1]=0

VMCN[2]=VMCN[2]+1

VMCN[2]<VMCN[1]

VMCN[2]=0VDOUT[31]=1

N1

VMCN[3]=0

VMCN[4]=VMCN[4]+1

VMCN[4]<VMCN[3]

VMCN[4]=0VDOUT[32]=1

N2

VMCN[5]=0

VMCN[6]=VMCN[6]+1

VMCN[6]<VMCN[5]

VMCN[6]=0VDOUT[34]=1

N3

VMCN[7]=0

VMCN[8]=VMCN[8]+1

VMCN[8]<VMCN[7]

VMCN[8]=0VDOUT[35]=1

N4

RTS

Is "0" set at the gauging counter No.1 (master ring gauging start)?

Is the counter value smaller than the preset value?

Master ring gauging cycle start condition is met.

Is the counter value smaller than the preset value?

Is the counter value smaller than the preset value?

Is the counter value smaller than the preset value?

Work gauging cycle start condition is met.

Offset data readout cycle start condition is met.

Tool breakage detection cycle start condition is met. 1

Checking the master ring gauging cycle start condition

1

Checking the work gauging cycle start condition

Checking the offset data readout cycle start condition in touch setter gauging

Checking the tool breakage detection cycle start condition in touch setter gauging

LE61497R0100700230007

Page 46: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-37SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Gauging cycle START condition cancel

Automatic tool indexing check for trial-cut gauging cycle

OMSSF

VRSTT=0 NO

YESM100

VDOUT[31]=0VDOUT[32]=0VDOUT[33]=0

VDOUT[34]=0VDOUT[35]=0

NK1RTS

Sequence restart OFF?

Synchronization with the OMSSF called from turret B

Master ring gauging cycle start condition cancelWork gauging cycle start condition cancelTrial cut part gauging cycle start condition cancel

Offset data readout cycle start condition cancel in touch setter gaugingTool breakage detection cycle start condition cancel in touch setter gauging

[Supplement]

Synchronization (M100) is necessary to avoid the followingcase: if either of the turrets fails meet to the gauging condition, the other turret does not perform required gauging.

LE61497R0100700230008

OTRCK

NO

NO

VRSTT=0YES

RTG=1

VS07=9999

NL1

NL2VGRID[RTG]=0

VDOUT[33]=1 YES

RTG>=VS07

NL3

NL4M100

RTS

RTG=RTG+1

Trial cut part gauging ON

Local variable

Setting the maximum tool group number at VS07

Is a tool in the tool group automatically indexed?

Repeating the index check in all the tool groups

Synchronization with the index check on turret B

Even when a tool is indexed on turret B, the actual gauging is perform on turret A. Synchronization is thus necessary for the gauging processing. (Do not start the gauging cycle independently on turret A or turret B).

LE61497R0100700230009

Page 47: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-38SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Touch setter gauging

Gauging cycle START condition check

This subprogram should be called before calling the touch setter gauging cycle.

Tool breakage detection cycle

OTST

NO

NO

NO

NO

YES

YES

YES

YES

YES

VRSTT=0

VS20=0

VDIN[35]=1

VDIN[34]=1

RTG=1

VS07=9999

NM1

NM2VS20=1

VGRID[RTG]=1

RTG>=VS07

NM3RTS

RTG=RTG+1

When activating the tool life management specification is supported, VS20 is used as a tool tip gauging start condition.

NO

Is the tool breakage detection cycle ON?

Is the offset data readout cycle ON?

RTG is a local variable.NO

Setting the maximum tool group number at VS07

Is a tool in the tool group automatically indexed?Repeating the index check in all the tool groups

Gauging cycle start conditions are met.

The touch setter gauging is performed by turret A, B or C independently. The turret A does not need to wait the gauging start conditions to be checked on other turrets.

LE61497R0100700240001

OTLLS OTLLA OTLLB OTLLMNN1

NN3

NN2VS17=0

VS17=1 VS17=0

VS16=0 VS16=1

VRSTT=0YES

YES

OTDSL

VDIN[35]=1

VS28=1

4D 2A

NO

NO

NN22 NN8

Checking ATG and AOG commands

Tool breakage detection cycle ON?

Tool breakage detection cycle

LE61497R0100700240002

Page 48: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-39SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Tool offset data read-out cycle

OTFRD OTFRA OTFRB OTFRM

NN4

NN6

NN5VS17=0

VS17=1 VS17=0

VS16=0 VS16=1

VRSTT=0YES

YES

OTDSL

VDIN[34]=1

4D 2A

NO

NO

NN22 NN8

Checking ATG and AOG commands

YESNO

YES

VMDT[6]=0

VGRID[ATG]=0

NONN7

VS28=0

Offset data readout cycle ON?

Tool life management specification not supported?

Automatic tool index not executed?

Readout cycle

Even if readout cycle is not ON, execution of the automatic tool index starts the gauging cycle. At this time, however, the gauging ON lamp does not light.

LE61497R0100700240003

Page 49: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-40SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

VS26=0XSTP=VSIOXZSTP=VSIOX

VMDT[6]=0 NO

NO

NO

NO

NO

YES

YES

YES

YESVDIN[1241]AND 7=0

NN9

NN10

VS17=1 NN11

NN12

VS01=VETON

TD=TDFN

NN163A

NN15

NN13

VDIN[1241]AND 7=0

VS17=1 NN14

YES

G00 X=XP1 Z=ZP1 G00 X=XP1 Z=ZP1

TDG=ATDG TDG=ATDG

G00 X=XP1 Z=ZP1

G00 X=XP1 Z=ZP1 G00 X=XP1 Z=ZP1

G40

G40

Clearing the NG flagStoring the actual position (start point)

Tool life management specification not supported?

ATC unprovided?

Moving the tool nose to P1

LE61497R0100700240004

Page 50: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-41SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

3A

X=XP2 Z=ZP2

MSPZ=0 YES

YES

YES

NO

NO

NO

X=XP3VS27=1

OTMXZ

PRNT 10

G00 X=XP2

NN17

NN18

NN19

VIMDX[5]=0VIMDX[6]=0

±NG VS26=0

MSPX=0

Z=ZP3VS27=0

OTMXZ

4B 4A 4C

VIMDZ[5]=0VIMDZ[6]=0

VIMDX[5]=0VIMDX[6]=0

NN20 NN21

Z-axis gauging OFF?Moving the tool nose to P2

Moving the tool nose to XP3Z-direction gauging

Clears the data displayed on the screen if gauging cycle is not executed.

Clears the data displayed on the screen if gauging cycle is not executed.

Calling the gauging and processing subprogram

Print command Z

Returning the tool nose to XP2

Is result other than ±NG?

Deleting the previously displayed X-axis data

X-axis gauging OFF?

Moving the tool nose to ZP3X-direction gauging

Calling the gauging and processing subprogram

LE61497R0100700240005

4B 4A 4C 4D

PRNT 9

G00 Z=ZP2

VS26=0

VDOUT[992]=2000+VETLN+VS28*100NN21

NN22

G00 X=XP1 Z=ZP1

X=XSTP Z=ZSTP

RTS

M126

Returning the tool nose to P2

Is result other than ±NG?

Retracting the tool nose to P1

NN20NO

Retracting the tool nose to the stored start point

YES

LE61497R0100700240006

Page 51: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-42SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Cycle judgment subprogram

OTMXZ

VDOUT[9]=0VS19=2VS25=1

VDIN[1236]AND 2=2

YES

YES

YES

YES

YES YES YES

YES

NO

NO NONO

NO

NO

NO

NO

NO

YESVS16=0

VS19=3

VS27=0

NO1

NO3

NO4

NO2VS29=VSNX[MSPX] -VZOFX-VZSHX

VS29=VSNZ[MSPZ] -VZOFZ-VZSHZ

VS29=-[VSNZ[MSPZ] -VZOFZ-VZSHZ]

VS19=3

VS29=-VS29

VMIRZ=0

OWTM

VS02=VS29VS03=VS31VS06=VS30VS18=ABS[VS06]

±OK?VS18=1 VS28=0 VSIN[1255]

AND 32≠32 VS27=0

1A 4A 2A 3A

NO9NO12

Judgment indicator lamp OFFSensor number (always "2" for touch setter gauging)NG double-touch flag (must be "1" because touch setter does not perform double-touch when the gauging result is NG)

Mirror-image specification supported?

X-direction gauging?

Setting the target valve

Calling the gauging and data processing subprogram

Target valueMeasured valueJudgmentAbsolute value of judgment data

Tool breakage detection

Processing X-axis data

Processing Z-axis data

LE61497R0100700240007

Page 52: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-43SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1A

4A

2A 3ANO12 NO9

VS27=0NO NO

NO

NO

NO

NONO

YES YES

YES

YES

YES

YES

YES

VIMDZ[5]=VS03VIMDZ[6]=0

VIMDX[5]=VS03VIMDX[6]=0

NO14

VS18=2

VMDT[6]=0

VORD[OT21]=1

VTLNG[VS08]=1 VS26=1

NO16

RTS

VS27=0NO5

NO6VDTWX[VS01]=VS32-VDTWX[VS01]

VDTWX[VS01]=VS32+VDTWX[VS01]

VDTWZ[VS01]=VS32+VDTWZ[VS01]

NO7VIMDX[5]=VS03VIMDX[6]=VS32

VIMDZ[5]=VS03VIMDZ[6]=VS32

VDTFX[VS01]=VS32-VDTFX[VS01]

VS17=1

VDTFX[VS01]=VS32+VDTFX[VS01]

VDTFZ[VS01]=VS32+VDTFZ[VS01]

NO11VIMDX[5]=VS03VIMDX[6]=VS32

VIMDZ[5]=VS03VIMDZ[6]=VS32

VS17=1

NO15

Processing Z-axis data

Processing X-axis data

Is the result NG?

CRT displayMeasured valueVariation

Tool life management specification not supported?

NG flag ON

LE61497R0100700240008

Page 53: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-44SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Gauging cycle - X-axis

OSKPX

VS15=VSIOX

APPS NO

NO

YESNO1

YESVS29≤VS15

G00 X=VS29-APPNO3

G30 X=VS29 D=APP L=IMP F=VSKFA

OSPCX

OTIME

X=VS31 D=APPS L=IMP F=VSKFB

OSPCX

NO4G00 X=VS15

RTS

G30 X=VS29 D=APP L=IMP F=VSKFB

OSPCX

G00 X=VS29+APP

NO2

Storing the actual value for double-touch gauging

Is APPS specified (for double-touch gauging)?

Comparing the target value with the actual value

Gauging by first touch

Converting the measured value into a value in the program coordinate system

Dwelling for 0.1 sec

Gauging by second touch by regarding the first touch point as the target value

Converting the measured value into a value in the program coordinate system

Returning to the sensor to the gauging cycle start point

LE61497R0100700240009

Page 54: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-45SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Gauging cycle - Z-axis

Converting gauged data into the coordinate value in the program coordinate system - X-axis

OSKPZ

VS15=VSIOZ

APPS NO

NO

YESNR1

YESVS29≤VS15

G00 Z=VS29-APPNR3

G30 Z=VS29 D=APP L=IMP F=VSKFA

OSPCZ

OTIME

Z=VS31 D=APPS L=IMP F=VSKFB

OSPCZ

NR4G00 Z=VS15

RTS

G30 Z=VS29 D=APP L=IMP F=VSKFB

OSPCZ

G00 Z=VS29+APP

NR2

Storing the actual value for double-touch gaugingIs APPS specified (for double-touch gauging)?

Comparing the target value with the actual value

Gauging by first touch

Converting the measured value into a value in the program coordinate system

Dwelling for 0.1 sec

Gauging by second touch by regarding the first touch point as the target value

Converting the measured value into a value in the program coordinate system

Returning to the sensor to the gauging cycle start point

LE61497R0100700240010

OSPCX

VS31=VSKPX[VS19]-VZOFX-VZSHX-VETFX

VS19=3 NO

YESVS31=-VS31NP1

RTS

Value in the program coordinate system

= Measured value in the (machine coordinate system) - Zero offset value - Zero shift value - Tool offset value

LE61497R0100700240011

Page 55: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-46SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Converting gauged data into the coordinate value in the program coordinate system - Z-axis

0.1 sec dwell

OSPCZ

VMIRZ=0 NO

YES

NP2

VS31=VSKPZ[VS19]-VZOFZ -VZSHZ-VETFZ

VS31=-[VSKPZ[VS19]-VZOFZ -VZSHZ-VETFZ]

RTSNP3

LE61497R0100700240012

OTIME

TIM1=VDIN[1000]NTIM1

TIM2=VDIN[1000]

TIM3=TIM2-TIM1

TIM3>0

NO

NO

YES

YES

TIM3>100

TIM1=TIM2NTIM2

RTS

Registering the 1-ms counter value at TIM1

Registering the 1-ms counter value at TIM2

Calculating the elapsed time

Is TIM3 value positive?

Has 0.1 second elapsed?

If TIM3 value is negative, the 1-ms counter is reset to "0".

LE61497R0100700240013

Page 56: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-47SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Work gauging data judgment cycle

OZTM

VDOUT[9]=0

VS11=ABS[VS32]

VIMDX[12]=VS11

DNG NO

NO

NO

NO

NO

NO

YES

YES

YES

YES

NS1

YES

VIMDZ[12]=DNG

VIMDX[12]>VIMDZ[12]

VS32>0 NS2

VDOUT[1]=1VS30=2VS32=0

+NG

M154 M154

VDOUT[922]=1300+VS27*2

VDOUT[992]=1301+VS27*2

NS8

RTS

NS3 NS4

VIMDZ[12]=DOKDOK

YESNS5 VIMDX[12]>VIMDZ[12]

NS7VS32>0NS6

-NG +OK -OK OKVDOUT[5]=1VS30=-2VS32=0

VDOUT[2]=1VS30=1

VDOUT[4]=1VS30=-1

VDOUT[3]=1VS30=0VS32=0

Using the absolute value of the variation amount for the subsequent judgment

Is DNG command specified?

Is DOK command specified?

Judgment indicator lamp ON

LE61497R0100700240014

Page 57: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-48SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Diameter Gauging

Diameter gauging (OD/ID, turret A)

These subprograms are called from turret A.

NO

VIMDX[4]=VS21VIMDX[7]=VS22VIMDX[8]=VS31

Judgment lamp OFF

ODOAA

VS24=0NS1

ODIAA

VS24=0

M155

VRSTT=0 NO

YESVS27=0

XSTP=VSIOXZSTP=VSIOZ

TDSN=VDETN

VDOUT[9]=0

VS25=0

VS19=1

OTDSL

ODWTM

VMDT[2]=MSPVMDT[3]=VS21VMDT[4]=VS30VMDT[5]=VS32VMDT[7]=VS22VMDT[8]=VS31VMDT[9]=VS21

VDIN[1255]AND 32≠32

YESNS2VS04=VTOFX[VS01] VS04=VTWOX[VS01]

NS32A

OD gauging ID gauging

Air blow ONSequence restart OFF?

X-direction gauging

Storing the start position

Storing the currently used tool offset number

Flag for NG double-touch gauging

Determining the sensor input numberDetermining whether the tool life management function is used or not, checking ATG and AOG commands, and selecting the tool number and the tool offset numberCalling the diameter gauging and data judging subprogram

Target pointMeasured valueJudgmentCompensation dataMeasured value at upper gauging pointMeasured value at lower gauging pointMeasured diameter

Measured diameter (displayed on CRT)Measured value at upper gauging point (displayed on CRT)Measured value at lower gauging point (displayed on CRT)

2BNS4

LE61497R0100700250001

Page 58: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-49SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2B 2A

OWXZ

VIMDX[6]=-VMDT[5]

PRNT 11

TD=TDSN

G00 X=XSTP Z=ZSTPNS4

M154

RTS

Calling the measured data processing subprogram

Variation amount in tool offset data (displayed on CRT)

Print command

Returning the sensor to gauging start point

Air blow OFF

LE61497R0100700250002

Page 59: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-50SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Diameter gauging (OD/ID, turret B)

These subprograms are called from turret A.

ODOBA

VS24=0

NT1

ODIBA

VS24=1

M155

VRSTT=0 NO

YESVS27=0

XSTP=VSIOXZSTP=VSIOZ

TDSN=VDETN

VDOUT[9]=0

VS25=0

VS19=1

ODWTM

VMDT[2]=MSPVMDT[3]=VS21VMDT[4]=VS30VMDT[5]=VS32VMDT[7]=VS22VMDT[8]=VS31VMDT[9]=VS21

OD gauging ID gauging

Air blow ONSequence restart OFF?

X-direction gauging

Storing the start position

Storing the currently used tool offset number

Judgment lamp OFF

Flag for NG double-touch gauging

Determining the sensor input number

Calling the diameter gauging and data judging subprogram

Target pointMeasured valueJudgmentCompensation dataMeasured value at upper gauging pointMeasured value at lower gauging pointMeasured diameter

NT42B

M100

M100

VS18=ABS[VS30]

2A

Starting the gauging cycle in synchronization with turret B

Waiting for tool offset number to be selected on turret B

Using the absolute value of the judgment data for the subsequent processing executed after synchronization

LE61497R0100700250003

Page 60: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-51SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2B 2A

VS18=2 YES

NO

NO

NO

YES

YES

NT3

NT2

NT4

M100

M100

M100

TD=TDSN

G00 X=XSTP Z=ZSTP

M154

RTS

VMDT[6]=0

VDIN[21]=1

±NGIs the result ±NG?

Tool life management specification not supported?

NG ignore button ON?

Waiting for data processing on turret B

Waiting for synchronization when the result is ±NG

Returning to the sensor to the gauging start position

Air blow OFF

M100 code (waiting for synchronization) is issued to turret B only twice when the result is NG though it is issued three times when the result is OK. This is to prevent the turret A from finishing the gauging subprogram and executing the next sequence before the alarm occurs on turret B.If NG is ignored (no alarm occurs), however, M100 is issued three times as in the case where the result is OK or ±OK.

LE61497R0100700250004

Page 61: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-52SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Diameter gauging (OD/ID, turret B)

These subprograms are called from turret B.

ODMBB

NO VRSTT=0YES

VS27=0

M100

OTDSL

M100

M100

VIMDX[4]=VMDT[3]VIMDX[7]=VMDT[7]VIMDX[8]=VMDT[8]VS04=VDTFX[VS01]

OWXZ

VIMDX[6]=-VMDT[5]

PRNT 11

M100

M100

RTSNV1

Sequence restart OFF?

X-direction gauging

Waiting for synchronized gauging with turret ADetermining whether the tool life management function is used or not, checking ATG and AOG commands, and selecting the tool number and the tool offset numberStarting the gauging cycle on turret A

Waiting for completion of gauging cycle on turret A

Measured diameter (displayed on CRT)Measured value at upper gauging point (displayed on CRT)Measured value at lower gauging point (displayed on CRT)Tool offset (for printing)

Calling the gauging data processing subprogram

Variation in tool offset (displayed on CRT)

Print command

Waiting for synchronization with turret A

Waiting for synchronization when the result is NG

LE61497R0100700250005

Page 62: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-53SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Diameter gauging (Data judgment)

ODWTM

VS24=0

TD=TDF2

G00 X=XP1 Z=ZP1

NO NU1

NO

YES

NU2 YES

VDIN[1255]AND 32≠32

G00 X=-[VDTFX[TDF1] -VDTFX[TDF2]]/2 Z=ZP1

G00 X=-[[VDTFX[TDF1] +VDTWX[TDF1]] -[VDTFX[TDF2] -VDTWX[TDF2]]]/2 Z=ZP11A

NU3

G00 Z=ZP2

VS29=MSP

OSKPX

VS22=VS31

VS24=0

G00 Z=ZP1

X=-XP1

Z=ZP2

NU6VS29=-MSP

OSKPX

2A

NO

NO NU4

VDIN[1255]AND 32≠32NU5 YES

G00 X=[VDTFX[TDF1] -VDTFX[TDF2]]/2

G00 X=[[VDTFX[TDF1] +VDTWX[TDF1]] -[VDTFX[TDF2] -VDTWX[TDF2]]]/2

YES

TD=TDF1

TD=TDF1TD=TDF2

OD gauging?

Setting the target value (of the upper gauging point)

Calling the X-direction gauging and processing subprogram

Storing the value measured at the upper gauging pointOD gauging?

Setting the target value (of the lower gauging point)

Calling the X-direction gauging and processing subprogram

LE61497R0100700250006

Page 63: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-54SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

VS21=[VS22-VS31]/2

VS24=0 NO

NO

NO NO

NO

YES

YES

YES

YES

YESYES

NO

NO

G00 Z=ZP1

X=XP1

TD=TDF2G00 Z=ZP1

TD=TDF1

VDIN[1255]AND32≠32

NU8

NU9

G00 X=-[VDTFX[TDF1] -VDTFX[TDF2]]/2

G00 X=-[[VDTFX[TDF1] +VDTWX[TDF1]] -[VDTFX[TDF2] -VDTWX[TDF2]]]/2

VS32=VS21+VS29VS11=ABS[VS32]

VIMDX[12]=VS11VIMDZ[12]=DNG

±NG?VIMDX[12]>VIMDZ[12]

YESAPPS

VS25=0VS25=1

1A

NU3

NU12

±OK?

VIMDZ[12]=DOK

VIMDX[12]>VIMDZ[12]

VS32>0 VS32>0

VDOUT[1]=1VS30=2

+NG

NU15

RTS

VDOUT[5]=1VS30=-2

VDOUT[2]=1VS30=1

VDOUT[4]=1VS30=-1

VDOUT[3]=1VS30=0

-NG +OK -OK OK

Measured diameter = [upper gauging point - lower gauging point]/2OD gauging?

Variation amount = Measured value - Target valueUsing the absolute value of the variation amount for the subsequent judgment

Is the judgment ±OK or OK?

NG double-touch

gauging?

LE61497R0100700250007

Page 64: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-55SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Sensor position compensation

OSNCA

VS17=0

VS19=2

VS16=0

VS17=1

VS19=2

VS16=0

VS17=0

VS19=3

OSNCB OSNCM

NW1

NW2

VRSTT=0YES

YES

YES

YES YES

OTNSL

VS26=0

XSTP=VSIOX

ZSTP=VSIOZ

VMDT[6]=0

NO

NO

NO

NO NO

NOVDIN[1241]AND 7=0

VDIN[1241]AND 7=0

NW3

NW4

VS17=1 NW5

G00 X=XP1 Z=ZP1

NW11

NW6VS01=VETON

X=XP2 Z=ZP2

2A

NW7

NW8G00 X=XP1 Z=ZP1

YESTDG=ATDG

TDG=ATDG

TD=TDFN

NW9

VS17=1 NW10

G00 X=XP1 Z=ZP1 G00 X=XP1 Z=ZP1

G40G40

2B

NW17

G00 X=XP1 Z=ZP1

Set "3" as the sensor number for turret B with mirror-image function

Sequence restart

Determining whether the tool life management function is used or not, checking ATG and AOG commands, and selecting the tool number and the tool offset numberResetting the NG flag

Storing the actual position

ATC unprovided?

Offset number output to the printer

Moving the tool nose to P2

LE61497R0100700250009

Page 65: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-56SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

YES

YESYES

YES

VIMDZ[5]=0VIMDZ[6]=0

MSPZ=0NW12 NO

NO

NO

NO

X=XP3

OSNMZ

G00 X=XP2

VS26=0NW13

MSPX=0NW14

Z=ZP3

OSNMX

G00 Z=ZP2

VS26=0NW15

M126

VDOUT[992]=2310NW16

NW17

G00 X=XP1 Z=ZP1

X=XSTP Z=ZSTP

RTS

2B

VIMDX[5]=0VIMDX[6]=0

VIMDX[5]=0VIMDX[6]=0

1

1

Z-axis offset

NG processing

LE61497R0100700250010

Page 66: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-57SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Sensor position compensation (Z-axis direction)

This subprogram is called from OSNCA.

OSNMZ

VMIRZ=0 NO

NO

NO

NO

NO

NY1

YES

YES

YES

YES

VS29=VSNZ[MSPZ]-VZOFZ-VZSHZ VS29=-[VSNZ[MSPZ]-VZOFZ-VZSHZ]

OSKPZNY2

VS32=VS31-VS29

DNGNY5

VIMDX[12]=ABS[VS32]

VIMDZ[12]=DNG

VIMDX[12]>VIMDZ[12]

NY6

VS29=VS32

VMIRZ=0

VS29=-VS29NY7

VSNZ[MSPZ]=VS29+VSNZ[MSPZ]NY8

VIMDZ[5]=VS31VIMDZ[6]=VS32

RTS

VS26=1

Is the same coordinate system used?

Setting the target value

Setting the measured value and the offset value for display

LE61497R0100700250011

Page 67: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-58SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Sensor position compensation (X-axis direction)

This subprogram is called from OSNCA.

OSNMX

VS29=VSNX[MSPX]-VZOFX-VZSHX

VS19=3 NO

NO

NO

YES

YES

YES

VS29=-VS29NX1

OSKPX

VS32=VS31-VS29

DNGNX2

NX3

VIMDX[12]=ABS[VS32]

VIMDZ[12]=DNG

VIMDX[12]>VIMDZ[12]

VSNX[MSPX]=VS32+VSNX[MSPX]NX4

VS26=1

VIMDX[5]=VS31VIMDX[6]=VS32

RTSLE61497R0100700250012

Page 68: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-59SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-2-6. Program List

ORGIA (Master ring gauging (ID), called from turret A)

IF [VRSTT NE 0] NA10M100IF [VDIN[31]EQ 0] NA10IF [VDIN[22]EQ 0] NA8NOEX XSTP=VSIOX ZSTP=VSIOZTD=TDF1IF [[VDIN[1255]AND 32] NE 32] NA1G00X=-[[VDTFX[TDF1]+VDTWX[TDF1]]-[VDTFX[TDF2]+VDTWX[TDF2]]]/2Z=ZP1 M155GOTO NA2NA1 G00X=-[VDTFX[TDF1]-VDTFX[TDF2]]/2Z=ZP1 M155NA2 Z=ZP2NOEX VS29=VRNGX VS19=1CALL OSKPXNOEX VIMDX[1]=VS31TD=TDF2IF [[VDIN[1255]AND 32] NE 32] NA3G00X=[[VDTFX[TDF1]+VDTWX[TDF1]]-[VDTFX[TDF2]+VDTWX[TDF2]]]/2GOTO NA4NA3 G00X=[VDTFX[TDF1]-VDTFX[TDF2]]/2 NA4 NOEX VS29=-VRNGXCALL OSKPXNOEX VIMDX[2]=VS31 VS32=[VIMDX[1]+VS31]/2 VS27=0CALL OZTMNOEX VIMDX[3]=VS32NOEX VS02=VRNGX VS03=VIMDX[3]+VS02 VS04=VZOFX VS06=VS30NOEX VZOFX=VZOFX+VIMDX[3] VS05=VZOFXPRNT 13NOEX VMDT[1]=-VIMDX[3]M100TD=TDF1G00Z=ZP3X=XP3 NOEX VS29=VRNGZCALL OSKPZIF [VMIRZ EQ 0] NA5NOEX VS31=-VS31NA5 NOEX VIMDZ[1]=VS31 VS32=VS31-VRNGZ VS27=1CALL OZTMNOEX VIMDZ[3]=VS32NOEX VS02=VRNGZ VS03=VS31 VS04=VZOFZ VS06=VS30NOEX VZOFZ=VS04+VIMDZ[3] VS05=VZOFZPRNT 14NOEX VMDT[1]=VIMDZ[3]M100IF [[VDIN[1255]AND 32] NE 32] NA6G00X=-[[VDTFX[TDF1]+VDTWX[TDF1]]-[VDTFX[TDF2]+VDTWX[TDF2]]]/2GOTO NA7NA6 G00X=-[VDTFX[TDF1]-VDTFX[TDF2]]/2NA7 Z=ZP1X=XSTP Z=ZSTP M154GOTO NA9NA8 NOEX VMDT[1]=0 VDOUT[992]=1100

Page 69: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-60SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NA9 M100NA10 RTS

ORGOA (Master ring gauging (ID), called from turret A)

IF [VRSTT NE 0] NB1M100IF [VDIN[31] EQ 0] NB1NOEX XSTP=VSIOX ZSTP=VSIOZTD=TDFNG00X=XP1 Z=ZP1 M155X=XP2 Z=ZP2Z=ZP3NOEX VS29=VRNGX VS19=1CALL OSKPXNOEX VIMDX[1]=VS31 VS32=VS31-VRNGX VS27=0CALL OZTMNOEX VIMDX[2]=0 VIMDX[3]=VS32NOEX VS02=VRNGX VS03=VS31 VS04=VZOFX VS06=VS30NOEX VZOFX=VZOFX+VIMDX[3] VS05=VZOFXPRNT 13NOEX VMDT[1]=-VIMDX[3]M100G00Z=ZP2X=XP3NOEX VS29=VRNGZCALL OSKPZIF [VMIRZ EQ 0] NB2NOEX VS31=-VS31NB2 NOEX VIMDZ[1]=VS31 VS32=VS31-VRNGZ VS27=1CALL OZTMNOEX VIMDZ[3]=VS32NOEX VS02=VRNGZ VS03=VS31 VS04=VZOFZ VS06=VS30NOEX VZOFZ=VZOFZ+VIMDZ[3] VS05=VZOFZPRNT 14NOEX VMDT[1]=VIMDZ[3]M100G00X=XP2X=XP1 Z=ZP1X=XSTP Z=ZSTP M154M100NB1 RTS

ORNGB (Master ring gauging (processing at turret B), called from turret B)

IF [VRSTT NE 0] NC1M100IF [VDIN[31] EQ 0] NC1M100NOEX VS04=VZOFX VZOFX=VS04+VMDT[1] VS05=VZOFX VIMDX[3]=VMDT[1]PRNT 13M100NOEX VS04=VZOFZ VZOFZ=VS04+VMDT[1] VS05=VZOFZ VIMDZ[3]=VMDT[1]PRNT 14M100NC1 RTS

Page 70: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-61SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWMXA (Work gauging (turret A in the X-axis direction), called from turret A)

NOEX VS27=0GOTO ND1

Page 71: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-62SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWMZA (Work gauging (turret A in the Z-axis direction), called from turret A)

NOEX VS27=1ND1 M155IF [VRSTT NE 0] ND7NOEX VDOUT[9]=0 VS25=0 VS29=MSP VS19=1CALL OTDSLNOEX VS17=0CALL OWTMNOEX VMDT[2]=MSP VMDT[3]=VS31 VMDT[4]=VS30 VMDT[5]=VS32IF [VS27 NE 0] ND4IF [[VDIN[1255]AND 32] NE 32] ND2NOEX VIMDX[4]=VS31 VS04=VDTWX[VS01]GOTO ND3ND2 NOEX VIMDX[4]=VS31 VS04=VDTFX[VS01]ND3 CALL OWXZNOEX VIMDX[6]=-VMDT[5]PRNT 11GOTO ND7ND4 IF [[VDIN[1255]AND 32] NE 32] ND5NOEX VIMDZ[4]=VS31 VS04=VDTWZ[VS01]GOTO ND6ND5 NOEX VIMDZ[4]=VS31 VS04=VDTFZ[VS01]ND6 CALL OWXZNOEX VIMDZ[6]=-VMDT[5]PRNT 12ND7 M154RTS

OWXBA (Work gauging (turret B in the X-axis direction), called from turret A)

NOEX VS27=0GOTO NE1

OWZBA (Work gauging (turret B in the Z-axis direction), called from turret A)

NOEX VS27=1NE1 M155IF [VRSTT NE 0] NE4M100M100NOEX VDOUT[9]=0 VS25=0 VS29=MSP VS19=1 VS17=0CALL OWTMNOEX VMDT[2]=MSP VMDT[3]=VS31 VMDT[4]=VS30 VMDT[5]=VS32NOEX VS18=ABS[VS30]IF [VS18 NE 2] NE2IF [VMDT[6] EQ 0] NE3IF [VDIN[21] NE 1] NE3NE2 M100NE3 M100M100NE4 M154RTS

OWXBB (Work gauging (turret B in the X-axis direction), called from turret B)

NOEX VS27=0GOTO NF1

Page 72: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-63SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWZBB (Work gauging (turret B in the Z-axis direction), called from turret B)

NOEX VS27=1NF1 IF [VRSTT NE 0] NF4M100CALL OTDSLM100M100IF [VS27 NE 0] NF2NOEX VIMDX[4]=VMDT[3] VS04=VDTFX[VS01]CALL OWXZNOEX VIMDX[6]=-VMDT[5]PRNT 11GOTO NF3NF2 NOEX VIMDZ[4]=VMDT[3] VS04=VDTFZ[VS01]CALL OWXZNOEX VIMDZ[6]=-VMDT[5]PRNT 12NF3 M100M100NF4 RTS

OWXZ (Work gauging (processing of measured data), called within the gauging cycle subprogram)

NOEX VS02=VMDT[2] VS03=VMDT[3] VS06=VMDT[4] VS18=ABS[VS06]IF [VS18 EQ 1] NG3NOEX VS05=VS04 VMDT[5]=0IF [VS18 NE 2] NG9IF [VMDT[6] EQ 0] NG1IF [VDIN[21] NE 1] NG1NOEX VDTNG[VS08]=1GOTO NG9NG1 IF [VS06 LT 0] NG2M154NOEX VDOUT[992]=1001+VS27*2GOTO NG9NG2 M154NOEX VDOUT[992]=1000+VS27*2GOTO NG9NG3 IF [[VDIN[1255]AND 32] NE 32] NG5IF [VS27 EQ 0] NG4NOEX VDTWZ[VS01]=VDTWZ[VS01]-VMDT[5] VS05=VDTWZ[VS01]GOTO NG7NG4 NOEX VDTWX[VS01]=VDTWX[VS01]-VMDT[5] VS05=VDTWX[VS01]GOTO NG7NG5 IF [VS27 EQ 0] NG6NOEX VDTFZ[VS01]=VDTFZ[VS01]-VMDT[5] VS05=VDTFZ[VS01]GOTO NG7NG6 NOEX VDTFX[VS01]=VDTFX[VS01]-VMDT[5] VS05=VDTFX[VS01]NG7 IF [VMDT[6] EQ 0] NG9IF TRCT NG8GOTO NG9NG8 IF [TRCT EQ 1] NG9NOEX VDTCA[VS08]=VDTCA[VS08]+ABS[VMDT[5]]NG9 RTS

Page 73: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-64SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWTM (Work gauging/Touch setter gauging (measuring and judgment cycle), called from a gauging subprogram)

NH1 IF [VS27 NE 0] NH2CALL OSKPXGOTO NH3NH2 CALL OSKPZNH3 IF [VS17 EQ 0] NH3AIF [VS27 EQ 1] NH3ANOEX VS32=VS29-VS31GOTO NH3BNH3A NOEX VS32=VS31-VS29NH3B NOEX VS11=ABS[VS32]VIMDX[12]=VS11VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NH6IF APPS NH4IF [VS25 NE 0] NH4NOEX VS25=1GOTO NH1NH4 IF [VS32 LE 0] NH5NOEX VDOUT[1]=1 VS30=2GOTO NH9NH5 NOEX VDOUT[5]=1 VS30=-2GOTO NH9NH6 VIMDZ[12]=DOKIF [VIMDX[12] GT VIMDZ[12]] NH7NOEX VDOUT[3]=1 VS30=0GOTO NH9NH7 IF [VS32 LE 0] NH8NOEX VDOUT[2]=1 VS30=1GOTO NH9NH8 NOEX VDOUT[4]=1 VS30=-1NH9 RTS

Page 74: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-65SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OTDSL

Determines whether the tool life management function is used or not. Selects tool number and tool offset number from group number.To be called within a subprogram.NOEX VS01=0IF ATDG NI1GOTO NI2NI1 NI2 NOEX VMDT[6]=0IF TDFN NI3GOTO NI9NI3 NOEX VS01=TDFNGOTO NI7NI4 NOEX VMDT[6]=1VS07=9999VS09=VDSTN[ATDG]IF [VS09 GT VS07] NI8IF [VS09 LE 0] NI8NOEX VS23=VGRSL[VS09]IF [VS23 EQ 0] NI8NOEX VS01=ATDGNI7 IF [VS01 NE 0] NI9NOEX VS08=VDSEN[VS01]*10000+VDSTN[VS01]NI8 M154NOEX VDOUT[992]=1008NI9 RTS

OCNCK (Counter for checking the gauging cycle START conditions, called from either turret A or turret B.)

IF [VRSTT NE 0] N4IF [VMCN[1]EQ 0] N1NOEX VMCN[2]=VMCN[2]+1IF [VMCN[2]LT VMCN[1]] N1NOEX VMCN[2]=0 VDOUT[31]=1N1 IF [VMCN[3]EQ 0] N2NOEX VMCN[4]=VMCN[4]+1IF [VMCN[4]LT VMCN[3]] N2NOEX VMCN[4]=0 VDOUT[32]=1N2 IF [VMCN[5]EQ 0] N3NOEX VMCN[6]=VMCN[6]+1IF [VMCN[6]LT VMCN[5]] N3NOEX VMCN[6]=0 VDOUT[34]=1N3 IF [VMCN[7]EQ 0] N4NOEX VMCN[8]=VMCN[8]+1IF [VMCN[8]LT VMCN[7]] N4NOEX VMCN[8]=0 VDOUT[35]=1N4 RTS

Page 75: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-66SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OMSSF (Cancels the gauging cycle START conditions, called from both turrets A and B)

IF [VRSTT NE 0] NK1M100NOEX VDOUT[31]=0 VDOUT[32]=0 VDOUT[33]=0NOEX VDOUT[34]=0 VDOUT[35]=0NK1 RTS

OTRCK (trial-cut gauging cycle START condition check)

To be called from both turrets A and B before trial-cut gauging cycleIF [VRSTT NE 0] NL4NOEX RTG=1VS07=9999NL1 IF [VGRID[RTG] NE 0] NL2IF [RTG GE VS07] NL3NOEX RTG=RTG+1GOTO NL1NL2 NOEX VDOUT[33]=1NL3 M100NL4 RTS

OTST Touch setter gauging cycle START condition check

To be called before touch setter gaugingIF [VRSTT NE 0] NM3NOEX VS20=0IF [VDIN[35] EQ 1] NM2IF [VDIN[34] EQ 1] NM2NOEX RTG=1VS07=9999NM1 IF [VGRID[RTG] EQ 1] NM2IF [RTG GE VS07] NM3NOEX RTG=RTG+1GOTO NM1NM2 NOEX VS20=1NM3 RTS

OTLLS (touch setter gauging tool breakage detection cycle)

To be called from turret at which gauging performedGOTO NN1

OTLLA Touch setter gauging read check

To be called from turret at which gauging performedNN1 NOEX VS17=0 VS16=0GOTO NN3

OTLLB

NOEX VS17=1GOTO NN2

OTLLM

NOEX VS17=0NN2 NOEX VS16=1NN3 IF [VRSTT NE 0] NN22

Page 76: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-67SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

CALL OTDSLIF [VDIN[35] NE 1] NN22NOEX VS28=1GOTO NN8

OTFRD

GOTO NN4

OTFRA

NN4 NOEX VS17=0 VS16=0GOTO NN6

OTFRB

NOEX VS17=1GOTO NN5

OTFRM

NOEX VS17=0NN5 NOEX VS16=1NN6 IF [VRSTT NE 0] NN22CALL OTDSLIF [VDIN[34] EQ 1] NN7IF [VMDT[6] EQ 0] NN22IF [VGRID[ATDG] EQ 0] NN22NN7 NOEX VS28=0NN8 NOEX VS26=0 XSTP=VSIOX ZSTP=VSIOZIF [VMDT[6] NE 0] NN13IF [[VDIN[1241] AND 7] EQ 0] NN10NN9 TD=TDFNNN10 IF [VS17 EQ 1] NN11G00X=XP1 Z=ZP1 GOTO NN12NN11 G40G00X=XP1 Z=ZP1NN12 NOEX VS01=VDETNGOTO NN16NN13 IF [[VDIN[1241] AND 7] NE 0] NN15TDG=ATDGIF [VS17 EQ 1] NN14G00X=XP1 Z=ZP1GOTO NN16NN14 G40G00X=XP1 Z=ZP1 GOTO NN16TDG=ATDGNN15 G00X=XP1 Z=ZP1NN16 X=XP2 Z=ZP2IF [MSPZ EQ 0] NN17X=XP3NOEX VS27=1CALL OTMXZPRNT 10G00X=XP2IF [VS26 EQ 0] NN18NOEX VIMDX[5]=0 VIMDX[6]=0

Page 77: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-68SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

GOTO NN20NN17 NOEX VIMDZ[5]=0 VIMDZ[6]=0NN18 IF [MSPX NE 0] NN19NOEX VIMDX[5]=0 VIMDX[6]=0GOTO NN21NN19 Z=ZP3NOEX VS27=0CALL OTMXZPRNT 9G00Z=ZP2IF [VS26 EQ 0] NN21NN20 NOEX VDOUT[992]=2000+VETLN+VS28*100NN21 G00X=XP1 Z=ZP1X=XSTP Z=ZSTPNN22 RTS

OTMXZ (Touch setter gauging cycle (processing cycle), called within a subprogram)

NOEX VDOUT[9]=0 VS19=2 VS25=1IF [[VDIN[1236] AND 2] NE 2] NO1IF [VS16 EQ 0] NO1NOEX VS19=3NO1 IF [VS27 EQ 0] NO3IF [VMIRZ NE 0] NO2NOEX VS29=VSNZ[MSPZ]-VZOFZ-VZSHZGOTO NO4NO2 NOEX VS29=-[VSNZ[MSPZ]-VZOFZ-VZSHZ]GOTO NO4NO3 NOEX VS29=VSNX[MSPX]-VZOFX-VZSHXIF [VS19 NE 3] NO4NOEX VS29=-VS29NO4 CALL OWTMNOEX VS02=VS29 VS03=VS31 VS06=VS30 VS18=ABS[VS06]IF [VS18 NE 1] NO12IF [VS28 NE 0] NO12IF [[VDIN[1255]AND 32] NE 32] NO8IF [VS27 EQ 0] NO5NOEX VDTWZ[VS01]=VS32+VDTWZ[VS01] VIMDZ[5]=VS03 VIMDZ[6]=VS32GOTO NO16NO5 IF [VS17 EQ 1] NO6NOEX VDTWX[VS01]=VS32+VDTWX[VS01]GOTO NO7NO6 NOEX VDTWX[VS01]=VS32-VDTWX[VS01]NO7 NOEX VIMDX[5]=VS03 VIMDX[6]=VS32GOTO NO16NO8 IF [VS27 EQ 0] NO9NOEX VDTFZ[VS01]=VS32+VDTFZ[VS01] VIMDZ[5]=VS03 VIMDZ[6]=VS32GOTO NO16NO9 IF [VS17 EQ 1] NO10NOEX VDTFX[VS01]=VS32+VDTFX[VS01]GOTO NO11NO10 NOEX VDTFX[VS01]=VS32-VDTFX[VS01]NO11 NOEX VIMDX[5]=VS03 VIMDX[6]=VS32GOTO NO16NO12 IF [VS27 EQ 0] NO13NOEX VIMDZ[5]=VS03 VIMDZ[6]=0GOTO NO14

Page 78: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-69SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NO13 NOEX VIMDX[5]=VS03 VIMDX[6]=0NO14 IF [VS18 NE 2] NO16IF [VMDT[6] EQ 0] NO15IF [VDIN[21] NE 1] NO15NOEX VDTNG[VS08]=1GOTO NO16NO15 VS26=1NO16 RTS

OSKPX (Gauging cycle (G30) generation (X-axis), called from a subprogram)

NOEX VS15=VSIOXIF APPS NQ1G30X=VS29 D=APP L=IMP F=VSKFBCALL OSPCXGOTO NQ4NQ1 IF [VS29 LE VS15] NQ2G00X=VS29-APPGOTO NQ3NQ2 G00X=VS29+APPNQ3 G30X=VS29 D=APP L=IMP F=VSKFACALL OSPCXCALL OT1MEX=VS31 D=APPS L=IMP F=VSKFBCALL OSPCXNQ4 G00X=VS15RTS

OSKPZ (Gauging cycle (G30) generation (Z-axis), called from a subprogram)

NOEX VS15=VSIOZIF APPS NR1G30Z=VS29 D=APP L=IMP F=VSKFBCALL OSPCZGOTO NR4NR1 IF [VS29 LE VS15] NR2G00Z=VS29-APPGOTO NR3NR2 G00Z=VS29+APPNR3 G30Z=VS29 D=APP L=IMP F=VSKFACALL OSPCZCALL OT1MEZ=VS31 D=APPS L=IMP F=VSKFBCALL OSPCZNR4 G00Z=VS15RTS

OSPCX (Converts the measured value into the coordinate value in the program coordinate system (X-axis), called from a subprogram)

NOEX VS31=VSKPX[VS19]-VZOFX-VZSHX-VETFXIF [VS19 NE 3] NP1NOEX VS31=-VS31NP1 RTS

OSPCZ (Converts the measured value into the coordinate value in the program coordinate system (Z-axis), called from a subprogram)

IF [VMIRZ NE 0] NP2

Page 79: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-70SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NOEX VS31=VSKPZ[VS19]-VZOFZ-VZSHZ-VETFZGOTO NP3NP2 NOEX VS31=-[VSKPZ[VS19]-VZOFZ-VZSHZ-VETFZ]NP3 RTS

OTIME (0.1 sec dwell, called from a subprogram)

NOEX TIM1=VDIN[1000]NTIM1 NOEX TIM2=VDIN[1000]NOEX TIM3=TIM2-TIM1IF [TIM3 GT 0] NTIM2NOEX TIM1=TIM2GOTO NTIM1NTIM2 IF [TIM3 LT 100] NTIM1RTS

OZTM (Judgment cycle for master ring gauging cycle, called from a subprogram)

NOEX VDOUT[9]=0 VS11=ABS[VS32]VIMDX[12]=VS11IF DNG NS1GOTO NS3NS1 VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NS3IF [VS32 LE 0] NS2NOEX VDOUT[1]=1 VS30=2 VS32=0M154NOEX VDOUT[992]=1301+VS27*2GOTO NS8NS2 NOEX VDOUT[5]=1 VS30=-2 VS32=0M154NOEX VDOUT[992]=1300+VS27*2GOTO NS8NS3 IF DOK NS4GOTO NS5NS4 VIMDZ[12]=DOKIF [VIMDX[12] LE VIMDZ[12]] NS7NS5 IF [VS32 LE 0] NS6NOEX VDOUT[2]=1 VS30=1GOTO NS8NS6 NOEX VDOUT[4]=1 VS30=-1GOTO NS8NS7 NOEX VDOUT[3]=1 VS30=0 VS32=0NS8 RTS

ODOAA (Diameter gauging (OD) by turret A, called from turret A)

NOEX VS24=0GOTO NS1

ODIAA (Diameter gauging (ID) by turret A, called from turret A)

NOEX VS24=1NS1 M155IF [VRSTT NE 0] NS4NOEX VS27=0 XSTP=VSIOX ZSTP=VSIOZ TDSN=VDETNNOEX VDOUT[9]=0 VS25=0 VS19=1CALL OTDSLCALL ODWTM

Page 80: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-71SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NOEX VMDT[2]=MSP VMDT[3]=VS21 VMDT[4]=VS30 VMDT[5]=VS32NOEX VMDT[7]=VS22 VMDT[8]=VS31 VMDT[9]=VS21NOEX VIMDX[4]=VS21 VIMDX[7]=VS22 VIMDX[8]=VS31IF [[VDIN[1255]AND 32] NE 32] NS2NOEX VS04=VDTWX[VS01]GOTO NS3NS2 NOEX VS04=VDTFX[VS01]NS3 CALL OWXZNOEX VIMDX[6]=-VMDT[5]PRNT 11TD=TDSNG00X=XSTP Z=ZSTP NS4 M154RTS

ODOBA (Diameter gauging (OD) by turret B, called from turret A)

NOEX VS24=0GOTO NT1

ODIBA (Diameter gauging (ID) by turret B, called from turret A)

NOEX VS24=1NT1 M155IF [VRSTT NE 0] NT4VS27=0 XSTP=VSIOX ZSTP=VSIOZ TDSN=VDETNM100M100NOEX VDOUT[9]=0 VS25=0 VS19=1CALL ODWTMNOEX VMDT[2]=MSP VMDT[3]=VS21 VMDT[4]=VS30 VMDT[5]=VS32NOEX VMDT[7]=VS22 VMDT[8]=VS31 VMDT[9]=VS21NOEX VS18=ABS[VS30]IF [VS18 NE 2] NT2IF [VMDT[6] EQ 0] NT3IF [VDIN[21] NE 1] NT3NT2 M100NT3 M100M100TD=TDSNG00X=XSTP Z=ZSTP NT4 M154RTS

ODMBB (Diameter gauging (turret B), called from turret B)

IF [VRSTT NE 0] NV1NOEX VS27=0M100CALL OTDSLM100M100NOEX VIMDX[4]=VMDT[3] VIMDX[7]=VMDT[7] VIMDX[8]=VMDT[8]NOEX VS04=VDTFX[VS01]CALL OWXZNOEX VIMDX[6]=-VMDT[5]PRNT 11M100

Page 81: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-72SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

M100NV1 RTS

ODWTM (Measuring and judgment cycle for diameter gauging, called from a gauging subprogram)

IF [VS24 NE 0] NU1TD=TDF2G00X=XP1 Z=ZP1 GOTO NU3NU1 TD=TDF1IF [[VDIN[1255]AND 32] NE 32] NU2G00X=-[[VDTFX[TDF1]+VDTWX[TDF1]]-[VDTFX[TDF2]+VDTWX[TDF2]]]/2Z=ZP1 GOTO NU3NU2 G00X=-[VDTFX[TDF1]-VDTFX[TDF2]]/2 Z=ZP1 NU3 G00Z=ZP2NOEX VS29=MSPCALL OSKPXNOEX VS22=VS31IF [VS24 NE 0] NU4TD=TDF1G00Z=ZP1X=-XP1 Z=ZP2GOTO NU6NU4 TD=TDF2IF [[VDIN[1255]AND 32] NE 32] NU5G00X=[[VDTFX[TDF1]+VDTWX[TDF1]]-[VDTFX[TDF2]+VDTWX[TDF2]]]/2GOTO NU6NU5 G00X=[VDTFX[TDF1]-VDTFX[TDF2]]/2 NU6 NOEX VS29=-MSPCALL OSKPXNOEX VS21=[VS22-VS31]/2IF [VS24 NE 0] NU7TD=TDF2G00Z=ZP1X=XP1 GOTO NU9NU7 TD=TDF1G00Z=ZP1IF [[VDIN[1255]AND 32] NE 32] NU8G00X=-[[VDTFX[TDF1]+VDTWX[TDF1]]-[VDTFX[TDF2]+VDTWX[TDF2]]]/2GOTO NU9NU8 G00X=-[VDTFX[TDF1]-VDTFX[TDF2]]/2 NU9 NOEX VS32=VS21+VS29 VS11=ABS[VS32]NOEX VIMDX[12]=VS11 VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NU12IF APPS NU10IF [VS25 NE 0] NU10NOEX VS25=1GOTO NU3NU10 IF [VS32 LE 0] NU11NOEX VDOUT[1]=1 VS30=2GOTO NU15NU11 NOEX VDOUT[5]=1 VS30=-2GOTO NU15

Page 82: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-73SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NU12 NOEX VIMDZ[12]=DOKIF [VIMDX[12] LE VIMDZ[12]] NU14IF [VS32 LE 0] NU13NOEX VDOUT[2]=1 VS30=1GOTO NU15NU13 NOEX VDOUT[4]=1 VS30=-1GOTO NU15NU14 NOEX VDOUT[3]=1 VS30=0NU15 RTS

OSNCA

NOEX VS17=0 VS19=2 VS16=0GOTO NW2

OSNCB

NOEX VS17=1 VS19=2GOTO NW1

OSNCM

NOEX VS17=0 VS19=3NW1 NOEX VS16=1NW2 IF [VRSTT NE 0] NW17CALL OTDSLNOEX VS26=0 XSTP=VSIOX ZSTP=VSIOZIF [VMDT[6] NE 0] NW7IF [[VDIN[1241] AND 7] EQ 0] NW4NW3 NW4 TD=TDFNIF [VS17 EQ 1] NW5G00X=XP1 Z=ZP1 GOTO NW6NW5 G40G00X=XP1 Z=ZP1 NW6 NOEX VS01=VDETNGOTO NW11NW7 IF [[VDIN[1241] AND 7] NE 0] NW9NW8 TDG=ATDGG00X=XP1 Z=ZP1 GOTO NW11NW9 TDG=ATDGIF [VS17 EQ 1] NW10G00 X=XP1 Z=ZP1GOTO NW11NW10 G40G00X=XP1 Z=ZP1 NW11 X=XP2 Z=ZP2IF [MSPZ NE 0] NW12NOEX VIMDZ[5]=0 VIMDZ[6]=0GOTO NW13NW12 X=XP3CALL OSNMZG00X=XP2IF [VS26 EQ 0] NW13NOEX VIMDX[5]=0 VIMDX[6]=0GOTO NW15

Page 83: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-74SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NW13 IF [MSPX NE 0] NW14NOEX VIMDX[5]=0 VIMDX[6]=0GOTO NW16NW14 Z=ZP3CALL OSNMXG00Z=ZP2IF [VS26 EQ 0] NW16NW15 NOEX VDOUT[992]=2310NW16 G00X=XP1 Z=ZP1X=XSTP Z=ZSTPNW17 RTS

OSNMZ

IF [VMIRZ NE 0] NY1NOEX VS29=VSNZ[MSPZ]-VZOFZ-VZSHZGOTO NY2NY1 NOEX VS29=-[VSNZ[MSPZ]-VZOFZ-VZSHZ]NY2 CALL OSKPZNY3 NOEX VS32=VS31-VS29NY4 IF DNG NY5GOTO NY6NY5 NOEX VIMDX[12]=ABS[VS32] VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NY6NOEX VS26=1GOTO NY8NY6 NOEX VS29=VS32IF [VMIRZ EQ 0] NY7NOEX VS29=-VS29NY7 NOEX VSNZ[MSPZ]=VS29+VSNZ[MSPZ]NY8 NOEX VIMDZ[5]=VS31 VIMDZ[6]=VS32RTS

OSNMX

NOEX VS29=VSNX[MSPX]-VZOFX-VZSHXIF [VS19 NE 3] NX1NOEX VS29=-VS29NX1 CALL OSKPXNOEX VS32=VS31-VS29IF DNG NX2GOTO NX3NX2 NOEX VIMDX[12]=ABS[VS32] VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NX3NOEX VS26=1GOTO NX4NX3 NOEX VSNX[MSPX]=VS32+VSNX[MSPX]NX4 NOEX VIMDX[5]=VS31 VIMDX[6]=VS32RTS

Page 84: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-75SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-3. Touch Sensor Gauging (Automatic Zero Offset Function)

1-3-1. General Description of MSB

This section covers the list, flow chart and variable table relating to the automatic zero offset taking the following maker subprogram (MSB) as an example.

LMSC300A.MSB

The content of MSM differ greatly from other control software.Other control software is used to control signals from the machine and also input/output of part programs and/or user’s commands.However, the MSB is created in the same format as that of the part program, and so it can be considered as the control software that implements gauging cycle instead of the user.

1-3-2. Variable Tables

The variables currently used in the gauging MSB are explained below.

(1) Common variables (different from common variables V1 to V200 used for parameter setting)

(2) System variables 1 (used for reading and compensating various types of data)

(3) System variables 2 (used for transmitting data between turret A and turret B)

(4) Input/output variables (used for input/output)

Common Variables (VS01 to VS32)

The common variables are not displayed on the screen unlike the common variables (V1 to V200) used in parameter setting.

Variable Name

Used as RemarksVariable

NameUsed as Remarks

VS01 Sensor input number VS17 Not used

VS02For storing the Z-coordinate value of the gauging cycle starting point

VS18 Not used

VS03

Measured value (program coordinate value, used for calculating compensation values)

VS19 Not used

VS04 Not used VS20 Not used

VS05 Not used VS21 Not used

VS06 Not used VS22 Not used

VS07 Not used VS23 Not used

VS08 Not used VS24 Not used

VS09 Not used VS25 Not used

VS10 Not used VS26 Not used

VS11Absolute value of amount of variation

VS27 Not used

Page 85: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-76SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

(1) Common variables used for setting parameters are common for turrets A and B, however, the above common variables are turret dependent.That is, turrets A and B have an independent VS01, for example, and the VS01 for turret A must be specified and called out from turret A, while the VS01 for turret B must be specified and called out from turret B.

(2) Note that these common variables (VS01 to VS32) will be used in other MSBs in addition to the gauging cycle discussed here. Therefore, if these common variables are used as variables transferred between subprograms, numerical values might be changed during the transfer.When these common variables are used, their processing must end within the same subprogram.

VS12 Not used VS28 Not used

VS13 Not used VS29 Not used

VS14 Not used VS30 Not used

VS15 Not used VS31 Not used

VS16 Not used VS32 Not used

Variable Name

Used as RemarksVariable

NameUsed as Remarks

G13N1 NOEX VS01=100

N2 NOEX VS02=10 VS03=20N3 CALL OSUB1N4N5N6N7 CALL OSUB2N8N9N10G14N1N2 NOEX VS01=100 VS02=50

N3 CALL OSUB1N4

N5N6 NOEX VS01=100 VS03=60N7 CALL OSUB3N8N9M02

Do not use common variables for transferring numerical values from OSUB1 to OSUB2.

Variables used in common in G14 side program

* Not used for transferring numerical values

When calling more than one subprogram from a subprogram, pay attention to the transfer of variables between subprograms.

Variables used in common in G13 side program

Within a subprogram, they can be used as desired.

LE61497R0100700290001

Page 86: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-77SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 1

System variables 1 are used in a touch sensor gauging subprogram.They are used for reading and writing numerical values stored in the CNC memory and those displayed and set as parameters, zero offset data, and tool data, etc.

[Supplement]

System Variables 2

System variables 2 are used in common for turret A and turret B.They are used for transferring data between turret A and turret B.They cannot be displayed on the screen.

Variable Name

Function Min - Max. - ValuesSubscript

Expression

VSIOZ Actual position of Z-axis -99999.9999 to 99999.9999

VSKPZSensor contact position of Z-axis (machine coordinate system)

-99999.9999 to 99999.9999 1 to 2

VZOFZ Z-axis zero offset data -99999.9999 to 99999.9999

VSHZ Z-axis zero shift data -99999.9999 to 99999.9999

VETFZ Presently used tool offset data (Z-axis) -99999.9999 to 99999.9999

VSKFA

Setting for OPTIONAL PARAMETER (GAUGING) Feed rate 2 for gauging cycle 2(Feed rate for the first contact detection in double-contact gauging cycle)

1 to 500

VSKFB

Setting for OPTIONAL PARAMETER (GAUGING) Feed rate 1 for gauging cycle 1(Feed rate for the second contact detection in a double-contact gauging cycle; feed rate for the contact detection in a single-contact gauging cycle)

1 to 500

Concerning VSKFA and VSKFB, the setting unit in the optional parameters is fixed at “mm/min”. However, the value appropriate for the selected unit system is set for these system variables.

Variable Name

Function

VMDT [1] Compensation data (used for the two-saddle specification: for transferring the compensation data calculated at the turret A side to the turret B side)

VMDT [2] Not used

VMDT [3] Not used

VMDT [4] Not used

VMDT [5] Not used

VMDT [6] Not used

VMDT [7] Not used

VMDT [8] Not used

VMDT [9] Not used

VMDT [10] Not used

VMDT [11] Not used

VMDT [12] Not used

Page 87: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-78SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-3-3. Program

Flow Chart

During restart?

"Setting ""1"" as the position for entering the touch sensor gauging skip data"

Double-touch?Initialization of judgment output

Moving the sensor to a point close to the target value with a distance of APP between them

Storing the actual value

Checking the positional relation between the target value and the actual value

First gauging

Converting the measured value into a value in the program coordinate system

Executing the second gauging by regarding the first touch point as the target value

Converting the measured value into a value in the program coordinate system

Converting the measured value into a value in the program coordinate system

Returning the sensor to the gauging start point

LE61497R0100700320001

Page 88: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-79SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Calculating the difference from the current zero position

DNG command specified?

DNG command specified?

Adding the compensation data to the previous zero offset amount

Setting the alarm number

LE61497R0100700320002

Page 89: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-80SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Program List

OZOFA (Automatic zero offset (processing at turret A), called from turret A)

IF [VRSTT NE 0] NA11NOEX VS01=1 VDOUT[9]=0IF APPS NA2G30Z=MSP D=APP L=IMP F=VSKFBNOEX VS03=VSKPZ[VS01]-VZOFZ-VZSHZ-VETFZGOTO NA5NA2 NOEX VS02=VSIOZIF [MSP LE VS02] NA3G00Z=MSP-APPGOTO NA4NA3 G00Z=MSP+APPNA4 G30Z=MSP D=APP L=IMP F=VSKFANOEX VS03=VSKPZ[VS01]-VZOFZ-VZSHZ-VETFZZ=VS03 D=APPS L=IMP F=VSKFBNOEX VS03=VSKPZ[VS01]-VZOFZ-VZSHZ-VETFZG00Z=VS02NA5 NOEX VS03=VS03-MSP VS11=ABS[VS03]NOEX VIMDX[12]=VS11 VIMDZ[3]=VS03IF DNG NA6GOTO NA8NA6 VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NA8IF [VS03 GT 0] NA7NOEX VDOUT[992]=3002 VS03=0 VDOUT[5]=1GOTO NA10NA7 NOEX VDOUT[992]=3003 VS03=0 VDOUT[1]=1GOTO NA10NA8 IF DOK NA9NA8A IF [VS03 GT 0] NA8BNOEX VDOUT[4]=1GOTO NA10NA8B NOEX VDOUT[2]=1GOTO NA10NA9 VIMDZ[12]=DOKIF [VIMDX[12] GT VIMDZ[12]] NA8ANOEX VS03=0 VDOUT[3]=1NA10 NOEX VZOFZ=VZOFZ+VS03 VMDT[1]=VS03M100NA11 RTS

OZOFB (Automatic zero offset (processing at turret B), called from turret B)

IF [VRSTT NE 0 ] NB1M100NOEX VZOFZ =VZOFZ+VMDT[1]NB1 RTS

Page 90: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-81SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-4. Automatic C-axis Zero Offset Function

1-4-1. General Description of MSB

This section covers the list, flow chart, variable table and other information relating to the automatic C-axis zero offset function, taking the following maker subprogram (MSB) as an example.

LMSD300A.MSB

The name of gauging control software is indicated as described below.

The MSB largely differs from the other control software in the contents.Other control software is used to control signals from the machine and also input/output of part programs and/or user’s commands.However, the MSB is created in the same format as that of the part program, and so it can be considered as the control software that implements gauging cycle instead of the user.

1-4-2. Variable Tables

The variables currently used in the gauging MSB are explained below.

(1) Common variables (different from common variables V1 to V200 used for parameter setting)

(2) System variables 1 (used for reading and compensating various types of data)

(3) System variables 2 (used for screen display)

(4) System variables 3 (used for transmitting data between turret A and turret B)

(5) Input/output variables (used for input/output)

LMS*????.MSB

*: Contents of each gauging software

????: Version of each gauging software

Page 91: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-82SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Common Variables (VS01 to VS32)

The common variables are not displayed on the screen unlike the common variables (V1 to V200) used in parameter setting.

(1) Common variables used for setting parameters are common for turrets A and B, however, the above common variables are turret dependent.That is, turrets A and B have an independent VS01, for example, and the VS01 for turret A must be specified and called out from turret A, while the VS01 for turret B must be specified and called out from turret B.

Variable Name

Used asRemarks

Variable Name

Used asRemarks

VS01 VS17 Not used

VS02 Both sides / one side of keyway VS18 Not used

VS03 VS19 Not used

VS04 Target C coordinate VS20 Not used

VS05 Number of groove searches VS21 Not used

VS06 VS22 Not used

VS07 C-axis actual position VS23 Not used

VS08 Skip feed rate (1st time) VS24 Not used

VS09 Skip feed rate (2nd time) VS25 Not used

VS10 C-axis sensor contact position VS26 Not used

VS11 C-axis direction of rotation VS27 Not used

VS12 VS28 Not used

VS13Offset between the sensor center and the sensor head in CCW rotation of the C-axis

VS29 Not used

VS14Offset between the sensor center and the sensor head in CCW rotation of the C-axis

VS30 Not used

VS15 Skip feed rate VS31 Not used

VS16 VS32 Not used

Page 92: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-83SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

(2) Note that these common variables (VS01 to VS32) will be used in other MSBs in addition to the gauging cycle discussed here. Therefore, if these common variables are used as variables transferred between subprograms, numerical values might be changed during the transfer.When these common variables are used, their processing must end within the same subprogram.

G13N1 NOEX VS01=100

N2 NOEX VS02=10 VS03=20N3 CALL OSUB1N4N5N6N7 CALL OSUB2N8N9N10G14N1N2 NOEX VS01=100 VS02=50

N3 CALL OSUB1N4

N5N6 NOEX VS01=100 VS03=60N7 CALL OSUB3N8N9M02

Do not use common variables for transferring numerical values from OSUB1 to OSUB2.

Variables used in common in G14 side program

* Not used for transferring numerical values

When calling more than one subprogram from a subprogram, pay attention to the transfer of variables between subprograms.

Variables used in common in G13 side program

Within a subprogram, they can be used as desired.

LE61497R0100700360001

Page 93: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-84SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 1

System variables 1 are used in this gauging subprogram.They are used for reading and writing numerical values stored in the CNC memory and those displayed and set as parameters, zero offset data, and tool data, etc.

System Variables 2

System variables 2 are used for display.When a numerical value is set for the system variables indicated below, the set numerical value is displayed at the specified field in the display screen.They are independent for each of the turrets.

Variable Name

Function Min - Max. - Values

Subscript

Expression

VSIOXActual position of X-axis (program coordinate system)

-9999.999 to 9999.999

VSIOCActual position of C-axis (program coordinate system)

0 to 359.999

VSKPC C-axis skip position (machine coordinate system) 0 to 359.999 1 to 2

VZOFC Zero offset of C-axis 0 to 359.999

VZSHC Zero shift of C-axis

VSNWDOffset between sensor center and sensor head in CW rotation of C-axis

VSNTUOffset between sensor center and sensor head in CCW rotation of C-axis

0 to 359.999

VCDIR Direction of rotation of C-axis

VRUND 360000 (constant of 360)

VCPFI Flag which indicates the presence of a groove 0, 128

VRSTTFlag which indicates that sequence restart is in progress

0, 128

VUNIT Unit amount 2, 4

VSKFA

Setting for OPTIONAL PARAMETER (GAUGING) Feed rate 2 for gauging cycle 2Feed rate for the first contact detection in double-contact gauging cycle

VSKFB

Setting for OPTIONAL PARAMETER (GAUGING) Feed rate 1 for gauging cycle 1Feed rate for the second contact detection in double-contact gauging cycle;feed rate for the contact detection in single-contact gauging cycle

Variable Name

Function

VIMDX [9] Variable for displaying measured values

VIMDX [10] Variable for displaying compensation data

Page 94: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-85SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 3

System variables 3 are used for transferring data between turret A and turret B.They are used in common for the two turrets.

Input/Output Variables

Input/output variables are used for user reserve alarm code output from MSB.

Variable Name

Function

VMDT [10] Variable for data transfer between turret A and turret B

Variable Name

Function

VDOUT [992] Alarm B user reserve code

VDOUT [993] Alarm A (user reserve code)

Page 95: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-86SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-4-3. Program

Table of Subprograms

Subprogram No.

Subprogram

NameFunction

(1) OZOFD Keyway gauging (both sides)

(2) OZOFC Keyway gauging (one side)

(3) OZOFF Key gauging (both sides)

(4) OZOFE Key gauging (one side)

(5) OCPFI Groove index cycle in the Z-axis direction

(6) OCPFX Groove index cycle in the X-axis direction

(7) ORDOF Conversion of angle data into a value between 0 and 359.999

(8) OFCAL Calculation of C-axis feedrate F

(9) OZOFGCompensation in a different coordinate system (Correcting the offset data at the other turret in the same spindle mode)

(10) OZOFH Compensation in a different coordinate system (different spindle mode)

Page 96: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-87SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Flow Chart

Keyway gauging (both sides, one side)

Storing gauging type

Restart?

C-axis for the 1st spindle connected?

C-axis for the 2nd spindle connected?

Machine lock OFF?

Storing the previous C-axis rotation commandFeedrate in gauging cycle 1

Calculating feedrate

Feedrate in gauging cycle

APPS command specified?

Feedrate in gauging cycle 2

Calculating feedrate

Feedrate in gauging cycle

Previous M15 command specified?

Keyway gauging (one side)?

Alarm A (user reserve code)

LE61497R0100700420001

Page 97: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-88SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

CCW rotation of the C-axis specified

C-axis gauging cycle target point

Chamfering VS07 by 360 degrees

APPS command specified?

Sensor touch position (C-axis coordination system)

Chamfering VS07 by 360 degrees

Distance between the actual position and the sensor touch position

Chamfering VS07 by 360 degrees

First touch position more distant than second approach position?

CW rotation of the C-axis specified

Retreat position from first sensor touch position equal to the distance of APPS

Chamfering VS07 by 360 degrees

To the second start point

CCW rotation of the C-axis specified

Second C-axis gauging cycle

LE61497R0100700420002

Page 98: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-89SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Sensor touch position (C-axis coordination system)

Subtracting the sensor diameter from the measured value

Chamfering VS07 by 360 degrees

Sensor touch position (negative side)

Keyway gauging (one side)?

CW rotation of the C-axis specified

C-axis gauging cycle target point

Chamfering VS07 by 360 degrees

APPS command specified?

LE61497R0100700420003

Page 99: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-90SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Sensor touch position (C-axis coordination system)

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

Distance between the actual position and the sensor touch position

First touch position more distant than second approach position?

Retreat position from first sensor touch position equal to the distance of APPS

CCW rotation of the C-axis specified

CW rotation of the C-axis specified

Second C-axis gauging cycle

To the second start point

LE61497R0100700420004

Page 100: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-91SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Sensor touch position (C-axis coordination system)

Subtracting the sensor diameter from the measured value

Chamfering VS07 by 360 degrees

Sensor touch position (positive side)

Keyway gauging (one side)?

Calculating the center position of a keyway

Value of the sensor touch position for the positive side larger than that for the negative side?

Adding 180° to the center position of a keyway

Chamfering VS07 by 360 degrees

Storing the center position of a keyway

LE61497R0100700420017

Page 101: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-92SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Copying the sensor touch position for the positive side into that for the negative side

Gauging value data for displayingCalculating the C-axis zero offset compensated value

Chamfering VS07 by 360 degrees

Compensated value data for displayingPassing the compensated value into a different coordinate system

Chamfering VS07 by 360 degrees

A new C-axis zero offset

Previous M15 command specified?

CW rotation of the C-axis specified

CCW rotation of the C-axis specified

Calculating a new C-axis zero offset value

LE61497R0100700420018

Page 102: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-93SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Key gauging (both sides, one side)

Storing gauging type

Restart?

C-axis for the 1st spindle connected?

C-axis for the 2nd spindle connected?

Machine lock OFF?

Storing the previous C-axis rotation commandFeedrate in gauging cycle 1

Calculating the feedrate in gauging cycle

Feedrate in gauging cycle

APPS command specified?

Feedrate in gauging cycle 2

Calculating the feedrate in gauging cycle

Feedrate in gauging cycle

Keyway gauging (one side)?

Previous M15 command specified?

Alarm A (user reserve code)

LE61497R0100700420005

Page 103: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-94SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

CW rotation of the C-axis specified

C-axis gauging cycle target point

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

Sensor touch position (C-axis coordination system)

Distance between the actual position and the sensor touch position

First touch position more distant than second approach position?

CCW rotation of the C-axis specified

Retreat position from first sensor touch position equal to the distance of APPS

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

To the second start point

Second C-axis gauging cycle

C-axis gauging cycle

C-axis gauging cycle

APPS command specified?

CW rotation of the C-axis specified

LE61497R0100700420006

Page 104: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-95SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

CCW rotation of the C-axis specified

CCW rotation of the C-axis specified

C-axis gauging cycle target point

Sensor touch position (C-axis coordination system)

Distance between the actual position and the sensor touch position

APPS command specified?

C-axis gauging cycle

C-axis gauging cycle

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

First touch position more distant than second approach position?

CW rotation of the C-axis specified

Retreat position from first sensor touch position equal to the distance of APPS

To the second start point

Chamfering VS07 by 360 degrees

LE61497R0100700420007

Page 105: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-96SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Subtracting the sensor diameter from the measured value

Sensor touch position (negative side)

Keyway gauging (one side)?

Sensor diameter

Gauging cycle start point for the other side

RTX command specified?

Value 0 if no RTX specified

X-axis actual position

X-axis retracting by the distance of specified RTX

Move the C-axis to the gauging cycle start pointMove the X-axis to the gauging cycle start point

C-axis approach point

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

Sensor touch position (C-axis coordination system)

CW rotation of the C-axis specified

LE61497R0100700420008

Page 106: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-97SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

APPS command specified?

C-axis gauging cycle

C-axis gauging cycle

Sensor touch position (C-axis coordination system)

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

First touch position more distant than second approach position?

CCW rotation of the C-axis specified

Retreat position from first sensor touch position equal to the distance of APPS

To the second start point

CW rotation of the C-axis specified

Second C-axis gauging cycle

Distance between the actual position and the sensor touch position

LE61497R0100700420009

Page 107: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-98SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Subtracting the sensor diameter from the measured value

Sensor touch position (negative side)

Keyway gauging (one side)?

Calculating the center position of a keyway

Value of the sensor touch position for the positive side larger than that for the negative side?

Adding 180° to the center position of a keyway

Storing the center position of a keyway

Chamfering VS07 by 360 degrees

Chamfering VS07 by 360 degrees

Sensor touch position (C-axis coordination system)

LE61497R0100700420010

Page 108: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-99SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Copying the sensor touch position for the positive side into that for the negative side

Gauging value data for displayingCalculating the C-axis zero offset compensated value

Chamfering VS07 by 360 degrees

Passing the compensated value into a different coordinate system

Compensated value data for displaying

Calculating a new C-axis zero offset value

Chamfering VS07 by 360 degrees

A new C-axis zero offset

Previous M15 command specified?

CCW rotation of the C-axis specified

CW rotation of the C-axis specified

LE61497R0100700420019

Page 109: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-100SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Groove index cycle in the Z-axis direction

Restart?

C-axis for the 1st spindle connected?

C-axis for the 2nd spindle connected?

Alarm A (user reserve code)

Machine lock OFF?

Storing the previous C-axis rotation command

Target point for the groove index cycle

Groove index cycle command

Z-axis target point

Groove not found after at least five times of searching

Alarm B (user reserve code)

Selecting the C-axis rotating direction specified before groove index cycle

Any groove found?Calculating the target point for the 2nd groove index cycle

3rd time

4th time

5th time

Counter increment

C-axis gauging cycle target pointInitializing counter

Target point for the groove index cycle

Chamfering VS07 by 360 degrees

LE61497R0100700420011

Page 110: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-101SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Groove index cycle in the X-axis direction

Restart?

C-axis for the 1st spindle connected?

C-axis for the 2nd spindle connected?

Machine lock OFF?

Storing the previous C-axis rotation command

Alarm A (user reserve code)

Target point for the groove index cycle

C-axis gauging cycle target point

Groove index cycle command

X-axis target point

Selecting the C-axis rotating direction specified before groove index cycle

Groove not found after at least five times of searching

Alarm B (user reserve code)Chamfering VS07 by 360 degrees

3rd time

Calculating the target point for the 2nd groove index cycle

Any groove found?

4th time

5th time

Target point for the groove index cycleCounter increment

LE61497R0100700420012

Page 111: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-102SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

The angle data set for VS07 is converted in a value between 0 and 359.999°

ORDOFNC1

VS07<VRUND

NO

NO

NO

NO

YES

YES

YES

YESVS07=VS07-VRUND

VS07>=VRUND

RTS

NC2

VS07>=0

VS07=VS07+VRUND

VS07<0

LE61497R0100700420013

Page 112: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-103SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Calculation of C-axis feedrate F C-axis feedrate F is calculated from the X-axis value so that the surface speed at the gauging position will be the parameter-set feedrate.

In units of inch?

Decimal point in units of mm?

Decimal point command in units of 10 mm?

Decimal point in units of inch?

Multiplying by 500mm/π

No Y-axis gauging specified?

Y-axis mode ON?

Feedrate (F)Parameter feedrate mm/min

Actual X-axis position data mm (in diameter)

Actual X-axis position data

Set value

LE61497R0100700420014

Page 113: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-104SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Compensation in a different coordinate system (Correcting the offset data at the other turret in the same spindle mode)

Compensation in a different coordinate system (Correcting the offset data in a different spindle mode)

Program List

OZOFD (Keyway gauging (both sides))

NOEX VS02=0GOTO NA1

OZOFC (Keyway gauging (one side))

NOEX VS02=1NA1 IF [VRSTT NE 0] NA20IF [VCAC1 NE 0] NA1BIF [VCAC2 NE 0] NA1BIF [VMLCK EQ 0] NA19NA1B NOEX VS11=VCDIR+113 VS15=VSKFBCALL OFCALVS08=VS15IF APPS NA2GOTO NA3NA2 NOEX VS15=VSKFACALL OFCALVS09=VS15NA3 IF [VS02 EQ 1] NA4GOTO NA5NA4 IF [VS11 EQ 128] NA10NA5 M16

OZOFG

VS07=VZOFC+VMDT[10]

ORDOF

VZOFC=VS07

RTS

Setting the C-axis zero offset data

Calculating the new C-axis zero offset value from the received measured data

LE61497R0100700420015

OZOFH

VS07=VZOFC-VMDT[10]

ORDOF

VZOFC=VS07

RTS

Setting the C-axis zero offset data

Calculating the new C-axis zero offset value from the received measured data

LE61497R0100700420016

Page 114: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-105SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NOEX VS07=VSIOC-CMW/2CALL ORDOFIF APPS NA6GOTO NA8NA6 G30 C=VS07 CD=CMW/2 CL=CMW/2 F=VS09NOEX VS07=VSKPC[1]-VZOFC-VZSHCCALL ORDOFNOEX VS10=VS07 VS07=VSIOC-VS10CALL ORDOFIF [VS07 GE APPS] NA7M15NOEX VS07=VS10+APPSCALL ORDOFG0 C=VS07M16NA7 G30 C=VS10 CD=APPS CL=CMW/2 F=VS08GOTO NA9NA8 G30 C=VS07 CD=CMW/2 CL=CMW/2 F=VS08NA9 NOEX VS10=VSKPC[1]-VZOFC-VZSHCNOEX VS13=ATAN[VSNTU/VSIOX*2] VS07=VS10-VS13CALL ORDOFNOEX VS13=VS07IF [VS02 EQ 1] NA16NA10 M15NOEX VS07=VSIOC+CMW/2CALL ORDOFIF APPS NA11GOTO NA13NA11 G30 C=VS07 CD=CMW/2 CL=CMW/2 F=VS09NOEX VS07=VSKPC[1]-VZOFC-VZSHCCALL ORDOFNOEX VS10=VS07 VS07=VS10-VSIOCCALL ORDOFIF [VS07 GE APPS] NA12M16NOEX VS07=VS10-APPSCALL ORDOFG0 C=VS07M15NA12 G30 C=VS10 CD=APPS CL=CMW/2 F=VS08GOTO NA14NA13 G30 C=VS07 CD=CMW/2 CL=CMW/2 F=VS08NA14 NOEX VS10=VSKPC[1]-VZOFC-VZSHCNOEX VS14=ATAN[VSNWD/VSIOX*2] VS07=VS10-VS14CALL ORDOFNOEX VS14=VS07IF [VS02 EQ 1] NA15NOEX VS07=[VS14+VS13]/2IF [VS14 GE VS13] NA141VS07=VS07+VRUND/2NA141 CALL ORDOFNA15 NOEX VS14=VS07GOTO NA17NA16 NOEX VS14=VS13NA17 NOEX VIMDX[9]=VS14 VS07=VS14-COFCALL ORDOF

Page 115: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-106SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NOEX VIMDX[10]=VS07 VMDT[10]=VS07 VS07=VZOFC+VS07CALL ORDOFNOEX VZOFC=VS07IF [VS11 EQ 128] NA18M16GOTO NA20NA18 M15GOTO NA20NA19 NOEX VDOUT[993]=102NA20 RTS

OZOFF (Key gauging (both sides))

NOEX VS02=0GOTO NA1

OZOFE (Key gauging (one side))

NOEX VS02=1NA1 IF [VRSTT NE 0] NA20IF [VCAC1 NE 0] NA1BIF [VCAC2 NE 0] NA1BIF [VMLCK EQ 0] NA19NA1B NOEX VS11=VCDIR+113 VS15=VSKFBCALL OFCALVS08=VS15IF APPS NA2GOTO NA3NA2 NOEX VS15=VSKFACALL OFCALVS09=VS15NA3 IF [VS02 EQ 1] NA4GOTO NA5NA4 IF [VS11 NE 128] NA5M15NOEX VS07=VSIOC+VRUND/2CALL ORDOFIF APPS NA111GOTO NA113NA111 G30 C=VS07 CD=VRUND/2 CL=VRUND/360000*179000 F=VS09NOEX VS07=VSKPC[1]-VZOFC-VZSHCCALL ORDOFNOEX VS10=VS07 VS07=VS10-VSIOCCALL ORDOFIF [VS07 GE APPS] NA112M16NOEX VS07=VS10-APPSCALL ORDOFG0 C=VS07M15NA112 G30 C=VS10 CD=APPS CL=VRUND/360000*179000 F=VS08GOTO NA114NA113 G30 C=VS07 CD=VRUND/2 CL=VRUND/360000*179000 F=VS08NA114 GOTO NA14NA5 M16NOEX VS07=VSIOC-VRUND/2CALL ORDOFIF APPS NA6

Page 116: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-107SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

GOTO NA8NA6 G30 C=VS07 CD=VRUND/2 CL=VRUND/360000*179000 F=VS09NOEX VS07=VSKPC[1]-VZOFC-VZSHCCALL ORDOFNOEX VS10=VS07 VS07=VSIOC-VS10CALL ORDOFIF [VS07 GE APPS] NA7M15NOEX VS07=VS10+APPSCALL ORDOFG0 C=VS07M16NA7 G30 C=VS10 CD=APPS CL=CKW F=VS08GOTO NA9NA8 G30 C=VS07 CD=VRUND/2 CL=VRUND/360000*179000 F=VS08NA9 NOEX VS10=VSKPC[1]-VZOFC-VZSHCNOEX VS13=ATAN[VSNTU/VSIOX*2] VS07=VS10-VS13CALL ORDOFNOEX VS13=VS07IF [VS02 EQ 1] NA16NA10 M15NOEX VS14=ATAN[VSNWD/VSIOX*2]NOEX VS07=VS07-CKW-APP+VS14CALL ORDOFIF RTX NA101RTX=0NA101 NOEX VS16=VSIOXG00 X=VS16+RTXC=VS07X=VS16NOEX VS07=VS07+APPCALL ORDOFIF APPS NA11GOTO NA13NA11 G30 C=VS07 CD=APP CL=CKW F=VS09NOEX VS07=VSKPC[1]-VZOFC-VZSHCCALL ORDOFNOEX VS10=VS07 VS07=VS10-VSIOCCALL ORDOFIF [VS07 GE APPS] NA12M16NOEX VS07=VS10-APPSCALL ORDOFG0 C=VS07M15NA12 G30 C=VS10 CD=APPS CL=CKW F=VS08GOTO NA14NA13 G30 C=VS07 CD=APP CL=CKW F=VS08NA14 NOEX VS10=VSKPC[1]-VZOFC-VZSHCNOEX VS14=ATAN[VSNWD/VSIOX*2] VS07=VS10-VS14CALL ORDOFNOEX VS14=VS07IF [VS02 EQ 1] NA15NOEX VS07=[VS14+VS13]/2IF [VS14 LT VS13] NA141 (GE)VS07=VS07+VRUND/2

Page 117: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-108SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NA141 CALL ORDOFNA15 NOEX VS14=VS07GOTO NA17NA16 NOEX VS14=VS13NA17 NOEX VIMDX[9]=VS14 VS07=VS14-COFCALL ORDOFNOEX VIMDX[10]=VS07 VMDT[10]=VS07 VS07=VZOFC+VS07CALL ORDOFNOEX VZOFC=VS07IF [VS11 EQ 128] NA18M16GOTO NA20NA18 M15GOTO NA20NA19 NOEX VDOUT[993]=102NA20 RTS

OCPFI (Groove index cycle in the Z-axis direction)

IF [VRSTT NE 0] NB14IF [VCAC1 NE 0] NB2AIF [VCAC2 NE 0] NB2AIF [VMLCK EQ 0] NB12NB2A NOEX VS11=VCDIR+113G0 C=COFNOEX VS04=VSIOC VS05=1NB1 G30 Z=MSP D=APP L=IMP F=VSKFB AN=1IF [VCPFI EQ 128] NB10IF [VS05 EQ 1] NB2GOTO NB3NB2 NOEX VS07=VS04-CFWM16GOTO NB9NB3 IF [VS05 EQ 2] NB4GOTO NB5NB4 NOEX VS07=VS04+CFWM15GOTO NB9NB5 IF [VS05 EQ 3] NB6GOTO NB7NB6 NOEX VS07=VS04+CFW*2GOTO NB9NB7 IF [VS05 EQ 4] NB8GOTO NB13NB8 NOEX VS07=VS04-CFW*2M16NB9 CALL ORDOFG0 C=VS07NOEX VS05=VS05+1GOTO NB1NB10 G0 Z=VSIOZIF [VS11 EQ 128] NB11M16GOTO NB14NB11 M15GOTO NB14NB12 NOEX VDOUT[993]=102

Page 118: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-109SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

GOTO NB14NB13 NOEX VDOUT[992]=3006NB14 RTS

OCPFX (Groove index cycle in the X-axis direction)

IF [VRSTT NE 0] NE14IF [VCAC1 NE 0] NE1BIF [VCAC2 NE 0] NE1BIF [VMLCK EQ 0] NE12NE1B NOEX VS11=VCDIR+113G0 C=COFNOEX VS04=VSIOC VS05=1NE1 G30 X=MSP D=APP L=IMP F=VSKFB AN=1IF [VCPFI EQ 128] NE10IF [VS05 EQ 1] NE2GOTO NE3NE2 NOEX VS07=VS04-CFWM16GOTO NE9NE3 IF [VS05 EQ 2] NE4GOTO NE5NE4 NOEX VS07=VS04+CFWM15GOTO NE9NE5 IF [VS05 EQ 3] NE6GOTO NE7NE6 NOEX VS07=VS04+CFW*2GOTO NE9NE7 IF [VS05 EQ 4] NE8GOTO NE13NE8 NOEX VS07=VS04-CFW*2M16NE9 CALL ORDOFG0 C=VS07NOEX VS05=VS05+1GOTO NE1NE10 G0 X=VSIOXIF [VS11 EQ 128] NE11M16GOTO NE14NE11 M15GOTO NE14NE12 NOEX VDOUT[993]=102GOTO NE14NE13 NOEX VDOUT[992]=3006NE14 RTS

ORDOF (Conversion of angle data into a value between 0 and 359.999)

NC1 IF [VS07 LT VRUND] NC2NOEX VS07=VS07-VRUNDIF [VS07 GE VRUND] NC1GOTO NC3NC2 IF [VS07 GE 0] NC3NOEX VS07=VS07+VRUNDIF [VS07 LT 0] NC2NC3 RTS

Page 119: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-110SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OFCAL (Calculation of C-axis feed rate F)

IF [[VUNIT AND 1]EQ 1] ND3IF [[VUNIT AND 2]EQ 2] ND2IF [[VUNIT AND 4]EQ 4] ND1NOEX VS15=VS15*1000GOTO ND2ND1 NOEX VS15=VS15*100ND2 NOEX VS15=VS15*159.155GOTO ND5ND3 IF [[VUNIT AND 2]EQ 2] ND4NOEX VS15=VS15*10000ND4 NOEX VS15=VS15*6.2659ND5 NOEX VS15=VS15/VSIOXIF [[VDIN[1257]AND 32] NE 32] ND6IF [VYMOD EQ 0] ND6NOEX VS15=VS15/2ND6 RTS

OZOFG (Compensation in a different coordinate system (Correcting the offset data at the other turret in the same spindle mode))

NOEX VS07=VZOFC+VMDT[10]CALL ORDOFNOEX VZOFC=VS07RTS

OZOFH (Compensation in a different coordinate system (Correcting the offset data in a different spindle mode))

NOEX VS07=VZOFC-VMDT[10]CALL ORDOFNOEX VZOFC=VS07RTS

Page 120: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-111SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-5. Y-axis Gauging Function

1-5-1. General Description of MSB

This subsection explains a list, a flow chart, a variable table, etc. used for Y-axis gauging function by taking the following file as an example.

LMSN312A. MSB

The name of gauging control software is indicated as described below.

The MSB largely differs from the other control software in the contents.The other control software controls inputs such as the signals sent from the machine, user's commands, and the commands from a part program created by the user.However, the MSB is created in the same format as that of the part program, and so it can be considered as the control software that implements gauging cycle instead of the user.

1-5-2. Variable Tables

The variables currently used in the gauging MSB are explained below.

(1) Common variables (These are different from the common variables V1 to V200 used in parameter setting.)

(2) System variables

LMS*????.MSB

*: Contents of each gauging software

????: Version of each gauging software

Page 121: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-112SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Common Variables (VS01 to VS32)

The common variables are not displayed on the screen unlike the common variables (V1 to V200) used in parameter setting.These common variables are used for the gauging cycles other than those done by Y-axis gauging function. Therefore, the variable data is eliminated or changed each time the gauging cycle is executed.

Variable Name

Used asRemarks

Variable Name

Used asRemarks

VS01Tool offset number, cutter radius compensation number

VS17

VS02 Target value VS18Absolute value of the gauging result

VS03 Gauging (measured value) VS19 Sensor input number

VS04The last tool offset value or cutter radius compensation value

VS20

VS05Corrected tool offset value or cutter radius compensation value

VS21Measured width or center position of a key or keyway Measured diameter

VS06 Gauging result VS22Measured value on positive Y-axis side Measured value of upper diameter

VS07 VS23 Tool number

VS08 Tool nose, tool number VS24Key or keyway gauging judgment flag (0: Key gauging, 1: Keyway gauging)

VS09 Saddle B readout judgment flag VS25 NG double-contact flag

VS10 Saddle B readout judgment flag VS26

VS11Absolute value of the compensation amount

VS27Gauging axis judgment (2: Y-axis gauging cycle)

VS12 Gauging by approach from side VS28

VS13 Y-axis gauging cycle number VS29 Target point

VS14Gauging direction in the Y-axis gauging cycle

VS30 Result of judgment

VS15 Y-axis gauging cycle start point VS31Measured value Measured value on negative Y-axis side Measured lower diameter

VS16 VS32 Compensation value

Page 122: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-113SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables

These system variables are used for gauging cycle other than the Y-axis gauging specification and the data are deleted and changed every time the gauging cycle is executed.Refer the system variables to the programming manual.

Variable Name Contents

VMDT [1] Zero compensation value

VMDT [2] Target value

VMDT [3] Gauging result

VMDT [4] Judgment

VMDT [5] Compensation value

VMDT [6] Flag of the control equipped with the tool life management function (0: life not exist, 1: life exist)

VMDT [7] +Y side gauging value/upper diameter gauging value

VMDT [8] -Y side gauging value/lower diameter gauging value

VMDT [9] Measured width or center position of a key or keyway Measured diameter

VRSTT Flag of sequence return restart

VMLCK Flag of machine locking

VPOCH Designates cutter compensation system

VIMDX In-machine gauging data (X-axis for displaying in a screen)

VIMDY In-machine gauging data (YI-axis for displaying in a screen)

VIMDZ In-machine gauging data (Z-axis for displaying in a screen)

VDNRX Nose R compensation value for X-axis

VDNRY Nose R compensation value for YI-axis

VDNRZ Nose R compensation value for Z-axis

VDTFX Tool offset X-axis

VDTFY Tool offset YI-axis

VDTFZ Too offset Z-axis

VTLCA Real loss of tool life

VDETN Presently used tool offset number

VSKPY YI-axis skip position (machine coordinate)

VZOFY Zero offset of YI-axis

VZSHY Shift value of YI-axis zero

VETFY Current tool offset value of YI-axis

VMIRY Direction match flag of Y-axis coordinate system (0: matched)

VSIOX X-axis designated target value (machine coordinate)

VSIOY YI-axis designated target value (machine coordinate)

VSIOZ Z-axis designated target value (machine coordinate)

Page 123: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-114SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-5-3. Program

Sub-programs

Flow Chart

The flowcharts of the programs used in the Y-axis gauging are shown the following pages.

Name Function

OWMYA Workpiece gauging in Y-axis direction (tool offset value compensation)

OWMYR Workpiece gauging in Y-axis direction (cutter radius compensation value compensation)

OWYM Work gauging data judgment cycle

OWXY Workpiece gauging in Y-axis direction, gauging data handling

OKIYR Keyway width compensation

OKIYA Keyway position compensation

OKOYR Key width compensation

OKOYA Key position compensation

OKWTM Keyway, Key gauging data judgment

OSKPY Gauging cycle of Y-axis

OSPCY Conversion of measured Y-axis position into program coordinate

ODTMY Diameter gauging data judgment by Y-axis gauging

ODOAY OD gauging by Y-axis movements

ODIAY ID gauging by Y-axis movements

OZORY Y-axis zero offset

OJUDY Gauging result judgment cycle

Page 124: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-115SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWMYA OWMYR

VS13=0 VS13=1

ND1

VS27=2M155

VRSTT=0N

N

N

Y

Y

Y

VYMOD≠0

ND1A

VDOUT[9]=0

VS25=0VS29=MSP

VS19=1

VS09=0

OTDSL

1A

2A

VMDT[2]=MSPVMDT[3]VS31VMDT[4]VS30

OWYM

1A

2B

ND3

VMLCK=0

OWMYA,OWMYR 1/2

VDOUT[992]=1400

1) Work Gauging in Y Direction (for Correcting Tool Offset Values) OWNYA Work Gauging in Y Direction (for Correcting Cutter Radius Compensation Values) OWMYR

Specify gauging result judgment dataAir blow ON

Specify a gauging cycle

Sequence restart?

Y-axis mode?

Judgment lamp OFF

Flag for NG double-touch gaugingSet the gauging target point

Set the sensor number

Target pointMeasured valueJudgment

Judge the gauging cycle data

Machine lock? Alarm B User reserve code

Determine whether or not the gauging result is used for the tool life management.

LE61497R0100700490001

Page 125: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-116SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWXY

2A

VIMDX[4]=VS31

VMDT[5]=VS32

VIMDX[6]=-VMDT[5]

VS01=0 Y

Y

Y

N

N

N

VS13=1

VS04=VDNRY[VS01]

VS14=0

V32=-V32

ND2B

ND3

M154

RTS

ND2

VS04=VDTFY[VS01]

ND2AVS32=0VS04=0

2B

OWMYA,OWMYR 2/2VS13=1

VIMDY[4]=VS31ND1D

ND1E

YN

VS13=1YN

VIMDY[6]=-VMDT[5]ND2D

Compensation amount

Air blow OFF

Work gauging in Y direction (cutter radius compensation)?

Y gauging by approaching from negative side?

If the compensation number is 0, set "0" at VS32 because no compensation is executed.

LE61497R0100700490002

Page 126: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-117SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWYM

RTS

OSKPY

VS32=VS31-VS29

VS11=ABS[VS32]

VIMDX[12]=VS11

VIMDZ[12]=DNG

VIMDZ[12]=DOK

APPS

VS25=0VS32>0

VS32>0

VDOUT[1]=1VS30=2

VDOUT[5]=1VS30=-2

VDOUT[2]=1VS30=1

VDOUT[4]=1VS30=-1

VDOUT[3]=1VS30=0

1A

NH1

Call subprogram for gauging in Y-axis direction

NG double-touch gauging

2) Work Gauging Judgment Cycle OWYM

NH3A

NH3B

VIMDX[12]>VIMDZ[12]

VIMDX[12]>VIMDZ[12]

± NG?

N

N

NN

Y Double-touch?Y

YY

Y

Y

N NG double-touch?

NH4

N

+ NG NH5 - NG

NH9

NH6

± OK?

NH7

+ OK NH8 - OK OK

OWYM 1/1

1A

VS25=1

LE61497R0100700490003

Page 127: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-118SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWXY

VS18=1

VS18=2

VS05=VS04VMDT[5]=0

VS27=2

VMDT[6]=0

TRCT

TRCT=1

VS13=1,2,4

VDTCA[VS08]=VDTCA[VS08]+ABS[VMDT[5]]

RTS

1A

VDIN[21]=1VMDT[6]=0

VDTNG[VS08]=1VS06 0

M154 M154

VDOUT[992]=1001+VS27*2 VDOUT[992]=1000+VS27*2

1A

VS02=VMDT[2]VS03=VMDT[3]VS06=VMDT[4]

VS1B=ABS[VS06]

N

NN

N

N

Y

Y

Y

NYE3

Y

Y

NYE1

NYE2-NG+NG

NYE3

NYE4

NYE3B

NYE5

NYE6

NYE3AN

N

N

N

N

Y

Y

Y

Y

YVDTFY[VS01]= VDTFY[VS01]-VMDT[5]VS05=VDTFY[VS01]

VDNRY[VS01]= VDNRY[VS01]-VMDT[5]VS05=VDNRY[VS01]

VDTWX[VS01]= VDTWX[VS01]-VMDT[5]VS05=VDTWX[VS01]

VDTFX[VS01]= VDTFX[VS01]-VMDT[5]VS05=VDTFX[VS01]

OWXY 1/1

Target valueMeasured valueJudgment resultAbsolute value of judgment result

NG ignored?

± NG processing

OK processing

Alarm B

Y-axis gauging?

TRCT command specified?

Omit calculation of wear amount?

Tool life management used?

Key or keyway width gauging?

Cutter radius compensation

3) Work Gauging in Y Direction: Gauging Data Processing OWXY

The compensation amount is cleared to 0 when judgment result is ± NG or OK. Tool life management

function used?

NG flag is set at the tool life management table without any alarm.

Y-axis tool offset

± OK processing

TWCD

TWCD=0

VDIN[1255]AND 32 =32

Y

N

Y

N

Y

N

LE61497R0100700490004

Page 128: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-119SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

4) Keyway Width Compensation OKIYRKeyway Position Compensation OKIYAKey Width Compensation OKOYRKey Position Compensation OKOYA

OKIYR OKIYA OKOYR OKOYA

VS13=2VS24=1

VS27=2M155

VS13=3VS24=1

VS13=4VS24=0

VS13=5VS24=0

XP2

ZP2

VRSTT=0

ZP2

VS12=0 VS12=1 VDOUT[992]=1402

VDOUT[992]=1400

VYMOD≠0

VMLCK=0

TDSN=VDETN

VDOUT[9]=0

VS25=0

VS19=1

VS09=0

OTNSL

OKWTM

2A

2B

OKIYR,OKIYA,OKOYR,OKOYA 1/2

NS1

NS1B

NS1C

NS1D

NS1E NS2

NS1A

N

N

N

N

N

NY

Y

Y

Y

Specify key or keyway gauging cycle

Alarm B User reserve code

Sequence restart?

Y-axis mode?

Machine lock? Alarm B User reserve code

Store the too offset number of the current sensor

Judgment lamp OFF

Flag for NG double-touch gauging

Set the sensor number

A-saddle side

Judge the gauging cycle data

Alarm occurs if both XP2 and ZP2 are specified or neither of them is specified.

Specify the gauging direction between front approach and side approachSpecify the gauging

judgment dataAir blow ON

Determine whether or not the gauging result is used for the tool life managementAfter checking ATG and AOG, the gauging system sets the tool number and the tool offset/cutter radius compensation number.

Y

Y

LE61497R0100700490005

Page 129: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-120SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

VS13=3.5

2C

2C

TD=TDSN

VIMDY[6]=-VMDT[5]

GOO X=XP1 Y=YSP Z=ZP1

VIMDY[4]=VS21VIMDY[7]=VS22VIMDY[8]=VS31

OWXY

RTS

2B

NS2

M154

N

N

Y

Y

NS1F

NS1G

VS04=VDTFY[VS01] VS04=VDNRY[VS01]VS32=VS32/2

VS13=2

VS32=-VS32

VMDT[2]=KH/2VMDT[3]=VS21VMDT[4]=VS30VMDT[5]=VS32VMDT[7]=VS22VMDT[8]=VS31VMDT[9]=VS21

OKIYR,OKIYA,OKOYR,OKOYA 2/2

Target pointMeasured valueJudgmentCompensation amountMeasured upper radiusMeasured lower radiusMeasured key/keyway width or center position

Key or keyway position compensation?

Air blow OFF

Keyway width compensation?

Set the previous tool offset or cutter radius compensation at VS04

Return to the gauging start position

For key or keyway width compensation, measured data is fed back to the cutter radius compensation value, and so the compensation amount is halved.

LE61497R0100700490006

Page 130: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-121SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OKWTM

VS24=0

VS12=1

VS24=0

VS12=1

OSKPY

OSKPY

2A

1A

G00 X=XP1 Z=ZP1 Y=YSP

NUON

N

Y

Y

NU1G00 X=XP1 Z=ZP1 Y=YSP+DYP

TD=TDF2

TD=TDF1

TD=TDF2

TD=TDF1

G00 X=XP1 Z=ZP1 Y=-[VDTFY[TDF1]-VDTFY[TDF2]]/2+YSP

NU2AG00 Z=ZP2

NU2

G00 X=XP2

NU2B

VS29=YSP+[KH/2]

VS22=VS31

YN

N

NU3

NU4

NU3A

Y

G00 X=XP1Y=YSP-DYPX=XP2

G00 Z=ZP1Y=YSP-DYPZ=ZP2

VS29=YSP-[KH/2]

OKWTM 1/2

VS25=1

G00 Y=[VTDFY[TDF1]-VTDFY[TDF2]]/2+YSP

5) Judgment of Keyway/Key Gauging Data OKWTM

Key gauging?

Positioning for gauging on +Y side

Set the target position on +Y side

Execute Y gauging

Store +Y side gauging result

Positioning for gauging on -Y side

Change the sensor offset

Gauging by front approach?

Set the target position on -Y side

Execute Y gauging

Gauging by front approach?

Bring the sensor center to the middle of keyway

Key gauging?

LE61497R0100700490007

Page 131: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-122SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

1A

VS13=3,5

VS24=0

VS32>0

APPS

VS25=0

VS32>0

G00 Y=YSP

TD=TDF2

TD=TDF1

G00 Y=-[VDTFY[TDF1]-VDTFY[TDF2]]/2+YSP

VS11=ABS[VS32]

VIMDX[T2]=VS11

VIMDZ[12]=DNG

VIMDZ[12]=DOG

VDOUT[1]=1VS30=2

VDOUT[5]=1VS30=-2

VDOUT[2]=1VS30=1

VDOUT[4]=1VS30=-1

VDOUT[3]=1VS30=0

VIMDX[12]>VIMDZ[12]

VIMDX[12]>VIMDZ[12]

G00 X=XP1 Z=ZP1

VS21=VS22-VS31VS29=KHVS32=VS21-VS29

VS21=[VS22+VS31]/2VS29=YSPVS32=VS21-VS29

RTS

Y

Y

Y

Y

Y

Y

Y

Y

N

N

N

N

N

N

N

NU4B

NU4A

NU5

NU9

NU7

NU8 NU10 NU11

NU12

NU6

+NG -NG +OK -OK OK

N

Key/keyway position compensation?

Calculate key/keyway width Calculate key/keyway center position

Key gauging?

Positioning for gauging on +Y side

Change offset in preparation for NG double-touch

Double-touch?

NG double-touch?

Difference between measured width and specified width

Difference between measured center and specified center

±OK?

±NG?

LE61497R0100700490008

Page 132: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-123SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OSKPY

RTS

OSPCY

RTS

VS29=≤VS15

APPSNPY3A

NPY3

NPY2

VS15=VSIOY

GOO Y=VS15

VS14=1VS14=0

G30 Y=VS29 D=APP L=IMP F=VSKFA

OSPCY

OT1ME

OSPCY

OSPCY

G30 Y=VS29 D=APP L=IMP F=VSKFB

Y=VS31 D=APPS L=IMP F=VSKFB

NPY1

NPY4

NY

NY

6) Y-axis Gauging Cycle OSKPY (Input)VS29: Gauging target positionAPPS: Double-touch command (relative value of

1st gauging point and approach point 2)

OSLPY,OSPCY 1/1

Set Y-axis gauging direction

APPS command specified?

Double-touch 1st gauging

Double-touch 2nd gauging

(Output)VS31: Measured value (program coordinate)VS14: Y-axis gauging direction

VZOFY:YI-axis zero offsetVZSHY:YI-axis zero offsetVETFY:Offset value of currently used

7) Conversion of Measured Y-axis Position into Program Coordinate OSPCY

VMIRY:becomes 0 when the directions of YI-axis program coordinate system are the same with those of machine coordinate system, and becomes 1 when they do not match.

VS31=VSKPY[VS19]-VZOFY-VZSHY-VETFY

GOO Y=VS29-APP GOO Y=VS29+APP

Store the Y-axis actual position

Approach APP in front of the gauging target position by G00

Convert measured value (machine coordinate) into program coordinate

Gauging

Convert measured value (machine coordinate) into program coordinate

Return to gauging start position

Convert measured Y-axis position VSKPY [VS19] into program coordinate and set at VS31

LE61497R0100700490009

Page 133: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-124SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

VS25=1

ODTMY

ODTMY 1/3

1A

VS24=0

G00 X=XP1 Z=ZP1 G00 X=XP1 Z=ZP1

G138

G00 Y=YP1

Z=ZP2

VS24=0

G00 Z=ZP2 Y=-[VDTFY[TDF1]-VDTFY[TDF2]]/2

VS12=1

G00 Y=YP1

VS29=MSP/2

X=XP2

OSKPY

VS22=VS31

2A

Y

Y

Y

N

N

N

N Y B 1

N Y B 2

N Y B 3

N Y B 4

N Y B 5

N Y B 6

TD=TDF2 TD=TDF1

8) Judgment of Diameter Measured by Y-axis Gauging ODTMY

OD gauging?

Positioning to the gauging cycle start point

OD gauging?

Y-axis mode ON

OD gauging by approach to the workpiece front

ID gauging always done by approach to the workpiece front

OD gauging by approach to a side of the workpiece

Setting the positive Y-axis target position

Starting Y-axis gauging

Storing positive Y-axis gauging result

Gauging by approach to the workpiece front

LE61497R0100700490010

Page 134: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-125SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

VS24=0

VS12=1

ODTMY 2/3

N

NY

Y

Y=-YP1 T=TOF1

G00 Z=ZP1

Z=ZP2

TD=TDF2Y=-YP1 T=TOF1

G00 X=XP1/2

VS29=-MSP/2

X=XP2

OSKPY

VS21=VS22-VS31

Y=0

G00 X=XP1/2

VS24=0

Y=0

G00 Z=ZP1

3A

N

Y

N Y B 7

N Y B 8

N Y B 9

N Y B 1 0

N Y B 1 2

VS12=1

N Y B 1 1

YN

Y=0

G00 Z=ZP1

TD=TDF1TD=TDF2

TD=TDF1

OD gauging?

Gauging by approach to the workpiece front?

OD gauging by approach to a side of the workpiece OD gauging by approach to the workpiece front

ID gauging always done by approach to the workpiece front

Setting the negative Y-axis target position

Starting Y-axis gauging

Measured value

OD gauging?

Changing sensor offset

Changing sensor offset

OD gauging by approach to a side of the workpiece

Gauging by approach to the workpiece front?

Gauging by approach to the workpiece front

Changing sensor offset

ID gauging always done by approach to the workpiece front

LE61497R0100700490011

Page 135: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-126SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

3A

ODTMY 3/3

VS32=VS21-MSP

VS11=ABS[VS32]

VIMDZ[12]=DNG

VIMDX[12]=VS11

VIMDX[12] > VIMDZ[12]

VS32 > 0

VS25=0

APPS

VIMDX[12] > VIMDZ[12]

VIMDZ[12]=DOK

VS32 > 0

1A

VDOUT[1]=1VS30=2

VDOUT[3]=1VS30=0

VDOUT[4]=1VS30=-1

VDOUT[2]=1VS30=1

VDOUT[5]=1VS30=-2

G136

RTS

Y

Y Y

Y

Y

Y

N

N

N

N

N

N

O K+ O K - O K+ N G - N G

N Y B 1 2

N Y B 1 3

N Y B 1 4

N Y B 1 5

N Y B 1 6 N Y B 1 7

N Y B 1 8

±OK?

Double touch?

NG double touch?

Y-axis mode OFF

±NG?

LE61497R0100700490012

Page 136: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-127SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

ODIAY

VS12=1

VS24=1

VDOUT[992]=1402

VDOUT[992]=1401

2C

ODOAY

VS24=0

VS27=0M155

XP2

ZP2

VS12=0

VRSTT=0

VYMOD=0

XSTP=VSIOXZSTP=VSIOZTDSN=VEDTN

VDOUT[9]=0VS25=0VS19=1

VS09=0

2A

ZP2

VS12=1

9) OD Gauging by Y-axis Movements ODOAY ID Gauging by Y-axis Movements ODIAY

ODOAY 1/2

ID gaugingOD gauging

ID gauging always done by approach to the workpiece front

Gauging by approach to the workpiece front

Gauging by approach to a side of the workpiece

Alarm B User reserve code

Alarm B User reserve code

XP2 command specified? ZP2 command issued?

ZP2 command issued?

Though the diameter is measured in Y-axis direction, the judgment of measured data also applies to the X-axis.Air blow ON

Not sequence restart?

Y-axis control mode?

Storing start position and machining command No.

Judgment lamp OFFNG double touch flagSetting the sensor No.

Turret A side

NYA2

NYA3 NYA1

NYA4

NYA5

N

Y

N

Y

N

Y

N

Y

N

Y

NYA9LE61497R0100700490013

Page 137: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-128SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2C

VDIN[1255]AND 64=64

2A

OTDSL

ODTMY

VMDT[2]=MSPVMDT[3]=VS21VMDT[4]=VS30VMDT[5]=VS32VMDT[7]=VS22VMDT[8]=VS31VMDT[9]=VS21

VIMDX[4]=VS21VIMDX[7]=VS22VIMDX[8]=VS31

VS04=VDTFX[VS01]

APO

BPO=VPOCHVPOCH=APO

OWXY

2B

2B

VIMDX[6]=-VMDT[5]

PRNT 11

G00 X=XSTP Z=ZSTP

M154

RTS

ODOAY 2/2

Y

Y

N

N

N Y A 6

N Y A 7

N Y A 9

TD=TDSN

Deciding tool No. and tool offset No.

Judgment of gauging cycle data

Target pointMeasured valueJudgmentCompensation amountMeasured upper diameter valueMeasured lower diameter valueMeasured diameter

Measured diameter (CRT display)Measured upper diameter (CRT display)Measured lower diameter (CRT display)Tool offset (for printing)

Tool offset data sets expanded?

Position specified?

Gauging data processing

Variation in tool offset data (CRT display)

Print command

Returning the axis to the positions located before gauging

Air blow OFF

LE61497R0100700490014

Page 138: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-129SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OZORY

VRSTT=0

DNG

VS03>0 DOK

VYMOD≠0

VMLCK=0

OSKPY

VIMDX[12]>VIMDZ[12]

VIMDX[12]>VIMDZ[12]

RTS

1A

1A

VDOUT[992]=1400

VS19=1VS29=MSP

VS03=VS31-MSPVS11=ABS[VS03]VIMDX[12]=VS11VIMDY[3]=VS03

VIMDZ[12]=DNG

VDOUT[992]=3005VS03=0

VDOUT[992]=3004VS03=0

VZOFY=VZOFY+VS03

VMDT[1]=VS03

VIMDZ[12]=DOK

VS03=0

N

N

N

Y

Y

Y

NA1

N

N

N

Y

Y

NA5

NA6

NA7

NA10

NA11

N

N

Y

Y

YNA8

NA9

NA

Sequence restart?

Y-axis control mode?

Machine lock? Alarm B

Call Y-axis direction gauging process

DNG command specified?

NG?

+NG?DOK command specified?

OK?

Add compensation value to zero offset

10) Y-axis Zero Offset OZORY OZORY 1/1

LE61497R0100700490015

Page 139: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-130SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OJUDY

RTS

VIMDX[12]>VIMDZ[12]

VIMDX[12]>VIMDZ[12]

VS32>0 VS32>0

VDOUT[1]=1VS30=2

VDOUT[5]=1VS30=-2

VDOUT[2]=1VS30=1

VDOUT[4]=1VS30=-1

VS27=2VDOUT[9]=0

VS32=MRE-MSP

VS11=ABS[VS32]

VIMDX[12]=VS11

VIMDZ[12]=JNG

±NG?

Y

N

N

N

N

Y Y

Y

+NG NH5 NH8

NH7

- NG

NH9

±OK?

VIMDZ[12]=JOK

+OK - OK OK

11) Gauging Result Judgment Cycle OJUDYOJUDY 1/1

NH6

VDOUT[992]=1000+VS27*2

VDOUT[992]=1001+VS27*2

VDOUT[3]=1VS30=0

LE61497R0100700490016

Page 140: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-131SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Program List

OWMYA (Workpiece gauging in Y-axis direction (tool offset value compensation))

NOEX VS13=0GOTO ND1

OWMYR (Workpiece gauging in Y-axis direction (cutter radius compensation value compensation))

NOEX VS13=1ND1 M155VS27=2IF [VRSTT NE 0] ND3IF [VYMOD NE 0] ND1AIF [VMLCK NE 0] ND1AVDOUT[992]=1400GOTO ND3ND1A NOEX VDOUT[9]=0 VS25=0 VS29=MSP VS19=1NOEX VS09=0ND1C CALL OTDSLCALL OWYMNOEX VMDT[2]=MSP VMDT[3]=VS31 VMDT[4]=VS30IF [VS13 EQ 1] ND1DNOEX VIMDY[4]=VS31GOTO ND1END1D NOEX VIMDX[4]=VS31ND1E IF [VS01 EQ 0] ND2AIF [VS13 NE 1] ND2NOEX VS04=VDNRY[VS01]IF [VS14 NE 0] ND2BVS32=-VS32GOTO ND2BND2 VS04=VDTFY[VS01]GOTO ND2BND2A NOEX VS32=0 VS04=0ND2B NOEX VMDT[5]=VS32CALL OWXYIF [VS13 EQ 1] ND2DNOEX VIMDY[6]=-VMDT[5]GOTO ND3ND2D NOEX VIMDX[6]=-VMDT[5]ND3 M154RTS

Page 141: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-132SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

OWYM (Workpiece gauging judgment cycle)

NH1 CALL OSKPYNH3A NOEX VS32=VS31-VS29NH3B NOEX VS11=ABS[VS32]VIMDX[12]=VS11VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NH6IF APPS NH4IF [VS25 NE 0] NH4NOEX VS25=1GOTO NH1NH4 IF [VS32 LE 0] NH5NOEX VDOUT[1]=1 VS30=2GOTO NH9NH5 NOEX VDOUT[5]=1 VS30=-2GOTO NH9NH6 VIMDZ[12]=DOKIF [VIMDX[12] GT VIMDZ[12]] NH7NOEX VDOUT[3]=1 VS30=0GOTO NH9NH7 IF [VS32 LE 0] NH8NOEX VDOUT[2]=1 VS30=1GOTO NH9NH8 NOEX VDOUT[4]=1 VS30=-1NH9 RTS

OWXY (Workpiece gauging in Y-axis direction, gauging data handling)

NOEX VS02=VMDT[2] VS03=VMDT[3] VS06=VMDT[4] VS18=ABS[VS06]IF [VS18 EQ 1] NYE3NOEX VS05=VS04 VMDT[5]=0IF [VS18 NE 2] NYE6IF [VMDT[6] EQ 0] NYE1IF [VDIN[21] NE 1] NYE1NOEX VDTNG[VS08]=1GOTO NYE6NYE1 IF [VS06 LT 0] NYE2M154NOEX VDOUT[992]=1001+VS27*2GOTO NYE6NYE2 M154NOEX VDOUT[992]=1000+VS27*2GOTO NYE6NYE3 IF [VS27 EQ 2] NYE3AIF TWCP NYE30GOTO NYE35NYE30 IF [TWCP EQ 0] NYE35IF [[VDIN[1255]AND 32] NE 32] NYE35NOEX VDTWX[VS01]=VDTWX[VS01]-VMDT[5] VS05=VDTWX[VS01]GOTO NYE4NYE35 NOEX VDTFX[VS01]=VDTFX[VS01]-VMDT[5] VS05=VDTFX[VS01]GOTO NYE4NYE3A IF [VS13 EQ 1] NYE3BIF [VS13 EQ 2] NYE3BIF [VS13 EQ 4] NYE3BNOEX VDTFY[VS01]=VDTFY[VS01]-VMDT[5] VS05=VDTFY[VS01]

Page 142: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-133SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

GOTO NYE4NYE3B NOEX VDNRY[VS01]=VDNRY[VS01]-VMDT[5] VS05=VDNRY[VS01]NYE4 IF [VMDT[6] EQ 0] NYE6IF TRCT NYE5GOTO NYE6NYE5 IF [TRCT EQ 1] NYE6NOEX VDTCA[VS08]=VDTCA[VS08]+ABS[VMDT[5]]NYE6 RTS

OKIYR (Keyway width compensation)

NOEX VS13=2 VS24=1GOTO NS1

OKIYA (Keyway position compensation)

NOEX VS13=3 VS24=1GOTO NS1

OKOYR (Key width compensation)

NOEX VS13=4 VS24=0GOTO NS1

OKOYA (Key position compensation)

NOEX VS13=5 VS24=0NS1 IF XP2 NS1BIF ZP2 NS1CNS1A VDOUT[992]=1402GOTO NS2NS1B IF ZP2 NS1ANOEX VS12=0GOTO NS1DNS1C NOEX VS12=1 NS1D M155NOEX VS27=2IF [VRSTT NE 0] NS2IF [VYMOD NE 0] NS1EIF [VMLCK NE 0] NS1EVDOUT[992]=1400GOTO NS2NS1E NOEX TDSN=VDETNNOEX VDOUT[9]=0 VS25=0 VS19=1NOEX VS09=0CALL OTDSLCALL OKWTMIF [VS13 EQ 3] NS1FIF [VS13 EQ 5] NS1FNOEX VS04=VDNRY[VS01] VS32=VS32/2IF [VS13 NE 2] NS1GNOEX VS32=-VS32GOTO NS1GNS1F NOEX VS04=VDTFY[VS01]NS1G NOEX VMDT[2]=KH/2 VMDT[3]=VS21 VMDT[4]=VS30 VMDT[5]=VS32NOEX VMDT[7]=VS22 VMDT[8]=VS31 VMDT[9]=VS21NOEX VIMDY[4]=VS21 VIMDY[7]=VS22 VIMDY[8]=VS31NS1I CALL OWXYNOEX VIMDY[6]=-VMDT[5]

Page 143: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-134SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

TD=TSONG00X=XP1 Y=YSP Z=ZP1 NS2 M154RTS

OKWTM (Keyway, Key gauging data judgment)

G00X=XP1 Y=YSP Z=ZP1NU0 IF [VS24 NE 0] NU1TD=TDF2G00X=XP1 Y=YSP+DYP Z=ZP1 GOTO NU2NU1 TD=TDF1G00 Y=-[VDTFY[TDF1]-VDTFY[TDF2]]/2+YSP Z=ZP1 X=XP1 NU2 IF [VS12 EQ 1] NU2AG00X=XP2GOTO NU2BNU2A G00 Z=ZP2NU2B NOEX VS29=YSP+[KH/2]CALL OSKPYNOEX VS22=VS31IF [VS24 NE 0] NU3IF [VS12 EQ 1] NU3ATD=TDF1G00X=XP1Y=YSP-DYP X=XP2GOTO NU4NU3A G00Z=ZP1Y=YSP-DYP Z=ZP2GOTO NU4NU3 TD=TDF2G00Y=[VDTFY[TDF1]-VDTFY[TDF2]]/2+YSP NU4 NOEX VS29=YSP-[KH/2]CALL OSKPYIF [VS13 EQ 3] NU4AIF [VS13 EQ 5] NU4ANOEX VS21=VS22-VS31NOEX VS29=KHNOEX VS32=VS21-VS29GOTO NU4BNU4A NOEX VS21=[VS22+VS31]/2NOEX VS29=YSPNOEX VS32=VS21-VS29NU4B G00 X=XP1 Z=ZP1IF [VS24 NE 0] NU5TD=TDF2G00Y=YSP GOTO NU6NU5 TD=TDF1G00 Y=-[VDTFY[TDF1]-VDTFY[TDF2]]/2+YSP NU6 NOEX VS11=ABS[VS32]

Page 144: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-135SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NOEX VIMDX[12]=VS11 VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NU9IF APPS NU7IF [VS25 NE 0] NU7NOEX VS25=1GOTO NU0NU7 IF [VS32 LE 0] NU8NOEX VDOUT[1]=1 VS30=2GOTO NU12NU8 NOEX VDOUT[5]=1 VS30=-2GOTO NU12NU9 NOEX VIMDZ[12]=DOKIF [VIMDX[12] LE VIMDZ[12]] NU11IF [VS32 LE 0] NU10NOEX VDOUT[2]=1 VS30=1GOTO NU12NU10 NOEX VDOUT[4]=1 VS30=-1GOTO NU12NU11 NOEX VDOUT[3]=1 VS30=0NU12 RTS

OSKPY (Gauging cycle of Y-axis)

NOEX VS15=VSIOYNPY1 IF [VS29 LE VS15] NPY2G00Y=VS29-APPVS14=0GOTO NPY3NPY2 G00Y=VS29+APPVS14=1NPY3 IF APPS NPY3AG30Y=VS29 D=APP L=IMP F=VSKFBCALL OSPCYGOTO NPY4NPY3A G30Y=VS29 D=APP L=IMP F=VSKFACALL OSPCYCALL OT1MEY=VS31 D=APPS L=IMP F=VSKFBCALL OSPCYNPY4 G00Y=VS15RTS

OSPCY (Conversion of measured Y-axis position into program coordinate)

IF [VMIRY NE 0] NP2NOEX VS31=VSKPY[VS19]-VZOFY-VZSHY-VETFYGOTO NP3NP2 NOEX VS31=-[VSKPY[VS19]-VZOFY-VZSHY-VETFY]NP3 RTS

ODTMY (Diameter gauging data judgment by Y-axis gauging)

IF [VS24 EQ 0] NYB1TD=TDF1G00X=XP1 Z=ZP1 GOTO NYB2NYB1 TD=TDF2G00X=XP1 Z=ZP1

Page 145: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-136SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NYB2 G138NYB3 IF [VS24 EQ 0] NYB4G00Z=ZP2 Y=-[VDTFY[TDF1]-VDTFY[TDF2]]/2GOTO NYB6NYB4 IF [VS12 NE 1] NYB5G00Y=YP1G00Z=ZP2GOTO NYB6NYB5 G00Y=YP1G00X=XP2NYB6 NOEX VS29=MSP/2CALL OSKPYNOEX VS22=VS31IF [VS24 EQ 0] NYB7TD=TDF2GOTO NYB9NYB7 TD=TDF1IF [VS12 NE 1] NYB8G00Z=ZP1Y=-YP1Z=ZP2GOTO NYB9NYB8 G00X=XP1/2Y=-YP1 X=XP2NYB9 NOEX VS29=-MSP/2CALL OSKPYNOEX VS21=VS22-VS31IF [VS24 EQ 0] NYB10TD=TDF1G00Z=ZP1Y=0 GOTO NYB12NYB10 TD=TDF2IF [VS12 NE 1] NYB11G00Z=ZP1Y=0 GOTO NYB12NYB11 G00X=XP1/2Y=0 NYB12 NOEX VS32=VS21-MSP VS11=ABS[VS32]NOEX VIMDX[12]=VS11 VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NYB15IF APPS NYB13IF [VS25 NE 0] NYB13NOEX VS25=1GOTO NYB3NYB13 IF [VS32 LE 0] NYB14NOEX VDOUT[1]=1 VS30=2GOTO NYB18NYB14 NOEX VDOUT[5]=1 VS30=-2GOTO NYB18NYB15 NOEX VIMDZ[12]=DOKIF [VIMDX[12] LE VIMDZ[12]] NYB17IF [VS32 LE 0] NYB16NOEX VDOUT[2]=1 VS30=1

Page 146: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-137SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

GOTO NYB18NYB16 NOEX VDOUT[4]=1 VS30=-1GOTO NYB18NYB17 NOEX VDOUT[3]=1 VS30=0NYB18 G136RTS

ODOAY (Diameter gauging by Y-axis gauging)

NOEX VS24=0IF XP2 NYA2IF ZP2 NYA3NYA1 VDOUT[992]=1402GOTO NYA9NYA2 IF ZP2 NYA1NOEX VS12=0GOTO NYA4NYA3 NOEX VS12=1GOTO NYA4

ODIAY (ID gauging by Y-axis movements)

NOEX VS24=1 VS12=1NYA4 NOEX VS27=0M155IF [VRSTT NE 0] NYA9IF [VYMOD EQ 0] NYA5NOEX VDOUT[992]=1401GOTO NYA9NYA5 NOEX XSTP=VSIOX ZSTP=VSIOZ TDSN=VDETNNOEX VDOUT[9]=0 VS25=0 VS19=1NOEX VS09=0CALL OTDSLCALL ODTMYNOEX VMDT[2]=MSP VMDT[3]=VS21 VMDT[4]=VS30 VMDT[5]=VS32NOEX VMDT[7]=VS22 VMDT[8]=VS31 VMDT[9]=VS21NOEX VIMDX[4]=VS21 VIMDX[7]=VS22 VIMDX[8]=VS31NOEX VS04=VDTFX[VS01]IF [[VDIN[1255] AND 64] NE 64] NYA7IF APO NYA6GOTO NYA7NYA6 NOEX BPO=VPOCHNOEX VPOCH=APONYA7 CALL OWXYNOEX VIMDX[6]=-VMDT[5]PRNT 11TD=TDSNG00X=XSTP Z=ZSTP NYA9 M154RTS

OZORY (Y-axis zero offset)

IF [VRSTT NE 0] NA12IF [VYMOD NE 0] NA1IF [VMLCK NE 0] NA1VDOUT[992]=1400GOTO NA12

Page 147: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-138SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NA1 NOEX VS19=1 VS29=MSPCALL OSKPYNA5 NOEX VS03=VS31-MSP VS11=ABS[VS03]NOEX VIMDX[12]=VS11 VIMDY[3]=VS03IF DNG NA6GOTO NA8NA6 VIMDZ[12]=DNGIF [VIMDX[12] LE VIMDZ[12]] NA8IF [VS03 GT 0] NA7NOEX VDOUT[992]=3004 VS03=0GOTO NA10NA7 NOEX VDOUT[992]=3005 VS03=0GOTO NA10NA8 IF DOK NA9GOTO NA10NA9 VIMDZ[12]=DOKIF [VIMDX[12] GT VIMDZ[12]] NA10NOEX VS03=0NA10 IF [VMIRY NE 0] NA11NOEX VZOFY=VZOFY+VS03 VMDT[1]=VS03GOTO NA12NA11 VZOFY=VZOFY-VS03 VMDT[1]=VS03NA12 RTS

OJUDY (Gauging result judgment cycle)

NOEX VS27=2 VDOUT[9]=0NOEX VS32=MRE-MSPNOEX VS11=ABS[VS32]VIMDX[12]=VS11VIMDZ[12]=JNGIF [VIMDX[12] LE VIMDZ[12]] NH6IF [VS32 LE 0] NH5NOEX VDOUT[1]=1 VS30=2VDOUT[992]=1001+VS27*2GOTO NH9NH5 NOEX VDOUT[5]=1 VS30=-2VDOUT[992]=1000+VS27*2GOTO NH9NH6 VIMDZ[12]=JOKIF [VIMDX[12] GT VIMDZ[12]] NH7NOEX VDOUT[3]=1 VS30=0GOTO NH9NH7 IF [VS32 LE 0] NH8NOEX VDOUT[2]=1 VS30=1GOTO NH9NH8 NOEX VDOUT[4]=1 VS30=-1NH9 RTS

Page 148: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-139SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-6. Automatic Gauging System Using Five Level Signals (BCD System)

1-6-1. General Description of MSB

This section covers the list, flow chart, variable table and other information relating to the post-process gauging (five levels) function, taking the following maker subprogram (MSB) as an example.

LMSL300A.MSB

The name of gauging control software is indicated as described below.

The MSB largely differs from the other control software in the contents.Other control software is used to control signals from the machine and also input/output of part programs and/or user’s commands.However, the MSB is created in the same format as that of the part program, and so it can be considered as the control software that implements gauging cycle instead of the user.Gauging control software differs from other control software in the following points.

The gauging control software functions only when it is called by a user.

The gauging control software is written in the same format as a part program.

The user’s own SSB can be written using an MSB.

1-6-2. Variable Tables

The variables currently used in the gauging MSB are explained below.

(1) Common variables (different from common variables V1 to V200 used for parameter setting)

(2) System variables 1 (used for reading and compensating various types of data)

(3) System variables 2 (used as counter for gauging functions)

(4) Input/output variables (used for input/output)

LMS*????.MSB

*: Contents of each gauging software

????: Version of each gauging software

Page 149: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-140SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Common Variables (VS01 to VS32)

The common variables are not displayed on the screen unlike the common variables (V1 to V200) used in parameter setting.

(1) Common variables used for setting parameters are common for turrets A and B, however, the above common variables are turret dependent.That is, turrets A and B have an independent VS01, for example, and the VS01 for turret A must be specified and called out from turret A, while the VS01 for turret B must be specified and called out from turret B.

(2) Note that these common variables (VS01 to VS32) will be used in other MSBs in addition to the gauging cycle discussed here. Therefore, if these common variables are used as variables transferred between subprograms, numerical values might be changed during the transfer.When these common variables are used, their processing must end within the same subprogram.

Variable Name

Used asRemarks

Variable Name

Used asRemarks

VS01Post-process gauging device judgment data

VS17 Not used

VS02Logical product of the previous judgment result and the present judgment result

VS18 Not used

VS03 Compensation value VS19 Not used

VS04 Tool nose, position, tool number VS20 Not used

VS05Tool No. of the tool presently selected in the tool group

VS21 Not used

VS06Post-process gauging device input No.

VS22 Not used

VS07Gauging (measured) value read counter

VS23 Not used

VS08 Post-process gauging input No. VS24 Not used

VS09Machining preparation command (group number designation)

VS25 Not used

VS10 Tool nose, tool number VS26 Not used

VS11 Not used VS27 Not used

VS12 Not used VS28 Not used

VS13 Not used VS29 Not used

VS14 Not used VS30Data No. at the consecutive NG counter

VS15 Not used VS31 Not used

VS16 Not used VS32 Not used

Page 150: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-141SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

G13N1 NOEX VS01=100

N2 NOEX VS02=10 VS03=20N3 CALL OSUB1N4N5N6N7 CALL OSUB2N8N9N10M02

Do not use common variables for transferring numerical values from OSUB1 to OSUB2.

Within a subprogram, they can be used as desired.

LE61497R0100700530001

Page 151: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-142SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 1

System variables 1 are used in this gauging subprogram.They are used for reading and writing numerical values stored in the CNC memory and those displayed and set as parameters, zero offset data, tool offset data, etc.

Variable Name

Function Min - Max. - ValuesSubscript

Expression

VXMDS Post-process gauging data set flag 0, 128

VXMMD For storing the previous gauging result 0 to 99 Data No. 1 to 12

VXMCO Consecutive ±OK counter 0 to 99 Data No. 1 to 12

VXMMO ±OK ignore counter 0 to 99 Data No. 1 to 12

VXMPO

Post-process gauging device input position No.(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 12 Data No. 1 to 12

VDXMN

Tool offset number whose tool offset data is corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 32 Data No. 1 to 12

VDXMG

Tool group No. of the tool offset data to be corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 12 Data No. 1 to 12

VXMCDCompensation value(from the POST-PROCESS GAG AUTO COMP DATA screen)

-999.999 to 999.999 Data No. 1 to 12

VXMNCCompensation skip counter(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 99 Data No. 1 to 12

VXMXZ

Axis for which compensation is to be done(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 99 Data No. 1 to 12

VGRSLTool No. of the tool presently selected in the tool group

0 to 12Tool group number

1 to 12

VDTNG NG flag in tool life management table 0 to 1Tool nose, tool

number

VDTCNActual machining count in the tool life management table

0 to 9999Tool nose, tool

number

VDTCAActual wear amount in the tool life management table

0 to 999.999Tool nose, tool

number

VDTFX Tool offset value in X-axis-9999.9999 to

9999.9999

Machining preparation command

VDTFZ Tool offset value in Z-axis-9999.9999 to

9999.9999

Machining preparation command

VBCDEGauged (measured) value (from the POST-PROCESS GAG INPUT DATA screen)

-0.099 to 0.099 Data No.1 to 12

Page 152: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-143SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

VXMADFixed value to be added to tool offset compensation data

0 to 0.099 None

Variable Name

Function Min - Max. - ValuesSubscript

Expression

Page 153: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-144SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 2

System variables 2 are used as counters for gauging cycles.Gauging counters No. 1 to No. 32, accessible in the parameter setting mode, correspond to variables VMCN [1] to VMCN [32].This gauging subprogram uses the “compensation lag” set for No. 9 using VMCN [9] and also the consecutive NG counters VMCN [20] to VMCN [28] which are set for No. 20 to No. 28. Other system parameters are not used.

System variables not assigned specific functions may be used and displayed in the same manner as common variables.Note that the range of numerical values that can be handled by these parameters is 0 to 9999 (positive integer).

Input/Output Variables

Output variables

Input variables

Variable Name

Function

VDOUT [991] “Alarm C User reserve code ####” is output by setting VDOUT[991] = ####.(####: 1 to 9999, decimal)

Variable Name

Function

VDIN [801] toVDIN [808]

Post-process gauging input data that corresponds to post-process gauging input Nos. 1 to 8

LE61497R0100700550001

Page 154: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-145SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-6-3. Program

Flow Chart

OXMS

NO

NO

NO NO NO

NO

NO

VRSTT=0YES

YES

YES

YES

YES YES YES

YES

NO

M100

VXMDS=0

VS07=1

NA1

VXMPO[VS07]=0

VS08=VXMPO[VS07]

VBCDE[VS08]=0

VS06=VXMPO[VS07]+800VS01=VDIN[VS06]

VS01=64? VS01=32,16? VS01=8,4?

NOCNOK NNG

NA2

VXMMD[VS07]=VS01

VS07=VS07+1

VS07≤8

VXMDS=0

RTSNA4

NA3

VDIN (*) * ; 801 - 808

OK OK OK NG NG

1

1

Sequence restart OFF?

Is the gauging data read?

Setting "1" at the reading counter

Post-process gauging input numberPost-process gauging input data

OK processing

±OK processing

±NG processing

Saving the judgment result for the next gauging

Reading counter; increment

Is there remaining data?

Gauging data reading completed

LE61497R0100700570001

Page 155: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-146SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NOC

VS08=VXMPO[VS07]

VS03=-VXMCD[VS08]

VS01=32 NO

YES

YES

YES

YES

YES

YES

YES

NO

NONO

NO

NO

NO

+OK

NC0

VS03=VS03-VXMAD VS03=VS03+VXMADNC1

NC2

NC4

VS02=VS01 AND VXMMD[VS07]

VS02=32,16

VXMCO[VS07]=0VXMMO[VS07]=0

VXMCO[VS07]=VXMCO[VS07]+1

VDXMN[VS07]=0

VXMMO[VS07]>0

2C

2A

NC10

NC6VDXMG[VS07]=0

VS09=VDXMG[VS07]VS05=VDSTN[VS09]VS05=VGRSL[VS05]

VS05=0

VXMMO[VS07]>0

2B 2D

NCE

±OK processing

Setting the compensation data

Clearing the ±OKconsecutive counterClearing the ±OKignore counter

Offset number = 0?

Ignore?

Tool group number = 0?

No tool selected?

Ignore?

Finding the currently selected tool number from the tool group

LE61497R0100700570002

Page 156: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-147SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2C

VXMCO[VS07]<VXMNC[VS07]

NONO

NO

NO

NO

NO NO

YES

YES

YES

YES

YES

YES YES

VS04=VDXMN[VS07]

2ANC10

VXMMO[VS07]=VXMMO[VS07]-1

1

NCAVDTCA[VS10]=VDTCA[VS10]+ABS[VS03]

2B

VDTCN[VS10]<VMCN[9]

2D

VXMCO[VS07]<VXMNC[VS07]

NC7VS04=VDSPN[VS09]*1000000+VDSEN[VS09]*10000+VS05

VS04=0

NCB

VDIN[1255]AND 32¹32

VXMXZ[VS07]=0 VXMXZ[VS07]=0NCB1 NCC

VDTWZ[VS04]=VDTWZ[VS04]+VS03

VDTWX[VS04]=VDTWX[VS04]+VS03

VDTFZ[VS04]=VDTFZ[VS04]+VS03

VDTFX[VS04]=VDTFX[VS04]+VS03

VXMMO[VS07]=VXMMC[VS07]

2D

NCE

VXMMO[VS07]=0

NCF

NCD

VXMCO[VS07]=0

GOTO NA2

1

VS10=VDSEN[VS09]*10000+VS05

Compensation skip?

Reducing the ignore counter value by 1

Actually machined parts < Compensation lag?

Compensation skip?

Clearing the ignore counter

X direction? X direction?

Setting the compensation skip counter value at the ignore counter

Clearing the ±OKconsecutive counter

LE61497R0100700570003

Page 157: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-148SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NNG

VS02=VXMMD[VS07] AND 12

VS30=VS07+20

VBCDE[VS08]=0

VS02=0

NO

NO

NO

NO

NO

NO

NO

YES

YES

YES

YES

YES

YES

VS02=VS01 AND 12

NB0 VS02=4,8

VMCN[VS30]=0

NB1VMCN[VS30]=VMCN[VS30]+1 NOK

VMCN[VS30]<VMCN[20]

NB1A

VMCN[VS30]=0

VDXMN[VS07]0

VDXMG[VS07]=0

VS09=VDXMG[VS07]VS05=VDSTN[VS09]VS05=VGRSL[VS05]

VS05=0

VDTCN[VS10]<VMCN[9]

VDTNG[VS10]=1

VS10=VDSEN[VS09]*10000+VS05

VDOUT[991]=9000

NOK

NB2

GOTO NA2

VXMCO[VS07]=0VXMMO[VS07]=0

NO

YES

YES

±NG processing

Clearing the consecutive NG counter clear

Consecutive NG counter increment

Clearing the consecutive NG counter clear

Tool group No. specified?

Finding the currently selected tool No. in the tool group

Actually machined number of workpieces smaller than the compensation lag?

±OK consecutive counter clear±OK invalid counter clear

No selected tool?

OK processing

LE61497R0100700570004

Page 158: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-149SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Program List

OXMS (Post-process gauging 5-level processing)

IF [VRSTT NE 0] NA4M100IF [VXMDS EQ 0] NA4NOEX VS07=1NA1 IF [VXMPO[VS07] EQ 0] NA3NOEX VS08=VXMPO[VS07]IF [VBCDE[VS08] NE 0] NNGNOEX VS06=VXMPO[VS07]+800 VS01=VDIN[VS06]IF [VS01 EQ 64] NOKIF [VS01 EQ 32] NOCIF [VS01 EQ 16] NOCIF [VS01 EQ 8] NNGIF [VS01 EQ 4] NNGGOTO NA3NNG VS02=[VXMMD[VS07] AND 12]VS30=VS07+20IF [VBCDE[VS08] NE 0] NB1AIF [VS02 EQ 0] NB0VS02=[VS01 AND 12]IF [VS02 EQ 4] NB1IF [VS02 EQ 8] NB1NB0 VMCN[VS30]=0NB1 VMCN[VS30]=VMCN[VS30]+1IF [VMCN[VS30] LT VMCN[20]] NOKNB1A VMCN[VS30]=0IF [VDXMN[VS07] NE 0] NB2IF [VDXMG[VS07] EQ 0] NOKNOEX VS09=VDXMG[VS07]NOEX VS05=VDSTN[VS09]NOEX VS05=VGRSL[VS05]IF [VS05 EQ 0] NOKNOEX VS10=VDSEN[VS09]*10000+VS05IF [VDTCN[VS10] LT VMCN[9]] NOKNOEX VDTNG[VS10]=1NB2 NOEX VDOUT[991]=9000NOK NOEX VXMCO[VS07]=0 VXMMO[VS07]=0GOTO NA2NOC NOEX VS08=VXMPO[VS07]NOEX VS03=-VXMCD[VS08]IF [VS01 NE 32] NC0NOEX VS03=VS03-VXMADGOTO NC1NC0 NOEX VS03=VS03+VXMADNC1 NOEX VS02=[VS01 AND VXMMD[VS07]]IF [VS02 EQ 32] NC2IF [VS02 EQ 16] NC2NOEX VXMCO[VS07]=0 VXMMO[VS07]=0NC2 NOEX VXMCO[VS07]=VXMCO[VS07]+1IF [VDXMN[VS07] EQ 0] NC6IF [VXMMO[VS07] GT 0] NC10IF [VXMCO[VS07] LT VXMNC[VS07]] NA2NOEX VS04=VDXMN[VS07]

Page 159: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-150SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

GOTO NCBNC6 IF [VDXMG[VS07] EQ 0] NCENOEX VS09=VDXMG[VS07]NOEX VS05=VDSTN[VS09]NOEX VS05=VGRSL[VS05]IF [VS05 EQ 0] NCEIF [VXMMO[VS07] GT 0] NC10NOEX VS10=VDSEN[VS09]*10000+VS05IF [VDTCN[VS10] LT VMCN[9]] NCEIF [VXMCO[VS07] LT VXMNC[VS07]] NA2NOEX VS04=VDSPN[VS09]*1000000+VDSEN[VS09]*10000+VS05NCA NOEX VDTCA[VS10]=VDTCA[VS10]+ABS[VS03]NCB IF [VS04 EQ 0] NCEIF [[VDIN[1255] AND 32] NE 32] NCB2IF [VXMXZ[VS07] EQ 0] NCB1NOEX VDTWZ[VS04]=VDTWZ[VS04]+VS03GOTO NCDNCB1 NOEX VDTWX[VS04]=VDTWX[VS04]+VS03GOTO NCDNCB2 IF [VXMXZ[VS07] EQ 0] NCCNOEX VDTFZ[VS04]=VDTFZ[VS04]+VS03GOTO NCDNCC NOEX VDTFX[VS04]=VDTFX[VS04]+VS03NCD NOEX VXMMO[VS07]=VXMMC[VS07]GOTO NCFNCE NOEX VXMMO[VS07]=0NCF NOEX VXMCO[VS07]=0GOTO NA2NC10 NOEX VXMMO[VS07]=VXMMO[VS07]-1NA2 NOEX VXMMD[VS07]=VS01NA3 NOEX VS07=VS07+1IF [VS07 LE 8] NA1NOEX VXMDS=0NA4 RTS

Page 160: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-151SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-7. Automatic Gauging System Using Five Level Signals

1-7-1. General Description of MSB

This section covers the list, flow chart, variable table and other information relating to the post-process gauging (five levels) function, taking the following maker subprogram (MSB) as an example.

LMSE300A.MSB

The name of gauging control software is indicated as described below.

In this manual, the gauging control software is represented by “MSB”.The MSB largely differs from the other control software in the contents.Other control software is used to control signals from the machine and also input/output of part programs and/or user’s commands.However, the MSB is created in the same format as that of the part program, and so it can be considered as the control software that implements gauging cycle instead of the user.Gauging control software differs from other control software in the following points.

The gauging control software functions only when it is called by a user.

The gauging control software is written in the same format as a part program.

The user’s own SSB can be written using an MSB.

1-7-2. Variable Tables

The variables used in MSBs are explained in this section.

(1) Common variables (different from common variables V1 to V200 used for parameter setting)

(2) System variables 1 (used for reading and compensating various types of data)

(3) System variables 2 (used as counter for gauging functions)

(4) Input/output variables (used for input/output)

LMS*????.MSB

*: Contents of each gauging software

????: Version of each gauging software

Page 161: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-152SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Common Variables (VS01 to VS32)

The common variables are not displayed on the screen unlike the common variables (V1 to V200) used in parameter setting.

(1) Common variables used for setting parameters are common for turrets A and B, however, the above common variables are turret dependent.That is, turrets A and B have an independent VS01, for example, and the VS01 for turret A must be specified and called out from turret A, while the VS01 for turret B must be specified and called out from turret B.

Variable Name

Used asRemarks

Variable Name

Used asRemarks

VS01Post-process gauging device judgment data

VS17 Not used

VS02Logical product of the previous judgment result and the present judgment result

VS18 Not used

VS03 Compensation value VS19 Not used

VS04 Tool nose, position, tool number VS20 Not used

VS05Tool No. of the tool presently selected in the tool group

VS21 Not used

VS06Post-process gauging device input No.

VS22 Not used

VS07Gauging (measured) value read counter

VS23 Not used

VS08 Not used VS24 Not used

VS09Machining preparation command (tool group number designation)

VS25 Not used

VS10 Tool nose, tool number VS26 Not used

VS11 Not used VS27 Not used

VS12 Not used VS28 Not used

VS13 Not used VS29 Not used

VS14 Not used VS30Data No. at the consecutive NG counter

VS15 Not used VS31 Not used

VS16 Not used VS32 Not used

Page 162: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-153SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

(2) Note that these common variables (VS01 to VS32) will be used in other MSBs in addition to the gauging cycle discussed here. Therefore, if these common variables are used as variables transferred between subprograms, numerical values might be changed during the transfer.When these common variables are used, their processing must end within the same subprogram.

G13N1 NOEX VS01=100

N2 NOEX VS02=10 VS03=20N3 CALL OSUB1N4N5N6N7 CALL OSUB2N8N9N10G14N1N2 NOEX VS01=100 VS02=50

N3 CALL OSUB1N4

N5N6 NOEX VS01=100 VS03=60N7 CALL OSUB3N8N9M02

Do not use common variables for transferring numerical values from OSUB1 to OSUB2.

Variables used in common in G14 side program

* Not used for transferring numerical values

When calling more than one subprogram from a subprogram, pay attention to the transfer of variables between subprograms.

Variables used in common in G13 side program

Within a subprogram, they can be used as desired.

LE61497R0100700610001

Page 163: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-154SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 1

System variables 1 are used in this gauging subprogram.They are used for reading and writing numerical values stored in the CNC memory and those displayed and set as parameters, zero offset data, and tool data, etc.

Variable Name

Function Min - Max. - ValuesSubscript

Expression

VXMDS Post-process gauging data set flag 0, 128

VXMMD For storing the previous gauging result 0 to 99 Data No. 1 to 12

VXMCO Consecutive ±OK counter 0 to 99 Data No. 1 to 12

VXMMO ±OK ignore counter 0 to 99 Data No. 1 to 12

VXMPO

Post-process gauging device input position No.(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 12 Data No. 1 to 12

VDXMN

Tool offset number whose tool offset data is corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 32 Data No. 1 to 12

VDXMG

Tool group No. of the tool offset data to be corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 12 Data No. 1 to 12

VXMCDCompensation value(from the POST-PROCESS GAG AUTO COMP DATA screen)

-999.999 to 999.999 Data No. 1 to 12

VXMNCCompensation skip counter(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 99 Data No. 1 to 12

VXMXZ

Axis for which compensation is to be done(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 99 Data No. 1 to 12

VGRSLTool No. of the tool presently selected in the tool group

0 to 12Tool group number

1 to 12

VDTNG NG flag in tool life management table 0 to 1Tool nose, tool

number

VDTCNActual machining count in the tool life management table

0 to 9999Tool nose, tool

number

VDTCAActual wear amount in the tool life management table

0 to 999.999Tool nose, tool

number

VDTFX Tool offset value in X-axis-9999.9999 to

9999.9999

Machining preparation command

VDTFZ Tool offset value in Z-axis-9999.9999 to

9999.9999

Machining preparation command

Page 164: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-155SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 2

System variables 2 are used as counters for gauging cycles.Gauging counters No. 1 to No. 32, accessible in the parameter setting mode, correspond to variables VMCN [1] to VMCN [32].This gauging subprogram uses the “compensation lag” set for No. 9 using VMCN [9] and also the consecutive NG counters VMCN [20] to VMCN [28] which are set for No. 20 to No. 28.Other system parameters are not used.

System variables not assigned specific functions may be used and displayed in the same manner as common variables.Note that the range of numerical values that can be handled by these parameters is 0 to 9999 (positive integer).

Input/Output Variables

Output variables

Input variables

Variable Name

Function

VDOUT [991] “Alarm C User reserve code ####” is output by setting VDOUT[991] = ####.(####: 1 to 9999, decimal)

Variable Name

Function

VDIN [801] toVDIN [808]

Post-process gauging input data that corresponds to post-process gauging input Nos. 1 to 8

LE61497R0100700630001

Page 165: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-156SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-7-3. Program

Flow Chart

OXMS

NO

NO

NO NO NO

NO

NO

VRSTT=0YES

YES

YES

YES YES YES

YES

M100

VXMDS=0

VS07=1

NA1

VXMPO[VS07]=0

VS06=VXMPO[VS07]+800VS01=VDIN[VS06]

VS01=64? VS01=32,16? VS01=8,4?

NOCNOK NNG

NA2VXMMD[VS07]=VS01

VS07=VS07+1

VS07≤8

VXMDS=0

RTSNA4

NA3

VDIN (*) * ; 801 - 808

OK OK OK NG NG

Sequence restart OFF?

Is the gauging data read?

Setting "1" at the reading counter

Post-process gauging input numberPost-process gauging input data

OKprocessing

±OKprocessing

±NGprocessing

Saving the judgment result for the next gauging

Reading counter; increment

Is there remaining data?

Gauging data reading completed

LE61497R0100700650001

Page 166: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-157SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NOC

VS01=32 NO

YES

YES

YES

YES

YES

YES

YES

NO

NONO

NO

NO

NO

NC1

NC2

NC4

VS02=VS01 AND VXMMD[VS07]

VS02=32,16

VXMCO[VS07]=0VXMMO[VS07]=0

VXMCO[VS07]=VXMCO[VS07]+1

VDXMN[VS07]=0

VXMMO[VS07]>0

2C

2A

NC10

NC6VDXMG[VS07]=0

VS09=VDXMG[VS07]VS05=VDSTN[VS09]VS05=VGRSL[VS05]

VS05=0

VXMMO[VS07]>0

2B 2D

NCE

VS03=VXMCD[VS07]

VS03=-VS03

±OK processing

Setting the OK/NG flagSetting the compensation data

Clearing the ±OK consecutive counterClearing the ±OK ignore counter

Offset number = 0?

Ignore?

Tool group number = 0?

No tool selected?

Ignore?

Finding the currently selected tool number from the tool group

LE61497R0100700650002

Page 167: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-158SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2C

VXMCO[VS07]<VXMNC[VS07]

NO

NO

NO

NO

NO

NO NO

YES

YES

YES

YES

YES

YES YES

VS04=VDXMN[VS07]

2A NC10

VXMMO[VS07]=VXMMO[VS07]-1

1

NCAVDTCA[VS10]=VDTCA[VS10]+ABS[VS03]

2B

VDTCN[VS10]<VMCN[9]

2D

VXMCO[VS07]<VXMNC[VS07]

VS04=0

NCB

VDIN[1255]AND 32¹32

VXMXZ[VS07]=0 VXMXZ[VS07]=0 NCC

VDTWZ[VS04]=VDTWZ[VS04]+VS03

VDTWX[VS04]=VDTWX[VS04]+VS03

VDTFZ[VS04]=VDTFZ[VS04]+VS03

VDTFX[VS04]=VDTFX[VS04]+VS03

VS04=VDSPN[VS09]*1000000+VDSEN[VS09]*10000+VS05

VS10=VDSEN[VS09]*1000+VS05

VXMMO[VS07]=VXMMC[VS07]

2D

NCE

VXMMO[VS07]=0

NCF

NCD

VXMCO[VS07]=0

GOTO NA2

1

Compensation skip?

Reducing the ignore counter value by 1

Actually machined parts < Compensation lag?

Clearing the ignore counter

Compensation skip?

X direction? X direction?

Setting the compensation skip counter value at the ignore counter

Clearing the ±OKconsecutive counter

LE61497R0100700650003

Page 168: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-159SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NNG

VS02=VXMMD[VS07] AND 12

VS30=VS07+20

VS02=0 NO

NO

NO

NO

NO

NO

YES

YES

YES

YES

VS02=VS01 AND 12

NBO VS02=4,8VMCN[VS30]=0

NB1VMCN[VS30]=VMCN[VS30]+1

NOK

VMCN[VS30]<VMCN[20]

VMCN[VS30]=0

VDXMN[VS07]0

VDXMG[VS07]=0

VS09=VDXMG[VS07]VS05=VDSTN[VS09]VS05=VGRSL[VS05]

VS05=0

VDTCN[VS10]<VMCN[9]

VDTNG[VS10]=1

VS10=VDSEN[VS09]*10000+VS05

VDOUT[991]=9000NOK

NB2

GOTO NA2

VXMCO[VS07]=0VXMMO[VS07]=0

NO

YES

YES

YES

±NG processing

Clearing the consecutive NG counter clear

Consecutive NG counter increment

Clearing the consecutive NG counter clear

Tool group No. specified?

Finding the currently selected tool No.in the tool group

Actually machined number of workpieces smaller than the compensation lag?

±OK consecutive counter clear±OK invalid counter clear

No selected tool?

OK processing

LE61497R0100700650004

Page 169: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-160SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Program List

OXMS (Post-process gauging 5-level processing)

IF [VRSTT NE 0] NA4M100IF [VXMDS EQ 0] NA4NOEX VS07=1NA1 IF [VXMPO[VS07] EQ 0] NA3NOEX VS06=VXMPO[VS07]+800 VS01=VDIN[VS06]IF [VS01 EQ 64] NOKIF [VS01 EQ 32] NOCIF [VS01 EQ 16] NOCIF [VS01 EQ 8] NNGIF [VS01 EQ 4] NNGGOTO NA3NNG VS02=[VXMMD[VS07] AND 12]VS30=VS07+20IF [VS02 EQ 0] NB0VS02=[VS01 AND 12]IF [VS02 EQ 4] NB1IF [VS02 EQ 8] NB1NB0 VMCN[VS30]=0NB1 VMCN[VS30]=VMCN[VS30]+1IF [VMCN[VS30] LT VMCN[20]] NOKVMCN[VS30]=0IF [VDXMN[VS07] NE 0] NB2IF [VDXMG[VS07] EQ 0] NOKNOEX VS09=VDXMG[VS07]NOEX VS05=VDSTN[VS09]NOEX VS05=VGRSL[VS05]IF [VS05 EQ 0] NOKNOEX VS10=VDSEN[VS09]*10000+VS05IF [VDTCN[VS10] LT VMCN[9]] NOKNOEX VDTNG[VS10]=1NB2 NOEX VDOUT[991]=9000NOK NOEX VXMCO[VS07]=0 VXMMO[VS07]=0GOTO NA2NOC NOEX VS03=VXMCD[VS07]IF [VS01 NE 32] NC1NOEX VS03=-VS03NC1 NOEX VS02=[VS01 AND VXMMD[VS07]]IF [VS02 EQ 32] NC2IF [VS02 EQ 16] NC2NOEX VXMCO[VS07]=0 VXMMO[VS07]=0NC2 NOEX VXMCO[VS07]=VXMCO[VS07]+1IF [VDXMN[VS07] EQ 0] NC6IF [VXMMO[VS07] GT 0] NC10IF [VXMCO[VS07] LT VXMNC[VS07]] NA2NOEX VS04=VDXMN[VS07]GOTO NCBNC6 IF [VDXMG[VS07] EQ 0] NCENOEX VS09=VDXMG[VS07]NOEX VS05=VDSTN[VS09]NOEX VS05=VGRSL[VS05]IF [VS05 EQ 0] NCE

Page 170: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-161SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

IF [VXMMO[VS07] GT 0] NC10NOEX VS10=VDSEN[VS09]*10000+VS05IF [VDTCN[VS10] LT VMCN[9]] NCEIF [VXMCO[VS07] LT VXMNC[VS07]] NA2NOEX VS04=VDSPN[VS09]*1000000+VDSEN[VS09]*10000+VS05NCA NOEX VDTCA[VS10]=VDTCA[VS10]+ABS[VS03]NCB IF [VS04 EQ 0] NCEIF [[VDIN[1255] AND 32] NE 32] NCB2IF [VXMXZ[VS07] EQ 0] NCB1NOEX VDTWZ[VS04]=VDTWZ[VS04]+VS03GOTO NCDNCB1 NOEX VDTWX[VS04]=VDTWX[VS04]+VS03GOTO NCDNCB2 IF [VXMXZ[VS07] EQ 0] NCCNOEX VDTFZ[VS04]=VDTFZ[VS04]+VS03GOTO NCDNCC NOEX VDTFX[VS04]=VDTFX[VS04]+VS03NCD NOEX VXMMO[VS07]=VXMMC[VS07]GOTO NCFNCE NOEX VXMMO[VS07]=0NCF NOEX VXMCO[VS07]=0GOTO NA2NC10 NOEX VXMMO[VS07]=VXMMO[VS07]-1NA2 NOEX VXMMD[VS07]=VS01NA3 NOEX VS07=VS07+1IF [VS07 LE 8] NA1NOEX VXMDS=0NA4 RTS

Page 171: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-162SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-8. Automatic Gauging System by Seven Level Signals

1-8-1. General Description of MSB

This section covers the list, flow chart, variable table and other information relating to the post-process gauging (seven levels) function, taking the following maker subprogram (MSB) as an example.

LMSF300A? MSB

The name of gauging control software is indicated as described below.

The MSB largely differs from the other control software in the contents.Other control software is used to control signals from the machine and also input/output of part programs and/or user’s commands.However, the MSB is created in the same format as that of the part program, and so it can be considered as the control software that implements gauging cycle instead of the user.

1-8-2. Variable Tables

The variables used in gauging MSBs are explained in this section.

(1) Common variables (different from common variables V1 to V200 used for parameter setting)

(2) System variables 1 (used for reading and compensating various types of data)

(3) System variables 2 (used as counter for gauging functions)

(4) Input/output variables (used for input/output)

LMS*????.MSB

*: Contents of each gauging software

????: Version of each gauging software

Page 172: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-163SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Common Variables (VS01 to VS32)

The common variables are not displayed on the screen unlike the common variables (V1 to V200) used in parameter setting.

(1) Common variables used for setting parameters are common for turrets A and B, however, the above common variables are turret dependent.That is, turrets A and B have an independent VS01, for example, and the VS01 for turret A must be specified and called out from turret A, while the VS01 for turret B must be specified and called out from turret B.

Variable Name

Used as RemarksVariable Name

Used asRemarks

VS01Post-process gauging device judgment data

VS17 Not used

VS02Logical product of the previous judgment result and the present judgment result

VS18 Not used

VS03 Compensation value VS19 Not used

VS04Tool nose, position, tool number

VS20 Not used

VS05Tool No. of the tool presently selected in the tool group

VS21 Not used

VS06OK/NG flagPost-process gauging device input No.

0:±OK1:±NG

VS22 Not used

VS07Gauging (measured) value read counter

VS23 Not used

VS08 Not used VS24 Not used

VS09Machining preparation command (group number designation)

VS25 Not used

VS10 Tool nose, tool number VS26 Not used

VS11 Not used VS27 Not used

VS12 Not used VS28 Not used

VS13 Not used VS29 Not used

VS14 Not used VS30Data No. at the consecutive NG counter

VS15 Not used VS31 Not used

VS16 Not used VS32 Not used

Page 173: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-164SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

(2) Note that these common variables (VS01 to VS32) will be used in other MSBs in addition to the gauging cycle discussed here. Therefore, if these common variables are used as variables transferred between subprograms, numerical values might be changed during the transfer.When these common variables are used, their processing must end within the same subprogram.

G13N1 NOEX VS01=100

N2 NOEX VS02=10 VS03=20N3 CALL OSUB1N4N5N6N7 CALL OSUB2N8N9N10G14N1N2 NOEX VS01=100 VS02=50

N3 CALL OSUB1N4

N5N6 NOEX VS01=100 VS03=60N7 CALL OSUB3N8N9M02

Do not use common variables for transferring numerical values from OSUB1 to OSUB2.

Variables used in common in G14 side program

* Not used for transferring numerical values

When calling more than one subprogram from a subprogram, pay attention to the transfer of variables between subprograms.

Variables used in common in G13 side program

Within a subprogram, they can be used as desired.

LE61497R0100700690001

Page 174: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-165SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 1

System variables 1 are used in this gauging subprogram.They are used for reading and writing numerical values stored in the CNC memory and those displayed and set as parameters, zero offset data, and tool data, etc.

Variable Name

Function Min - Max. - ValuesSubscript

Expression

VXMDS Post-process gauging data set flag 0, 128

VXMMD For storing the previous gauging result 0 to 99 Data No. 1 to 12

VXMCO Consecutive ±OK counter 0 to 99 Data No. 1 to 12

VXMMO ±OK ignore counter 0 to 99 Data No. 1 to 12

VXMPO

Post-process gauging device input position No.(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 12 Data No. 1 to 12

VDXMN

Tool offset number whose tool offset data is corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 32 Data No. 1 to 12

VDXMG

Tool group No. of the tool offset data to be corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 12 Data No. 1 to 12

VXMCDCompensation value(from the POST-PROCESS GAG AUTO COMP DATA screen)

-999.999 to 999.999 Data No. 1 to 12

VXMNCCompensation skip counter(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 99 Data No. 1 to 12

VXMXZ

Axis for which compensation is to be done(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 99 Data No. 1 to 12

VGRSLTool No. of the tool presently selected in the tool group

0 to 12Tool group number

1 to 12

VDTNG NG flag in tool life management table 0 to 1Tool nose, tool

number

VDTCNActual machining count in the tool life management table

0 to 9999Tool nose, tool

number

VDTCAActual wear amount in the tool life management table

0 to 999.999Tool nose, tool

number

VDTFX Tool offset value in X-axis-9999.9999 to

9999.9999

Machining preparation command

VDTFZ Tool offset value in Z-axis-9999.9999 to

9999.9999

Machining preparation command

Page 175: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-166SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

System Variables 2

System variables 2 are used as counters for gauging cycles.Gauging counters No. 1 to No. 32, accessible in the parameter setting mode, correspond to variables VMCN [1] to VMCN [32]. This gauging subprogram uses the “compensation lag” set for No. 9 using VMCN [9] and also the consecutive NG counters VMCN [20] to VMCN [28] which are set for No. 20 to No. 28.Other system parameters are not used.

System variables not assigned specific functions may be used and displayed in the same manner as common variables.Note that the range of numerical values that can be handled by these parameters is 0 to 9999 (positive integer).

Input/Output Variables

Output variables

Input variables

Variable Name

Function

VDOUT [991] “Alarm C User reserve code ####” is output by setting VDOUT[991] = ####.(####: 1 to 9999, decimal)

Variable Name

Function

VDIN [801] ?VDIN [808]

Post-process gauging input data that corresponds to post-process gauging input Nos. 1 to 8

LE61497R0100700710001

Page 176: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-167SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-8-3. Program

Flow Chart

OXMS

NO

NO

NO NO NO

NO

NO

VRSTT=0YES

YES

YES

YES YES YES

YES

M100

VXMDS=0

VS07=1

NA1

VXMPO[VS07]=0

VS06=VXMPO[VS07]+800VS01=VDIN[VS06]

VS01=64? VS01=32,16? VS01=8,4?

NOCNOK NNC

NA2VXMMD[VS07]=VS01

VS07=VS07+1

VS07≤8

VXMDS=0

RTSNA4

NA3

VDIN (*) * ; 801 - 808

OK OK OK NG NG

Sequence restart OFF?

Is the gauging data read?

Setting "1" at the reading counter

Post-process gauging input numberPost-process gauging input data

OKprocessing

±OKprocessing

±NGprocessing

Saving the judgment result for the next gauging

Reading counter; increment

Is there remaining data?

Gauging data reading completed

VS01=2,1? NO

YESNNG±±NG

processing

NG NG

LE61497R0100700730001

Page 177: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-168SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NOC

VS01=32 NO

YES

YES

YES

YES

YES

YES

YES

NO

NONO

NO

NO

NO

NC1

NC2

NC4

VS02=VS01 AND VXMMD[VS07]

VS02=32,16

VXMCO[VS07]=0VXMMO[VS07]=0

VXMCO[VS07]=VXMCO[VS07]+1

VDXMN[VS07]=0

VXMMO[VS07]>0

2C

2A

NC10

VDXMG[VS07]=0

VS09=VDXMG[VS07]VS05=VDSTN[VS09]VS05=VGRSL[VS05]

VS05=0

VXMMO[VS07]>0

2B 2D

NCE

VS03=-VS03

VS06=0VS03=VXMCD[VS07]

NNC

VS06=1VS03=VXMCD[VS07]*3

VS01=8 NO

YES

YES

NO

NC3VS02=VS01 AND VXMMD[VS07]

VS02=8,4

VS03=-VS03

VXMMO[VS07]=0

±OK processingSetting the OK/NG flagSetting the compensation data

Clearing the ± OK consecutive counterClearing the ± OK ignore counter

Offset number = 0?

Ignore?

Tool group number = 0?

No tool selected?

Ignore?

Finding the currently selected tool number from the tool group

Setting the OK/NG flagSetting the compensation data

±NG processing

Previous and present offset values are AND

Clearing the ± OK ignore counter

LE61497R0100700730002

Page 178: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-169SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2C

VXMCO[VS07]<VXMNC[VS07]

NO

NO

NO

NO

NO

NO NO

YES

YES

YES

YES

YES

YES YES

VS04=VDXMN[VS07]

2A NC10

VXMMO[VS07]=VXMMO[VS07]-1

1

NCAVDTCA[VS10]=VDTCA[VS10]+ABS[VS03]

VS04=VDSPN[VS09]*1000000+VDSEN[VS09]*10000+VS05

VS10=VDSEN[VS09]*1000+VS05

2B

VDTCN[VS10]<VMCN[9]

2D

VXMCO[VS07]<VXMNC[VS07]

VS04=0

NCB

VDIN[1255]AND 32¹32

VXMXZ[VS07]=0 VXMXZ[VS07]=0NCC

VDTWZ[VS04]=VDTWZ[VS04]+VS03

VDTWX[VS04]=VDTWX[VS04]+VS03

VDTFZ[VS04]=VDTFZ[VS04]+VS03

VDTFX[VS04]=VDTFX[VS04]+VS03

VXMMO[VS07]=VXMMC[VS07]

2DNCE

VXMMO[VS07]=0

NCF

NCD

VXMCO[VS07]=0

GOTO NA2

1

NO VS06=0

VS06=0NO

YES

YES

NC5

Compensation skip?

Reducing the ignore counter value by 1

Actually machined parts < Compensation lag?

Compensation skip?

Clearing the ignore counter

X direction?

Setting the compensation skip counter value at the ignore counter

Clearing the ±OKConsecutive counter

X direction?

LE61497R0100700730003

Page 179: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-170SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NNG

VS02=VXMMD[VS07] AND 3

VS30=VS07+20

VS02=0NO

NO

NO

NO

NO

NO

YES

YES

YES

YES

VS02=VS01 AND 3

NBO VS02=1,2

VMCN[VS30]=0NB1

VMCN[VS30]=VMCN[VS30]+1 NOK

VMCN[VS30]<VMCN[20]

VMCN[VS30]=0

VDXMN[VS07]0

VDXMG[VS07]=0

VS09=VDXMG[VS07]VS05=VDSTN[VS09]VS05=VGRSL[VS05]

VS05=0

VDTCN[VS10]<VMCN[9]

VDTNG[VS10]=1

VS10=VDSEN[VS09]*10000+VS05

VDOUT[991]=9000NOK

NB2

GOTO NA2

VXMCO[VS07]=0VXMMO[VS07]=0

NO

YES

YES

YES

±NG processing

Clearing the consecutive NG counter clear

Consecutive NG counter increment

Clearing the consecutive NG counter clear

Tool group No.specified?

Finding the currently selected tool No.in the tool group

Actually machined number of workpieces smaller than the compensation lag?

±OK consecutive counter clear±OK invalid counter clear

No selected tool ?

OK processing

LE61497R0100700730004

Page 180: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-171SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Program List

OXMS (Post-process gauging 7-level processing)

IF [VRSTT NE 0] NA4M100IF [VXMDS EQ 0] NA4NOEX VS07=1NA1 IF [VXMPO[VS07] EQ 0] NA3NOEX VS06=VXMPO[VS07]+800 VS01=VDIN[VS06]IF [VS01 EQ 64] NOKIF [VS01 EQ 32] NOCIF [VS01 EQ 16] NOCIF [VS01 EQ 8] NNCIF [VS01 EQ 4] NNCIF [VS01 EQ 2] NNGIF [VS01 EQ 1] NNGGOTO NA3NNG VS02=[VXMMD[VS07] AND 3]VS30=VS07+20IF [VS02 EQ 0] NB0VS02=[VS01 AND 3]IF [VS02 EQ 1] NB1IF [VS02 EQ 2] NB1NB0 VMCN[VS30]=0NB1 VMCN[VS30]=VMCN[VS30]+1IF [VMCN[VS30] LT VMCN[20]] NOKVMCN[VS30]=0IF [VDXMN[VS07] NE 0] NB2IF [VDXMG[VS07] EQ 0] NOKNOEX VS09=VDXMG[VS07]NOEX VS05=VDSTN[VS09]NOEX VS05=VGRSL[VS05]IF [VS05 EQ 0] NOKNOEX VS10=VDSEN[VS09]*10000+VS05IF [VDTCN[VS10] LT VMCN[9]] NOKNOEX VDTNG[VS10]=1NB2 NOEX VDOUT[991]=9000NOK NOEX VXMCO[VS07]=0 VXMMO[VS07]=0GOTO NA2NOC NOEX VS06=0 VS03=VXMCD[VS07]IF [VS01 NE 32] NC1NOEX VS03=-VS03NC1 NOEX VS02=[VS01 AND VXMMD[VS07]]IF [VS02 EQ 32] NC2IF [VS02 EQ 16] NC2NOEX VXMCO[VS07]=0 VXMMO[VS07]=0NC2 NOEX VXMCO[VS07]=VXMCO[VS07]+1GOTO NC4NNC NOEX VS06=1 VS03=VXMCD[VS07]*3IF [VS01 NE 8] NC3NOEX VS03=-VS03NC3 NOEX VS02=[VS01 AND VXMMD[VS07]]IF [VS02 EQ 8] NC4IF [VS02 EQ 4] NC4NOEX VXMMO[VS07]=0

Page 181: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-172SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

NC4 IF [VDXMN[VS07] EQ 0] NC6IF [VXMMO[VS07] GT 0] NC10IF [VS06 NE 0] NC5IF [VXMCO[VS07] LT VXMNC[VS07]] NA2NC5 NOEX VS04=VDXMN[VS07]GOTO NCBNC6 IF [VDXMG[VS07] EQ 0] NCENOEX VS09=VDXMG[VS07]NOEX VS05=VDSTN[VS09]NOEX VS05=VGRSL[VS05]IF [VS05 EQ 0] NCEIF [VXMMO[VS07] GT 0] NC10NOEX VS10=VDSEN[VS09]*10000+VS05IF [VDTCN[VS10] LT VMCN[9]] NCEIF [VS06 NE 0] NC7IF [VXMCO[VS07] LT VXMNC[VS07]] NA2NC7 NOEX VS04=VDSPN[VS09]*1000000+VDSEN[VS09]*10000+VS05NCA NOEX VDTCA[VS10]=VDTCA[VS10]+ABS[VS03]NCB IF [VS04 EQ 0] NCEIF [[VDIN[1255] AND 32] NE 32] NCB2IF [VXMXZ[VS07] EQ 0] NCB1NOEX VDTWZ[VS04]=VDTWZ[VS04]+VS03GOTO NCDNCB1 NOEX VDTWX[VS04]=VDTWX[VS04]+VS03GOTO NCDNCB2 IF [VXMXZ[VS07] EQ 0] NCCNOEX VDTFZ[VS04]=VDTFZ[VS04]+VS03GOTO NCDNCC NOEX VDTFX[VS04]=VDTFX[VS04]+VS03NCD NOEX VXMMO[VS07]=VXMMC[VS07]GOTO NCFNCE NOEX VXMMO[VS07]=0NCF NOEX VXMCO[VS07]=0GOTO NA2NC10 NOEX VXMMO[VS07]=VXMMO[VS07]-1NA2 NOEX VXMMD[VS07]=VS01NA3 NOEX VS07=VS07+1IF [VS07 LE 8] NA1NOEX VXMDS=0NA4 RTS

Page 182: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-173SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-9. CEJ MATIC Gauging MSB

1-9-1. CEJ MATIC Gauging Subprograms

1-9-2. Common Variables

1-9-3. System variables

Variable Name

Function

OCEJA CEJ MATIC gauging, Turret A side compensation processing, Called at turret A side, No arguments

OCEJBCEJ MATIC gauging, Turret B side compensation processing, Called at turret B side, No arguments

Variable Name

Function

VS04 Tool offset number of the tool offset data to be corrected

VS05 Tool number or tool group number read from CEJ MATIC

VS06 Tool No. of the tool presently selected in the tool group

VS07 Gauging (measured) value read counter

VS08 Work variables

VS09 Turret designation (A or B)

VS10 Machining preparation command (group number designation)

VS11 Tool group number

VS12 Tool nose, tool number

Variable Name

Function

VXMDR CEJ MATIC gauging data read completion flag

VCEJM CEJ MATIC read data

VXMAB Turret designation (A/B) in CEJ MATIC read data

VXMBD Compensation data in CEJ MATIC read data

VXMXZ Axis designation (X/Z) in CEJ MATIC read data

VDXMN Tool offset No. set at the CEJ MATIC gauging automatic offset data screen

VGRSL Tool No. of the tool presently selected in the tool group

VDTFX Tool offset in X-axis

VDTFZ Tool offset in Z-axis

Page 183: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-174SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-9-4. Program

CEJ MATIC Gauging Subprogram Flow Chart

OCEJA

M100 M100

VS09=1N1

NO

NO

NONO

NO

NO

YESYES

YES

YES

YES

YES

VRSTT=0

VXMDR=0

VXMDR=0VS07=1

2C

NB 1A

N2

VS08=VCEJM[VS07]/$1000000VS08=VS08 AND $80

VS08=0

VXMAB[VS07]=VS09

VS08=VCEJM[VS07]AND $1F00000VS08=VS08/$10000

VS05=BIN[VS08]VS08=VCEJM[VS07]AND $200000

VS08=0

VS06=VGRSL[VS11]

VS10=VDXMG[VS05]VS11=VDSTN[VS10]

VS04=VDSPN[VS10]*1000000+VDSEN[VS10]*10000+VS06

N3

VS06=0

2A

N6

2B

OCEJB

VS09=0

VS04=VDXMN[VS05]

VCEJM[*] *;1~12

Setting the flag for recognizing turret A or turret B

Is data read from CEJ MATIC gauging device?

Clearing the post-process data setting flagSetting "1" at the measured value reading counter (max. counter value: 12 times)

Check of (c)

Checking (b)

Setting the tool number or tool group number in a binary number

(a) Tool or tool group number(b) Type of tool number/tool group number(c) Indicating that the gauging data has been written

Finding the currently selected tool number from the read tool group

No tool registered?

Tool number

LE61497R0100700780001

Page 184: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-175SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

TRCT NO

NO

NONO

NO

NO

YES

YES

YES

YESYES

YES

TRCT=0

VDTCA[VS12]=VDTCA[VS12]+ABS[VXMBD[VS07]]

VS12=VDSEN[VS04]*1000000+VDSTN[VS04]

N8VS04=0

VDIN[1255]AND32=32

VXMXZ[VS07]=0

VDTWX[VS04]=VDTWX[VS04]-VXMBD[VS07]

VDTWZ[VS04]=VDTWZ[VS04]-VXMBD[VS07]

VXMXZ[VS07]=0NA

N9

VDTFX[VS04]=VDTFX[VS04]-VXMBD[VS07]

VDTFZ[VS04]=VDTFZ[VS04]-VXMBD[VS07]

VS07=VS07+1

VS07=<122C

1ANB

RTS

Reading counter increment

LE61497R0100700780002

Page 185: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-176SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Program List (CEJ MATIC Gauging Subprogram)

OCEJA (Saddle A side)

M100NOEX VS09=1GOTO N1

OCEJB (Saddle B side)

M100NOEX VS09=0N1 IF [VRSTT NE 0] NBIF [VXMDR EQ 0] NBNOEX VXMDR=0 VS07=1N2 NOEX VS08=VCEJM[VS07]/16777216 VS08=[VS08 AND 128]IF [VS08 EQ 0] NAIF [VXMAB[VS07] NE VS09] NANOEX VS08=[VCEJM[VS07] AND 2031616] VS08=VS08/65536NOEX VS05=BIN[VS08] VS08=[VCEJM[VS07] AND 2097152]IF [VS08 NE 0] N3NOEX VS04=VDXMN[VS05]GOTO N6N3 NOEX VS10=VDXMG[VS05]NOEX VS11=VDSTN[VS10]NOEX VS06=VGRSL[VS11]IF [VS06 EQ 0] NANOEX VS04=VDSPN[VS10]*1000000+VDSEN[VS10]*10000+VS06N6 IF TRCT N7GOTO N8N7 IF [TRCT NE 0] N8NOEX VS12=VDSEN[VS04]*10000+VDSTN[VS04]NOEX VDTCA[VS12]=VDTCA[VS12]+ABS[VXMBD[VS07]]N8 IF [VS04 EQ 0] NAIF [[VDIN[1255] AND 32] EQ 32] N10IF [VXMXZ[VS07] EQ 0] N9NOEX VDTFX[VS04]=VDTFX[VS04]-VXMBD[VS07]GOTO NAN9 NOEX VDTFZ[VS04]=VDTFZ[VS04]-VXMBD[VS07]GOTO NAN10 IF [VXMXZ[VS07] EQ 0] N11NOEX VDTWX[VS04]=VDTWX[VS04]-VXMBD[VS07]GOTO NAN11 NOEX VDTWZ[VS04]=VDTWZ[VS04]-VXMBD[VS07]NA NOEX VS07=VS07+1IF [VS07 LE 12] N2NBRTS

Page 186: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-177SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-10. MSB for Post-process Gauging Using RS-232C

1-10-1.Gauging Subprogram

1-10-2.System Variables

1-10-3.Common Variables

Variable Name

Function

OXMRA Subprogram called at turret A side

OXMRB Subprogram called at turret B side

Variable Name

Function

VEXDR Post-process gauging data read completion flag

VEXPO Gauging position number

VEXTRDesignation of turret for which tool offset data is corrected (0: Turret A side, 1: Turret B side)

VEXAX Designation of axis for which tool offset is corrected (0: Z-axis, 1: X-axis)

VEXGF Group flag (0: offset number, 1: group number)

VDEXT Machining preparation command value to be corrected

VEXOK Judgment of gauging result (0: OK, 1: NG)

VEXFB Feedback data

Variable Name

Function

VS01 Gauging position number

VS02 Machining preparation command

VS03 Tool No. of the tool presently selected in a tool group

VS04 Tool nose, position, tool number

VS07 Gauging position counter

VS08 Turret to be called

VS09 Machining preparation command (group number designation)

VS10 Tool nose, tool number

Page 187: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-178SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1-10-4.Program

Gauging Program Flow Chart

OXMRA

VS08=0

OXMRB

VS08=1NA1

VEXDR=0NO

NO

NO

NONO

NO

NOYES

YES

YES

YES

YES

YES

YES

M100

VEXDR=0

VS07=1NA2

VEXPO[VS07]=0

VS01=VEXPO[VS07]

VS08=0

VEXTR[VS01]=0

NA4

VEXTR[VS01]=0

VEXOK[VS01]=0

VS02=VEXTO[VS01]

VEXGF[VS01]=0

VS04=VS02

3B

NA10

3A

NA8

2B

NA5

2A

NA4A

3C

NA11

Reading of post-process gauging data completed?

1AGauging position counter

Is the above counter value "0"?

Specifying the turret for which offset data is compensated 0: Turret A 1: Turret B

Is the gauging result OK?

Offset number or group number used for compensated

Group flag 0: Offset number 1: Group number

Tool offset number

NA3

LE61497R0100700830001

Page 188: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-179SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

2A

VEXGF[VS01]=0

NA4B NO

NO

NO

NO

NO

NO

VDOUT[991]=9010

3B

NA10

VS02=VDEXT[VS01]NA5

YES

YES

YES

YES

YES

YES

VS02=0

VS03=VGRSL[VS02]

VS10=VDSEN[VS09]*10000+VS05

VS09=VS02VS03=VDSTN[VS09]

VS04=VDSPN[VS09]*1000000+VDSEN[VS09]*10000+VS05

VS03=0

NA7A

VEXOK[VS01]=0

NA7B

NA7CTRCT

TRCT=1

VDTNG[VS10]=1

VDTCA[VS10]=VDTCA[VS10]+ABS[VEXFB[VS01]]NA8

3A

2B

Group flag 0: Offset number, 1: Group number

Offset number used for compensation

Is offset number or group number "0"?

Tool number selected from the tool group

Is the gauging result OK?

Is the actual wear amount accumulated?

Is the actual wear amount ignored?

Gauging result is NG

LE61497R0100700830002

Page 189: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-180SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

Program List (Gauging Subprogram)

OXMRA

VS08=0GOTO NA1

OXMRB

VS08=1NA1 IF [VEXDR EQ 0] NA11M100VEXDR=0VS07=1NA2 IF [VEXPO[VS07] EQ 0] NA10VS01=VEXPO[VS07]IF [VS08 EQ 0] NA3IF [VEXTR[VS01] EQ 0] NA10GOTO NA4NA3 IF [VEXTR[VS01] NE 0] NA10NA4 IF [VEXOK[VS01] NE 0] NA4AVS02=VDEXT[VS01]IF [VEXGF[VS01] NE 0] NA5VS04=VS02GOTO NA8NA4A IF [VEXGF[VS01] EQ 0] NA4B

3B 3A NA8

YES

YES

YES

YES

YES

NO

NO

NO

NO

NO

VS04=0

VDIN[1255]AND 32¹32

VEXAX[VS01]=0

VDTFZ[VS04]=VDTFZ[VS04] -VEXFB[VS01]

VDTFX[VS04]=VDTFX[VS04] -VEXFB[VS01]

VEXAX[VS01]=0

NA10

VS07=VS07+1

3CNA11

RTS

1A

NA2

VDTWZ[VS04]=VDTWZ[VS04] -VEXFB[VS01]

VDTWX[VS04]=VDTWX[VS04] -VEXFB[VS01]

VS07=<12

Is the offset data compensated for Z-axis?

Gauging position counter increment

LE61497R0100700830003

Page 190: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

5972-E P-181SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

VS02=VDEXT[VS01]GOTO NA5NA4B VDOUT[991]=9010GOTO NA10NA5 IF [VS02 EQ 0] NA10VS09=VS02VS03=VDSTN[VS09]VS03=VGRSL[VS02]IF [VS03 EQ 0] NA10VS10=VDSEN[VS09]*10000+VS05VS04=VDSPN[VS09]*1000000+VDSEN[VS09]*10000+VS05NA7A IF [VEXOK[VS01] EQ 0] NA7BVDTNG[VS10]=1GOTO NA10NA7B IF TRCT NA7CGOTO NA8NA7C IF [TRCT EQ 1] NA8VDTCA[VS10]=VDTCA[VS10]+ABS[VEXFB[VS01]]NA8 IF [VS04 EQ 0] NA10IF [[VDIN[1255] AND 32] NE 32] NA9AIF [VEXAX[VS01] NE 0] NA9VDTWX[VS04]=VDTWX[VS04]-VEXFB[VS01]GOTO NA10NA9 VDTWZ[VS04]=VDTWZ[VS04]-VEXFB[VS01]GOTO NA10NA9A IF [VEXAX[VS01] NE 0] NA9BVDTFZ[VS04]=VDTFZ[VS04]-VEXFB[VS01]GOTO NA10NA9B VDTFX[VS04]=VDTFX[VS04]-VEXFB[VS01]NA10 VS07=VS07+1IF [VS07 LE 12] NA2NA11 RTS

Page 191: Okuma OSP-P300S P300L Gauging Systems Instruction Manual Application LE61-497-R01a

This manual may be at variance with the actual product due to specification or design changes.Please also note that specifications are subject to change without notice.If you require clarification or further explanation of any point in this manual, please contact your OKUMA representative.

LIST OF PUBLICATIONS

Publication No. Date Edition

5972-E December 2011 1st

Original Instruction Manual