186
OSP-U100L/U10L/ E100L/E10L/P200L/P20L GAUGING SYSTEMS INSTRUCTION MANUAL (2nd Edition) -APPLICATION- Pub No. 5327-E-R1 (LE61-129-R2) Feb. 2007

OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

Embed Size (px)

Citation preview

Page 1: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

OSP-U100L/U10L/E100L/E10L/P200L/P20LGAUGING SYSTEMSINSTRUCTION MANUAL(2nd Edition) -APPLICATION-Pub No. 5327-E-R1 (LE61-129-R2) Feb. 2007

Page 2: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-E P-(i)SAFETY PRECAUTIONS

SAFETY PRECAUTIONSThe machine is equipped with safety devices which serve to protect personnel and the machine itself fromhazards arising from unforeseen accidents. However, operators must not rely exclusively on these safetydevices: they must also become fully familiar with the safety guidelines presented below to ensure accident-free operation.This instruction manual and the warning signs attached to the machine cover only those hazards whichOkuma 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 majornoise source (for example, an electric welder or electric discharge machine) since thiscould cause malfunction of the CNC unit.

• If possible, connect the machine to a ground not used by any other equipment. If there isno choice but to use a common ground, the other equipment must not generate a largeamount 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 operation panel are not subject to excessivevibrations or shock.

• The permissible ambient temperature range for the control enclosure is 5 to 40°C.

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

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

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 thereare 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 CONTROLON switch on the operation panel.

Page 3: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-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 coverremoved.

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

(4) When machining the initial workpiece, check for machine operations, run the machine under noload 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, andmaximum 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 operationpanel are set to 100%.

(13) When moving the turret, check the software limits for X- and Z-axes or the locations of limitswitch 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) Chuck each workpiece firmly.

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

4. On Finishing Work(1) On finishing work, clean the vicinity of the machine.

(2) Return the ATC, APC and other equipment 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 themain power disconnect switch.

Page 4: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-E P-(iii)SAFETY PRECAUTIONS

5. Precautions during Maintenance Inspection and When Trouble OccursIn order to prevent unforeseen accidents, damage to the machine, etc., it is essential to observe thefollowing points when performing maitenance inspections or during checking when trouble hasoccurred.

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

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

(3) If two or more persons must work together, establish signals so that they can communicate toconfirm 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 wereand secure them properly with their screws, etc.

(7) When carrying out inspections in which measuring instruments are used - for example voltagechecks - 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 currentleakage 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 inthe MCS drive unit (servo/spindle), and for this reason only service personnel are permittedto 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 boardwhose memory stores the machining programs, parameters, etc. In order to ensure that thecontents of this memory will be retained even when the power is switched off, the memoryis supplied with power by a battery. Depending on how the printed circuit boards are han-dled, the contents of the memory may be destroyed and for this reason only service per-sonnel should handle these boards.

Page 5: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-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 excessivetemperature 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.

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 sufficienttraining.

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

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

(5) Memorize the position of the emergency stop button so that you can press it immediately at anytime 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 toconfirm safety before proceeding to each new step.

Page 6: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-E P-(v)SAFETY PRECAUTIONS

7. Symbols Used in This ManualThe following warning indications are used in this manual to draw attention to information ofparticular importance. Read the instructions marked with these symbols carefully and follow them.

indicates an imminently hazardous situation which, if not avoided, will result in death or serious injury.

indicates a potentially hazardous situation which, if not avoided, could result in death or seri-ous injury.

indicates a potentially hazardous situation which, if not avoided, may result in minor or moder-ate injury.

indicates a potentially hazardous situation which, if not avoided, may result in damage to your property.

indicates general instructions for safe operation.

DANGER

WARNING

CAUTION

CAUTION

SAFETY INSTRUCTIONS

Page 7: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-E P-(i)INTRODUCTION

INTRODUCTIONThank you very much for purchasing our numerical control unit OSP-E100L/E10L.Before using this NC unit (hereafter simply called NC), thoroughly read this programming manual (hereaftercalled this manual) 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 maintainaccuracy over a long term.You must pay particular attention to the cautions given in this manual, read them carefully, and make sure youfully understand them before operating the NC.

Display Screens

The NC display screens vary with the selected NC specifications. The screens shown in this manual, therefore, may not exactly the same with those displayed on your NC.

Page 8: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-E P-(i)TABLE OF CONTENTS

TABLE OF CONTENTS

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

1. Notes for Using Gauging MSB................................................................................................. 11-1. Notes ................................................................................................................................ 11-2. Control Statements........................................................................................................... 3

2. Touch Setter Gauging and Touch Sensor Gauging................................................................. 82-1. Overview........................................................................................................................... 82-2. Variable Tables................................................................................................................. 82-3. Print ................................................................................................................................ 172-4. Program.......................................................................................................................... 212-5. Flow Charts .................................................................................................................... 242-6. Program List ................................................................................................................... 60

3. Touch Sensor Gauging (Automatic Zero Offset Function)..................................................... 753-1. General Description of MSB ........................................................................................... 753-2. Variable Tables............................................................................................................... 753-3. Program.......................................................................................................................... 79

4. Automatic C-axis Zero Offset Function.................................................................................. 824-1. General Description of MSB ........................................................................................... 824-2. Variable Tables............................................................................................................... 824-3. Programs ........................................................................................................................ 86

5. Y-axis Gauging Function ..................................................................................................... 1075-1. Outline of MSB ............................................................................................................. 1075-2. Variables Table............................................................................................................. 1075-3. Programs ...................................................................................................................... 110

6. Automatic Gauging System Using Five Level Signals (BCD System)................................. 1356-1. General Description of MSB ......................................................................................... 1356-2. Variable Tables............................................................................................................. 1366-3. Program........................................................................................................................ 140

7. Automatic Gauging System Using Five Level Signals......................................................... 1467-1. General Description of MSB ......................................................................................... 1467-2. Variable Tables............................................................................................................. 1467-3. Program........................................................................................................................ 151

8. Automatic Gauging System by Seven Level Signals........................................................... 1578-1. General Description of MSB ......................................................................................... 1578-2. Variable Tables............................................................................................................. 1578-3. Program........................................................................................................................ 162

9. CEJ MATIC Gauging MSB .................................................................................................. 1689-1. CEJ MATIC Gauging Subprograms ............................................................................. 1689-2. Common Variables ....................................................................................................... 1689-3. System Variables.......................................................................................................... 1689-4. Program........................................................................................................................ 169

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

Page 9: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-E P-(ii)TABLE OF CONTENTS

10-1.Gauging Subprogram .................................................................................................. 17210-2.System Variables......................................................................................................... 17210-3.Common Variables ...................................................................................................... 17210-4.Program....................................................................................................................... 173

Page 10: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

SECTION 1 MAKER SUBPROGRAMS FOR GAUGING (MSB)

1. Notes for Using Gauging MSB

1-1. Notes

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

1-1-1. 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 blockoperation.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 V1 = 100..............×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 thesequence is excluded from single block processing. The operation itself does not vary regardless ofwhether or not NOEX is specified.

Page 11: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

1-1-2. Judging Local Variable Definition Using IF Statement

LE61129R0200700030001

(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 alocal variable name may not be enclosed by brackets ([ ]).

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

The IF statement judges whether or not the specified local variable has been defined and causes ajump to the N3 block if it has been defined.If it has not been defined, 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.

1-1-3. 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 themachine coordinate system) is set at VSKPZ.

LE61129R0200700040001

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

N2 IF Local-variable-name N3

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

X

Z

Machine zero

Zero offsetZero shift value

Measured value

Tool offset value

Contact point VSKPZ [*]

Page 12: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

[Supplement]

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. Ifno 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 isrequired after an IF instruction.Example:

LE61129R0200700050001

Specify either a space or a tab code immediately after an element consisting of two or moreconsecutive 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 thetouch setter gauging cycle, the contact point coordinate value is set at VSKPZ [2]. In the touchsensor gauging cycle (master ring gauging cycle, work gauging cycle), it is set at VSKPZ [1]. Thisis 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 fouralphanumeric digits following address N.Sequence names can be expressed in two ways: [N] [4-digit number] and [N] [Alphabet] [3-digitalphanumerics]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 NLAP2

Page 13: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

1-2-1. GOTO Statement (Unconditional Branch)

(1) Programming format

LE61129R0200700060001

[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 programor from the turret B side program to the turret A side program is not allowed.

The branch destination sequence name “N1” must be present in the same block where the controlstatement (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)

Page 14: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

1-2-2. IF Statement (Conditional Branch)

(1) Programming format

LE61129R0200700070001

(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:

LE61129R0200700070002

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

(3) Evaluation of defined or undefined local variables by IF statement

LE61129R0200700070003

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)

N1000 IF [V1 EQ 10] N2000

This stands for "EQUAL".

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.

Page 15: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Example:

LE61129R0200700070004

In the example program above, if local variable ABC has been defined, the program jumps tothe N2000 block.If it has not been defined, the next block is executed.

1-2-3. CALL Statement (Program Call)

(1) Programming format

LE61129R0200700080001

(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.

:N1000 IF ABC N2000 : :N2000

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.

Page 16: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

1-2-4. RTS Statement (Subprogram End Code)

(1) Programming format

LE61129R0200700090001

(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 blocknext to the CALL statement block.Variables registered by the execution of the CALL statement and those registered in the calledsubprogram are discarded.Example:

LE61129R0200700090002

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

LE61129R0200700090003

The sequence name specified as the jump destination must be present in the samesubprogram.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)

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

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

SubprogramMain program

N1000 O1234 N001 N050 N1001→ →→ →

Page 17: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2. Touch Setter Gauging and Touch Sensor Gauging

2-1. Overview

2-1-1. General Description of MSB

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

LMSA300A.MSBThe name of the gauging control software is expressed as indicated below.

In this manual, the gauging control software is represented by “MSB”.MSBs largely differ from other control software in their contents.Other control software is used to control signals from the machine and also input/output of partprograms and/or user’s commands.In contrast, MSBs have the same format as part programs, and they may be considered to becontrol software that executes gauging cycles instead of an operator.In the explanation below, LMSA300A.MSB (tool nose gauging using a touch sensor) is used as anexample. A variety of MSBs exist in addition to this program and the internal specification is specificto the individual programs. However, the basic programming format, variables to be used, etc. arecommon to all MSBs.

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)

(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*: Indicates the content of the gauging software.????: Indicates the gauging software version.

Page 18: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-2-1. Common Variables (VS01 to VS32)

Differing from common variables (V1 to V200) used for parameter setting, common variables VS01to VS32 are not displayed on the screen.

VariableNo. Function Remark Variable

No. Function Remark

VS01 Tool offset number For printer output VS17 Not used

VS02 Target value For printer output VS18 Absolute value of judgment result

Work/touch setter gauging

VS03 Gauging (measured) value For printer output VS19 Sensor input number

(1 or 2)Master ring/work/touch setter gauging

VS04 Offset value (previous) For printer output VS20

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

Touch setter gauging

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

VS07 Not used VS23 Tool number Work gauging

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

Work gauging

VS09 Not used VS25 NG double-contact flag

Work/touch setter gauging

VS10 Not used VS26 NG processing flag Touch setter gauging

VS11 Absplite value of amount of varition

Work/touch setter gauging VS27

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

Work/touch settergauging

VS12 Not used VS28

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

Touch setter gauging

VS13 Not used VS29 Target point Master ring/work/touch setter gauging

VS14 Not used VS30 Compensation data Work/touch setter gauging

VS15Gauging cycle starting point X (Z) coordinate value

Master ring/work/touch setter gauging VS31 Gauging (measured)

valueMaster ring/work/touch setter gauging

VS16 Not used VS32 Result of judgment Work/touch setter gauging

Page 19: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

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

LE61129R0200700120001

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.

Page 20: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-2-2. System Variables

System variables 1 are used in in-process gauging operations.They have numerical values automatically determined by the CNC and are used for reading, writing,and altering various types of data.* The subscript expression is the numerical value that can be specified following a variable name inthe format [*].

Variable Name Function Min - Max. - Values Subscript

Expression

VSIOX Actual position of X-axis(program coordinate system) -99999.999 to 99999.999

VSIOZ Actual position of Z-axis(program coordinate system) -99999.999 to 99999.999

VSKPX Sensor contact position of X-axis(machine coordinate system) -99999.999 to 99999.999 1 to 2

VSKPZ Sensor 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.999VETFZ Presently used tool offset data (Z-axis) -99999.999 to 99999.999VETON Presently used tool offset number 1 to 32VETLN Presently used tool number 1 to 12

VRNGX Master ring position (X-axis)(program coordinate system) -99999.999 to 99999.999

VRNGZ Master ring position (Z-axis) (program coordinate system) -99999.999 to 99999.999

VSNX Sensor position (X-axis)(machine coordinate system) -99999.999 to 99999.999 1 to 2

VSNZ Sensor 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

VGRID Flag indicating an occurrence of automatic indexing in a tool group 0 to 1 1 to 12

VTLNG Flag indicating the result in a gauging cycle was NG 0 to 1 1 to 12

VTLOA Offset number (group 1) 0 to 32 1 to 12VTLGN Group number the tool belongs to 0 to 12 1 to 12VTLSN Tool life - preset count number 0 to 9999 1 to 12VTLCN Actual machined number 0 to 9999 1 to 12VTLST Tool life - preset time 0 to 359999 1 to 12VTLCT Actual cutting time 0 to 359999 1 to 12VTLSA Tool life - preset wear amount 0 to 999.999 1 to 12VTLCA Actual tool wear amount 0 to 99999.999 1 to 12VTLLF Flag indicating the tool life status 0 to 1 1 to 12VTLOB Offset number (group 2) 0 to 32 1 to 12VTLOC Offset number (group 3) 0 to 32 1 to 12VZOFX X-axis zero offset data -99999.999 to 99999.999VZOFZ Z-axis zero offset data -99999.999 to 99999.999VZSHX X-axis zero shift data -99999.999 to 99999.999

Page 21: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-2-3. System Variables 2

System variables 2 are used for transferring data between turret A and turret B. They cannot bedisplayed 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 thangauging subprograms.They can be used in the same manner as parameter setting common variables.

VZSHZ Z-axis zero shift data -99999.999 to 99999.999VTOFX Tool offset data (X-axis) -99999.999 to 99999.999 1 to 32VTOFZ Tool offset data (Z-axis) -99999.999 to 99999.999 1 to 32

VSKFASetting for OPTIONAL PARAMETER (GAUGING) Feedrate in gauging cycle 2 (Feedrate for the first contact detection in double-contact gauging cycle)

1 to 500

VSKFB

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

1 to 500

VNSRX Nose radius compensation data (X-axis) -99999.999 to 99999.999 1 to 32VNSRZ Nose radius compensation data (Z-axis) -99999.999 to 99999.999 1 to 32

Variable Name Function Remarks

VMDT [1] Compensation data Master ring gaugingVMDT [2] Target value Work gaugingVMDT [3] Gauging (measured value) Work gaugingVMDT [4] Judgment Work gaugingVMDT [5] Compensation data 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 valueVMDT [8] Diameter gauging, lower diameter gauging valueVMDT [9] Diameter gauging, diameter gauging value

VMDT [10] Not usedVMDT [11] Not usedVMDT [12] Not used

Variable Name Function Min - Max. - Values Subscript

Expression

Page 22: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-2-4. 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 gaugingcycle executions.They are used in common for turret A and turret B.

Subprogram OCNCK is used for automatically incrementing a counter; when the counter datareaches 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.

LE61129R0200700150001

Variable Name Function Variable

Name Function

VMCN [1] Master ring gauging cycle ON preset value Setting VMCN [17] Not usedVMCN [2] Master ring gauging cycle ON counter Counter VMCN [18] Not usedVMCN [3] Work gauging cycle ON preset value Setting VMCN [19] Not usedVMCN [4] Work gauging cycle ON counter Counter VMCN [20] Not usedVMCN [5] Read-out cycle ON preset value Setting VMCN [21] Not usedVMCN [6] Read-out cycle ON counter Counter VMCN [22] Not usedVMCN [7] Tool breakage detection cycle ON preset value Setting VMCN [23] Not usedVMCN [8] Tool breakage detection cycle ON counter Counter VMCN [24] Not usedVMCN [9] Not used VMCN [25] Not used

VMCN [10] Not used VMCN [26] Not usedVMCN [11] Not used VMCN [27] Not usedVMCN [12] Not used VMCN [28] Not usedVMCN [13] Not used VMCN [29] Not usedVMCN [14] Not used VMCN [30] Not usedVMCN [15] Not used VMCN [31] Not usedVMCN [16] Not used VMCN [32] Not used

Page 23: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

2-2-5. 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 isdisplayed 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] Zero offset, Compensation data in the X-axis direction (amount of variation) 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 availableVIMDX [10] Not used Display available

VIMDX [11] Spare No display with standard specification

VIMDX [12] Spare No display with standard specification

Page 24: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-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).

