Despite the care taken in the preparation of this document, NUM cannot guarantee the accuracy of the information it contains and cannot be held
responsible for any errors therein, nor for any damage which might result from the use or application of the document.
The physical, technical and functional characteristics of the hardware and software products and the services described in this document are subject
to modification and cannot under any circumstances be regarded as contractual.
The programming examples described in this manual are intended for guidance only. They must be specially adapted before they can be used in
programs with an industrial application, according to the automated system used and the safety levels required.
All rights reserved. No part of this manual may be copied or reproduced in any form or by any means whatsoever, including photographic or magnetic
processes. The transcription on an electronic machine of all or part of the contents is forbidden.
This software is the property of NUM. Each memorized copy of this software sold confers upon the purchaser a non-exclusive licence strictly limited
to the use of the said copy. No copy or other form of duplication of this product is authorized.
2en-938872/2
Table of Contents
Table of Contents
1 Structured Programming1 - 1
1.1General1 - 3
1.2Structured Programming Commands1 - 6
1.3Example of Structured Programming1 - 13
2 Reading the Programme Status Access Symbols2 - 1
2.1General2 - 3
2.2Symbols for Accessing the Data of the
Current Block2 - 3
2.3Symbols Accessing the Data of the
Previous Block2 - 11
3 Storing Data in Variables L900 to L9513 - 1
3.1General3 - 3
3.2Storing F, S, T, H and N in Variables L900
to L9253 - 3
3.3Storing EA to EZ in Variables L926 to L9513 - 4
3.4Symbolic Addressing of Variables L900
to L9513 - 4
4 Creating and Managing Symbolic Variable Tables4 - 1
4.1Creating Symbolic Variable Tables4 - 3
4.2Symbolic Variable Management Commands4 - 8
5 Creating Subroutines Called by G Functions5 - 1
5.1Calling Subroutines by G Functions5 - 3
5.2Inhibiting Display of Subroutines Being
Executed5 - 5
9.3Procedure After Enabling the N/M AUTO
Function9 - 8
9.4Stopping and Restarting in N/M AUTO Mode 9 - 11
9.5Checks Included in N/M AUTO9 - 12
Appendix A Table of Structured Programming CommandsA - 1
Appendix B Table of Symbolic Variable Management CommandsB - 1
Appendix C Table of Programme Status Access SymbolsC - 1
C.1Addressing G and M FunctionsC - 3
C.2Addressing a List of BitsC - 3
C.3Addressing a ValueC - 3
C.4Addressing a List of ValuesC - 4
Appendix D Table of Symbols Stored in Variables L900 to L951D - 1
D.1Symbols Stored in Variables L900 to L925D - 3
D.2Symbols Stored in Variables L926 to L951D - 3
4en-938872/2
Record of Revisions
DOCUMENT REVISIONS
DateRevisionReason for revisions
02-930Document creation (conforming to software at index D)
01-951Conforming to software at index G
Additions to the manual
- RTCP function
- N/M AUTO function
Table of Contents
Inclusion of changes
Software at index E:
- Addressing of the calling function by [.RG80] in a subroutine called by a G function
- Addressing by [.IRDI(i)] defining the origin of angular offsets
Software at index F:
- Coordinate conversions
06-972Conforming to software at index K
Additions to the manual:
- Smooth polynomial interpolation
- For addressing by [.IBX(i)], [.IRX(i)] and [.IBI(i)], [.IRI(i)], added indexes 10, 11, 4
and 5 related to G21 and G22.
Inclusion of changes
Software at indexes H and J:
- Update of N/M AUTO function
en-938872/25
6en-938872/2
NUM 1020/1040/1060 Documentation Structure
NUM
T
PROGRAMMING
MANUAL
Volume 1
Volume 2
938820
NUM
AUTOMATIC
CONTROL
FUNCTION
PROGRAMMING
MANUAL LADDER
LANGUAGE
938846
NUM
SYNCHRONISATION
OF TWO SPINDLES
938854
User Documents
These documents are designed for use of the CNC.
Forword
Foreword
NUM
M/W
OPERATOR
MANUAL
938821
OPERATOR
Integrator Documents
NUM
1060
INSTALLATION
AND
COMMISSIONING
MANUAL
938816
INSTALLATION
COMMISSIONING
NUM
T
MANUAL
938822
NUM
M
PROGRAMMING
MANUAL
Volume 1
Volume 2
938819
These documents are designed for setting up the CNC on a machine.
NUM
1020/1040
AND
MANUAL
938938
NUM
PARAMETER
MANUAL
938818
NUM
G
CYLINDRICAL
GRINDING
PROGRAMMING
MANUAL
938930
NUM
DYNAMIC
OPERATORS
938871
NUM
PROCAM
DESCRIPTION
LANGUAGE
938904
NUM
G
CYLINDRICAL
GRINDING
COMMISSIONING
MANUAL
938929
NUM
H/HG
GEAR
CUTTING AND
GRINDING
MANUAL
938932
NUM
GS
SURFACE
GRINDING
MANUAL
938945
en-938872/27
Special Programming Documents
NUM
PROFIL
FUNCTION
OPERATING
MANUAL
938937
These documents concern special numerical control programming applications.
NUM
SUPPLEMENTARY
PROGRAMMING
MANUAL
938872
NUM
GS
PROCAM GRIND
INTERACTIVE
PROGRAMMING
938953
NUM
M
PROCAM MILL
INTERACTIVE
PROGRAMMING
MANUAL
938873
NUM
G
PROCAM GRIND
INTERACTIVE
PROGRAMMING
938931
NUM
T
PROCAM TURN
INTERACTIVE
PROGRAMMING
MANUAL
938874
NUM
DUPLICATED
AND
SYNCHRONISED
AXES
938875
8en-938872/2
Supplementary Programming Manual
Manual Contents
Presentation of the commands used for structured programming of branches and
loops.
CHAPTER 1
STRUCTURED
PROGRAMMING
Forword
CHAPTER 2
READING THE
PROGRAMME
STATUS ACCESS
SYMBOLS
CHAPTER 3
STORING
DATA IN
VARIABLES
L900 TO L951
Presentation of the symbols giving visibility into the programmed functions and
programme context during call of a cycle by a G function.
How to store values related to the arguments or functions programmed in variables
L900 to L951 when calling a cycle by a G function.
en-938872/29
CHAPTER 4
CREATING AND
MANAGING
SYMBOLIC
VARIABLE TABLES
CHAPTER 5
CREATING
SUBROUTINES
CALLED BY
G FUNCTIONS
How to create and manage symbolic variable tables for storing functions and cutting
paths.
How to create subroutines called by G functions.
How to specify tool paths by polynomials.
CHAPTER 6
POLYNOMIAL
INTERPOLATION
CHAPTER 7
COORDINATE
CONVERSIONS
10en-938872/2
Coordinate conversions using a square matrix.
CHAPTER 8
RTCP
FUNCTION
Forword
Possibility of controlling the movements of a machine to position the tool with respect
to the part and pivot it around its centre.
Possibility of controlling the N/M AUTO axes while the other machine axes follow a
programmed path.
CHAPTER 9
N/M AUTO
FUNCTION
APPENDIX A
TABLE OF
STRUCTURED
PROGRAMMING
COMMANDS
APPENDIX B
Presents the structured programming commands in table form.
Presents the symbolic variable management commands in table form.
TABLE OF
SYMBOLIC
VARIABLE
MANAGEMENT
COMMANDS
en-938872/211
APPENDIX C
TABLE OF
PROGRAMME
STATUS ACCESS
SYMBOLS
APPENDIX D
TABLE OF
SYMBOLS
STORED IN
VARIABLES
L900 TO L951
Presents the programme status access symbols in table form:
-G function addressing,
-M function addressing,
-addressing a list of bits,
-addressing a value,
-addressing a list of values.
Presents lists of symbols stores in variables L900 to L951 in table form.
-Symbols stored in variables L900 to L925.
-Symbols stored in variables L926 to L951.
12en-938872/2
Using the Supplementary Programming Manual
Syntax Conventions
The command lines (blocks) used in programming include commands, symbols,
variables, functions and/or arguments.
A particular syntax is used for each of the elements described herein. The applicable
syntax rules describe how to write the programme blocks.
Certain syntaxes are given on one or more lines. Writing is simplified by use of the
following conventions:
-the functionality(ies) to which the syntax relates is (are) highlighted by the use of
bold face characters,
-«..» or lower case letters after one or more capital letters, addresses or signs
replace a numerical value (e.g. N..),
-the ellipsis «...» replaces a character or address string similar to that preceding it
in the block (e.g. [Symb1]/[Symb2]...),
-«xx» after one or more address letters replaces alphanumeric characters (e.g.
[.IBxx(i)]),
-«xxx» after an address letter replaces numerical values (e.g. Gxxx).
Forword
Examples
Syntax for creating a symbolic variable table
P.BUILD [TAB(7,NB)] H.. N.. +n N..+n
Syntax of a «repeat until» loop and its graphic representation
REPEAT
(instructions)
UNTIL (condition)
Repeat
Instructions
Until
condition
en-938872/213
Index
Questionnaire
Agencies
The index at the end of the volume gives access to information by keywords.
To help us improve the quality of our documentation, we request you to return the
questionnaire at the end of the volume.
The list of NUM agencies is given at the end of the volume.
14en-938872/2
Structured Programming
1 Structured Programming
1.1General1 - 3
1.1.1Commands Used in Structured Sequences1 - 3
1.1.2General Syntax Rules1 - 3
1.1.3Nesting and Branches1 - 5
1.2 Structured Programming Commands1 - 6
1.2.1Condition Graph1 - 6
1.2.2Instruction Execution Conditions1 - 7
1.2.3REPEAT UNTIL Loops1 - 8
1.2.4WHILE Loops1 - 9
1.2.5Loops with Control Variable1 - 10
1.2.6Exiting the Loop1 - 12
1.3Example of Structured Programming1 - 13
1
en-938872/21 - 1
1 - 2en-938872/2
1.1General
Structured Programming
The system provides the possibility of programming structured branches and loops,
making the programmes easier to read and simplifying the programming of complex
part programmes.
The programming tools described in this chapter are used to create subroutines
called by G functions (see Chapter 5).
A structured sequence always begins and ends with keywords.
It begins with one of the following keywords:
IF
REPEAT
WHILE
FOR
1
It ends with:
ENDI for IF
UNTIL for REPEAT
ENDW for WHILE
ENDF for FOR
The word ELSE can be interposed between the words IF and ENDI.
1.1.1Commands Used in Structured Sequences
-Conditional execution of instructions: IF, THEN, ELSE, ENDI
-Repeat until loops: REPEAT, UNTIL
-While loops: WHILE, DO, ENDW
-Loops with control variables: FOR, TO, DOWNTO, BY, DO, ENDF
-Exit from a loop: EXIT
1.1.2General Syntax Rules
The words IF, REPEAT, WHILE, FOR, ENDI, UNTIL, ENDW and ENDF must be the
first words in a block (no sequence number).
The words IF, REPEAT, THEN, ELSE, UNTIL, WHILE, DO and DOWNTO must
always be followed by a space, e.g.:
WHILEL0 <3 is not recognised by the system. The required syntax is WHILE L0 <3.
The words DO and THEN must immediately follow the condition. Alternately, if these
two words are not located on the same line as the words IF, WHILE and FOR, they
must be the first words on the next line.
en-938872/21 - 3
Blocks with sequence numbers (N..) are allowed in loops.
Blocks beginning with the words ENDI, ENDW, ENDF, EXIT or UNTIL must not
include ISO programming functions.
One of words DO, THEN or ELSE can be followed by ISO programming functions in
a same block.
Example:
WHILE L1 < 3 DO G91 X12
or
WHILE L1 < 3
DO G91 X12
The following sequence is refused:
WHILE L0 < 3 G91 X10
DO
Not allowed in a
conditional instruction
1 - 4en-938872/2
1.1.3Nesting and Branches
Structured Programming
Nesting
Fifteen structured nesting levels are possible independently of subroutine calls by
function G77 ...
Example:
First nesting level Second nesting level Third nesting level
IF
IF
REPEAT
UNTIL
ENDI
ENDI
Branches
Programming of a conditional or unconditional branch by G79 ... is allowed in a
structured sequence, but must branch to the lowest nesting level of the current
programme or subroutine.
Example:
1
%1%2
IFG79 N100
WHILEREPEAT
G79 N100
good
IF
G77 H2G79 N100
G79 N50
G79 N30
bad
bad
G79 N50
ENDI
N30N50
ENDWUNTIL
N50N100
ENDI
N100
M02
good
good
bad
en-938872/21 - 5
1.2Structured Programming Commands
1.2.1Condition Graph
A condition must follow one of words IF, WHILE or UNTIL and must be located in the
same block. If the block contains limits and a possible increment, they must follow
the word FOR.
Condition Graph
<
>
Parameters
Variables
Variables:All the variables used in parametric programming:
L variables, E parameters and symbolic variables.
Expression: Sequence of parameters and immediate values connected by symbols
+, -, *, /, !, & (see Chapter 6 of the Programming Manual). The operations
are calculated in sequence from left to right.
=
(Expression)
and
or
1 - 6en-938872/2
1.2.2Instruction Execution Conditions
Structured Programming
Syntax
IF(condition) THEN
(instructions 1)
ELSE
(instructions 2)
ENDI
If the condition is true, «instructions 1» are executed. Else, «instructions 2» are
executed.
The word ELSE is optional.
Graph
IF
Condition
THEN
instructions 1
ELSE
instructions 2
1
Example
IF E70000> 100 AND E70000 <200 THEN
G77 H100
ELSE
G77 H500
ENDI
The word THEN may be programmed at the beginning of the next block and followed
by the functions to be executed.
Example:
IF L4 < 8
THEN L6 = L2+1 XL6
ENDI
en-938872/21 - 7
1.2.3REPEAT UNTIL Loops
Syntax
The instructions are executed repetitively until the condition becomes true.
Even if the condition is true at the beginning, the instructions are executed once.
Graph
Example
Wait for a correct answer
REPEAT
(instructions)
UNTIL (condition)
Repeat
Untilinstructions
REPEAT
$ EXIT FROM THE PROGRAMME (Y/N) ?
[ANSWER]= $
UNTIL [ANSWER] = 14 OR [ANSWER] = 25
The answer «Y» returns the value 25
and the answer «N» returns the value
14 (ranks of the letters Y and N in the
alphabet)
1 - 8en-938872/2
1.2.4WHILE Loops
Structured Programming
Syntax
WHILE (condition) DO
(instructions)
ENDW
The instructions are executed while the condition remains true. Unlike REPEAT
UNTIL loops, the instructions are not executed if the condition is false at the
beginning.
Graph
While
condition
The word DO may be programmed at the beginning of the next block and followed
by the functions to be executed.
Example:
instructions
1
WHILE (condition)
DO XL6
ENDW
en-938872/21 - 9
1.2.5Loops with Control Variable
Syntax
FOR (variable) = (expression 1) TO/DOWNTO (expression 2) BY (value) DO
(instructions)
ENDF
The instructions are executed for «variable = expression 1». Then «variable» is
incremented (TO) or decremented (DOWNTO) by «value» before the «instructions»
are executed again, and the process is continued until «variable» is equal to
«expression 2».
The word «BY» is optional.
Graph
Variable = expression 1
to expression 2
by ± value
For
instructions
1 - 10en-938872/2
The variable can be:
-an L programme variable,
-a symbolic variable,
-a parameter E80000, E81000 or E82000 (be careful about stopping computations
for L100 to L199, Exxxxx and the symbolic variables).
The expressions are positive or negative integers. The system rounds them off (down
to 0.5 and up above 0.5).
Structured Programming
With TO, the loop continues to be executed as long the current value of the variable
is less than or equal to the final value (incrementing of the variable).
With DOWNTO, the loop continues to be executed as long the current value is higher
than or equal to the final value (decrementing of the variable).
The value of BY is incremented or decremented from the variable each cycle (the
default value of Y is equal to 1).
BY must always have a positive value. If the value of BY is negative, functions TO
and DOWNTO are reversed.
Example
Resetting the tool data
FOR L1=1 TO 20
DO
L2=56000+L1
EL2=0
ENDF
1
en-938872/21 - 11
1.2.6Exiting the Loop
Syntax
The EXIT instruction is used to exit from an iteration loop (FOR, WHILE or REPEAT)
and go to the next higher nesting level, ignoring any subsequent IF functions.
The word EXIT is used only in IF loops.
Example
Current
loop
EXIT
REPEAT
(instructions)
IF (condition) THEN
(instructions)
ELSE
EXIT
ENDI
UNTIL (condition)
(continued)
WHILE (condition) DO
REPEAT
IF (condition) THEN
(instructions)
IF (condition) THEN
Current
loop
EXIT
ENDI
(instructions)
ENDI
UNTIL (condition)
(instructions)
ENDW
1 - 12en-938872/2
1.3Example of Structured Programming
L10
L11
L1
Y
L0
Pattern
start point
X
Hole drilling pattern
L2 = number of holes in X
L3 = number of holes in Y
Structured Programming
1
en-938872/21 - 13
%20
$ X START:
L0=$
$ Y START:
L1=$
$ X STEP:
L10=$
$ Y STEP:
L11=$
L4=0
WHILE L4 <> 25 DO
Test for answer yes: Y
REPEAT $ NUMBER OF POINTS IN X:
L2=$
UNTIL L2>0
Test for number of columns greater
than 0
REPEAT $ NUMBER OF POINTS IN Y:
L3=$
UNTIL L3>0
Test for number of rows greater than 0
REPEAT $ PATTERN OF POINTS IN X:
$=L2
$+ /Y:
$=L3
$+ OK (Y/N) :
L4=$
UNTIL L4=14 OR L4=25
Wait for answer: N (no) or Y (yes)
ENDW
$
N.. G00 G52 XO Z0
N.. T1 D1 M06
N..
FOR L5=1 TO L3 DO
2.2Symbols for Accessing the Data of the Current Block2 - 3
2.2.1Symbols Addressing Boolean Values2 - 3
2.2.1.1Addressing G Functions2 - 4
2.2.1.2Addressing of M Functions2 - 4
2.2.1.3Addressing a List of Bits2 - 6
2.2.2Symbols Addressing Numerical Values2 - 8
2.2.2.1Addressing a Value2 - 8
2.2.2.2Addressing a List of Values2 - 9
2.3Symbols Accessing the Data of the Previous Block2 - 11
2
en-938872/22 - 1
2 - 2en-938872/2
2.1General
Reading the Programme Status Access Symbols
The programming tools described in this chapter are required for creating subroutines
called by G functions (see Chapter 5).
The programme status access symbols give visibility into the functions programmed
in a block used to call a machining cycle by a G function. They also give information
on the part programme context when the call is made.
These symbols are used to read the modal data in the current block.
These read-only symbols are accessible by parametric programming.
These symbols can be:
-symbols to access the data in the current block,
-symbols to access the data in the previous block.
Each symbol addresses a data item or list of data items with the form of a one-
dimensional array or table.
2.2Symbols for Accessing the Data of the Current Block
The symbols can be:
-symbols addressing Boolean values,
-symbols addressing numerical values.
General Syntax
Variable = [•symbol(i)]
VariableL programme variable, symbolic variable [symb], E
parameter.
2
[•symbol(i)]Symbol between square brackets, preceded by a
decimal point, possibly followed by an index (i).
2.2.1Symbols Addressing Boolean Values
The symbols addressing Boolean values associated with programmed functions are
used to determine whether the functions are active or not.
The Boolean values are defined by 0 or 1.
en-938872/22 - 3
2.2.1.1Addressing G Functions
[•BGxx]G function addressing.
The symbol [•BGxx] is used to determine whether the G functions specified by xx are
enabled or inhibited, e.g.:
[•BGxx]=0: function Gxx inhibited
[•BGxx]=1: function Gxx enabled
The symbol [•BMxx] is used to determine whether the M functions specified by xx are
enabled or inhibited, e.g.:
[•BMxx]=0: function Mxx inhibited
[•BMxx]=1: function Mxx enabled
The symbol [•IBxx(i)] addresses a list of bits corresponding to the items specified by
xx.
The values are Boolean, i.e. 0 or 1.
The index (i) defines the rank of the element in the list.
[•IBX(i)]List of axes programmed in the current block.
Index i = 1 to 11.
This nonmodal list can remain stored and be read by parametric
programming if the system is in state G999.
i = 1: X axis
i = 2: Y axis
i = 3: Z axis
i = 4: U axis
i = 5: V axis
i = 6: W axis
i = 7: A axis
i = 8: B axis
i = 9: C axis
i = 10: in G21: Y axis address index 10
in G22: Z axis address index 10
i = 11: in G21: X axis address index 11
in G22: Y axis address index 11
2 - 6en-938872/2
[•IBX1(i)]List of axes programmed from the beginning of the programme to
the current block.
Index i = 1 to 9: Same as list of axes programmed in the current
block (see [•IBX(i)]).
The axes programmed with respect to the measurement origin
(G52) are cancelled in this list, but are included in it again if
programming is resumed with respect to the programme origin.
[•IBX2(i)]List containing the last axes programmed (primary axes X Y Z or
secondary axes U V W).
Index i = 1 to 6. Except for axes A, B and C, the list is the same
as for the axes programmed in the current block (see [•IBX(i)]).
Programming an axis in a group cancels the equivalent axis in
other group. For instance, programming axis V resets the bit
relative to X and sets the bit for V.
Reading the Programme Status Access Symbols
[•IBXM(i)]Mirroring of the axes. The bit is set to indicate mirroring and is
reset to indicate no mirroring.
Index i = 1 to 9: same as the list of axes programmed in the
current block (see [•IBX(i)]).
[•IBI(i)]List of arguments I, J and K programmed in the current block.
Index i = 1 to 5.
List modal only in state G999.
i = 1: argument I
i = 2: argument J
i = 3: argument K
i = 4: in G21: J component address index 4
in G22: K component address index 4
i = 5: in G21: I component address index 5
in G22: J component address index 5
[•IBP(i)]List of arguments P, Q and R programmed in the current block.
Index i = 1 to 3.
List modal only in state G999.
i = 1: argument P
i = 2: argument Q
i = 3: argument R
2
en-938872/22 - 7
2.2.2Symbols Addressing Numerical Values
The symbols addressing numerical values are used to read the modal data of the
current block.
2.2.2.1Addressing a Value
[•Rxx] Addressing a value.
The symbol [•Rxx] is used to address a value corresponding to the elements specified
by xx.
[•RF]Feed rate
(units as programmed by G93, G94 or G95).
[•RS]Spindle speed
(G97: format according the spindle characteristics declared in
machine parameter P7).
[•RT]Tool number.
[•RD]Tool correction number.
[•RN]Number of the last sequence (block) encountered.
If the block number is not specified, the last numbered block is
This nonmodal function may however remain stored. Its value
can therefore be read if the system is in state G999 or G998.
[.RG80]Number of the calling function in a subroutine called by G
function.
In a subroutine called by G function, the number of the calling
function is addressed by [.RG80] (in state G80, its value is zero).
[•RNC]Value of NC (spline curve number).
[•RDX]Tool axis orientation.
Defined by the following signs and values:
+1 for G16 P++2 for G16 Q++3 for G16 R+
-1 for G16 P--2 for G16 Q--3 for G16 R-
[•RXH]Nesting level of the current subroutine.
1: main programme
2: first nesting level
3: second nesting level, etc. (8 possible nesting levels)
2 - 8en-938872/2
2.2.2.2Addressing a List of Values
[•IRxx(i)]Addressing a list of values.
Reading the Programme Status Access Symbols
The symbol [•IRxx(i)] is used to address a list of values corresponding to the elements
specified by xx.
Index (i) defines the rank of the element in the list.
[•IRX(i)]Values of the dimensions programmed on the axes.
Index i = 1 to 11.
i = 1: value of X
i = 2: value of Y
i = 3: value of Z
i = 4: value of U
i = 5: value of V
i = 6: value of W
i = 7: value of A
i = 8: value of B
i = 9: value of C
i = 10: in G21: Y axis address index 10
in G22: Z axis address index 10
i = 11: in G21: X axis address index 11
in G22: Y axis address index 11
[•IRTX(i)]Values of the offsets programmed on the axes.
Index i = 1 to 9, same as the values of the dimensions
programmed on the axes (see [•IRX(i)]).
[•IRI(i)]Values of arguments I, J and K. Index i = 1 to 5.
i = 1: value of I
i = 2: value of J
i = 3: value of K
i = 4: in G21: J component address index 4
in G22: K component address index 4
i = 5: in G21: I component address index 5
in G22: J component address index 5
2
[•IRP(i)]Values of arguments P, Q and R. Index i = 1 to 3.
i = 1: value of P
i = 2: value of Q
i = 3: value of R
[•IRH(i)]Numbers of current programmes or subroutines or lower nesting
levels.
Index i = 1 to n subroutine.
i = 1: addresses the main programme
i = 2: addresses the subroutine called by the main programme
i = 3: addresses the next subroutine, etc. (8 possible nesting
levels)
en-938872/22 - 9
[•IRDI(i)]Values defining the origin of the programmed angular offsets
(G59 I.. J.. K..). Index i = 1 to 3.
i = 1: value of I
i = 2: value of J
i = 3: value of K
2 - 10en-938872/2
Reading the Programme Status Access Symbols
2.3Symbols Accessing the Data of the Previous Block
The same data can be accessed in the previous block as in the current block (see 2.2).
The same symbols are used, but are preceded by two decimal points (instead of one).
The symbols can be:
-symbols addressing Boolean values, or
-symbols addressing numerical values.
The symbols are used to read the modal data of the previous block.
These data are those of the last executable previous block (or possibly the last block
executed).
This addressing is used only when execution of the current block is suspended by
programming function G999.
2
General Syntax
Variable = [••symbol(i)]
VariableL programme variable, symbolic variable [symb], E
parameter.
[••symbol(i)]Symbol between square brackets, preceded by two
decimal points, possibly followed by an index (i).
en-938872/22 - 11
2 - 12en-938872/2
Storing Data in Variables L900 to L951
3 Storing Data in Variables L900 to L951
3.1General3 - 3
3.2Storing F, S, T, H and N in Variables L900 to L9253 - 3
3.3Storing EA to EZ in Variables L926 to L9513 - 4
3.4Symbolic Addressing of Variables L900 to L9513 - 4
3
en-938872/23 - 1
3 - 2en-938872/2
3.1General
Storing Data in Variables L900 to L951
The programming tools described in this chapter are necessary for creating subroutines
called by G functions (see Chapter 5).
Certain arguments or functions may have different meanings in the machining cycles
programmed. Status symbols [•IBE0(i)] and [•IBE1(i)] are used to detect their
presence in blocks including a G function calling a subroutine.
It is up to the subroutine to correctly address these arguments or functions according
to their meanings and to store their values in variables L900 to L951.
The bits of [•IBE0(i)] and [•IBE1(i)] (each equal to 0 or 1) are accessible for read by
parametric programming.
3.2Storing F, S, T, H and N in Variables L900 to L925
Storing F, S and T
Status symbol [•IBE0(i)] consisting of a list of bits is used to detect programming of
F, S or T in blocks including a function Gxxx.
Index (i): from 1 to 26 for addresses A to Z.
Addressing the status symbol:
-bit [•IBE0(6)] is set if F is programmed,
-bit [•IBE0(19)] is set if S is programmed,
-bit [•IBE0(20)] is set if T is programmed.
The values of F, S and T are stored in the following variables (L900 to L925):
-F in L905,
-S in L918,
-T in L919.
Storing H and N
H and N can only be stored when not preceded by functions G75, G76, G77 or G79
related to them for ISO programming.
3
A second N (following the first N and defining the last call sequence of a subroutine
N.. to N..) is stored in variable L914 (this N can in no case be the block number
programmed at the start of the sequence).
Addressing the status symbol:
-bit [•IBE0(8)] is set if H is programmed,
-bit [•IBE0(14)] is set if the first N is programmed,
-bit [•IBE0(15)] is set if the second N is programmed.
en-938872/23 - 3
The values of H and N are stored in the following variables:
-H in L907,
-first N in L913,
-second N in L914.
3.3Storing EA to EZ in Variables L926 to L951
The values of EA to EZ to be stored in variables L926 to L951 are defined by two
alphabetic characters:
-the first is the letter E,
-the second is a letter between A and Z.
Status symbol [•IBE1(i)] consisting of a list of 26 bits is used to detect the presence
of functions EA to EZ in blocks including a function Gxxx (i = alphabetic index of the
second letter after E).
Addressing the status symbol:
-bit [•IBE1(1)] addresses the bit corresponding to EA,
-bit [•IBE1(2)] addresses the bit corresponding to EB, and so forth down to ...,
-bit [•IBE1(26)] addresses the bit corresponding to EZ.
The values are stored in the following variables (L926 to L951):
-EA in L926,
-EB in L927, and so forth down to ...,
-EZ in L951.
3.4Symbolic Addressing of Variables L900 to L951
Variables L900 to L925 and L926 to L951 in either the left-hand or right-hand side of
an expression can be addressed by alphabetic symbols preceded by the character
«‘» (apostrophe).
Variables L900 to L925
L900 to L925 can be addressed by symbols ‘A to ‘Z.
Example:
‘C = ‘A + ‘B is equivalent to L902 = L900 + L901
Variables L926 to L951
L926 to L951 can be addressed by symbols ‘EA to ‘EZ respectively.
(‘EA = L926, ‘EB = L927, etc. up to ‘EZ = L951).
Example:
‘A = ‘B - ‘EA / ’EZ is equivalent to L900 = L901 - L926 / L951.
3 - 4en-938872/2
Creating and Managing Symbolic Variable Tables
4 Creating and Managing Symbolic Variable Tables
4.1Creating Symbolic Variable Tables4 - 3
4.1.1Defining a Table4 - 3
4.1.2Table Dimensions4 - 3
4.1.3Initialising Variables and Tables4 - 5
4.1.4Creating Tables for Storing Profiles4 - 6
4.1.5Data That Can Be Stored in a Table4 - 7
4.2Symbolic Variable Management Commands4 - 8
4.2.1Storing a Profile4 - 8
4.2.2Storing a Profile Interpolated in the Plane4 - 11
4.2.3Offsetting an Open Profile and Updating
the Table4 - 13
4.2.4Redefining a Profile According to the Tool
Relief Angle4 - 15
4.2.5M Functions and/or Axes Enabled or
Inhibited. Setting or Resetting Bits4 - 18
4.2.6Searching the Stack for Symbolic
Variables4 - 20
4.2.7Providing a List of Symbolic Variables4 - 21
4.2.8Copying Blocks or Entries from One Table
into Another Table4 - 22
4.2.9Indirect Addressing of Symbolic Variables4 - 27
4.2.10Programming Examples4 - 28
4
en-938872/24 - 1
4 - 2en-938872/2
Creating and Managing Symbolic Variable Tables
The programming tools described in this chapter are used to create subroutines
called by G functions (see Chapter 5).
4.1Creating Symbolic Variable Tables
The rules for writing symbolic variables used when creating tables are the same as
those defined for parametric programming (see Chapter 7 of the Programming
Manual).
4.1.1Defining a Table
A table is declared as a symbolic variable between the words VAR and ENDV.
A table is defined by including its dimensions between brackets after the last
character of the symbolic variable.
For tables with several dimensions, the dimensions are separated by commas «,» or
semicolons «;».
Syntax
VAR
[TABLn(a,b,c ...)]
ENDV
VARDeclaration of symbolic variables.
[TABLn(a,b,c...)]TABLn: table name in the stack.
(a,b,c ...) : table dimensions.
ENDVEnd of symbolic variable declaration.
Example of table definitions
VAR
[TABL1(10)] [TABL2(2,5,3)]
ENDV
For table 2 [TABL2] above, the number of entries reserved equals:
2 x 5 x 3 = 30 entries, i.e. 5 groups of 2 then 3 groups of 10.
4
4.1.2Table Dimensions
Tables can have from one to four dimensions.
For tables with one dimension:
-the value of a dimension must be between 1 and 65535.
en-938872/24 - 3
For tables with 2, 3 or 4 dimensions:
-the value of a dimension must be between 1 and 255.
The dimensions must be declared as immediate values or declared symbolic
variables.
Example:
[VAR1] = 10
[VAR] = [TAB1 (VAR1,5)]
Symbolic variables are real values.
Table indexes are immediate values or symbolic variables.
A dimension cannot be defined using:
-L programme variables,
-E external parameters.
Example:
If symbolic variable [TAB(L0,3)] is programmed, it is not programme variable L0 but
symbolic variable [L0] that is searched for.
The table indexes can be additions or subtractions of values or symbolic variables.
Example:
is equivalent to:
[TAB1 (10,5)]
VAR [IX] [COSX] [SINX] [NBT] = 4
[TABL(2,NBT)] = 0, 0, 10, 5, 20, 8, 30, -2
ENDV
FOR [IX] = 1 TO [NBT] -1 DO
[COSX] = [TABL(1,IX+1)] - [TABL(1,IX)]
[SINX] = [TABL(2,IX+1)] - [TABL(2,IX)]
L0 = [COSX]
[COSX] L0 = [SINX]
*
[SINX] + L0
*
[COSX] = [COSX] / RL0 [SINX] = [SINX] / RL0
X [TABL(1,IX+1)] Y [TABL(2,IX+1)]
ENDF
4 - 4en-938872/2
Structure of tables with several dimensions
The entries for the first dimension are located first in the declaration, then multiplied
by the number of entries of the second dimension. The result is then multiplied by the
number of entries of the following dimension and so forth.
4.1.3Initialising Variables and Tables
The values are initialised with a default value of zero.
Initialising with other values is made by declaring the character = followed by the initial
value(s) separated by commas «,».
The initial values can be declared in several blocks. In this case, the character = is
repeated before the value(s) defined in the next block.
Example:
VAR [NTB] = 4 [TABLE(2,NTB)] = 3,6
= 10,1,8,2,6,6
ENDV
Creating and Managing Symbolic Variable Tables
4
If
L0= [TABLE(2,3)]
L0= 2 (ie. the loth digit)
Storage in the memory
TABLE (1.1) = 3
TABLE (2.1) = 6
TABLE (1.2) = 10
4 x
Second
dimension
2
2
2
2
First
dimension
NBT = 4
(2.2) = 1
(1.3) = 8
(2.3) = 2
(1.4) = 6
(2.4) = 6
en-938872/24 - 5
4.1.4Creating Tables for Storing Profiles
Entry 1Entry 2Entry 3Entry 4Entry 5etc.
First dimension
Second
dimension
(blocks)
The system offers the possibility of storing a profile written in ISO or PGP in a table
of the programme stack. The table is created as the profile blocks are read.
The programmed blocks are stored in a table with two dimensions:
-the first dimension includes all the functions to be saved in a block,
-the second dimension corresponds to the number of blocks in the profile.
The data in the table are then accessed by parametric programming.
Example:
4 - 6en-938872/2
Creating and Managing Symbolic Variable Tables
4.1.5Data That Can Be Stored in a Table
The following ISO programming data can be stored in tables.
G Functions
Only one G function per block can be stored.
After a change of interpolation plane in a block, the new function is stored (G17, G18
or G19 for milling, G20, G21 or G22 for turning). Otherwise, one of modal functions
G00, G01, G02 or G03 is stored.
Values of the Programmed Axes
X, Y, Z, U, V, W, A, B, C (depending on the axes declared in machine parameter P0).
The modal values programmed with the axes are stored.
Values of I, J, K, P, Q, R
The values of the functions are stored only if the functions are present in the block.
Otherwise, the value zero is stored in the corresponding entries.
Feed Rate F
The modal value related to function F is stored.
Spindle Speed S
The value of S is not stored in the table unless it is present in the block. Otherwise,
a value of zero is stored.
Tool Call T
Function T is not stored in the table unless it is present in the block. Otherwise, a value
of zero is stored.
4
en-938872/24 - 7
4.2Symbolic Variable Management Commands
4.2.1Storing a Profile
BUILDCreates a table for storing profile paths.
The BUILD function is used to store the profile in a two-dimensional table:
-the first dimension is limited to 16 entries,
-the second dimension is limited to 255 entries.
Syntax
BUILD [TAB(G / X / Y / I / J,NB)] H.. N..+n N..+n
BUILDCreation of a table for storing a profile.
TABTable name in the stack.
G / X / Y / I / JData types whose values are stored in the entries of the
first table dimension (16 entries maximum).
NBName of the variable containing the number of blocks of
the second table dimension (maximum 255 blocks).
H..Definition of the limits of the profile.
N.. N..
H.. N.. N..
N..+n N..+n
H N..+n N..+n
4 - 8en-938872/2
Note
The BUILD function must be the first word in the block and the table name TAB must
be the second. They must be separated by at least one space.
Creating and Managing Symbolic Variable Tables
Programming the table name TAB and variable NB automatically creates a twodimensional table.
Example:
%555%55
N10 ...G.. ...
First block of the profile
N..G.. ...
N..G.. ...
BUILD [TAB(G/X/Y/I/J,NB)] H55G.. ...
Last block of the profile
N..
Two-dimensional table created by the above programme:
-first dimension: 5 entries,
-second dimension: 4 entries (blocks).
(blocks)
NB
TAB
Allocation of Additional Entries in a Field of the BUILD Function
Additional entries can be allocated in the first table dimension if they are not initialised
by data in the blocks. In this case, the entries are declared by «0s» separated by the
character /.
Example:
..
..
..
..
4
..
..
..
..
...
...
...
...
..
..
..
..
..
..
..
..
%55
N10 ...
N..
N110
First block of the profile
N..
N..
N220
Last block of the profile
N..
BUILD [PROF1(G/X/Y/Z/0/0,NB)] N110 N220
The first table dimension includes
6 entries
4
en-938872/24 - 9
Declaring Entries as a List of Bits in a Field of the BUILD Function
In a symbolic variable, some of the following axes and arguments can be declared
as a list of bits:
-axes X, Y, Z, etc.,
-arguments I, J, K,
-arguments P, Q, R.
The list of bits is declared by programming one of addresses X, I or P followed by a
decimal point and the symbolic variable name in a field of BUILD.
Example:
BUILD [TAB1(G/I.Symb/R,NB)] H..
Symbolic variable [Symb] contains a sum of values. This sum is defined from the
indexes of the addressing symbols [••IBX(i)], [••IBI(i)] and [••IBP(i)], i.e.:
-1 for index i = 1
-2 for index i = 2
-4 for index i = 3
-8 for index i = 4, etc.
Therefore, the value of the variable including I, J and K of [••IBI(i)] is equal to
I-1
J-1
2
+ 2
Example:
+ 2
K-1
.
Declaration of I.Symb
VAR [LIST] = 6
ENDV
BUILD [PROF(G/X.LIST/R,NB)] N.. N..
is equivalent to the following block:
BUILD [PROF(G/Y/Z/R,NB)] N.. N..
4 - 10en-938872/2
Creating and Managing Symbolic Variable Tables
4.2.2Storing a Profile Interpolated in the Plane
P.BUILD Creates a table for storing the dimensions of the profile
interpolation plane.
The P.BUILD function is used to store the profile in a two-dimensional table:
-the first dimension is limited to 7 entries,
-the second dimension is limited to 255 entries.
Syntax
P.BUILD [TAB(7,NB)] H.. N..+n N..+n
BUILDCreation of a table for storing a profile.
TABTable name in the stack.
7Number of entries in the first dimension (maximum 7).
NBName of the variable containing the number of blocks
(maximum 255 blocks).
H..Definition of the limits of the profile.
N.. N..
H.. N.. N..
N..+n N..+n
H.. N..+n N..+n
Note
The P.BUILD function must be the first word in the block and the table name TAB must
be the second. They must be separated by at least one space.
4
en-938872/24 - 11
Defining the Seven Entries of the First Dimension with the P.BUILD Function
0
+1
0
20
20
10
10
50
20
0
20
0
0
30
0
10
20
20
10
10
50
3
NB
(blocks)
TAB
-entry 1: Type of interpolation:
value = 0 for linear interpolation,
value = -1 for clockwise circular interpolation,
value = +1 for anticlockwise circular interpolation.
-entry 2: End point, value of the dimension on the X axis.
-entry 3: End point, value of the dimension on the Y axis.
-entry 4: Position of the centre:
value on the X axis for circular interpolation, else value = 0.
-entry 5: Position of the centre:
value on the Y axis for circular interpolation, else value = 0.
-entry 6: Start point, value of the dimension on the X axis.
-entry 7: Start point, value of the dimension on the Y axis.
Table TAB and variable NB create the following table with 7 entries:
Creating and Managing Symbolic Variable Tables
4.2.3Offsetting an Open Profile and Updating the Table
R.OFFNormal offset of an open profile.
The R.OFF function is used for normal offset of a profile initially created in a table by
the P.BUILD function or a table with the same format, i.e. [Pa(7,Nb)].
After execution of the R.OFF function, the offset profile is contained in the same table
and the variable specifying the number of blocks is updated since intermediate blocks
may have been created (see Fig. 1).
Syntax
R.OFF [Pa(7,Nb)] / ±1 / R
4
R.OFFNormal offset of a profile.
PaTable name.
7Number of table entries.
NbName of the variable containing the number of blocks in
table Pa.
±1Value = +1: right offset of the profile,
value = -1: left offset of the profile.
RRadius expressed in the same units as the dimensions.
Note
The R.OFF function must be the first word in a block.
The profile executed with the R.OFF function must be an open profile, i.e. the start
point of the profile must be different from the end point (see Fig. 2).
The R.OFF function can only operate on profiles contained in P.BUILD that do not
include alternating left and right offsets during execution.
en-938872/24 - 13
Creation of an Intermediate Block by the System
When the profile includes particular
paths, the system may create a
connection block.
Open contour
When the profile includes a narrowed
section, it must be sufficiently large to
allow passage of the tool. Otherwise,
the system considers the profile to be
closed.
4.2.4Redefining a Profile According to the Tool Relief Angle
CUTElimination of the grooves or parts of groove located inside the tool
relief angle.
The CUT function applies to grooves located in the path of a plane profile created in
a table by the P.BUILD function or a table with the same format, i.e. [Pa(7,Nb)].
After execution of the CUT function, the new profile is contained in the same table and
the variable specifying the number of blocks is updated.
Syntax
CUT * [Pa(7,Nb)] / Angle
4
CUTEliminates the grooves or parts of grooves located
within the tool relief angle.
*
PaTable name.
7Number of table entries.
NbName of the variable containing the number of blocks in
AngleAngle Relief angle in degrees.
Note
The CUT function must be the first word in the block (no sequence number).
When the character * precedes the table name, all the
grooves located within the tool relief angle are
processed.
When the character * is missing in front the table name,
only the first groove located within the tool relief angle is
processed.
table Pa.
en-938872/24 - 15
Review of the Angles of a Cutting Tool Defined in Plane ZX
Charac teristic angles:
- Kr: approach angle,
- εr : tool nose angle,
- a : clearance angle.
Processing of the table
The table analysis begins on the first block and ends:
-on the last block with CUT * ...,
-on the first cut with CUT ...
In the table, the profile must always be defined so that the profile start dimension on
the X axis (first block) is less than the profile end X dimension (last block).
Example:
Profile correctly definedProfile incorrectly defined
εr
Kr
a
Feed direction
4 - 16en-938872/2
First
block
Last
block
Last
block
First
block
Creating and Managing Symbolic Variable Tables
a
,,,,,
,,,,,
,,,,,
,,,,,
a
a
When the clearance angle is negative or zero (between 0 degrees and -180 degrees),
the profile areas located below this angle are eliminated.
When the relief angle is positive (between 0 degrees and +180 degrees), the profile
areas above the angle are eliminated.
Examples:
«a» shows the areas that are eliminated.
Example 1:
Elimination of the first groove in the profile (no * in front of the variable).
CUT [PA(7,NB)] / -95
Example 2:
Elimination of the grooves or parts of grooves located on the profile (* in front of the
variable).
CUT * [PA(7,NB)] / -50
4
en-938872/24 - 17
4.2.5M Functions and/or Axes Enabled or Inhibited. Setting or Resetting Bits
BSETProgramming of M functions and/or one or more axes enabled.
Setting of the bits of [•IBE0(i)] and [•IBE1(i)].
BCLRProgramming of M functions and/or one or more axes inhibited.
Resetting of the bits of [•IBE0(i)] and [•IBE1(i)].
BCLRInhibiting the programming of M functions and/or one or
more axes.
[•BMxx] / [•IBX(i)]When the system is in state G999, inhibiting by BCLR
resets the bits of [•BMxx] and/or [•IBX(i)].
[•IBE0(i)] / [•IBE1(i)]When a subroutine is called by function Gxx, BCLR also
resets the bits of [•IBE0(i)] and [•IBE1(i)].
4 - 18en-938872/2
Creating and Managing Symbolic Variable Tables
Note
Functions BSET and BCLR:
-must be the first words in the block (no sequence number),
-must be separated from the list of symbols by at least one space. However, there
must be no spaces in the list of symbols,
-are followed by the list of symbols to be enabled or inhibited. The symbols are
separated by «/».
Example
In block N120, only movements X10 and Z10 are executed. The movements on the
Y and B axes and the "post M" function M05 are inhibited (see Chapter 2 for indexes
(2) and (8) corresponding to Y and B respectively).
The MOVE function provides several possibilities for copying:
-simple copying of blocks,
-partial copying of blocks,
-specification of the entries to be copied.
Syntax for Simple Copying of Blocks
MOVE [Pj(nj,mj)] = [Pi(ni,mi)]
MOVECopies the contents of one table into another table.
During a simple copy, the two tables must have the
same format, i.e.: nj = ni and mj = mi.
4 - 22en-938872/2
PjTarget table name.
nj,mjEntries and blocks of the target table.
PiSource table name.
ni,miEntries and blocks of the source table.
Creating and Managing Symbolic Variable Tables
Syntax for Partially Copying Blocks
MOVE [Pj(nj,mj)],mj1,mj2 = [Pi(ni,mi)],mi1,mi2
MOVECopies the contents of one table into another table.
PjTarget table name.
nj,mjEntries and blocks of the target table.
mj1,mj2Limits of target table Pj between which are copied the
blocks indexed mi1 to mi2 of the source table Pi. The
other blocks of Pj are not modified.
PiSource table name.
4
ni,miEntries and blocks of the source table.
mi1,mi2Indexed limits of source table Pi.
These limits and the blocks between these two limits
are copied into table Pj between limits mj1 and mj2.
MOVECopies the contents of one table into another table.
PjTarget table name.
nj,mjEntries and blocks of the target table.
PiSource table name.
ni,miEntries and blocks of the source table.
/ j1=i1 / j2=i2 / jn=inWhen certain entries of a table are not to be copied,
each entry to be copied must be specified with, after the
character «/», the target entry index followed by the
character «=» and the source entry index.
The value of an entry copied in the target table can be
inverted by preceding the source entry index by the sign
«-» (minus).
en-938872/24 - 23
Notes
The MOVE function must be the first word in the block (no sequence number).
The maximum number of blocks in a finished profile is limited to 95.
It is possible to reverse the order of a copy by reversing the start and end limit indexes
in one of the tables.
The indexes can be specified in symbolic variables.
In case of a programming error, the system returns the following error numbers:
ERROR 196 (inconsistency in index declaration),
ERROR 199 (syntax error).
Examples
MOVE simple copy of blocks
Example: Copying the contents of one table into another table.
MOVE [PB(2,3)] = [PA(2,3)]
Entries 1
Block 1
Block 2
Block 3
Target table
212
Source table
1
2
3
4 - 24en-938872/2
Creating and Managing Symbolic Variable Tables
MOVE partial copy of blocks
Example 1: Copying part of a table into another table.
MOVE [PB(2,5)],2,5 = [PA(2,6)],1,4
4
Example 2: Copying part of a table into another table.
MOVE [PB(2,5)],2,4 = [PA(2,6)],3,5
Example 3: Reversal of the limit and block indexes when copying part of a table into
another table.
MOVE [PB(2,5)],2,5 = [PA(2,6)],4,1
en-938872/24 - 25
MOVE: Partial copying of blocks and specification of the entries to be copied
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,
,,
,,
,,
,,,,,
,
,,,
,
,
,
,
,
,
,
,,
,,
,,
,,
,,,,,
,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
,,
,,
,,
,,
,,,,,
Example: Inversion of the values of the entries when copying part of a table into
another table.
Only the first and third entries are copied into the target table PB, and the values of
the first entries are inverted.
MOVE [PB(3,6)] = [PA(3,6)] / 1=-1 / 3=3
,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
Reminder
DELETE Function
The DELETE (or DELE) function can be used to programme deletion of the symbolic
variables (see Chapter 7 of the Programming Manual).
4 - 26en-938872/2
Creating and Managing Symbolic Variable Tables
4.2.9Indirect Addressing of Symbolic Variables
A variable or a table of symbolic variables can be referenced by a value.
This addressing mode simplifies linking tables by using numbers instead of the
names of the symbolic variables.
This symbolic variable addressing mode is indirect, since it is via another address
vector variable whose value is the reference of another symbolic variable or table of
symbolic variables.
Numerical addressing is symbolised by the character @ followed by the address
vector name.
The variables addressed by negative numbers are automatically deleted by function
G80.
Example
VAR [no] = 7 [@no(10)]
[Symb]
The table with 10 entries is referenced
by the value 7
ENDV
[Symb] = 7 L0 = [@Symb(2)]
«@Symb» addresses the same
table declared as «@no»
-G100 to G255 (reminder: G200 to G255 reserved for NUM).
en-938872/25 - 3
A subroutine call by a Gxxx function without arguments is ignored by the system. The
arguments are interpreted by the %10xxx subroutine called.
The subroutines called by G functions must therefore have visibility into the programme context and all the functions programmed in the calling block.
Execution of a subroutine called by a G function cannot be interrupted by an
«immediate» request in the edit mode (EDIT).
A subroutine called by a G function cannot itself call another subroutine by a G
function. However, nesting with another type of call is possible (call by M function or
machine processor), but two calls of the same type can in no case be nested.
Functionalities Used in %10xxx Subroutines
-Functions G997, G998 and G999,
-Programme variables L900 to L925 and L926 to L951,
-External parameters E,
-Symbolic variables,
-Programme status access symbols.
A call to a subroutine by a G function implicitly sets function G999 (execution
suspended and block concatenation forced). This function has to be cancelled by
programming functions G998 and/or G997 set in the subroutine.
During the return to the part programme, state G999 is systematically reset as long
as the subroutine calling function (Gxxx) remains present and active (no G80).
For additional information on functions G997, G998 and G999, refer to the programming
manuals for:
-Milling (938819),
-Turning (938820).
5 - 4en-938872/2
Creating Subroutines Called by G Functions
5.2Inhibiting Display of Subroutines Being Executed
Display on the programme page (PROG) of a subroutine and its internal subroutines
during execution can be inhibited.
The character «:» after the subroutine number inhibits display. In this case, only the
subroutine call block is displayed.
Example:
Only block N150 including function G108 is displayed during execution of subroutines
Creating a particular cycle with function G199 (subroutine %10199).
The cycle below is given only for guidance.
It allows execution of several drilling or punching operations «P» distributed on a
circle with radius «R» centred on XY (G17).
Cycle syntax and parameters
G199Cycle for drilling equally spaced holes on a circle.
X.. Y..Circle centre position.
ER..Approach and clearance position.
Z..Machining end point.
P..Number of equally spaced holes.
R..Radius of the hole circle.
F..Feed rate.
Circle 1 cycle
Circle 2 cycle
Circle 3 cycle
Circle 4 cycle
Circle 5 cycle
Cycle cancelled
N110 M02
Representation of machining
X
Y
1 (6 holes)
2 (4 holes)4 (4 holes)
5 (6 holes)
3 (6 holes)
Creating Subroutines Called by G Functions
Cycle subroutine
%10199: (Equally spaced holes on the circle)
VAR
[G0/1] [RETURN] [FEED] [G94/5]
ENDV
[G0/1]=3
[G0/1]=1
[..BG03] [G0/1]=2
*
[..BG01] + [G0/1]
*
[FEED]=[.RF]
[G94/5]= 94
[G94/5]= 95
*
[.BG95] + [G94/5]
*
PUSH L0 - L7
(Test whether P and R are programmed in the call block)
IF [..G80]= 1 THEN
L0= [.IBP(1)]
G79 L0= 0 N100
ENDI
IF [.IBP(1)] = 1 THEN
L100= [.IRP(1)]
ENDI
L100= [.IRP(1)]
G79 L100 < 1 N101
IF [.IBX(3)] = 1 THEN L925 = [.IRX(3)]
ENDI
[.BG94]
[.IBP(3)]
*
[..BG02] + [G0/1]
*
Store G0, G1, G2 or G3
Store G94 or G95
First block in the cycle?
Error if P or R is missing
Read next P if any
Store P
Error if P is not a positive integer
Hole bottom dimension
X dimension
Y dimension
Cycle start dimension
Hole bottom dimension modified
XY movements enabled
FOR L4= 1 TO L100
L5= L4
L6= CL5
L7= SL5
360 / L100
*
[.IRP(3)] + L0
*
[.IRP(3)] + L1
*
G3 G94 F5000 XL6 YL7 IL0 JL1
M997
IF [.IBE0(6)]= 1 THEN
Current angle
X dimension
Y dimension
Circular positioning
Forced concatenation
Feed rate
G94 FL905
ENDI
G1 Z L925
G4 F1
G0 Z [RETURN]
Hole drilled
Dwell in bottom of hole
Return in Z
M999
ENDF
G [G94/5] F [FEED]
End of cycle
Return to initial conditions
PULL L0 - L7
G79 N9999
End of cycle
5 - 8en-938872/2
N100 E.500
N101 E.501
Error number (see %20500)
Error number (see %20500)
N9999
Error message programme
%20500 (Error messages of cycle G199)
N500 $ P AND R MANDATORY IN G199
N501 $ P MUST BE A POSITIVE INTEGER IN G199
Creating Subroutines Called by G Functions
Example 2
Creating a special cycle with function G177 (subroutine %10177).
The cycle below is given only for guidance.
It is used to execute a profile by back and forth passes with the possibility of radius
correction if required.
Cycle syntax and parameters
G177 N.. N.. ER..
G177Machining by back and forth passes.
N.. N..Numbers of the first and last blocks defining the profile
(when the blocks are in reverse order, machining of the
profile is reversed).
ER..Argument forcing or cancelling radius correction:
ER 40 : machining to tool centre
ER 41 : offset on the left of the profile
ER 42 : offset on the right of the profile
%10177: (Profile machined by back and forth passes)
G998
VAR [N1] [N2] [PLANF] [G] [H] [diam] [NBLOC] [M998] [multi]=1
[axis1] [axis2] [PLANT] [centre1] [centre2]
ENDV
IF 'ER<40 OR 'ER>42 THEN 'ER=40
If ER is not correctly programmed,
error ER 40
ENDI
[M998]=[.BM999]-[.BM997]+998 M998
Storage of M997, M998 and M999
[N1]=L913 [N2]=L914
IF L913>L914 THEN [N1]=L914 [N2]=L913
Storage of the profile execution direction
ENDI
[H]=[.RXH]-1 [H]=[.IRH(H)]
Nesting level
IF L913>L914 THEN
P.BUILD [TAB(7,NB)] H[H] N[N1] N[N2]
Creation of a table to store
the profile
G997
[PLANT]=[.BG20]+[.BG21]
[diam]=E70007
Choice of the plane for turning
Programming by diameter
5 - 10en-938872/2
Creating Subroutines Called by G Functions
IF [PLANT]<>0 THEN
IF [.BG20]=1 THEN @Y=X @X=Z @J=I @I=K
ELSE @Y=Y @X=X @J=J @I=I
ENDI
IF [diam]=1 THEN [multi]=2
For turning by diameter (x2)
ENDI
ELSE
E11005=0
IF [.BG17]=1 THEN @Y=Y @X=X @J=J @I=
ELSE
IF [.BG18]=1 THEN @Y=X @X=Z @J=I @I=K
Address equivalence for milling
ELSE
@Y=Z @X=Y @J=K @I=J
ENDI
ENDI
ENDI
[axis1]= [TAB(3,NB)]
[multi] [axis2] [TAB(2,NB)]
*
Profile start point equal
to end point
G1 GL943 @Y [axis1] @X [axis2]
G998
FOR [NBLOC]=[NB] DOWNTO 2 DO
[G]=[TAB(1,NBLOC)]
IF [G]=0 THEN [G]=1
ELSE
IF [G]=-1 THEN [G]=3
ELSE [G]=2
Loop until the
profile is finished
ENDI
ENDI
[axis1]=[TAB(7,NBLOC)]
[centre1]=[TAB(5,NBLOC)]
Programming by diameter or radius as
defined at the beginning restored
5
en-938872/25 - 11
Example 3
Peck drilling cycle created by NUM and called by function G83
Cycle %10083 calls subroutine %10080 to analyse all the cycles created by NUM
(see subroutine %10080 following subroutine %10083).
Review of the syntax of cycle G83 for milling
N.. G83 X.. Y.. Z.. ER.. P.. Q.. F..
%10083:
(peck drilling cycle)
VAR [M3/4][M998][G90/1][G0/1][RF][clearance]=1 [diam]
[IX][IY][IZ][LZ][I][dimension][depth][Gplan][E]
ENDV
[diam]=E11005 E11005=0
G77 H10080(call analysis module)
(check syntax: P present if previous block with G80)
IF [..BG80]=1 AND [.IBP(1)]=0
THEN E.889
ENDI
(load P and Q if programmed)
IF [.IBP(1)]=1 THEN 'P=[.IRP(1)]
IF [.IBP(2)]=0 THEN 'Q='P
ENDI
ENDI
IF [.IBP(2)]=1 THEN 'Q=[.IRP(2)]
ENDI
(convert clearance if in INCHES)
IF [.BG70]=1 THEN [clearance]=[clearance]/25.4
ENDI
(clearance direction according to tool orientation)
IF [.RDX]<0 THEN [clearance]=-[clearance]
ENDI
(prepare positioning of the axes)
IF [.BG95]=1 THEN G0
ELSE F5000
ENDI
IF [I]<>0 THEN G9 G998
[dimension] = 'ER [I]=[IZ]+10 G0 G77 H10080 N[I] N[I]
(assign correct sign to P and Q if programmed)
IF 'P < 0 THEN 'P = -'P
ENDI
IF 'Q < 0 THEN 'Q = -'Q
5 - 12en-938872/2
Creating Subroutines Called by G Functions
EN DI
IF 'P > 0 THEN 'I=0 'L='ER-L[LZ]
(error if retraction plane = hole bottom)
IF 'L = 0 THEN E.891
ENDI
IF 'L < 0 THEN 'L=-'L
ENDI
IF 'Q = 0 OR 'Q > 'P THEN 'Q = 'P
ENDI
(calculate depth of first pass)
'I = 'Q-'P
'J = 'L-'I
IF 'J <= 0 THEN
(go to bottom of hole)
[dimension]=L[LZ] G1 F[RF] G77 H10080 N[I] N[I]
G79N100
ENDI
IF 'J < 'Q/2 THEN 'I = -'Q/2 + 'L
ENDI
IF 'ER > L[LZ] THEN [depth] = -'I + 'ER
ELSE [depth] = 'I + 'ER
ENDI
(execute first pass)
[dimension]=[depth] G9 G1 F[RF] G77 H10080 N[I] N[I]
IF [.IBE1(6)]=1 THEN G4 FL931
ENDI
(retract —> ER)
[dimension]=’ER G0 G77 H10080 N[I] N[I]
REPEAT
(calculate approach dimension)
[dimension]=[clearance]+[depth]G0 G77 H10080 N[I] N[I]
(calculate and execute next passes)
'I = 'Q-'P
IF 'J <= 0 THEN
EXIT
ENDI
IF 'J < 'Q/2 THEN 'I = -'Q/2 + 'L
ENDI
IF 'ER > L[LZ] THEN [depth] = -'I + 'ER
ELSE [depth] = 'I + 'ER
ENDI
[dimension]=[depth] G9 G1 F[RF] G77 H10080 N[I] N[I]
IF [.IBE1(6)]=1 THEN G4 FL931
ENDI
[dimension]=’ER G0 G77 H10080 N[I] N[I]
UNTIL 'I = 'L (test for end of loop)
'I/'L + 'P + 'I
*
'I/'L + 'P + 'I 'J = 'L-'I
*
5
en-938872/25 - 13
ENDI
(go to bottom of hole)
[dimension]=L[LZ] G1 F[RF] G77 H10080 N[I] N[I]
ENDI
N100
(dwell specified by EF)
IF [.IBE1(6)]=1 THEN G4 FL931
ENDI
(retract to ER)
[dimension] = 'ER [I]=[IZ]+10 G0 G77 H10080 N[I] N[I]
G997 G9 M[M998]
G[G90/1] G[G0/1] F[RF] E11005=[diam]
Subroutine %10080 called by cycle %10083
%10080
(analyse drilling, tapping cycles, etc.)
IF [.IBE0(6)] = 1 THEN FL905
ENDI
IF [.IBE0(19)] = 1 THEN SL918
ENDI
IF [.IBE0(20)] = 1 THEN TL919
ENDI
BCLR [.IBE0(6)]/[.IBE0(19)]/[.IBE0(20)]
(read spindle rotation direction and M block sequencing)
[M3/4]=3*[.BM03] [M3/4]=4
[M998]=[.BM999]-[.BM997]+998 M997
(read tool axis number)
[IZ] = [.RDX]
IF [IZ] < 0 THEN [IZ] = -[IZ]
ENDI
(G21, G22 prohibited during a machining cycle)
[E]=[.BG21]+[.BG22] G79 [E]>0 N85
(plane and tool axis compatible?)
IF [.BG20]=1 THEN [Gplan]=20
ELSE [Gplan]=[.BG19]-[.BG17]+18
[E]=[Gplan]+[IZ] G79 [E]<>20 N83
ENDI
(read axis ranks and station in tool axis L900)
[LZ]=922+[IZ] G79 N[IZ]
N1 [IX]=5 [IY]=6 G79 N3+1
N2 [IX]=4 [IY]=6 G79 N3+1
N3 [IX]=4 [IY]=5
(choose primary or secondary axis)
(on the axis perpendicular to the tool axis)
IF [.IBX2(IX)] = 0 THEN [IX] = [IX]-3
ENDI
[.BM04]+[M3/4]
*
5 - 14en-938872/2
Creating Subroutines Called by G Functions
IF [.IBX2(IY)] = 0 THEN [IY] = [IY]-3
ENDI
(and on tool axis)
IF [.IBX2(IZ)] = 0 THEN [IZ] = [IZ]+3 [LZ]=[LZ]-3
IF [.IBX2(IZ)] = 0 THEN E.880
ENDI
ENDI
(store the last Z dimension in 'ER=. Return if ER was not programmed)
IF [.IBE1(18)] = 0 THEN 'ER = [..IRX(IZ)]
ELSE [E]=[IZ]-1
(If programming is by diameter, correct 'ER)
IF E[E]=1 THEN 'ER='ER/2
ENDI
ENDI
[LZ]=[LZ]+26 ( LZ points to variables L926..L951)
(on the first block to be initialised - hole bottom dimension)
IF [..BG80] = 1 THEN L[LZ]=[..IRX(IZ)]
ENDI
(if programmed, store the new hole bottom dimension)
IF [.IBX(IZ)] = 1 THEN L[LZ] = [.IRX(IZ)]
ENDI
(test whether the orientation is consistent with the machining direction)
IF 'ER <> L[LZ] THEN
IF 'ER>L[LZ] AND [.RDX]<0 THEN E.890
ENDI
IF 'ER<L[LZ] AND [.RDX]>0 THEN E.890
ENDI
ENDI
(store the type of positioning)
[G0/1]=3*[.BG03][G0/1]=2
(store feed rate, dwell)
[RF]=[.RF]
(if ED is programmed, read it and if linear interpolation is specified, force
positioning of the axes already programmed)
IF [.IBE1(4)] = 1 THEN EDL929
BCLR [.IBE1(4)]
IF [G0/1] < 2 THEN G91 [dimension]=0
IF [.IBX1(IX)] = 1 THEN [I]=[IX]+10 G77 H10080 N[I] N[I]
ENDI
IF [.IBX1(IY)] = 1 THEN [I]=[IY]+10 G77 H10080 N[I] N[I]
ENDI
ENDI
ENDI
(store presence then disable the tool axis)
[I]=[.IBX(IZ)]+[.IBX(IX)]+[.IBX(IY)] G90
BCLR [.IBX(IZ)]
1000+70007
*
[.BG02]+[.BG01]+[G0/1] [G90/1]=90+[.BG91]
*
5
en-938872/25 - 15
(test spindle rotation if axis is programmed)
IF [I]<>0 THEN [E]=[M3/4]
ENDI
G79 N800
(error message)
N81 E.831 (spindle stopped)
N82 E.882 (hole bottom not programmed)
N83 E.890 (tool orientation incompatible)
N84 E.894 (ER prohibited in G20)
N85 E.895 (G21, G22 prohibited during this cycle)
(—movements—)
N11 X[dimension]
N12 Y[dimension]
N13 Z[dimension]
N14 U[dimension]
N15 V[dimension]
N16 W[dimension]
N800
6.3.1Notes on Smooth Polynomial Interpolation6 - 7
6.3.2Restrictions on Smooth Polynomial
Interpolation6 - 8
6
en-938872/26 - 1
6 - 2en-938872/2
6.1General
Polynomial Interpolation
Polynomial interpolation is a tool for defining paths by polynomials. It is used for spline
curve fitting.
The position on each of the axes is defined by a polynomial based on an independent
(dimensionless) parameter which varies from 0 to 1 from the beginning to the end of
the path.
There are two types of polynomial interpolation:
-segmented polynomial interpolation,
-smooth polynomial interpolation.
Distinction Between Segmented and Smooth Polynomial Interpolation
With segmented polynomial interpolation, the segment size depends on the
programmed feed rate. Each segment is calculated so as to be executed in 10 ms
and is interpolated linearly for each sample.
With smooth polynomial interpolation, interpolation is carried out in real time, i.e. a
point on the curve is calculated for each sample.
Optional Functionalities
To be able to use smooth polynomial interpolation, it is necessary to enable option
52 (smooth polynomial interpolation). Otherwise, programming of argument I.. in the
syntax is ignored and segmented interpolation is carried out if option 51 (spline curve)
is enabled.
Segment polynomial interpolation (absence of I.. in the syntax) is accepted if either
of options 51 and 52 is enabled.
6.2Programming Segmented Polynomial Interpolation
In the block syntax, each polynomial is characterised by the end position followed by
the coefficients of increasing degrees separated by «/».
All the following geometric transformations can be applied to the curve:
-programmed offset (G59),
-mirroring (G51 ...),
-scaling factor (G74),
-angular offset (ED..).
REMARKTo make an angular offset, both axes of the interpolation plane must be
programmed and must have the same number of coefficients. The
polynomial for one axis may have to be padded out with coefficients
whose value is zero so that it has the same number of coefficients as
the other axis of the plane. If this is not the case, the system returns
error message 133.
6 - 4en-938872/2
Polynomial Interpolation
Example:
Without angular offset
G1 X20 Y0 /50/-180/240/-110
With angular offset ED..
G1 X20 /20/0/0/0 Y0 /50/-180/240/-110
Radius correction using polynomial interpolation
With radius correction (G41 or G42), the normal tool offset is not carried out unless
both axes of the interpolation plane are programmed.
Throughout interpolation (from the start point to the end point), the tool is held normal
to the curve in the interpolation plane.
Consecutive polynomial curves must be tangent. If a curve not tangent with another
polynomial curve (line or circle) is sequenced, the connection is made by a connection
circle that positions the tool normal to the new curve at its start point.
When two curves are sequenced and the tool diameter is too large to be positioned
on the normal to one of the programmed paths (connection radius smaller than the
tool radius or path inaccessible), the system nevertheless applies the path continuity
rules, which results in undesirable material removal.
6.2.3Interpolation Feed rate
The curve segmenting step is directly related to the feed rate programmed:
-in G93 (V/L) and G94 (mm/min), the segmenting step is computed so as to be
executed in 10 milliseconds (ms) if the sampling period is less than 5 ms,
-in G95 (mm/revolution), the segmenting step is equal to the programmed feed per
revolution.
6
en-938872/26 - 5
6.2.4Limit on the Number of Coefficients
4
060-4030-15
3
120-30
5
5
2-52030-2040
0
Axis 2, 5 entries
Axis 0, 4 entriesAxis 1, 3 entries
For each block, the coefficients are stored in the programme stack which has a
maximum of 32 entries. Each coefficient is stored in an entry. In addition, for each
axis, one entry is occupied by the physical address of the axis followed by the number
of coefficients.
If the stack becomes full, the system returns the error message 6.
The coefficients have the same format and same limit values as dimensions.
Example:
Storage of the coefficients of a block in the stack.
X..Interpolation end point X coordinate.
/ Coeff nth degPolynomial first, second, etc. degree coefficients.
Y.. Z..Interpolation end point on the Y, Z and other axes.
I..Curve length (path on which the programmed feed rate
applies).
6.3.1Notes on Smooth Polynomial Interpolation
When declaring polynomials, the coefficient of the highest degree does not have to
be specified. Since sum of the coefficients of an axis is equal to the relative
movement, the system can determine the highest degree automatically.
Example:
...
G01 X0 Y..
X20/10/-5/
The third degree coefficient is equal to (20-0)-(10-5) = 15
...
Special Application
With smooth polynomial interpolation, the check of parameter I.. can also be used to
apply the programmed feed rate to a single axis instead of to the path.
Application of the feed rate to the X axis
...
G01 X10 Y10 F1000
X20 Y25/30/ I10
X35 Y50/25/ I15
Linear interpolation on X and 2nd degree
interpolation (25-10)-30 = -15 on Y X35
Linear interpolation on X and Y
(second degree coefficient = 0)
...
6
en-938872/26 - 7
6.3.2Restrictions on Smooth Polynomial Interpolation
With smooth polynomial interpolation, the tool corrections in G41, G42 and G29
cannot be used.
Backoff on a path defined by smooth polynomial interpolation is impossible.
6 - 8en-938872/2
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.