num 1020, 1040, 1060 Programming Manual

NUM
1020/1040/1060
SUPPLEMENTARY
PROGRAMMING
MANUAL
0101938872/2
06-97 en-938872/2
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.
© Copyright NUM 1997.
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.
© Copyright NUM 1997 software NUM 1000 line.
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.
2 en-938872/2
Table of Contents
Table of Contents
1 Structured Programming 1 - 1
1.1 General 1 - 3
1.2 Structured Programming Commands 1 - 6
1.3 Example of Structured Programming 1 - 13
2 Reading the Programme Status Access Symbols 2 - 1
2.1 General 2 - 3
2.2 Symbols for Accessing the Data of the Current Block 2 - 3
2.3 Symbols Accessing the Data of the Previous Block 2 - 11
3 Storing Data in Variables L900 to L951 3 - 1
3.1 General 3 - 3
3.2 Storing F, S, T, H and N in Variables L900 to L925 3 - 3
3.3 Storing EA to EZ in Variables L926 to L951 3 - 4
3.4 Symbolic Addressing of Variables L900 to L951 3 - 4
4 Creating and Managing Symbolic Variable Tables 4 - 1
4.1 Creating Symbolic Variable Tables 4 - 3
4.2 Symbolic Variable Management Commands 4 - 8
5 Creating Subroutines Called by G Functions 5 - 1
5.1 Calling Subroutines by G Functions 5 - 3
5.2 Inhibiting Display of Subroutines Being Executed 5 - 5
5.3 Programming Examples 5 - 6
6 Polynomial Interpolation 6 - 1
6.1 General 6 - 3
6.2 Programming Segmented Polynomial Interpolation 6 - 3
6.3 Programming Smooth Polynomial Interpolation 6 - 7
7 Coordinate Conversions 7 - 1
7.1 General 7 - 3
7.2 Using the Coordinate Conversion Matrix 7 - 3
7.3 Application of Coordinate Conversion 7 - 5
7.4 Example of Application Subroutine 7 - 6
en-938872/2 3
8 RTCP Function 8 - 1
8.1 General 8 - 3
8.2 Using the RTCP Function 8 - 4
8.3 Description of Movements 8 - 6
8.4 Processing Related to the RTCP Function 8 - 9
8.5 Use in JOG and INTERV Modes 8 - 11
8.6 Restrictions and Conditions of Use 8 - 11
9 N/M AUTO Function 9 - 1
9.1 General 9 - 3
9.2 Using the N/M AUTO Function 9 - 7
9.3 Procedure After Enabling the N/M AUTO Function 9 - 8
9.4 Stopping and Restarting in N/M AUTO Mode 9 - 11
9.5 Checks Included in N/M AUTO 9 - 12
Appendix A Table of Structured Programming Commands A - 1 Appendix B Table of Symbolic Variable Management Commands B - 1 Appendix C Table of Programme Status Access Symbols C - 1
C.1 Addressing G and M Functions C - 3 C.2 Addressing a List of Bits C - 3 C.3 Addressing a Value C - 3 C.4 Addressing a List of Values C - 4
Appendix D Table of Symbols Stored in Variables L900 to L951 D - 1
D.1 Symbols Stored in Variables L900 to L925 D - 3 D.2 Symbols Stored in Variables L926 to L951 D - 3
4 en-938872/2
Record of Revisions
DOCUMENT REVISIONS
Date Revision Reason for revisions
02-93 0 Document creation (conforming to software at index D)
01-95 1 Conforming 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-97 2 Conforming 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/2 5
6 en-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/2 7
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
8 en-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/2 9
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
10 en-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/2 11
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.
12 en-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/2 13
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.
14 en-938872/2
Structured Programming
1 Structured Programming
1.1 General 1 - 3
1.1.1 Commands Used in Structured Sequences 1 - 3
1.1.2 General Syntax Rules 1 - 3
1.1.3 Nesting and Branches 1 - 5
1.2 Structured Programming Commands 1 - 6
1.2.1 Condition Graph 1 - 6
1.2.2 Instruction Execution Conditions 1 - 7
1.2.3 REPEAT UNTIL Loops 1 - 8
1.2.4 WHILE Loops 1 - 9
1.2.5 Loops with Control Variable 1 - 10
1.2.6 Exiting the Loop 1 - 12
1.3 Example of Structured Programming 1 - 13
1
en-938872/2 1 - 1
1 - 2 en-938872/2
1.1 General
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.1 Commands 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.2 General 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/2 1 - 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 - 4 en-938872/2
1.1.3 Nesting 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 IF G79 N100
WHILE REPEAT
G79 N100
good
IF G77 H2 G79 N100 G79 N50 G79 N30
bad bad
G79 N50
ENDI N30 N50
ENDW UNTIL
N50 N100 ENDI N100 M02
good
good bad
en-938872/2 1 - 5
1.2 Structured Programming Commands
1.2.1 Condition 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 - 6 en-938872/2
1.2.2 Instruction 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/2 1 - 7
1.2.3 REPEAT 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 - 8 en-938872/2
1.2.4 WHILE 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/2 1 - 9
1.2.5 Loops 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 - 10 en-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/2 1 - 11
1.2.6 Exiting 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 - 12 en-938872/2
1.3 Example 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/2 1 - 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
Loop on rows
$ ROW POSITION:
$=L5
XL0 L6=L5-1
L11+L1 YL6
*
G00 Z0
FOR L4=1 TO L2 DO
Loop on columns
$ DRILL THE ROW POINT: $=L5 $+COLUMN: $=L4 L6=L4-1*L10+L0 XL6 G01 Z-10 F50 G00 Z0
ENDF ENDF N.. M02
1 - 14 en-938872/2
Reading the Programme Status Access Symbols
2 Reading the Programme Status Access Symbols
2.1 General 2 - 3
2.2 Symbols for Accessing the Data of the Current Block 2 - 3
2.2.1 Symbols Addressing Boolean Values 2 - 3
2.2.1.1 Addressing G Functions 2 - 4
2.2.1.2 Addressing of M Functions 2 - 4
2.2.1.3 Addressing a List of Bits 2 - 6
2.2.2 Symbols Addressing Numerical Values 2 - 8
2.2.2.1 Addressing a Value 2 - 8
2.2.2.2 Addressing a List of Values 2 - 9
2.3 Symbols Accessing the Data of the Previous Block 2 - 11
2
en-938872/2 2 - 1
2 - 2 en-938872/2
Loading...
+ 116 hidden pages