LE61129R0200700160001

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 theturret 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 usedas variables.

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

VIMDZ [7] Not used Display availableVIMDZ [8] Not used Display availableVIMDZ [9] Not used Display available

VIMDZ [10] Not used Display available

VIMDZ [11] Spare No display with standard specification

VIMDZ[12] Spare No display with standard specification

Page 25: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-2-6. 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 ofthe inputs and outputs.

Output Variables

Special Input/Output VariablesThe inputs and outputs of the input/output variables indicated below correspond to each other andwhen 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] = 1: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: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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.

2-3-1. 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-axisPRNT 2 Work gauging cycle; turret A, Z-axisPRNT 3 Work gauging cycle; turret B, X-axisPRNT 4 Work gauging cycle; turret B, Z-axisPRNT 5 Master ring gauging cycle; turret A, X-axisPRNT 6 Master ring gauging cycle; turret A, Z-axisPRNT 7 Master ring gauging cycle; turret B, X-axisPRNT 8 Master ring gauging cycle; turret B, Z-axisPRNT 9 Touch setter gauging cycle; X-axis; data of the designated turret

PRNT 10 Touch setter gauging cycle; Z-axis; data of the designated turretPRNT 11 Work gauging cycle; X-axis; data of the designated turretPRNT 12 Work gauging cycle; Z-axis data of the designated turretPRNT 13 Master ring gauging cycle; X-axis; data of the designated turretPRNT 14 Master ring gauging cycle; Z-axis; data of the designated turret

Output Variable Function

Master Ring

Gauging

Work Gauging

Touch Setter

Gauging

VS01 Tool offset number whose tool offset data is corrected ×

VS02 Target valueVS03 Measured valueVS04 Offset data before compensation ×VS05 Offset data after compensation ×

VS06 Result of judgment: 0 for ±OK, ±1 for OK, ±2 for ±NG ×

Page 27: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-3-2. Print Format

Output format is indicated below.

Master ring gauging cycle

LE61129R0200700200001

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 iscorrected using these data.For the measured value in the X-axis direction in the ID master ring gauging cycle, the target valuewith 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

Page 28: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Work gauging cyclePRNT1 (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

LE61129R0200700200002

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 Result0 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

7 50.000 50.050 10.000 9.950 +OK

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

1997.8.28 THURSDAY 16:18:20

Page 29: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Touch setter gauging cycle

• Turret A PRNT9..........A-TURRET X-AXISPRNT10.........A-TURRET Z-AXIS

• Turret B PRNT9...........B-TURRET X-AXISPRNT10.........B-TURRET Z-AXIS

LE61129R0200700200003

(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

8 50.000 50.050 +OK

1997.3.24 THURSDAY 17:25:31

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

Page 30: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-4. Program

2-4-1. Table of Subprograms

The subprograms and their functions are briefly described below.

Subprogram No. Subprogram Name Function

(1) ORGIA Master ring gauging ID: To be called from turret AIf called while the chuck is closed, an alarm occurs.

(2) ORGOA Master 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 cycleTo be called within a gauging subprogramThe 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: To be called within the gauging cycle subprogramMeasured data is processed according to the result of judgment.

(12) OTNSL

Checks ATG and AOG commands, and selects the tool number and tool offset number.To be called within a subprogram. Determines whether the tool life management function is used or not. An alarm occurs if an ATG or AOG command is not correct.

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

Page 31: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

(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 in the block before the tool gauging cycle block.Turns 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 direction and corrects the tool offset data.

(19) OTMXZ

Touch 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 OSKPX in the direction of Z-axis.

(22) OSPCXConverts the coordinate value of the X-axis direction sensor “touch” point, which is read in terms of the machine coordinate system, into the coordinate value in the program coordinate system.

(23) OSPCZ Executes the same processing as OSPCX in the Z-axis direction.(24) OT1ME Executes a 0.1 sec dwell.

(11) OWTM

Work gauging/Touch setter gauging - Measuring and judgment cycle: To be called from a gauging subprogramThe result of actual measurement is classified into five levels: 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.

(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.

Subprogram No. Subprogram Name Function

Page 32: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

(28) ODOBA

Diameter gauging - OD by turret B: To be called from turret BMeasures 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 - ID by turret B: To be called from turret BMeasures 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: To be called from a gauging subprogramThe 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) OSNCA Touch 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 No. Subprogram Name Function

Page 33: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-5. Flow Charts

2-5-1. Master Ring Gauging

Master ring ID gauging cycleThis subprogram is called from turret A

LE61129R0200700220001

ORGIA

VRSTT=0NO

NO

YES

M100

VDIN[31]=0

YES

YES

YES

NO3B

3C

Is chuck NO.1 open?

XSTP=VSIOXZSTP=VSIOZ

VDIN[1255]AND32≠32

NA1

Sequence restart OFF?

Waiting forsynchronizationwith turret B

Gauging cycle is not ON

Storing the start position

NO

GOO X=-[TOFX[TOF1]-VTOFX[TOF2]/2 Z=ZP1 T=TLN*100+TOF1 M155

GOO X=-[[VTOFX[TOF1]+VTWOX[TOF1]] -[VTOFX[TOF2]+VTWOX[TOF2]]]/2 Z=ZP1 T=TLN*100+TOF1 M155

NA2

Z=ZP2

VS29=VRNGX

VS19=1

OSKPX

VIMDX[1]=VS31

VDIN[1255]AND32≠32 NO

GOO X=[TOFX[TOF1]-VTOFX[TOF2]]/2 T=TOF2

GOO X=[[VTOFX[TOF1]+VTWOX[TOF1]] -[VTOFX[TOF2]+VTWOX[TOF2]]]/2 T=TOF2

YESNA3

NA4

2A

Moving the sensor to P2Bringing the sensor tothe center of master ringTLN: tool number only

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)

Setting the sensor offsetvalue at TOF2

Page 34: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700220002

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

G00 Z=ZP3

X=XP3 T=TOF1

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

Print commandSetting 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

Page 35: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700220003

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

Page 36: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Master ring OD gauging cycleThis subprogram is called from turret A.

LE61129R0200700220004

ORGOA

VRSTT=0 NO

YES

YES

NO

M100

VDIN[31]=0

XSTP=VSIOXZSTP=VSIOZ

G00 X=XP1 Z=ZP1 T=TLN*100+TOF M155

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

Page 37: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700220005

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

Page 38: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700220006

Master ring gauging cycleThis subprogram is called from turret B.

LE61129R0200700220007

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

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

Page 39: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-5-2. Work Gauging

Work gauging cycle (Turret A, in the X/Z-axis direction)This subprogram is called from turret A.

LE61129R0200700230001

OWMXA OWMZA

VS27=0 VS27=1ND1

M155

VRSTT=0NO

YESVDOUT[9]=0

VS25=0VS29=MSP

VS19=1

OTNSL

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=VTOFX[VS01]

VIMDX[4]=VS31VS04=VTWOX[VS01]

ND3 ND6

VIMDZ[4]=VS31VS04=VTOFZ[VS01]

VIMDZ[4]=VS31VS04=VTWOZ[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 direction Z direction

Calling the subprogram for processing measured data

Variation in tool offset

Print command

Air blow OFF

Page 40: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Work gauging cycle (Turret A, in the X/Z-axis direction)This subprogram is called from turret A.

LE61129R0200700230002

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=2 YES ±NG

NO

NE2

NE3

M100

M100

M100

M154

RTS

NE4

VMDT[6]=0 YES

NO

NO

VDIN[21]=1

Setting the flag for judging by Turret B in Z Direction (Called from Turret A)

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.

Page 41: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-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 A in combination with OWXBA or OWZBA.

LE61129R0200700230003

OWXBB OWZBB

VS27=0 VS27=1NF1

VRSTT=0NO

YESM100

M100

VS27=0

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

OWXZ

Setting the flag for judging the gauging direction

Gauging in X direction Gauging in Z direction

Sequence restart OFF?

OTNSL

M100

NO

OWXZ

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

PRNT 11NF3

M100

M100NF4

RTS

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

PRNT 12

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

Z direction

X direction YES NF2

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 and BPrevious 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

Page 42: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

LE61129R0200700230004

OWXZ

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

YESVS18=1

VS05=VS04VMDT[5]=0

VS18=2

NO (OK processing, ±NG processing)

NO

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

NG1

VS06>=0 NO(-NG)

YES(+NG)M154 M154

VDOUT[992]=1001+VS27*2

1

VDIN[21]=1NO VTLNG[VS23]=1

VDOUT[992]=1000+VS27*2

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

NG3

VDIN[1255]AND32≠32 NO

NO NONG5 YES

NG6 YES NG4 YESVS27=0 VS27=0

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

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

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

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

NG7

VMDT[6]=0 YES

YES

NONO

NO

YES

NG9

TRCT

TRCT=1

VTLCA[VS23]=VTLCA[VS23] +ABS[VMDT[5]]

RTS

1

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

Page 43: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Work gauging data judgment cycle

LE61129R0200700230005

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.

Page 44: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Tool offset number indexing

LE61129R0200700230006

OTNSL

VS01=0

ATGNO

NO

NO

NO

NONONO

NO

YES

YES

YES

YES YES YES

AOGN14

N12

VMDT[6]=0

TOFNN13 YES

VS01=TOFN

VMDT[6]=1

OTGNM

0<ATG<VS07

VS23=VGRSL[ATG]

VS23=0

AOG=1 AOG=2 AOG=3

VS01=VTLOA[VS23] VS01=VTLOB[VS23] VS01=VTLOC[VS23]N17

VS01=0YES

N19

N18

VDOUT[992]=1008

M154M126

RTS

OTNSL: subprogram for checking ATG and AOG command values and selecting tool offset numberVS01: variable used to output the tool offset number to the printer

Tool offset number?

Is ATG (tool group number) specified?

Setting the maximum tool group number at VS07

Is ATG command value within allowable range?

Are tools registered in the specified tool group?

Tool offset number unregistered?

When both ATG and AOG are specified, data is processed assuming the tool life management specification. If one of the commands is omitted, the tool offset number is obtained from TOFN 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.

Page 45: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Gauging cycle START condition check counters

LE61129R0200700230007

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

Page 46: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Gauging cycle START condition cancel

LE61129R0200700230008

Automatic tool indexing check for trial-cut gauging cycle

LE61129R0200700230009

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.

OTRCK

NO

NO

VRSTT=0YES

RTG=1

OTGNM

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).

Page 47: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-5-3. Touch Setter Gauging

Gauging cycle START condition checkThis subprogram should be called before calling the touch setter gauging cycle.

LE61129R0200700240001

Tool breakage detection cycle

LE61129R0200700240002

OTST

NO

NO

NO

NO

YES

YES

YES

YES

YES

VRSTT=0

VS20=0

VDIN[35]=1

VDIN[34]=1

RTG=1

OTGNM

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 or turret B independently. The turret A does not need to wait the gauging start conditions to be checked on turret B.

OTLLS OTLLA OTLLB OTLLMNN1

NN3

NN2VS17=0

VS17=1 VS17=0

VS16=0 VS16=1

VRSTT=0YES

YES

OTNSL

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

Page 48: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Tool offset data read-out cycle

LE61129R0200700240003

OTFRD OTFRA OTFRB OTFRM

NN4

NN6

NN5VS17=0

VS17=1 VS17=0

VS16=0 VS16=1

VRSTT=0YES

YES

OTNSL

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.

Page 49: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700240004

2A

VS26=0XSTP=VSIOXZSTP=VSIOX

VMDT[6]=0NO

NO

NO

NO

NO

YESYES

YES

YESVDIN[1241]AND 7=0

NN9TLN1=TLNTLN1=TLN1/100TLN1=FIX[TLN1]TLN=TLN-TLN1*100

NN10

VS17=1 NN11

G00 X=XP1 Z=ZP1T=TLN

G00 X=XP1 Z=ZP1TM=TLN

NN12

VS01=VETONNN16

3A

NN15

NN13

VDIN[1241]AND 7=0

VS17=1

G00 X=XP1 Z=ZP1TG=ATG OG=AOG

G00 X=XP1 Z=ZP1OG=AOG

G00 X=XP1 Z=ZP1TM=VS23*100+VS01

NN14

Clearing the NG flagStoring the actual position (start point)

Tool life management specification not supported?

ATC unprovided?

Moving the tool nose to P1

YES

Page 50: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700240005

LE61129R0200700240006

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

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

Page 51: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Cycle judgment subprogram

LE61129R0200700240007

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

Page 52: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700240008

1A

VS27=0

4A

2A 3ANO12 NO9

NO 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[VETLN]=1 VS26=1

NO16

RTS

VS27=0NO5

NO6VTWOX[VS01]= VS32-VTWOX[VS01]

VTWOX[VS01]=VS32+VTWOX[VS01]

VTWOZ[VS01]=VS32+VTWOZ[VS01]

NO7VIMDX[5]=VS03VIMDX[6]=VS32

VIMDZ[5]=VS03VIMDZ[6]=VS32

VTOFX[VS01]=VS32-VTOFX[VS01]

VS17=1

VTOFX[VS01]=VS32+VTOFX[VS01]

VTOFZ[VS01]=VS32+VTOFZ[VS01]

NO11VIMDX[5]=VS03VIMDX[6]=VS32

VIMDZ[5]=VS03VIMDZ[6]=VS32

VS17=1

Processing Z-axis data

Processing X-axis data

Is the result NG?

CRT displayMeasured valueVariation

Tool life management specification not supported?

NO15

NG flag ON

Page 53: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Gauging cycle - X-axis

LE61129R0200700240009

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

Page 54: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Gauging cycle - Z-axis

LE61129R0200700240010

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

LE61129R0200700240011

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

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

Page 55: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

LE61129R0200700240012

0.1 sec dwell

LE61129R0200700240013

OSPCZ

VMIRZ=0 NO

YES

NP2

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

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

RTSNP3

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".

Page 56: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Work gauging data judgment cycle

LE61129R0200700240014

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 DNG command specified?

Judgment indicator lamp ON

Page 57: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

2-5-4. Diameter Gauging

Diameter gauging (OD/ID, turret A)These subprograms are called from turret A.

LE61129R0200700250001

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

TSON=VETON

VDOUT[9]=0

VS25=0

VS19=1

OTNSL

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

Page 58: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700250002

2B 2A

OWXZ

VIMDX[6]=-VMDT[5]

PRNT 11

G00 X=XSTP Z=ZSTP T=TSONNS4

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

Page 59: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Diameter gauging (OD/ID, turret B)These subprograms are called from turret A.

LE61129R0200700250003

ODOBA

VS24=0

NT1

ODIAA

VS24=1

M155

VRSTT=0 NO

YESVS27=0

XSTP=VSIOXZSTP=VSIOZ

TSON=VETON

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

Page 60: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700250004

2B 2A

VS18=2 YES

NO

NO

NO

YES

YES

NT3

NT2

NT4

M100

M100

M100

G00 X=XSTP Z=ZSTP T=TSON

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.

Page 61: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Diameter gauging (OD/ID, turret B)These subprograms are called from turret B.

LE61129R0200700250005

ODMBB

NO VRSTT=0YES

VS27=0

M100

OTNSL

M100

M100

VIMDX[4]=VMDT[3]VIMDX[7]=VMDT[7]VIMDX[8]=VMDT[8]VS04=VTOFX[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)Previous 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

Page 62: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Diameter gauging (Data judgment)

LE61129R0200700250006

ODWTM

VS24=0

G00 X=XP1 Z=ZP1 T=TOF2

NO NU1

NOYES

NU2 YES

VDIN[1255]AND 32≠32

G00 X=-[VTOFX[TOF1] -VTOFX[TOF2]]/2 Z=ZP1 T=TOF1

G00 X=-[[VTOFX[TOF1] +VTWOX[TOF1]] -[VTOFX[TOF2] -VTWOX[TOF2]]]/2 Z=ZP1 T=TOF11A

NU3

G00 Z=ZP2

VS29=MSP

OSKPX

VS22=VS31

VS24=0

G00 Z=ZP1

X=-XP1 T=TOF1

Z=ZP2

NU6VS29=-MSP

OSKPX

2A

NO

NO NU4

VDIN[1255]AND 32≠32

NU5 YESG00 X=[VTOFX[TOF1] -VTOFX[TOF2]]/2 T=TOF2

G00 X=-[[VTOFX[TOF1] +VTWOX[TOF1]] -[VTOFX[TOF2] -VTWOX[TOF2]]]/2 T=TOF2

OD gauging?

Setting the target value (of the upper gauging point)

Calling the X-direction gauging and processing subprogram

String the value measured at the upper gauging pointOD gauging?

YES

Setting the target value (of the lower gauging point)

Calling the X-direction gauging and processing subprogram

Page 63: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700250007

2A

VS21=[VS22-VS31]/2

VS24=0 NO

NO

NO NO

NO

YES

YES

YES

YES

YESYES

NO

NO

G00 Z=ZP1

X=XP1 T=TOF2

G00 Z=ZP1

VDIN[1255] AND32≠32

NU8

NU9

G00 X=[VTOFX[TOF1] -VTOFX[TOF2]]/2 T=TOF1

G00 X=-[[VTOFX[TOF1] +VTWOX[TOF1]] -[VTOFX[TOF2] -VTWOX[TOF2]]]/2 T=TOF1

VS32=VS21+VS29VS11=ABS[VS32]

VIMDX[12]=VS11VIMDZ[12]=DNG

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

YESAPPS

VS25=0

VS25=1

1A

NU3

NU10

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?

Page 64: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Calculating the maximum tool group number

LE61129R0200700250008

OTGNM

VDIN[1255]AND 16=16

YES

YES

YES

NO

NO

NO

NV1

NV2

NV3

NV4

VDIN[1255]AND 4=4

VDIN[1255]AND 2=2

VS07=32

RTS

VS07=64 VS07=96 VS07=200

Tool life management of 200 tool groups

Tool life management specification of 96 tool groups

Tool life management specification of 64 tool groups

Page 65: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Sensor position compensation

LE61129R0200700250009

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 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

TLN1=TLNTLN1=TLN1/100TLN1=FIX[TLN1]

TLN=TLN-TLN1*100

NW3

NW4

VS17=1 NW5

G00 X=XP1 Z=ZP1T=TLN

NW11

NW6VS01=VETON

X=XP2 Z=ZP2

2A

NW7

NW8G00 X=XP1 Z=ZP1 OG=AOG

NW9

VS17=1 NW10

G00 X=XP1 Z=ZP1TM=TLN

G00 X=XP1 Z=ZP1TG=ATG OG=AOG

G00 X=XP1 Z=ZP1TM=VS23*100+VS01

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

2B

NW17

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 number

Resetting the NG flag

Storing the actual position

ATC unprovided?

Offset number output to the printer

Moving the tool nose to P2

Page 66: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700250010

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

Page 67: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Sensor position compensation (Z-axis direction)This subprogram is called from OSNCA.

LE61129R0200700250011

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

Page 68: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Sensor position compensation (X-axis direction)This subprogram is called from OSNCA.

LE61129R0200700250012

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

RTS

Page 69: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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=VSIOZIF [[VDIN[1255] AND 32] NE 32] NA1G00X=-[[VTOFX[TOF1]+VTWOX[TOF1]]-[VTOFX[TOF2]+VTWOX[TOF2]]]/2Z=ZP1 T=TLN*100+TOF1 M155GOTO NA2NA1 G00X=-[VTOFX[TOF1]-VTOFX[TOF2]]/2Z=ZP1 T=TLN*100+TOF1 M155NA2 Z=ZP2NOEX VS29=VRNGX VS19=1CALL OSKPXNOEX VIMDX[1]=VS31IF[[VDIN[1255]AND 32]NE 32]NA3G00X=[[VTOFX[TOF1]+VTWOX[TOF1]]-[VTOFX[TOF2]+VTWOX[TOF2]]]/2T=TOF2GOTO NA4NA3 G00X=[VTOFX[TOF1]-VTOFX[TOF2]]/2 T=TOF2NA4 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]M100G00Z=ZP3X=XP3 T=TOF1NOEX 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=-[[VTOFX[TOF1]+VTWOX[TOF1]]-[VTOFX[TOF2]+VTWOX[TOF2]]]/2GOTO NA7NA6 G00X=-[VTOFX[TOF1]-VTOFX[TOF2]]/2NA7 Z=ZP1X=XSTP Z=ZSTP M154GOTO NA9NA8 NOEX VMDT[1]=0 VDOUT[992]=1100NA9 M100NA10 RTS

Page 70: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

ORGOA (Master ring gauging (OD), called from turret A)IF[VRSTT NE 0]NB1M100IF[VDIN[31] EQ 0]NB1NOEX XSTP=VSIOX ZSTP=VSIOZG00X=XP1 Z=ZP1 T=TLN*100+TOF 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

OWMXA (Work gauging (turret A in the X-axis direction), called from turret A)NOEX VS27=0GOTO ND1

Page 71: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-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 OTNSLNOEX 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=VTWOX[VS01]GOTO ND3ND2 NOEX VIMDX[4]=VS31 VS04=VTOFX[VS01]ND3 CALL OWXZNOEX VIMDX[6]=-VMDT[5]PRNT 11GOTO ND7ND4 IF[[VDIN[1255]AND 32]NE 32]ND5NOEX VIMDZ[4]=VS31 VS04=VTWOZ[VS01]GOTO ND6ND5 NOEX VIMDZ[4]=VS31 VS04=VTOFZ[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: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-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 OTNSLM100M100IF[VS27 NE 0]NF2NOEX VIMDX[4]=VMDT[3] VS04=VTOFX[VS01]CALL OWXZNOEX VIMDX[6]=-VMDT[5]PRNT 11GOTO NF3NF2 NOEX VIMDZ[4]=VMDT[3] VS04=VTOFZ[VS01]CALL OWXZNOEX VIMDZ[6]=-VMDT[5]PRNT 12NF3 M100M100NF4 RTS

OWXZ (Work gauging (processing of measured data), called within the gaugingcycle 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 VTLNG[VS23]=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 VTWOZ[VS01]=VTWOZ[VS01]-VMDT[5] VS05=VTWOZ[VS01]GOTO NG7NG4 NOEX VTWOX[VS01]=VTWOX[VS01]-VMDT[5] VS05=VTWOX[VS01]GOTO NG7NG5 IF[VS27 EQ 0]NG6NOEX VTOFZ[VS01]=VTOFZ[VS01]-VMDT[5] VS05=VTOFZ[VS01]GOTO NG7NG6 NOEX VTOFX[VS01]=VTOFX[VS01]-VMDT[5] VS05=VTOFX[VS01]NG7 IF[VMDT[6] EQ 0]NG9IF TRCT NG8GOTO NG9NG8 IF[TRCT EQ 1]NG9NOEX VTLCA[VS23]=VTLCA[VS23]+ABS[VMDT[5]]NG9 RTS

Page 73: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

OWTM (Work gauging/Touch setter gauging (measuring and judgment cycle), calledfrom a gauging 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 VTLNG[VS23]=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 VTWOZ[VS01]=VTWOZ[VS01]-VMDT[5] VS05=VTWOZ[VS01]GOTO NG7NG4 NOEX VTWOX[VS01]=VTWOX[VS01]-VMDT[5] VS05=VTWOX[VS01]GOTO NG7NG5 IF[VS27 EQ 0]NG6NOEX VTOFZ[VS01]=VTOFZ[VS01]-VMDT[5] VS05=VTOFZ[VS01]GOTO NG7NG6 NOEX VTOFX[VS01]=VTOFX[VS01]-VMDT[5] VS05=VTOFX[VS01]NG7 IF[VMDT[6] EQ 0]NG9IF TRCT NG8GOTO NG9NG8 IF[TRCT EQ 1]NG9NOEX VTLCA[VS23]=VTLCA[VS23]+ABS[VMDT[5]]NG9 RTS

OTNSLDetermines 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 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 VTLNG[VS23]=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]NG4

Page 74: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NOEX VTWOZ[VS01]=VTWOZ[VS01]-VMDT[5] VS05=VTWOZ[VS01]GOTO NG7NG4 NOEX VTWOX[VS01]=VTWOX[VS01]-VMDT[5] VS05=VTWOX[VS01]GOTO NG7NG5 IF[VS27 EQ 0]NG6NOEX VTOFZ[VS01]=VTOFZ[VS01]-VMDT[5] VS05=VTOFZ[VS01]GOTO NG7NG6 NOEX VTOFX[VS01]=VTOFX[VS01]-VMDT[5] VS05=VTOFX[VS01]NG7 IF[VMDT[6] EQ 0]NG9IF TRCT NG8GOTO NG9NG8 IF[TRCT EQ 1]NG9NOEX VTLCA[VS23]=VTLCA[VS23]+ABS[VMDT[5]]NG9 RTS

OCNCK (Counter for checking the gauging cycle START conditions, called fromeither 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

OMSSF (Cancels the gauging cycle START conditions, called from both turrets Aand B)IF[VRSTT NE 0]NK1M100NOEX VDOUT[31]=0 VDOUT[32]=0 VDOUT[33]=0NOEX VDOUT[34]=0 VDOUT[35]=0NK1 RTS

OTRCK (Checks conditions for starting the trial-cut gauging cycle, called from bothturrets A and B)IF[VRSTT NE 0]NK1M100NOEX VDOUT[31]=0 VDOUT[32]=0 VDOUT[33]=0NOEX VDOUT[34]=0 VDOUT[35]=0NK1 RTS

Page 75: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

OTST (Checks conditions for starting the touch setter gauging cycle, called in theblock before the tool gauging cycle block)IF[VRSTT NE 0]NM3NOEX VS20=0IF[VDIN[35] EQ 1]NM2IF[VDIN[34] EQ 1]NM2NOEX RTG=1CALL OTGNMNM1 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), called from the turreton which the tool to be measured is set)GOTO NN1

OTLLA (Touch setter gauging (tool offset data read-out cycle), called from the turreton which the tool to be measured is set)NN1 NOEX VS17=0 VS16=0GOTO NN3

OTLLBNOEX VS17=1GOTO NN2

OTLLMNOEX VS17=0NN2 NOEX VS16=1NN3 IF[VRSTT NE 0]NN22CALL OTNSLIF[VDIN[35] NE 1]NN22NOEX VS28=1GOTO NN8

OTFRDGOTO NN4

OTFRANN4 NOEX VS17=0 VS16=0GOTO NN6

OTFRBNN4 NOEX VS17=0 VS16=0GOTO NN6

OTFRMNOEX VS17=0NN5 NOEX VS16=1NN6 IF[VRSTT NE 0]NN22

Page 76: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

CALL OTNSLIF[VDIN[34] EQ 1]NN7IF[VMDT[6] EQ 0]NN22IF[VGRID[ATG] 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 NOEX TLN1=TLNTLN1=TLN1/100TLN1=FIX[TLN1]TLN=TLN-TLN1*100NN10 IF[VS17 EQ 1]NN11G00X=XP1 Z=ZP1 T=TLNGOTO NN12NN11 G00X=XP1 Z=ZP1 TM=TLNNN12 NOEX VS01=VETONGOTO NN16NN13 IF[[VDIN[1241] AND 7] NE 0]NN15IF[VS17 EQ 1]NN14G00X=XP1 Z=ZP1 TG=ATG OG=AOGGOTO NN16NN14 G00X=XP1 Z=ZP1 TM=VS23*100+VS01GOTO NN16NN15 G00X=XP1 Z=ZP1 OG=AOGNN16 X=XP2 Z=ZP2IF[MSPZ EQ 0]NN17X=XP3NOEX VS27=1CALL OTMXZPRNT 10G00X=XP2IF[VS26 EQ 0]NN18NOEX VIMDX[5]=0 VIMDX[6]=0GOTO 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 from OTFRD orOTLLS)NOEX VDOUT[9]=0 VS19=2 VS25=1IF[[VDIN[1235] AND 2] NE 2]NO0AIF[VS16 EQ 0]NO0ANOEX VS19=3

Page 77: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NO0A IF[VS27 EQ 0]NO1IF[VMIRZ NE 0]NO0BNOEX VS29=VSNZ[MSPZ]-VZOFZ-VZSHZGOTO NO2NO0B NOEX VS29=-[VSNZ[MSPZ]-VZOFZ-VZSHZ]GOTO NO2NO1 NOEX VS29=VSNX[MSPX]-VZOFX-VZSHXIF[VS19 NE 3]NO2NOEX VS29=-VS29NO2 CALL OWTMNOEX VS02=VS29 VS03=VS31 VS06=VS30 VS18=ABS[VS06]IF[VS18 NE 1]NO4IF[VS28 NE 0]NO4IF[VS27 EQ 0]NO3NOEX VTOFZ[VS01]=VS32+VTOFZ[VS01] VIMDZ[5]=VS03 VIMDZ[6]=VS32GOTO NO7NO3 IF[VS17 EQ 1]NO3ANOEX VTOFX[VS01]=VS32+VTOFX[VS01]GOTO NO3BNO3A NOEX VTOFX[VS01]=VS32-VTOFX[VS01]NO3B NOEX VIMDX[5]=VS03NOEX VIMDX[6]=VS32GOTO NO7NO4 IF[VS27 EQ 0]NO5NOEX VIMDZ[5]=VS03 VIMDZ[6]=0GOTO NO6NO5 NOEX VIMDX[5]=VS03 VIMDX[6]=0NO6 IF[VS18 NE 2]NO7IF[VMDT[6] EQ 0]NO8IF[VORD[OT21] NE 1]NO8NOEX VTLNG[VETLN]=1GOTO NO7NO8 VS26=1NO7 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 NR1

Page 78: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

G30Z=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 programcoordinate 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 programcoordinate system (Z-axis), called from a subprogram)NOEX VS31=VSKPX[VS19]-VZOFX-VZSHX-VETFXIF[VS19 NE 3]NP1NOEX VS31=-VS31NP1 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 NS8

Page 79: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NS3 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 TSON=VETONNOEX VDOUT[9]=0 VS25=0 VS19=1CALL OTNSLCALL ODWTMNOEX 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=VTWOX[VS01]GOTO NS3NS2 NOEX VS04=VTOFX[VS01]NS3 CALL OWXZNOEX VIMDX[6]=-VMDT[5]PRNT 11G00X=XSTP Z=ZSTP T=TSONNS4 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 TSON=VETONM100M100NOEX 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]NT2

Page 80: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

IF[VMDT[6] EQ 0]NT3IF[VDIN[21] NE 1]NT3NT2 M100NT3 M100M100G00X=XSTP Z=ZSTP T=TSONNT4 M154RTS

ODMBB (Diameter gauging (turret B), called from turret B)IF [VRSTT NE 0] NV1NOEX VS27=0M100CALL OTNSLM100M100NOEX VIMDX[4]=VMDT[3] VIMDX[7]=VMDT[7] VIMDX[8]=VMDT[8]NOEX VS04=VTOFX[VS01]CALL OWXZNOEX VIMDX[6]=-VMDT[5]PRNT 11M100M100NV1 RTS

ODWTM (Measuring and judgment cycle for diameter gauging, called from agauging subprogram)IF[VS24 NE 0]NU1G00X=XP1 Z=ZP1 T=TOF2GOTO NU3NU1 IF[[VDIN[1255]AND 32]NE 32]NU2G00X=-[[VTOFX[TOF1]+VTWOX[TOF1]]-[VTOFX[TOF2]+VTWOX[TOF2]]]/2Z=ZP1 T=TOF1GOTO NU3NU2 G00X=-[VTOFX[TOF1]-VTOFX[TOF2]]/2 Z=ZP1 T=TOF1NU3 G00Z=ZP2NOEX VS29=MSPCALL OSKPXNOEX VS22=VS31IF[VS24 NE 0]NU4G00Z=ZP1X=-XP1 T=TOF1Z=ZP2GOTO NU6NU4 IF[[VDIN[1255]AND 32]NE 32]NU5G00X=[[VTOFX[TOF1]+VTWOX[TOF1]]-[VTOFX[TOF2]+VTWOX[TOF2]]]/2T=TOF2GOTO NU6NU5 G00X=[VTOFX[TOF1]-VTOFX[TOF2]]/2 T=TOF2NU6 NOEX VS29=-MSPCALL OSKPXNOEX VS21=[VS22-VS31]/2IF[VS24 NE 0]NU7G00Z=ZP1X=XP1 T=TOF2

Page 81: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

GOTO NU9NU7 G00Z=ZP1IF[[VDIN[1255]AND 32]NE 32]NU8G00X=-[[VTOFX[TOF1]+VTWOX[TOF1]]-[VTOFX[TOF2]+VTWOX[TOF2]]]/2T=TOF1GOTO NU9NU8 G00X=-[VTOFX[TOF1]-VTOFX[TOF2]]/2 T=TOF1NU9 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 NU15NU12 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

OTGNMIF [[VDIN[1255] AND 16] NE 16]NV1NOEX VS07=200GOTO NV4NV1 IF [[VDIN[1255] AND 12] NE 12]NV2NOEX VS07=96GOTO NV4NV2 IF [[VDIN[1255] AND 10] NE 10]NV3NOEX VS07=64GOTO NV4NV3 NOEX VS07=32NV4 RTS

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

OSNCBNOEX VS17=1 VS19=2GOTO NW1

OSNCMNOEX VS17=0 VS19=3NW1 NOEX VS16=1NW2 IF[VRSTT NE 0]NW17CALL OTNSL

Page 82: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NOEX VS26=0 XSTP=VSIOX ZSTP=VSIOZIF[VMDT[6] NE 0]NW7IF[[VDIN[1241] AND 7] EQ 0]NW4NW3 NOEX TLN1=TLNNOEX TLN1=TLN1/100NOEX TLN1=FIX[TLN1]NOEX TLN=TLN-TLN1*100NW4 IF[VS17 EQ 1]NW5G00X=XP1 Z=ZP1 T=TLNGOTO NW6NW5 G00X=XP1 Z=ZP1 TM=TLNNW6 NOEX VS01=VETONGOTO NW11NW7 IF[[VDIN[1241] AND 7] NE 0]NW9NW8 G00X=XP1 Z=ZP1 OG=AOGGOTO NW11NW9 IF[VS17 EQ 1]NW10G00 X=XP1 Z=ZP1 TG=ATG OG=AOGGOTO NW11NW10 G00X=XP1 Z=ZP1 TM=VS32*100+VS01NW11 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 NW15NW13 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

OSNMZIF[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=VS32

Page 83: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

IF [VMIRZ EQ 0]NY7NOEX VS29=-VS29NY7 NOEX VSNZ[MSPZ]=VS29+VSNZ[MSPZ]NY8 NOEX VIMDZ[5]=VS31 VIMDZ[6]=VS32RTS

OSNMXNOEX 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: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

3. Touch Sensor Gauging (Automatic Zero Offset Function)

3-1. General Description of MSB

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

LMSC300A.MSBMSBs largely differ from other control software in their contents.Other control software is used to control signals from the machine and also input/output of partprograms and/or user’s commands.In contrast, MSBs have the same format as part programs, and they may be considered to becontrol software which executes gauging cycles instead of an operator.

3-2. Variable Tables

The variables used in MSB 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) Input/output variables (used for input/output)

Page 85: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

3-2-1. Common Variables (VS01 to VS32)

Differing from common variables (V1 to V200) used for parameter setting, common variables VS01to VS32 are not displayed on the screen.

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

Variable Name Function Remark Variable

Name Function Remark

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 usedVS05 Not used VS21 Not usedVS06 Not used VS22 Not usedVS07 Not used VS23 Not usedVS08 Not used VS24 Not usedVS09 Not used VS25 Not usedVS10 Not used VS26 Not usedVS11 Not used VS27 Not usedVS12 Not used VS28 Not usedVS13 Not used VS29 Not usedVS14 Not used VS30 Not usedVS15 Not used VS31 Not usedVS16 Not used VS32 Not used

Page 86: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

LE61129R0200700290001

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.

Page 87: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

3-2-2. 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 thosedisplayed and set as parameters, zero offset data, tool offset data, etc.

[Supplement]

3-2-3. 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. Values Subscript

ExpressionVSIOZ Actual position of Z-axis -99999.9999 to 99999.9999VSKPZ Sensor contact position of Z-axis -99999.9999 to 99999.9999 1 to 2VZOFZ Zero offset of Z-axis -99999.9999 to 99999.9999VSHZ Zero shift of Z-axis -99999.9999 to 99999.9999VETFZ Presently used tool offset data (Z-axis) -99999.9999 to 99999.9999

VSKFA

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

1 to 500

VSKFB

Setting for OPTIONAL PARAMETER (GAUGING) Feedrate in gauging cycle 1 (Feedrate for the second contact detection in a double-contact gauging cycle; feedrate 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 usedVMDT [3] Not usedVMDT [4] Not usedVMDT [5] Not usedVMDT [6] Not usedVMDT [7] Not usedVMDT [8] Not usedVMDT [9] Not usedVMDT [10] Not usedVMDT [11] Not usedVMDT [12] Not used

Page 88: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

3-3. Program

3-3-1. Flow Chart

LE61129R0200700320001

OZOFA

VRSTT=0 NO

NO

NO

YES

YES

YES

NA11

2BVS01=1

APPSNA2

VS02=VSIOZ

MSP≤VS02

G00 Z=MSP-APP G00 Z=MSP+APP

NA3

NA4

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

VS03=VSKPZ[VS01]-VZOFZ -VZSHZ-VETFZ

Z=VS03 D=APPSL=IMP F=VSKFB

VS03=VSKPZ[VS01] -VZOFZ-VZSHZ-VETFZ

G00 Z=VS02NA5

2A

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

VS03=VSKPZ[VS01]-VZOFZ -VZSHZ-VETFZ

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

Storing the actual value (gauging start point)

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

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

First gauging

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

Returning the sensor to the gauging start point

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

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

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

Page 89: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700320002

LE61129R0200700320003

2A

VS03=VS03-MSPVS11=ABS[VS03]VIMDX[12]=VS11

DNG NO

NO

NO

NO

NO

YES

YES YES

YES

NA6VIMDZ[12]=DNG

NG?VIMDX[12] <VIMDZ[12]

+NG?

NA7VDOUT[992]

=3003VDOUT[992]

=3002

VS03=0 VS03=0NA10

VZOFZ=VZOFZ+VS03

VMDT[1]=VS03

M100NA11

RTS

DOKVS03>0

VIMDZ[12]=DOKNA9

NA8

OK?VIMDX[12] <VIMDZ[12]

VS03=0

2B

YES

Calculating the difference from the current zero positionObtaining the absolute value of the difference

DNG command specified?

DOK command specified?

Setting the alarm number

Adding the compensation data to the previous zero offset amount

Transferring the offset amount to turret B (by setting the offset amount at the system variable common to turrets A and B)

OZOFB

VRSTT=0NO

Correcting the zero position in Z direction on turret B

Waiting for the gauging and processing to be completed on turret A

NB1

M100

VZOFZ=VZOFZ+VMDT[1]

RTS

YES

Page 90: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

3-3-2. Program List

OZOFA (Automatic zero offset (processing at turret A), called from turret A)IF[VRSTT NE 0]NA11NOEX VS01= 1IF 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]-VZ0FZ-VZSHZ-VETEZZ=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=0GOTO NA10NA7 NOEX VDOUT [992]=3003 VS03=0 GOTO NA10NA8 IF DOK NA9GOTO NA10NA9 VIMDZ [12]=DOKIF[VIMDX [12] GT VIMDZ[12]]NA10NOEX VS03=0NA10 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 91: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

4. Automatic C-axis Zero Offset Function

4-1. General Description of MSB

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

LMSD300A.MSBThe name of the gauging control software is expressed as indicated below.

MSBs largely differ from other control software in their contents.Other control software is used to control signals from the machine and also input/output of partprograms and/or user’s commands.In contrast, MSBs have the same format as part programs, and they may be considered to becontrol software that executes gauging cycles instead of an operator.

4-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 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*: Indicates the content of the gauging software.????: Indicates the gauging software version.

Page 92: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

4-2-1. Common Variables (VS01 to VS32)

Differing from common variables (V1 to V200) used for parameter setting, common variables VS01to VS32 are not displayed on the screen.

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

Variable No. Function Remark Variable

No. Function Remark

VS01 VS17 Not usedVS02 Both sides / one side of keyway VS18 Not usedVS03 VS19 Not usedVS04 C-axis target value VS20 Not usedVS05 Number of groove searches VS21 Not usedVS06 VS22 Not usedVS07 C-axis actual position VS23 Not usedVS08 Skip feedrate (1st time) VS24 Not usedVS09 Skip feedrate (2nd time) VS25 Not usedVS10 VS26 Not usedVS11 C-axis direction of rotation VS27 Not usedVS12 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 CW rotation of the C-axis

VS30 Not used

VS15 Skip feedrate VS31 Not usedVS16 VS32 Not used

Page 93: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

LE61129R0200700360001

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.

Page 94: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

4-2-2. 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 thosedisplayed and set as parameters, zero offset data, tool offset data, etc.

Variable Name Function Min. - Max. Values Subscript

Expression

VSIOX Actual position of X-axis (program coordinate system) -9999.999 to 9999.999

VSIOC Actual 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.999VZSHC Zero shift of C-axis 0 to 359.999

VSNWD Offset between sensor center and sensor head in CW rotation of C-axis 0 to 359.999

VSNTU Offset between sensor center and sensor head in CCW rotation of C-axis 0 to 359.999

VCDIR Direction of rotation of C-axis 15, 16VRUND 360000 (constant of 360)VCPFI Flag which indicates the presence of a groove 0, 128

VRSTT Flag which indicates that sequence restart is in progress 0, 128

VUNIT Unit amount 2, 4

VSKFA

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

1 to 500

VSKFB

Setting for OPTIONAL PARAMETER (GAUGING) Feedrate in gauging cycle 1 (Feedrate for the second contact detection in the double-contact gauging cycle; feedrate for the contact detection in the single-contact gauging cycle)

1 to 500

Page 95: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

4-2-3. 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 isdisplayed at the specified field in the display screen.They are independent for each of the turrets.

4-2-4. 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.

4-2-5. Input/Output Variables

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

4-3. Programs

4-3-1. Table of Subprograms

Variable Name Function

VIMDX [9] Variable for displaying measured valuesVIMDX [10] Variable for displaying compensation data

Variable Name Function

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

Variable Name Function

VDOUT [992] Alarm B user reserve codeVDOUT [993] Alarm A user reserve code

Subprogram No. Subprogram Name Function

(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) OZOFG Compensation 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 (Correcting the offset data in a different spindle mode)

Page 96: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

4-3-2. Flow Charts

Keyway gauging (both sides, one side)

LE61129R0200700420001

OZOFD OZOFC

VS02=0 VS02=1NA1

VRSTT=0 NO

NO

NO

NO

NO

NO

YESYES

YES

YES

YES

YES

YES

VCACN=0NO

VS11=VCDIR+113VS15=VSKFB

OFCAL

VMLOK=0

VDOUT[993]=102NA20

4C

VS08=VS15

APPSNA2VS15=VSKFA

OFCAL

VS09=VS15NA3

VS02=1NA4 M15?

VS11=128NA5

NA10

2DM16

VS07=VSIOC-CMW/2

ORDOF

APPS NA8

2CG30 C=VS07 CD=CMW/2CL=CMW/2 F=VS09

VS07=VSKPC[1]-VZOFC-VZSHC

2A

ORDOF

Keyway gauging cycle (both sides)

Keyway gauging cycle (one side)

C-axis disconnected?

Machine lock OFF?

Storing the previous C-axis rotation command

Calculating the skip feedrate

Alarm A (user reserve code)

Calculating the first skip feedrate from the value set at the OPTIONAL PARAMETER (GAUGING) No.2 Feedrate in gauging cycle 2

Key one-side gauging?

Converting the target value to a value within the range from 0° to 360°

Converting the target value to a value within the range from 0° to 360°

Calculating the sensor touch position (in the program coordination system)

Page 97: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700420002

2A

VS10=VS07VS07=VSIOC-VS10

ORDOF

VS07≥APPS

M15

VS07=VS10+APPS

NO

NO

NO

YES

YES

YES

G00 C=VS07

ORDOF

ORDOF

ORDOF

M16NA7

G30 C=VS10 CD=APPSCL=CMW/2 F=VS08

NA9

NA82C

G30 C=VS07 VD=CMW/2CL=CMW/2 F=VS08

VS10=VSKPC[1]-VZOFC-VZSHC

VS13=ATAN[VSNTU/VS10X*2]VS07=VS10-VS13

VS13=VS07

2DNA10

VS02=1

4B

NA16

M15

VS07=VSIOC+CMW/2

APPSNA13

3C3A

NA11

Calculating the distance between the actual valve and the first touch position valve

Converting the distance into a valve within the range from 0° to 360°

Moving the sensor from the first touch position by a distance of APPS in the opposite direction

Calculating the sensor touch position (in the program coordinate system)

Subtracting the sensor diameter from the measured value

Keyway gauging cycle (one side)?

Gauging on the other side

Page 98: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700420003

3A

ORDOF

ORDOF

ORDOF

ORDOF

G30 VS07 CD=CMW/2CL=CMW/2 F=VS09

VS07=VSKPC[1]-VZOFC-VZSHC

VS10=VS07VS07=VS10-VSIOC

VS07≥APPSNO

YES

M16

VS07=VS10-APPS

G00 C=VS07

M15NA12

NA14

G30 C=VS10 CD=APPSCL=CMW/2 F=VS08

3CNA13

G30 C=VS07 CD=CMW/2CL=CMW/2 F=VS08

VS10=VSKPC[1]-VZOFC-VZSHC

VS14=ATAN[VSNWD/VSIOX*2]VS07=VS10-VS14

VS14=VS07

4A

Target value for indexing the keyway

Page 99: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700420004

4A

NO

NO

NO

YES

YES

YES

VS07=[VS14+VS13]/2

VS02=1

VS14≥VS13

VS07=VS07+VRUND/2NA141

NA15

NA17

NA20

ORDOF

ORDOF

ORDOF

VS14=VS07

VIMDX[9]=VS14VS07=VS14-COF

VIMDX[10]=VS07VMDT[10]=VS07VS07=VZOFC+VS07

VZOFC=VS07

VS11=128

M16

RTS

NA18

M154C

4B

VS14=VS13

NA16

Keyway gauging cycle (one side)?

Calculating the middle position between the gauging points on both sides of the keyway

Setting the gauging data to be displayedCalculating the compensation data

Setting the compensation data to be displayedTransferring the compensation data to the other coordinate systemCalculating the new C-axis offset data

Converting the offset data into a valve within the range from 0° to 360°

Setting the C-axis zero offset

Selecting the C-axis rotating direction specified before gauging cycle

Page 100: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Key gauging (both sides, one side)

LE61129R0200700420005

OZOFF

VS02=0

VRSTT=0

NA1NO

NO NO

NO

NO

NO

NO

YESYES

YES

YES

YES

YES

VCACN=0

VS11=VCDIR+113VS15=VSKFB

OFCAL

VS08=VS15

APPSNA2VS15=VSKFA

VS09=VS15

OFCAL

NA3VS02=1

NA4VS11=128

NA5

M15?YES

4AM16

VS07=CSIOC-VRUND/2

ORDOF

APPS

G30 C=VS07 CD=VRUND/2CL=VRUND/360000*179000 F=VS09

2C

2A

VS07=VSKPC[1]-VZOFC-VZSHC

ORDOF

NA8

VMLOK=0

VDOUT[993]=102NA20

6B

Key gauging cycle (both sides)

OZOFE

VS02=1

Key gauging cycle (one side)

C-axis disconnected?

Storing the previous C-axis rotation command

Calculating the skip feedrate

Machine lock OFF?

Alarm A (user reserve code)

Calculating the first skip feedrate from the value set at the OPTIONAL PARAMETER (GAUGING) No.2 Feedrate in gauging cycle 2

Key gauging cycle (one side)?

Subtracting 180° from the actual valve to determine the target value

Calculating the target value into a valve whthin the range from 0° to 360°

Calculating the sensor touch position (in the program coordinate system)

Calculating the target value into a valve whthin the range from 0° to 360°

Page 101: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700420006

2A

VS10=VS07VS07=VS10-VSIOC

ORDOF

YES

YES

VS07≥APPS

ORDOF

ORDOF

NOM15

VS07=VS10+APPS

ORDOF

G00 C=VS07

M16NA7

G30 C=VS10 CD=APPSCL=CMW F=VS08

NA82C

G30 C=VS07 CD=VRUND/2CL=VRUND/360000*179000 F=VS08

NA9VS10=VSKPC[1]-VZOFC-VZSHC

VS13=ATAN[VSNTU/VSIOX*2]VS07=VS10-VS13

VS13=VS07

VS02=1NA10

M15

NA16

6C

VS14=ATAN[VSNWD/VSIOX*2]

VS07=VS07-CKW-APP+VS14

3A

Calculating the distance between the actual value and the first touch position value

Converting the distance into a value whthin the range from 0° to 360°

Moving the sensor from the first touch position by a distance of APPS in the opposite direction

Calculating the sensor touch position (in the program coordinate system)

Subtracting the sensor diameter from the measured value

Keyway gauging cycle (one side)?

Page 102: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700420007

3A

RTXNO

NO

YES

YES

RTX=0NA101

G00 X=VSIOX+RTX

C=VS07

X=VSIOX-RTX

VS07=VS07+APP

ORDOF

APPSNA11

G30 C=VS07 CD=APPCL=CKW F=VS09

5B

NA13

VS07=VSKPC[1]-VZOFC-VZSHC

5A

Does the positioning to the gauging start point need retraction of X-axis?

Retraction of X-axis

Positioning of C-axis

Approach of X-axis

Calculating the sensor touch position (in the program coordinate system)

Page 103: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700420008

ORDOF

ORDOF

ORDOF

ORDOF

4A

M15

VS07=VSIOC-VRUND/2

APPS NO

NO

YES

YES

NA111G30 C=VS07 CD=VRUND/2

CL=VRUND/360000*179000 F=VS09

VS07=VSKPC[1]-VZOFC-VZSHC

VS07≤APPS

VS10=VS07VS07=VS10-VSIOC

M16

VS07=VS10-APPS

G00 C=VS07

M15

G30 C=VS10 CD=APPSCL=VRUND/360000*179000 F=VS08

G30 C=VS07 CD=VRUND/2CL=VRUND/360000*179000 F=VS08

5A

NA112 NA113

NA14

Adding 180° to the actual value to determine the target value

Calculating the sensor touch position (in the program coordinate system)

Converting the measured value into a value whthin the range from 0° to 360°

Converting the measured value into a value whthin the range from 0° to 360°

Calculating the distance between the actual value and the first gauging position value.

Moving the sensor from the first touch position by a distance of APPS in the opposite direction

Positioning the sensor to the second gauging cycle start point

Page 104: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700420009

5A

ORDOF

ORDOF

ORDOF

ORDOF

ORDOF

VS10=VS07VS07=VS10-VSIOC

YES

YES

YES

NO

NO

NO

VS07≥APPS

M16

VS07=VS10-APPS

G00 C=VS07

M15NA12

G30 C=VS10 CD=APPS CL=CKW F=VS08

NA135B

G30 C=VS07 CD=APP CL=CKW F=VS08NA14

VS10=VSKPC[1]-VZOFC-VZSHC

VS14=ATAN[VSNWD/VS10X*2]VS07=VS10-VS14

VS14=VS07

VS02=1

VS07=[VS14+VS13]/2

VS14<VS13

VS07=VS07+VRUND/2]

6A

Target value for indexing the key

Calculating the sensor touch position (in the program coordinate system)

Key gauging cycle (one sides)

Calculating the middle point between gauging point on both sides of the key

Adding 180° to the middle point if 0° exists between both gauging points

NA141

NA15

Page 105: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700420010

6ANA15

VS14=VS07NA17

VIMDX[9]=VS14VS07=VS14-COF

ORDOF

VIMDX[10]=VS07VMDT[10]=VS07VS07=VZOFC+VS07

VZOFC=VS07

VS11=128

M16

NA20

RTS

NA18

M15

6C

VS14=VS13

NA16

6B

ORDOF

Setting the gauging data to be displayed Calculating the compensation data

Setting the compensation data to be displayedTransferring the offset value to the other coordinate systemCalculating the new C-axis offset amount

Converting the offset data into a value whthin the range from 0° to 360°

Setting the C-axis zero offset

Selecting the C-axis rotating direction specified before gauging cycle

Page 106: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Groove index cycle in the Z-axis direction

LE61129R0200700420011

ORDOF

OCPF1

VRSTT=0 NO

NO NO

NO

NO

NO

NO

NO

NO

YES

YES

YES

YES

YES

YES

NB2

NB4

NB6

NB8

NB9

VCACN=0

NB12VDOUT[993]=102

VS11=VCDIR+113

G00 C=COF

VS04=VSIOCVS05=1

NB1G30 Z=MSP D=APP L=IMP F=VSKFB AN=1

VS07=VS04-CFW M16

VS07=VS04+CFW M15

VS07=VS04+CFW*2

VS07=VS04-CFW*2 M16

G00 C=VS07

VS05=VS05+1

VCPFI=128

VS05=1

VS05=2

VS05=3

VS05=4

NB13VDOUT[992]=3006

NB14

RTS

YESNB11

NB10

G00 Z=VSIOZ

VS11=128

M15 M16

VMLOK=0

C-axis disconnected?

Storing the current C-axis rotation directionTarget point for indexing the groove

C-axis target position

Calculating the target value for the second groove indexing cycle

Third groove indexing cycle

Fourth grooveindexing cycle

Fifth groove indexing cycle

Converting the target value into a value whthin the range from 0° to 360°

Groove indexing target value

Is a groove found?

YES

Counting the groove indexing times

Groove not found after at least five times of searching

Alarm B 2288 (user reserve code)

Groove indexing cycle command

Z-axis command target point

Selecting the C-axis rotating direction specified before gauging cycle

Machine lock OFF?

Alarm A 1213 (user reserve code)

YES

Page 107: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Groove index cycle in the X-axis direction

LE61129R0200700420012

ORDOF

OCPFX

VRSTT=0 NO

NO NO

NO

NO

NO

NO

NO

NO

YES

YES

YES

YES

YES

YES

NE2

NE4

NE6

NE8

NE9

VCACN=0

NE12VDOUT[993]=102

VS11=VCDIR+113

G00 C=COF

VS04=VSIOCVS05=1

NE1G30 Z=MSP D=APP L=IMP F=VSKFB AN=1

VS07=VS04-CFW M16

VS07=VS04+CFW M15

VS07=VS04+CFW*2

VS07=VS04-CFW*2 M16

G00 C=VS07

VS05=VS05+1

VCPFI=128

VS05=1

VS05=2

VS05=3

VS05=4

NE13VDOUT[992]=3006

NE14

RTS

YESNE11

NE10

G00 Z=VSIOX

VS11=128

M15 M16

VMLOK=0

C-axis disconnected?

Storing the current C-axis rotation directionTarget point for indexing the groove

C-axis target position

Calculating the target value for the second groove indexing cycle

Third groove indexing cycle

Fourth groove indexing cycle

Fifth groove indexing cycle

Converting the target value into a value whthin the range from 0° to 360°

Groove indexing target value

Is a groove found?

YES

Counting the groove indexing times

Groove not found after at least five times of searching

Alarm B 2288 (user reserve code)

Groove indexing cycle command

X-axis command target point

Selecting the C-axis rotating direction specified before gauging cycle

Machine lock OFF?

Alarm A 1213 (user reserve code)

Page 108: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Conversion of angle data into a value between 0 and 359.999 The angle data set forVS07 is converted in a value between 0 and 359.999

LE61129R0200700420013

Calculation of C-axis feedrate F C-axis feedrate F is calculated from the X-axis valueso that the surface speed at the gauging position will be the parameter-set feedrate.

LE61129R0200700420014

ORDOFNC1

VS07<VRUND

NO

NO

NO

NO

YES

YES

YES

YESVS07=VS07-VRUND

VS07≥VRUND

RTS

NC2

VS07≥0

VS07=VS07+VRUND

VS07<0

Feedrate (F) = × ×360°Parameter feedrate mm/min

Actual X-axis position data mm × π(in diameter)

500mm

360°

=

=

×Set value1

Actual X-axis position data

×500mm

159.155

π

OFCAL

[VUNIT AND 2]=2

NO

NO

YES

YES[VUNIT AND 4]=4

VS15=VS15*1000

ND2

VS15=VS15*159.155VS15=VS15/VSIOX

RTS

ND1

VS15=VS15*100

Decimal point command in units of mm? VUNIT is the value set at the

optional parameter (unit system).

V915 is the value set at the optional parameter (gauging) No.1 (Feedrate in gauging cycle 1) or No.2 (Feedrate in gauging cycle 2).

Decimal point command in units of 10 mm?

Page 109: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

Compensation in a different coordinate system (Correcting the offset data at theother turret in the same spindle mode)

LE61129R0200700420015

Compensation in a different coordinate system (Correcting the offset data in adifferent spindle mode)

LE61129R0200700420016

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

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

Page 110: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

4-3-3. Program List

OZOFD (Keyway gauging (both sides))NOEX VS02=0GOTO NA1

OZOFC (Keyway gauging (one side))NOEX VS02=1NA1 IF[VRSTT NE 0]NA20IF[VCACN EQ 0]NA1AGOTO NA1BNA1A IF[VMLOK 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 M16NOEX 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 ORDOF

Page 111: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NOEX 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 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

OZOFF (Key gauging (both sides))NOEX VS02=0GOTO NA1

OZOFE (Key gauging (one side))NOEX VS02=1NA1 IF[VRSTT NE 0]NA20IF[VCACN EQ 0]NA1AGOTO NA1BNA1A IF[VMLOK EQ 0]NA19NA1B NOEX VS11=VCDIR+113 VS15=VSKFBCALL OFCALVS08=VS15IF APPS NA2GOTO NA3NA2 NOEX VS15=VSKFACALL OFCALVS09=VS15NA3 IF[VS02 EQ 1]NA4GOTO NA5

Page 112: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NA4 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 NA6GOTO 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 G00 X=VSIOX+RTXC=VS07X=VSIOX-RTXNOEX VS07=VS07+APPCALL ORDOF

Page 113: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

IF 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 ナ iGE ナ jVS07=VS07+VRUND/2NA141 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[VCACN EQ 0]NB1AGOTO NB2ANB1A IF[VMLOK 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 NB9

Page 114: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NB3 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]=102GOTO NB14NB13 NOEX VDOUT[992]=3006NB14 RTS

OCPFX (Groove index cycle in the X-axis direction)IF[VRSTT NE 0]NE14IF[VCACN EQ 0]NE1AGOTO NE1BNE1A IF[VMLOK 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*2M16

Page 115: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NE9 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

OFCAL (Calculation of C-axis feedrate F)IF[[VUNIT AND 2]EQ 2]ND2IF[[VUNIT AND 4]EQ 4]ND1NOEX VS15=VS15*1000GOTO ND2ND1 NOEX VS15=VS15*100ND2 NOEX VS15=VS15*159.155 VS15=VS15/VSIOXRTS

OZOFG (Compensation in a different coordinate system (Correcting the offset dataat 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 datain a different spindle mode))NOEX VS07=VZOFC-VMDT[10]CALL ORDOFNOEX VZOFC=VS07RTS

Page 116: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

5. Y-axis Gauging Function

5-1. Outline of MSB

This subsection explains a list, a flow chart, a variable table, etc. used for Y-axis gauging function bytaking the following file as an example.

LMSN312A.MSBThe 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'scommands, 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 beconsidered as the control software that implements gauging cycle instead of the user.

5-2. Variables Table

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 inparameter setting.)

(2) System variables

LMS*????.MSB*: Contents of each gauging software????: Version of each gauging software

Page 117: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

5-2-1. 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 gaugingfunction. Therefore, the variable data is eliminated or changed each time the gauging cycle isexecuted.

Variable name Used as Remarks Variable

name Used as Remarks

VS01 Tool offset number, cutter radius compensation number VS17

VS02 Target value VS18 Absolute value of the gauging result

VS03 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 keywayMeasured diameter

VS06 Gauging result VS22

Measured value on positive Y-axis sideMeasured value of upper diameter

VS07 VS23 Tool number

VS08 VS24Key or keyway gauging judgment flag (0: Key gauging, 1: Keyway gauging)

VS09 Saddle B readout judgment flag VS25 NG double-touch flagVS10 Saddle B readout judgment flag VS26

VS11 Absolute value of the compensation amount VS27 Gauging axis judgment (2: Y-

axis gauging cycle)VS12 Gauging by approach from side VS28VS13 Y-axis gauging cycle number VS29 Target point

VS14 Gauging direction in the Y-axis gauging cycle VS30 Result of judgment

VS15 Y-axis gauging cycle start point VS31

Measured valueMeasured value on negative Y-axis sideMeasured lower diameter

VS16 VS32 Compensation amount

Page 118: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

5-2-2. System Variables

These system variables are used for gauging cycle other than the Y-axis gauging specificationand the data are deleted and changed every time the gauging cycle is executed.Refer the system variables to the programming manual.

Name ContentsVMDT[1] Zero compensated valueVMDT[2] Target valueVMDT[3] Gauging resultVMDT[4] JudgmentVMDT[5] Compensated valueVMDT[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 valueVMDT[8] -Y side gauging value/lower diameter gauging valueVMDT[9] Gauging value of key, keyway width, or center position/gauging value of

diameter gaugingVRSTT Flag of sequence return restartVMLCK Flag of machine lockingVPOCH Designates cutter compensation systemVIMDX 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)VNSRX Nose R compensated value of X-axisVNSRY Nose R compensated value of YI-axisVNSRZ Nose R compensated value of Z-axisVTOFX Tool offset X-axisVTOFY Tool offset YI-axisVTOFZ Too offset Z-axisVTLCA Real loss of tool lifeVETON Current tool offset numberVSKPY YI-axis skip position (machine coordinate)VZOFY Zero offset of YI-axisVZSHY Shift value of YI-axis zeroVETFY Current tool offset value of YI-axisVMIRY 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 119: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

5-3. Programs

5-3-1. Sub-programs

5-3-2. Flowcharts

The flowcharts of the programs used in the Y-axis gauging are shown the following pages.

Name ContentsOWMYA Workpiece gauging in Y-axis direction (tool offset value compensation)OWMYR Workpiece gauging in Y-axis direction (cutter radius compensation value

compensation)OWYM Workpiece gauging judgment cycleOWXY Workpiece gauging in Y-axis direction, gauging data handlingOKIYR Keyway width compensationOKIYA Keyway position compensationOKOYR Key width compensationOKOYA Key position compensationOKWTM Keyway, Key gauging data judgmentOSKPY Gauging cycle of Y-axisOSPCY Conversion of measured Y-axis position into program coordinateODTMY Diameter gauging data judgment by Y-axis gaugingODOAY OD gauging by Y-axis movementsODIAY ID gauging by Y-axis movementsOZORY Y-axis zero offsetOJUDY Gauging result judgment cycle

Page 120: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490001

1) Work Gauging in Y Direction (for Correcting Tool Offset Values) OWMYA Work Gauging in Y Direction (for Correcting Cutter Radius Compensation Values) OWMYR

OWMYA OWMYR

VS13=0 VS13=1

ND1

VS27=2M155

Specify gauging result judgment dataAir blow ON

Specify a gauging cycle

Sequence restart?VRSTT=0

Y

N

N

N

N

N

Y

Y

Y

Y

Y-axis mode?VYMOD≠0

ND1A

VDOUT[9]=0 Judgment lamp OFF

VS25=0VS29=MSP

Flag for NG double-touch gaugingSet the gauging target point

VS19=1

VS09=0

Set the sensor number

VDIN[1255]AND 64=64

Position specified?

APO

BPO = VPOCHVPOCH = APO

OTNSL

1A

2A

VMDT[2]=MSPVMDT[3]VS31VMDT[4]VS30

Target pointMeasured valueJudgment

Judge the gauging cycle data

OWYM

1A

2B

ND3

Machine lock?

VMLCK=0Alarm B User reserve code

OWMYA,OWMYR 1/2

VDOUT[992]=1400

Tool offset in multiple coordinate systems?

Determine whether or not the gauging result is used for the tool life management.After checking ATG and AOG, the gauging system sets the tool number and the tool offset/cutter radius compensation number.

Page 121: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490002

OWXY

2A

VIMDX[4]=VS31

VMDT[5]=VS32

VIMDX[6]=-VMDT[5]

VS01=0 Y

Y

Y

N

N

N

Y

Y

N

N

VS13=1

VS04=VNSRY[VS01]

VS14=0

V32=-V32

ND2B

Compensation amount

Tool offset in multiple coordinate systems?VDIN[1255]

AND 64 = 64

Position specified?

APO

VPOCH = BPO

ND3

M154 Air blow OFF

RTS

ND2

VS04=VTOFY[VS01]

ND2AVS32=0VS04=0

2B

OWMYA,OWMYR 2/2

Work gauging in Y direction (cutter radius compensation)?

Y gauging by approaching from negative side?

VS13=1

VIMDY[4]=VS31

ND1DY

N

If the compensation number is 0, set "0" at VS32 because no compensation is executed.

ND1E

VS13=1Y

NVIMDY[6]=-VMDT[5]

ND2D

ND2E

Page 122: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490003

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

Page 123: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490004

OWXY

VS18=1

VS18=2

VS05=VS04VMDT[5]=0

VS27=2

VMDT[6]=0

TRCT

TRCT=1

VS13=1, 2, 4,

VTLCA[VS23]=VTLCA[VS23]+ABS[VMDT[5]]

RTS

1A

VDIN[21]=1VMDT[6]=0

VTLNG[VS23]=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]

Target valueMeasured valueJudgment resultAbsolute value of judgment result

N

YN

N

N

Y

Y

Y

± OK processing NYE3

NG ignored?

± NG processingN

Y

NYE1

NYE2-NG+NG

OK processing

Alarm B

NYE3

NYE4

NYE3B

NYE5

NYE6

NYE3A

Y-axis gauging?

YN

N

N

N

N

Y

Y

Y

Y

TRACT command specified?

Omit calculation of wear amount?

Tool life management used?

Y

Key or keyway width gauging?

Cutter radius compensation

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

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

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

3) Work Gauging in Y Direction: Gauging Data Processing OWXY OWXY 1/1

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 offsetMeasure diameter

through Y-axis gauging

Correct X-axis tool offset

Page 124: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490005

4) Keyway Width Compensation OKIYR Keyway Position Compensation OKIYA Key Width Compensation OKOYR Key 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

TSON=VETON

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

Page 125: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490006

2A

VS13=3.5

APO

VDIN[1255]AND 64=64

2C

2C

VIMDY[6]=-VMDT[5]

GOO X=XP1 Y=YSP Z=ZP1 T=TSON

VIMDY[4]=VS21VIMDY[7]=VS22VIMDY[8]=VS31

BPO = VPOCHVPOCH = APO

OWXY

RTS

2B

Y

Y

N

NPosition specified?

Air blow OFF

NS2

VDIN[1255]AND 64 = 64

APO

VPOCH = BPO

M154

N

N

N

N

Y

Y

Y

Y

NS1I

NS1F

NS1G

VS04=VTOFY[VS01] VS04=VNSRY[VS01]VS32=VS32/2

VS13=2

VS32=-VS32

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

Target pointMeasured valueJudgmentCompensation amountMeasured upper radiusMeasured lower radiusMeasured key/keyway width or center position

Key or keyway position compensation?

Keyway width compensation?

Tool offset in multiple coordinate systems?

Position specified?

OKIYR,OKIYA,OKOYR,OKOYA 2/2

Set the previous tool offset or cutter radius compensation at VS04

Tool offset in multiple coordinate systems?

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.

Page 126: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490007

OKWTM

VS24=0

VS12=1

VS24=0

VS12=1

OSKPY

OSKPY

2A

1A

5) Judgment of Keyway/Key Gauging Data OKWTM

GOO X=XP1 Z=ZP1 Y=YSPNUO

N

N

Y

Y

Key gauging? NU1GOO X=XP1 Z=ZP1 Y=YSP+DYP T-TOF2 GOO X=XP1 Z=ZP1 Y=-[VIOFY[TOF]]-VTOFY[TOF2]]/2+YSP T=TOF1

Positioning for gauging on +Y side

NU2AGOO Z=ZP2

NU2

GOO X=XP2

NU2B

VS29=YSP+[KH/2] Set the target position on +Y side

Execute Y gauging

VS22=VS31 Store +Y side gauging result

Key gauging?

Y

N

N

Positioning for gauging on -Y side NU3

NU4

NU3A

Change the sensor offset

Gauging by front approach?

Y

GOO X=XP1Y=YSP-DYP T=TOF1X=XP2

GOO Z=ZP1Y=YSP-DYP T=TOF1Z=ZP2

VS29=YSP-[KH/2] Set the target position on -Y side

Execute Y gauging

OKWTM 1/2

VS25=1

GOO Y=[VTOFY[TOF1]-VTOFY[TOF2]]/2+YSP T=TOF2

Gauging by front approach?

Bring the sensor center to the middle of keyway

Page 127: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490008

2A

1A

VS13=3,5

VS24=0

VS32>0

APPS

VS25=0

VS32>0

GOO Y=YSP T=TOF2 GOO Y=-[VTOFY[TOF1]-VTOFY[TOF2]]/2+YSP T=TOF1

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]

GOO X=XP1 Z=ZP1

VS21=VS22-VS31VS29=KHVS32=VS21-VS29

VS21=[VS22+VS31]/2VS29=YSPVS32=VS21-VS29

RTS

Key/keyway position compensation?

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

Calculate key/keyway widthCalculate key/keyway center position

Key gauging?

Positioning for gauging on +Y side

Change offset in preparation for NG double-touch

±NG?

Double-touch?

NG double-touch?

±OK?

Difference between measured width and specified width

Difference between measured center and specified center

N

Page 128: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490009

OSKPY

RTS

OSPCY

RTS

VS29=≤VS15

APPS

NPY3A

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 shift amountVETFY: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

Page 129: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490010

VS25=1

ODTMY

8) Judgment of Diameter Measured by Y-axis Gauging ODTMYODTMY 1/3

1A

VS24=0

G00 X=XP1 Z=ZP1 T=TOF2 G00 X=XP1 Z=ZP1 T=TOF1

G138

G00 Y=YP1

Z=ZP2

VS24=0

VS12=1

G00 Y=YP1

VS29=MSP/2

X=XP2

OSKPY

VS22=VS31

2A

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

N

Y

N

Y

N

Y

NYB1

NYB2

NYB3

NYB4

NYB5

NYB6

G00 Z=ZP2 Y=-[VTOFY[TOF1]-VTOFY[TOF2]]/2

Page 130: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490011

2A

VS24=0

VS12=1

ODTMY 2/3

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

Y=-YP1 T=TOF1

G00 Z=ZP1

Z=ZP2

T=TOF2Y=-YP1 T=TOF1

G00 X=XP1/2

VS29=-MSP/2

X=XP2

OSKPY

VS21=VS22-VS31

Y=0 T=TOF2

G00 X=XP1/2

VS24=0

Y=0 T=TOF1

G00 Z=ZP1

3A

Setting the negative Y-axis target position

Starting Y-axis gauging

Measured value

OD gauging?

Changing sensor offset

Changing sensor offset

VS12=1

OD gauging by approach to a side of the workpiece

Gauging by approach to the workpiece front?

Gauging by approach to the workpiece front

Y=0 T=TOF2

G00 Z=ZP1

Changing sensor offset

ID gauging always done by approach to the workpiece front

N

Y

N

Y

Y

N

Y

N

NYB7

NYB8

NYB9

NYB10

NYB11

NYB12

Page 131: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490012

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

±OK?

Double touch?

NG double touch?

Y-axis mode OFF

NYB12

±NG?

NYB13

NYB18

NYB14

NYB15

NYB16 NYB17

N

Y

N

Y

Y

N

N

Y

N

Y

N

Y

+NG -NG -OK+OK OK

Page 132: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490013

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=VSIOZTSON=VETON

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 tool offset 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

NYA9

Page 133: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490014

2C

VDIN[1255]AND 64=64

2A

OTNSL

ODTMY

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

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

VS04=VTOFX[VS01]

APO

BPO=VPOCHVPOCH=APO

OWXY

2B

APO

VDIN[1255]AND 64=64

2B

VIMDX[6]=-VMDT[5]

PRNT 11

G00 X=XSTP Z=ZSTP T=TSON

VPOCH=BPO

M154

RTS

ODOAY 2/2

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)Old 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

Tool offset data sets expanded?

Position specified?

N

Y

N

Y

N

Y

N

YNYA8

NYA9

NYA6

NYA7

Page 134: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490015

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

Y

NA8

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

Page 135: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700490016

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

Page 136: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

5-3-3. 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 valuecompensation))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=0IF[[VDIN[1255] AND 64] NE 64]ND1CIF APO ND1BGOTO ND1CND1B NOEX BPO=VPOCHNOEX VPOCH=APOND1C CALL OTNSLCALL 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=VNSRY[VS01]IF[VS14 NE 0]ND2BVS32=-VS32GOTO ND2BND2 VS04=VTOFY[VS01]GOTO ND2BND2A NOEX VS32=0 VS04=0ND2B NOEX VMDT[5]=VS32CALL OWXYIF [VS13 EQ 1]ND2DNOEX VIMDY[6]=-VMDT[5]GOTO ND2END2D NOEX VIMDX[6]=-VMDT[5]ND2E IF[[VDIN[1255] AND 64] NE 64]ND3IF APO ND2CGOTO ND3ND2C NOEX VPOCH=BPOND3 M154RTS

Page 137: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

5327-E P-128SECTION 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 VTLNG[VS23]=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 VTWOX[VS01]=VTWOX[VS01]-VMDT[5] VS05=VTWOX[VS01]GOTO NYE4NYE35 NOEX VTOFX[VS01]=VTOFX[VS01]-VMDT[5] VS05=VTOFX[VS01]GOTO NYE4NYE3A IF[VS13 EQ 1]NYE3BIF[VS13 EQ 2]NYE3BIF[VS13 EQ 4]NYE3BNOEX VTOFY[VS01]=VTOFY[VS01]-VMDT[5] VS05=VTOFY[VS01]

Page 138: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

GOTO NYE4NYE3B NOEX VNSRY[VS01]=VNSRY[VS01]-VMDT[5] VS05=VNSRY[VS01]NYE4 IF[VMDT[6] EQ 0]NYE6IF TRCT NYE5GOTO NYE6NYE5 IF[TRCT EQ 1]NYE6NOEX VTLCA[VS23]=VTLCA[VS23]+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 TSON=VETONNOEX VDOUT[9]=0 VS25=0 VS19=1NOEX VS09=0CALL OTNSLCALL OKWTMIF[VS13 EQ 3]NS1FIF[VS13 EQ 5]NS1FNOEX VS04=VNSRY[VS01] VS32=VS32/2IF[VS13 NE 2]NS1GNOEX VS32=-VS32GOTO NS1GNS1F NOEX VS04=VTOFY[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]=VS31IF[[VDIN[1255] AND 64] NE 64]NS1IIF APO NS1H

Page 139: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

GOTO NS1INS1H NOEX BPO=VPOCHNOEX VPOCH=APONS1I CALL OWXYNOEX VIMDY[6]=-VMDT[5]G00X=XP1 Y=YSP Z=ZP1 T=TSONIF[[VDIN[1255] AND 64] NE 64]NS2IF APO NS1JGOTO NS2NS1J NOEX VPOCH=BPONS2 M154RTS

OKWTM (Keyway, Key gauging data judgment)G00X=XP1 Y=YSP Z=ZP1NU0 IF[VS24 NE 0]NU1G00X=XP1 Y=YSP+DYP Z=ZP1 T=TOF2GOTO NU2NU1 G00 Y=-[VTOFY[TOF1]-VTOFY[TOF2]]/2+YSP Z=ZP1 X=XP1 T=TOF1NU2 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]NU3AG00X=XP1Y=YSP-DYP T=TOF1X=XP2GOTO NU4NU3A G00Z=ZP1Y=YSP-DYP T=TOF1Z=ZP2GOTO NU4NU3 G00Y=[VTOFY[TOF1]-VTOFY[TOF2]]/2+YSP T=TOF2NU4 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]NU5G00Y=YSP T=TOF2GOTO NU6NU5 G00 Y=-[VTOFY[TOF1]-VTOFY[TOF2]]/2+YSP T=TOF1NU6 NOEX VS11=ABS[VS32]NOEX VIMDX[12]=VS11 VIMDZ[12]=DNGIF[VIMDX[12] LE VIMDZ[12]]NU9

Page 140: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

IF 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]NYB1G00X=XP1 Z=ZP1 T=TOF1GOTO NYB2NYB1 G00X=XP1 Z=ZP1 T=TOF2NYB2 G138NYB3 IF[VS24 EQ 0]NYB4G00Z=ZP2 Y=-[VTOFY[TOF1]-VTOFY[TOF2]]/2GOTO NYB6

Page 141: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NYB4 IF[VS12 NE 1]NYB5G00Y=YP1G00Z=ZP2GOTO NYB6NYB5 G00Y=YP1G00X=XP2NYB6 NOEX VS29=MSP/2CALL OSKPYNOEX VS22=VS31IF[VS24 EQ 0]NYB7T=TOF2GOTO NYB9NYB7 IF[VS12 NE 1]NYB8G00Z=ZP1Y=-YP1 T=TOF1Z=ZP2GOTO NYB9NYB8 G00X=XP1/2Y=-YP1 T=TOF1X=XP2NYB9 NOEX VS29=-MSP/2CALL OSKPYNOEX VS21=VS22-VS31IF[VS24 EQ 0]NYB10G00Z=ZP1Y=0 T=TOF1GOTO NYB12NYB10 IF[VS12 NE 1]NYB11G00Z=ZP1Y=0 T=TOF2GOTO NYB12NYB11 G00X=XP1/2Y=0 T=TOF2NYB12 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=1GOTO NYB18NYB16 NOEX VDOUT[4]=1 VS30=-1GOTO NYB18NYB17 NOEX VDOUT[3]=1 VS30=0NYB18 G136RTS

Page 142: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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 TSON=VETONNOEX VDOUT[9]=0 VS25=0 VS19=1NOEX VS09=0CALL OTNSLCALL 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=VTOFX[VS01]IF[[VDIN[1255] AND 64] NE 64]NYA7IF APO NYA6GOTO NYA7NYA6 NOEX BPO=VPOCHNOEX VPOCH=APONYA7 CALL OWXYNOEX VIMDX[6]=-VMDT[5]PRNT 11G00X=XSTP Z=ZSTP T=TSONIF[[VDIN[1255] AND 64] NE 64]NYA9IF APO NYA8GOTO NYA9NYA8 NOEX VPOCH=BPONYA9 M154RTS

OZORY (Y-axis zero offset)IF[VRSTT NE 0]NA12IF[VYMOD NE 0]NA1IF[VMLCK NE 0]NA1VDOUT[992]=1400GOTO NA12NA1 NOEX VS19=1 VS29=MSPCALL OSKPYNA5 NOEX VS03=VS31-MSP VS11=ABS[VS03]NOEX VIMDX[12]=VS11 VIMDY[3]=VS03

Page 143: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

IF 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 144: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

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 anexample.

LMSL300A.MSBThe name of the gauging control software is expressed as indicated below.

MSBs largely differ from other control software in their contents.Other control software is used to control signals from the machine and also input/output of partprograms and/or user’s commands.In contrast, MSBs have the same format as part programs, and they may be considered to becontrol software that executes gauging cycles instead of an operator.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.

LMS*????.MSB*: Indicates the content of the gauging software.????: Indicates the gauging software version.

Page 145: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

6-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)

6-2-1. Common Variables (VS01 to VS32)

Differing from common variables (V1 to V200) used for parameter setting, common variables VS01to VS32 are not displayed on the screen.

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

Variable No. Function Remark Variable

No. Function Remark

VS01 Post-process gauging device judgement data VS17 Not used

VS02Logical product of the previous judgement result and the present judgement result

VS18 Not used

VS03 Compensation data VS19 Not used

VS04 Tool offset No. of the tool offset data to be corrected VS20 Not used

VS05 Tool No. of the tool presently selected in the tool group VS21 Not used

VS06 Post-process gauging device input No. VS22 Not used

VS07 Gauging value reading counter VS23 Not used

VS08 Post-process gauging input No. VS24 Not used

VS09 Not used VS25 Not usedVS10 Not used VS26 Not usedVS11 Not used VS27 Not usedVS12 Not used VS28 Not usedVS13 Not used VS29 Not used

VS14 Not used VS30 Data No. at the consecutive NG counter

VS15 Not used VS31 Not usedVS16 Not used VS32 Not used

Page 146: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

LE61129R0200700530001

6-2-2. System Variables

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

Variable Name Function Min. - Max. Values Subscript

ExpressionVXMDS Post-process gauging data set flag 0, 128VXMMD For storing the previous gauging result 0 to 99 Data No. 1 to 12VXMCO Consecutive ±OK counter 0 to 99 Data No. 1 to 12VXMMO ±OK ignore counter 0 to 99 Data No. 1 to 12

VXMPOPost-process gauging device input position No. (from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 12 Data No. 1 to 12

VXMONTool offset No. of the tool offset data to be corrected (from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 32 Data No. 1 to 12

VXMTGTool 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

VXMOG

Tool offset group No. of the tool offset data to be corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 3 Data No. 1 to 12

VXMCDCompensation data (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 screen)

0 to 99 Data No. 1 to 12

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.

Page 147: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

VGRSL Tool No. of the tool presently selected in the tool group 0 to 12 Tool group 1 to 12

VTLNG NG flag in tool life management table 0 to 1 Tool No. 1 to 12

VTLCN Actual machining count in the tool life management table 0 to 9999 Tool No. 1 to 12

VTLCA Actual wear amount in the tool life management table 0 to 999.999 Tool No. 1 to 12

VTOFX Tool offset data (X-axis) -9999.9999 to 9999.9999 Offset No. 1 to 32

VTOFZ Tool offset data (Z-axis) -9999.9999 to 9999.9999 Offset No. 1 to 32

VTLOA Tool offset No. of tool group 1 0 to 32 Tool No. 1 to 12VTLOB Tool offset No. of tool group 2 0 to 32 Tool No. 1 to 12VTLOC Tool offset No. of tool group 3 0 to 32 Tool No. 1 to 12

VBCDEGauged (measured) value (from the POST-PROCESS GAG INPUT DATA screen)

-0.099 to 0.099 Data No.1 to 12

VXMAD Fixed value to be added to tool offset compensation data 0 to 0.099 None

Variable Name Function Min. - Max. Values Subscript

Expression

Page 148: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

6-2-3. 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 tovariables VMCN [1] to VMCN [32].This gauging subprogram uses the “compensation lag” set for No. 9 using VMCN [9] and also theconsecutive NG counters VMCN [20] to VMCN [28] which are set for No. 20 to No. 28. Othersystem parameters are not used.

LE61129R0200700550001

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

6-2-4. 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] to VDIN [808]

Post-process gauging input data that corresponds to post-process gauging input Nos. 1 to 8

Page 149: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

6-3. Program

6-3-1. Flow Chart

LE61129R0200700570001

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

Page 150: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700570002

NOC

VS08=VXMPO[VS07]

VS03=-VXMCD[VS08]

VS01=32 NO

YES

YES

YES

YES

YES

YES

YES

YES

NO

NONO

NO

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

VXMON[VS07]=0

VXMMO[VS07]>0

2C

2A

NC10

NC6VXMTG[VS07]=0

VXMOG[VS07]=0

VS05=VXMTG[VS07]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?

Tool offset group number =0?

No tool selected?

Ignore?

Finding the currently selected tool number from the tool group

Page 151: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700570003

2C

VXMCO[VS07]<VXMNC[VS07]

NO

NO

NO

NONO

NO

NO

NO NO

YES

YES

YES

YES

YES

YES

YES

YES YES

VS04=VXMON[VS07]

2A NC10

VXMMO[VS07]=VXMMO[VS07]-1

1

NC8

VS04=VTLOA[VS05]

NCA

VTLCA[VS05]=VTLCA[VS05]+ABS[VS03]

2B

VTLCN[VS05]<VMCN[9]

2D

VXMCO[VS07]<VXMNC[VS07]

NC7

VXMOG[VS07]=1

VXMOG[VS07]=2

NC9VS04=VTLOB[VS05] VS04=VTLOC[VS05]

VS04=0

NCB

VDIN[1255]AND 32≠32

VXMXZ[VS07]=0 VXMXZ[VS07]=0NCB1 NCC

VTWOZ[VS04]=VTWOZ[VS04]+VS03

VTWOX[VS04]=VTWOX[VS04]+VS03

VTOFZ[VS04]=VTOFZ[VS04]+VS03

VTOFX[VS04]=VTOFX[VS04]+VS03

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?

Compensation skip?

Offset group 1

Offset group 2

Clearing the ignore counter

X direction? X direction?

Setting the compensation skip counter value at the ignore counter

Clearing the ±OKconsecutive counter

Page 152: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700570004

NNG

VS02=VXMMD[VS07] AND 12

VS30=VS07+20

VBCDE[VS08]=0

VS02=0

NO

NO

NO

NO

NO

NO

NO

NO

YES

YES

YES

YES

YES

YES

YES

VS02=VS01 AND 12

NB0 VS02=4,8

VMCN[VS30]=0

NB1

VMCN[VS30]=VMCN[VS30]+1 NOK

VMCN[VS30]<VMCN[20]

NB1A

VMCN[VS30]=0

VXMON[VS07]0

VXMTG[VS07]=0

VXMOG[VS07]=0

VS05=VXMTG[VS07]VS05=VGRSL[VS05]

VS05=0

VTLCN[VS05]<VMCN[9]

VTLNG[VS05]=1

VDOUT[991]=9000

NOK

NB2

GOTO NA2

VXMCO[VS07]=0VXMMO[VS07]=0

±NG processing

Clearing the consecutive NG counter clear

Consecutive NG counter increment

Clearing the consecutive NG counter clear

Tool group No. specified?

Tool offset 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?

NO

YES

OK processing

YES

Page 153: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

6-3-2. 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 [VXMON[VS07] NE 0] NB2IF [VXMTG[VS07] EQ 0] NOKIF [VXMOG[VS07] EQ 0] NOKNOEX VS05=VXMTG[VS07] VS05=VGRSL[VS05]IF [VS05 EQ 0] NOKIF [VTLCN[VS05] LT VMCN[9]] NOKNOEX VTLNG[VS05] =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 [VXMON[VS07] EQ 0] NC6IF [VXMMO[VS07] GT 0] NC10IF [VXMCO[VS07] LT VXMNC[VS07]] NA2NOEX VS04=VXMON[VS07]GOTO NCBNC6 IF [VXMTG[VS07] EQ 0] NCEIF [VXMOG[VS07] EQ 0] NCE

Page 154: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NOEX VS05=VXMTG[VS07] VS05=VGRSL[VS05]IF [VS05 EQ 0] NCEIF [VXMMO[VS07] GT 0] NC10IF [VTLCN[VS05] LT VMCN[9] ] NCEIF [VXMCO[VS07] LT VXMNC[VS07]] NA2IF [VXMOG[VS07] EQ 1] NC8IF [VXMOG[VS07] EQ 2] NC9NOEX VS04=VTLOC[VS05]GOTO NCANC8 NOEX VS04=VTLOA[VS05] GOTO NCANC9 NOEX VS04=VTLOB[VS05] NCA NOEX VTLCA[VS05] =VTLCA[VS05]+ABS[VS03]NCB IF [VS04 EQ 0] NCEIF [[VDIN[1255] AND 32] NE 32]NCB2IF [VXMXZ[VS07] EQ 0] NCB1NOEX VTWOZ[VS04]=VTWOZ[VS04]+VS03GOTO NCDNCB2 NOEX VTWOX[VS04]=VTWOX[VS04]+VS03GOTO NCDNCB2 IF [VXMXZ[VS07] EQ 0] NCCNOEX VTOFZ[VS04]=VTOFZ[VS04]+VS03GOTO NCDNCC NOEX VTOFX[VS04]=VTOFX[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 155: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

7. Automatic Gauging System Using Five Level Signals

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 anexample.

LMSE300A.MSBThe name of the gauging control software is expressed as indicated below.

MSBs largely differ from other control software in their contents.Other control software is used to control signals from the machine and also input/output of partprograms and/or user’s commands.In contrast, MSBs have the same format as part programs, and they may be considered to becontrol software that executes gauging cycles instead of an operator.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.

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*: Indicates the content of the gauging software.????: Indicates the gauging software version.

Page 156: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

7-2-1. Common Variables (VS01 to VS32)

Differing from common variables (V1 to V200) used for parameter setting, common variables VS01to VS32 are not displayed on the screen.

Variable No. Function Remark Variable

No. Function Remark

VS01 Post-process gauging device judgement data VS17 Not used

VS02Logical product of the previous judgement result and the present judgement result

VS18 Not used

VS03 Compensation data VS19 Not used

VS04 Tool offset No. of the tool offset data to be corrected VS20 Not used

VS05 Tool No. of the tool presently selected in the tool group VS21 Not used

VS06 Post-process gauging device input No. VS22 Not used

VS07 Gauging value reading counter VS23 Not usedVS08 Not used VS24 Not usedVS09 Not used VS25 Not usedVS10 Not used VS26 Not usedVS11 Not used VS27 Not usedVS12 Not used VS28 Not usedVS13 Not used VS29 Not used

VS14 Not used VS30Data No. at the consecutive NG counter

VS15 Not used VS31 Not usedVS16 Not used VS32 Not used

Page 157: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

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

LE61129R0200700610001

7-2-2. 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 thosedisplayed and set as parameters, zero offset data, tool offset data, etc.

Variable Name Function Min. - Max. Values Subscript

ExpressionVXMDS Post-process gauging data set flag 0, 128VXMMD For storing the previous gauging result 0 to 99 Data No. 1 to 12VXMCO Consecutive ±OK counter 0 to 99 Data No. 1 to 12VXMMO ±OK ignore counter 0 to 99 Data No. 1 to 12

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.

Page 158: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

VXMON

Tool offset No. of the tool offset data to be corrected (from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 32 Data No. 1 to 12

VXMTG

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

VXMOG

Tool offset group No. of the tool offset data to be corrected (from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 3 Data No. 1 to 12

VXMCDCompensation data(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 0 to 99 (from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 99 Data No. 1 to 12

VGRSL Tool No. of the tool presently selected in the tool group 0 to 12 Tool group No.

1 to 12

VTLNG NG flag in tool life management table 0 to 1 Tool No.1 to 12

VTLCN Actual machining count in the tool life management table 0 to 9999 Tool No.

1 to 12

VTLCA Actual wear amount in the tool life management table 0 to 999.999 Tool No.

1 to 12

VTOFX Tool offset data (X-axis) -9999.9999 to 9999.9999

Offset No.1 to 32

VTOFZ Tool offset data (Z-axis) -9999.9999 to 9999.9999

Offset No.1 to 32

VTLOA Tool offset No. of tool group 1 0 to 32 Tool No. 1 to 12VTLOB Tool offset No. of tool group 2 0 to 32 Tool No. 1 to 12VTLOC Tool offset No. of tool group 3 0 to 32 Tool No. 1 to 12

Variable Name Function Min. - Max. Values Subscript

Expression

Page 159: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

7-2-3. 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 tovariables VMCN [1] to VMCN [32].This gauging subprogram uses the “compensation lag” set for No. 9 using VMCN [9] and also theconsecutive NG counters VMCN [20] to VMCN [28] which are set for No. 20 to No. 28.Other system parameters are not used.

LE61129R0200700630001

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

7-2-4. 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] to VDIN [808] Post-process gauging input data that corresponds to post-process gauging input

Page 160: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

7-3. Program

7-3-1. Flow Chart

LE61129R0200700650001

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

Page 161: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700650002

NOC

VS01=32 NO

YES

YES

YES

YES

YES

YES

YES

YES

NO

NONO

NO

NO

NO

NO

NC1

NC2

NC4

VS02=VS01 AND VXMMD[VS07]

VS02=32,16

VXMCO[VS07]=0VXMMO[VS07]=0

VXMCO[VS07]=VXMCO[VS07]+1

VXMON[VS07]=0

VXMMO[VS07]>0

2C

2A

NC10

NC6 VXMTG[VS07]=0

VXMOG[VS07]=0

VS05=VXMTG[VS07]VS05=VGRSL[VS05]

VS05=0

VXMMO[VS07]>0

2B 2D

NCE

±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?

Tool offset group number =0?

No tool selected?

Ignore?

Finding the currently selected tool number from the tool group

VS03=VXMCD[VS07]

VS03=-VS03

Page 162: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700650003

2C

VXMCO[VS07]<VXMNC[VS07]

NO

NO

NO

NONO

NO

NO

NO NO

YES

YES

YES

YES

YES

YES

YES

YES YES

VS04=VXMON[VS07]

2A NC10

VXMMO[VS07]=VXMMO[VS07]-1

1

NC8

VS04=VTLOA[VS05]

NCA

VTLCA[VS05]=VTLCA[VS05]+ABS[VS03]

2B

VTLCN[VS05]<VMCN[9]

2D

VXMCO[VS07]<VXMNC[VS07]

NC7

VXMOG[VS07]=1

VXMOG[VS07]=2

NC9VS04=VTLOB[VS05] VS04=VTLOC[VS05]

VS04=0

NCB

VDIN[1255]AND 32≠32

VXMXZ[VS07]=0 VXMXZ[VS07]=0 NCC

VTWOZ[VS04]=VTWOZ[VS04]+VS03

VTWOX[VS04]=VTWOX[VS04]+VS03

VTOFZ[VS04]=VTOFZ[VS04]+VS03

VTOFX[VS04]=VTOFX[VS04]+VS03

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?

Compensation skip?

Offset group 1

Offset group 2

Clearing the ignore counter

X direction? X direction?

Setting the compensation skip counter value at the ignore counter

Clearing the ±OKconsecutive counter

Page 163: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700650004

NNG

VS02=VXMMD[VS07] AND 12

VS30=VS07+20

VS02=0 NO

NO

NO

NO

NO

NO

YES

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

VXMON[VS07]0

VXMTG[VS07]=0

VXMOG[VS07]=0

VS05=VXMTG[VS07]VS05=VGRSL[VS05]

VS05=0

VTLCN[VS05]<VMCN[9]

VTLNG[VS05]=1

VDOUT[991]=9000NOK

NB2

GOTO NA2

VXMCO[VS07]=0VXMMO[VS07]=0

±NG processing

Clearing the consecutive NG counter clear

Consecutive NG counter increment

Clearing the consecutive NG counter clear

Tool group No. specified?

Tool offset 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?

NO

YES

OK processing

YES

YES

Page 164: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

7-3-2. Program List

OXMS (Post-process gauging 5-level processing)IF [VRSTT NE 0] NA4M100IF [VXMDS EQ 0] NA4NOEX VS07=1NA1 IF [VEMPO[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 [VXMON[VS07] NE 0] NB2IF [VXMTG[VS07] EQ 0] NOKIF [VXMOG[VS07] EQ 0] NOKNOEX VS05=VXMTG[VS07] VS05=VGRSL[VS05]IF [VS05 EQ 0] NOKIF [VTLCN[VS05] LT VMCN[9]] NOKNOEX VTLCN[VS05] =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 VXMC0[VS07]=0 VXMMO[VS07]=0NC2 NOEX VXMCO[VS07]=VXMCO[VS07]+1IF [VXMON[VS07] EQ 0] NC6IF [VXMMO[VS07] GT 0] NC10IF [VXMCO[VS07] LT VXMNC[VS07]] NA2NOEX VS04=VXMON[VS07]GOTO NCBNC6 IF [VXMTG[VS07] EQ 0] NCEIF [VXMOG[VS07] EQ 0] NCENOEX VS05=VXMTG[VS07] VS05=VGRSL[VS05]IF [VS05 EQ 0] NCEIF [VXMMO[VS07] GT 0] NC10IF [VTLCN[VS05] LT VMCN[9] ] NCEIF [VXMCO[VS07] LT VXMNC[VS07]] NA2IF [VXMOG[VS07] EQ 1] NC8

Page 165: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

IF [VXMOG[VS07] EQ 2] NC9NOEX VS04=VTLOC[VS05]GOTO NCANC8 NOEX VS04=VTLOA[VS05] GOTO NCANC9 NOEX VS04=VTLOB[VS05] NCA NOEX VTLCA[VS05] =VTLCB[VS05]+ABS[VS03]NCB IF [VS04 EQ 0] NCEIF [[VDIN[1255] AND 32] NE 32]NCB2IF [VXMXZ[VS07] EQ 0] NCB1NOEX VTWOZ[VS04]=VTWOZ[VS04]+VS03GOTO NCDNCB1 NOEX VTWOX[VS04]=VTWOX[VS04]+VS03GOTO NCDNCB2 IF [VXMXZ[VS07] EQ 0] NCCNOEX VTOFZ[VS04]=VTOFZ[VS04]+VS03GOTO NCDNCC NOEX VTOFX[VS04]=VTOFX[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 166: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

8. Automatic Gauging System by Seven Level Signals

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 anexample.

LMSF300A.MSBThe name of the gauging control software is expressed as indicated below.

MSBs largely differ from other control software in their contents.Other control software is used to control signals from the machine and also input/output of partprograms and/or user’s commands.In contrast, MSBs have the same format as part programs, and they may be considered to becontrol software that executes gauging cycles instead of an operator.

8-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*: Indicates the content of the gauging software????: Indicates the gauging software version.

Page 167: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

8-2-1. Common Variables (VS01 to VS32)

Differing from common variables (V1 to V200) used for parameter setting, common variables VS01to VS32 are not displayed on the screen.

Variable No. Function Remark Variable

No. Function Remark

VS01 Post-process gauging device judgement data VS17 Not used

VS02

Logical product of the previous judgement result and the present judgement result

VS18 Not used

VS03 Compensation data VS19 Not used

VS04 Tool offset No. of the tool offset data to be corrected VS20 Not used

VS05 Tool 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

VS07 Gauging value reading counter VS23 Not used

VS08 Not used VS24 Not usedVS09 Not used VS25 Not usedVS10 Not used VS26 Not usedVS11 Not used VS27 Not usedVS12 Not used VS28 Not usedVS13 Not used VS29 Not used

VS14 Not used VS30 Data No. at the consecutive NG counter

VS15 Not used VS31 Not usedVS16 Not used VS32 Not used

Page 168: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

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

LE61129R0200700690001

8-2-2. 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 thosedisplayed and set as parameters, zero offset data, tool offset data, etc.

Variable Name Function Min. - Max. Values Subscript

ExpressionVXMDS Post-process gauging data set flag 0, 128VXMMD For storing the previous gauging result 0 to 99 Data No. 1 to 12VXMCO Consecutive ±OK counter 0 to 99 Data No. 1 to 12VXMMO ±OK ignore counter 0 to 99 Data No. 1 to 12

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.

Page 169: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

VXMON

Tool offset No. of the tool offset data to be corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 32 Data No. 1 to 12

VXMTG

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

VXMOG

Tool offset group No. of the tool offset data to be corrected(from the POST-PROCESS GAG AUTO COMP DATA screen)

0 to 3 Data No. 1 to 12

VXMCDCompensation data(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

VGRSL Tool No. of the tool presently selected in the tool group 0 to 12 Tool group No.

1 to 12VTLNG NG flag in tool life management table 0 to 1 Tool No. 1 to 12

VTLCN Actual machining count in the tool life management table 0 to 9999 Tool No. 1 to 12

VTLCA Actual wear amount in the tool life management table 0 to 999.999 Tool No. 1 to 12

VTOFX Tool offset data (X-axis) -9999.9999 to 9999.9999 Offset No. 1 to 32

VTOFZ Tool offset data (Z-axis) -9999.9999 to 9999.9999 Offset No. 1 to 32

VTLOA Tool offset No. of tool group 1 0 to 32 Tool No. 1 to 12VTLOB Tool offset No. of tool group 2 0 to 32 Tool No. 1 to 12VTLOC Tool offset No. of tool group 3 0 to 32 Tool No. 1 to 12

Variable Name Function Min. - Max. Values Subscript

Expression

Page 170: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

8-2-3. 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 tovariables VMCN [1] to VMCN [32]. This gauging subprogram uses the “compensation lag” set forNo. 9 using VMCN [9] and also the consecutive NG counters VMCN [20] to VMCN [28] which areset for No. 20 to No. 28.Other system parameters are not used.

LE61129R0200700710001

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

8-2-4. 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 No. 1 to 8

Page 171: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

8-3. Program

8-3-1. Flow Chart

LE61129R0200700730001

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

Page 172: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700730002

NOC

VS01=32 NO

YES

YES

YES

YES

YES

YES

YES

YES

NO

NONO

NO

NO

NO

NO

NC1

NC2

NC4

VS02=VS01 AND VXMMD[VS07]

VS02=32,16

VXMCO[VS07]=0VXMMO[VS07]=0

VXMCO[VS07]=VXMCO[VS07]+1

VXMON[VS07]=0

VXMMO[VS07]>0

2C

2A

NC10

VXMTG[VS07]=0

VXMOG[VS07]=0

VS05=VXMTG[VS07]VS05=VGRSL[VS05]

VS05=0

VXMMO[VS07]>0

2B 2D

NCE

±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?

Tool offset group number =0?

No tool selected?

Ignore?

Finding the currently selected tool number from the tool group

VS03=-VS03

Setting the OK/NG flagSetting the compensation data*3

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

±NG processing

Previous and present offset values are AND

Clearing the ± OK ignore counter

Page 173: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700730003

2C

VXMCO[VS07]<VXMNC[VS07]

NO

NO

NO

NONO

NO

NO

NO NO

YES

YES

YES

YES

YES

YES

YES

YES YES

VS04=VXMON[VS07]

2A NC10

VXMMO[VS07]=VXMMO[VS07]-1

1

NC8

VS04=VTLOA[VS05]

NCAVTLCA[VS05]=VTLCA[VS05]+ABS[VS03]

2B

VTLCN[VS05]<VMCN[9]

2D

VXMCO[VS07]<VXMNC[VS07]

NC7

VXMOG[VS07]=1

VXMOG[VS07]=2

NC9VS04=VTLOB[VS05] VS04=VTLOC[VS05]

VS04=0

NCB

VDIN[1255]AND 32≠32

VXMXZ[VS07]=0 VXMXZ[VS07]=0 NCC

VTWOZ[VS04]=VTWOZ[VS04]+VS03

VTWOX[VS04]=VTWOX[VS04]+VS03

VTOFZ[VS04]=VTOFZ[VS04]+VS03

VTOFX[VS04]=VTOFX[VS04]+VS03

VXMMO[VS07]=VXMMC[VS07]

2DNCE

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?

Compensation skip?

Offset group 1

Offset group 2

Clearing the ignore counter

X direction? X direction?

Setting the compensation skip counter value at the ignore counter

Clearing the ±OKConsecutive counter

NO±OK?

VS06=0

±OK?VS06=0

NO

YES

YES

NC5

Page 174: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700730004

NNG

VS02=VXMMD[VS07] AND 3

VS30=VS07+20

VS02=0NO

NO

NO

NO

NO

NO

YES

YES

YES

YES

YES

VS02=VS01 AND 3

NBO VS02=1,2VMCN[VS30]=0

NB1VMCN[VS30]=VMCN[VS30]+1 NOK

VMCN[VS30]<VMCN[20]

VMCN[VS30]=0

VXMON[VS07]=0

VXMTG[VS07]=0

VXMOG[VS07]=0

VS05=VXMTG[VS07]VS05=VGRSL[VS05]

VS05=0

VTLCN[VS05]<VMCN[9]

VTLNG[VS05]=1

VDOUT[991]=9000NOK

NB2

GOTO NA2

VXMCO[VS07]=0VXMMO[VS07]=0

±NG processing

Clearing the consecutive NG counter clear

Consecutive NG counter increment

Clearing the consecutive NG counter clear

Tool group No.specified?

Tool offset 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 ?

NO

YES

OK processing

YES

YES

NO

Page 175: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

8-3-2. 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 [VXMON[VS07] NE 0] NB2IF [VXMTG[VS07] EQ 0] NOKIF [VXMOG[VS07] EQ 0] NOKNOEX VS05=VXMTG[VS07] VS05=VGRSL[VS05]IF [VS05 EQ 0] NOKIF [VTLCN[VS05] LT VMCN[9]] NOKNOEX VTLNG[VS05] =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 VXMCD[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 NC4 IF [VXMON[VS07] EQ 0] NC6IF [VXMMO[VS07] GT 0] NC10IF [VS06 NE 0] NC5

Page 176: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

IF [VXMCO[VS07] LT VXMNC[VS07]] NA2NC5 NOEX VS04=VXMON[VS07]GOTO NCBNC6 IF [VXMTG[VS07] EQ 0] NCEIF [VXMOG[VS07] EQ 0] NCENOEX VS05=VXMTG[VS07] VS05=VGRSL[VS05]IF [VS05 EQ 0] NCEIF [VXMMO[VS07] GT 0] NC10IF [VTLCN[VS05] LT VMCN[9] ] NCEIF [VS06 NE 0]NC7IF [VXMCO[VS07] LT VXMNC[VS07]] NA2NC7 IF [VXMOG[VS07] EQ 1] NC8IF [VXMOG[VS07] EQ 2] NC9NOEX VS04=VTLOC[VS05]GOTO NCANC8 NOEX VS04=VTLOA[VS05] GOTO NCANC9 NOEX VS04=VTLOB[VS05] NCA NOEX VTLCA[VS05] =VTLCA[VS05]+ABS[VS03]NCB IF [VS04 EQ 0] NCEIF [VDIN[1255] AND 32] NE 32]NCB2IF [VXMXZ[VS07] EQ 0] NCB1NOEX VTWOZ[VS04]=VTWOZ[VS04]+VS03GOTO NCDNCB1 NOEX VTWOX[VS04]=VTWOX[VS04]+VS03GOTO NCDNCB2 IF [VXMXZ[VS07] EQ 0] NCCNOEX VTOFZ[VS04]=VTOFZ[VS04]+VS03GOTO NCDNCC NOEX VTOFX[VS04]=VTOFX[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 177: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

9. CEJ MATIC Gauging MSB

9-1. CEJ MATIC Gauging Subprograms

9-2. Common Variables

9-3. System Variables

Subprogram Name Description

OCEJA CEJ MATIC gauging, Turret A side compensation processing, Called at turret A side, No arguments

OCEJB CEJ MATIC gauging, Turret B side compensation processing, Called at turret B side, No arguments

Subprogram Name Description

VS04 Tool offset number of the tool offset data to be correctedVS05 Tool number or tool group number read from CEJ MATICVS06 Tool No. of the tool presently selected in the tool groupVS07 Gauging (measured) value read counterVS08 Work variablesVS09 Turret designation (A or B)

Subprogram Name Description

VXMDR CEJ MATIC gauging data read completion flagVCEJM CEJ MATIC read dataVXMAB Turret designation (A/B) in CEJ MATIC read dataVXMBD Compensation data in CEJ MATIC read dataVXMXZ Axis designation (X/Z) in CEJ MATIC read dataVXMOG Tool offset group No. set at the CEJ MATIC gauging automatic offset data screenVXMON Tool offset No. set at the CEJ MATIC gauging automatic offset data screenVGRSL Tool No. of the tool presently selected in the tool groupVTOFX Tool offset data (X-axis)VTOFZ Tool offset data (Z-axis)VTLOA Tool offset No. (group 1)VTLOB Tool offset No. (group 2)VTLOC Tool offset No. (group 3)

Page 178: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

9-4. Program

9-4-1. CEJ MATIC Gauging Subprogram Flow Chart

LE61129R0200700780001

OCEJA

M100 M100

VS09=1N1

NO

NO

NONO

NO

NO

NONO NO

YESYES

YES

YES

YES

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[VS05]N3

VS06=0

VXMOG[VS05]=0

VXMOG[VS05]=1 VXMOG[VS05]=2N4 N5

VS04=VTLOA[VS06] VS04=VTLOB[VS06] VS04=VTLOC[VS06]

2A

N6

2B

OCEJB

VS09=0

VS04=VXMON[VS05]

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?

Checking if a tool offset group number command is specified on the CEJ MATIC COMP DATA screen,and finding the required tool offset number in the tool offset group number (on the same screen)

Tool number

Group 1 Group 2 Group 3

VCEJM (*) * : 1 - 12

Page 179: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700780002

2A

TRCT NO

NO

NONO

NO

NO

YES

YES

YES

YESYES

YES

TRCT=0

VTLCA[VS06]=VTLCA[VS06]+ABS[VXMBD[VS07]]

N8VS04=0

VDIN[1255]AND32=32

VXMXZ[VS07]=0

VTWOX[VS04]=VTWOX[VS04]-VXMBD[VS07]

VTWOZ[VS04]=VTWOZ[VS04]-VXMBD[VS07]

VXMXZ[VS07]=0NA

N9

VTOFX[VS04]=VTOFX[VS04]-VXMBD[VS07]

VTOFZ[VS04]=VTOFZ[VS04]-VXMBD[VS07]

VS07=VS07+1

VS07≤122C

1ANB

RTS

Reading counter increment

Page 180: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

9-4-2. 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=VXMON[VS05]GOTO N6N3 NOEX VS06=VGRSL[VS05]IF[VS06 EQ 0]NAIF[VXMOG[VS05] EQ 0]NAIF[VXMOG[VS05] NE 1]N4NOEX VS04=VTLOA[VS06]GOTO N6N4 IF[VXMOG[VS05] NE 2]N5NOEX VS04=VTLOB[VS06]GOTO N6N5 NOEX VS04=VTLOC[VS06]N6 IF TRCT N7GOTO N8N7 IF[TRCT NE 0]N8NOEX VTLCA[VS06]=VTLCA[VS06]+ABS[VXMBD[VS07]]N8 IF[VS04 EQ 0]NAIF[[VDIN[1255] AND 32] EQ 32]N10IF[VXMXZ[VS07] EQ 0]N9NOEX VTOFX[VS04]=VTOFX[VS04]-VXMBD[VS07]GOTO NAN9 NOEX VTOFZ[VS04]=VTOFZ[VS04]-VXMBD[VS07]GOTO NAN10 IF[VXMXZ[VS07] EQ 0]N11NOEX VTWOX[VS04]=VTWOX[VS04]-VXMBD[VS07]GOTO NAN11 NOEX VTWOZ[VS04]=VTWOZ[VS04]-VXMBD[VS07]NA NOEX VS07=VS07+1IF[VS07 LE 12]N2NBRTS

Page 181: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

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

10-1. Gauging Subprogram

10-2. System Variables

10-3. Common Variables

Subprogram Name Description

OXMRA Subprogram called at turret A sideOXMRB Subprogram called at turret B side

Subprogram Name Description

VEXDR Post-process gauging data read completion flagVEXPO Gauging position number

VEXTR Designation 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)VEXTO Designation of offset number or group number for which tool offset data is correctedVEXOG Designation of offset group number for which tool offset data is correctedVEXOK Judgement of gauging result (0: OK, 1: NG)VEXFB Feedback data

Subprogram Name Description

VS01 Gauging position numberVS02 Offset No. or group No.VS03 Tool No. of the tool presently selected in a tool groupVS04 Tool offset No.VS07 Gauging position counterVS08 Turret to be called

Page 182: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

10-4. Program

10-4-1. Gauging Program Flow Chart

LE61129R0200700830001

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

Page 183: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700830002

2A

VEXGF[VS01]=0

NA4B NO

NO

NO

NO

NONO

NO

NO

NO

VDOUT[991]=9010

3B

NA10

VS02=VEXTO[VS01]NA5

YES

YES

YES

YES

YES YES

YES

YES

YES

VS02=0

VS03=VGRSL[VS02]

VS03=0

VEXOG[VS01]=0

VEXOG[VS01]=1 VEXOG[VS01]=0NA6 NA7

NA7A

VS04=VTLOA[VS03] VS04=VTLOB[VS03] VS04=VTLOC[VS03]

VEXOK[VS01]=0

NA7B

NA7CTRCT

TRCT=1

VTLNG[VS03]=1

VILCA[VS03]=VTLCA[VS03]+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 offset group number for which offset data is compensated "0"?

Is the gauging result OK?

Is the actual wear amount accumulated?

Is the actual wear amount ignored?

Gauging result is NG

Page 184: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

LE61129R0200700830003

10-4-2. Program List (Gauging Subprogram)

OXMRAVS08=0GOTO NA1

OXMRBVS08=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=VEXTO[VS01]IF [VEXGF[VS01] NE 0] NA5VS04=VS02GOTO NA8NA4A IF [VEXGF[VS01] EQ 0] NA4BVS02=VEXTO[VS01]GOTO NA5

3B 3A NA8

YES

YES

YES

YES

YES

NO

NO

NO

NO

NO

VS04=0

VDIN[1255] AND 32≠32

VEXAX[VS01]=0

VTOFZ[VS04]=VTOFZ[VS04] -VEXFB[VS01]

VTOFX[VS04]=VTOFX[VS04] -VEXFB[VS01]

VEXAX[VS01]=0

NA10

VS07=VS07+1

3CNA11

RTS

1A

NA2

VTWOZ[VS04]=VTWOZ[VS04] -VEXFB[VS01]

VTWOX[VS04]=VTWOX[VS04] -VEXFB[VS01]

Is the offset data compensated for Z-axis?

Gauging position counter increment

VS07≤12

Page 185: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

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

NA4B VDOUT[991]=9010GOTO NA10NA5 IF [VS02 EQ 0] NA10VS03=VGRSL[VS02]IF [VS03 EQ 0] NA10IF [VEXOG[VS01] EQ 0] NA10IF [VEXOG[VS01] NE 1] NA6VS04=VTLOA[VS03]GOTO NA7ANA6 IF [VEXOG[VS01] NE 2] NA7VS04=VTLOB[VS03]GOTO NA7ANA7 VS04=VTLOC[VS03]NA7A IF [VEXOK[VS01] EQ 0] NA7BVTLNG[VS03]=1GOTO NA10NA7B IF TRCT NA7CGOTO NA8NA7C IF [TRCT EQ 1] NA8VTLCA[VS03]=VTLCA[VS03]+ABS[VEXFB[VS01]]NA8 IF [VS04 EQ 0] NA10IF[[VDIN[1255] AND 32] NE 32]NA9AIF [VEXAX[VS01] NE 0] NA9VTWOX[VS04]=VTWOX[VS04]-VEXFB[VS01]GOTO NA10NA9 VTWOZ[VS04]=VTWOZ[VS04]-VEXFB[VS01]GOTO NA10NA9A IF [VEXAX[VS01] NE 0] NA9VTOFZ[VS04]=VTOFZ[VS04]-VEXFB[VS01]GOTO NA10NA9B VTOFX[VS04]=VTOFX[VS04]-VEXFB[VS01]NA10 VS07=VS07+1IF [VS07 LE 12] NA2RTS

Page 186: OSP-P200L Gauging Systems Instruction Manual LE61-129-R2

LIST OF PUBLICATIONS

Publication No. Date Edition

5327-E March 2006 1st

5327-E-R1 February 2007 2nd

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.