Professional Documents
Culture Documents
Dynamic Operator Manual
Dynamic Operator Manual
Dynamic Operator Manual
1020/1040/1050/1060
DYNAMIC
OPERATOR
MANUAL
0101938871/A
08-2000 en-938871/A
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.
2 en-938871/A
Table of Contents
1 General 1-1
1.1 Use of the Dynamic Operators 1-3
1.2 Types of Operations 1-3
1.3 General Syntax Rules for the Operations 1-4
1.4 End of Execution of an Operation 1-6
1.5 Details on Execution of the Operations 1-7
1.6 Use of Dynamic Operators for Axis
Multigroups 1-8
1.7 Types of Operands Used 1-8
1.8 Use of Parameters E950xx 1 - 11
1.9 Order of Execution of the Measurement -
Servo-Drive Task 1 - 12
2 Description of the Operations 2-1
2.1 Add 2-3
2.2 Subtract 2-4
2.3 Multiply 2-5
2.4 Rotate a Vector 2-6
2.5 Load a Parameter With or Without Mask 2-8
2.6 Load of a Peripheral Memory With or
Without Mask 2-9
2.7 Indexed Load of a Parameter 2 - 12
2.8 Indexed Storage of a Parameter 2 - 13
2.9 Compare Two Parameters 2 - 14
2.10 Conditions on the Sum of Two Parameters 2 - 16
2.11 Store Data in a Peripheral Memory 2 - 18
2.12 Increment with Modulo 2 - 22
2.13 Multiply by a Programme Variable 2 - 23
2.14 Arc Tangent Function 2 - 24
2.15 Manual Control of an Axis 2 - 25
2.16 Third-Degree Polynomial and Derivative 2 - 26
2.17 Speed on Path 2 - 27
2.18 Divide 2 - 28
2.19 Square Root 2 - 29
2.20 Axis Speed Synchronisation 2 - 30
2.21 Oscillation Cycles 2 - 32
2.22 Dynamic Operators in C Function 2 - 35
2.23 Electronic Cam 2 - 49
2.24 Differential Datum Shift 2 - 50
3 Examples of Use 3-1
3.1 Example 1 3-3
3.2 Example 2 3-4
3.3 Example 3 3-6
Appendix A List of Operations A-1
en-938871/A 3
4 en-938871/A
Preliminary
Preliminary
OEM Documents
These documents are designed for the OEM integrating the numerical control on a machine.
AUTOMATIC
INSTALLATION INSTALLATION INSTALLATION PARAMETER
CONTROL
AND AND AND
FUNCTION
COMMISSIONING COMMISSIONING COMMISSIONING MANUAL
PROGRAMMING
MANUAL MANUAL MANUAL
MANUAL LADDER
LANGUAGE
en-938871/A 5
Special Programming Documents
These documents concern special numerical control programming applications.
6 en-938871/A
Preliminary
Overview of the dynamic operators used to define operations performed at the rate
of the real-time clock.
CHAPTER 1
GENERAL
CHAPTER 2
DESCRIPTION OF
THE OPERATIONS
CHAPTER 3
EXAMPLES
OF USE
APPENDIX A
SYNTAX
SUMMARY
TABLE
en-938871/A 7
Agencies
The list of NUM agencies is given at the end of the manual.
Questionnaire
To help us improve the quality of our documentation, we kindly request you to return the questionnaire at the end of
the manual.
8 en-938871/A
General
1 General
en-938871/A 1-1
1-2 en-938871/A
General
1 : Add
2 : Subtract
3 : Multiply
4 : Rotate a vector
5 : Load a parameter with or without mask
6 : Load a peripheral memory with or without mask
7 : Indexed load of a parameter
8 : Indexed storage of a parameter
9 : Compare of two parameters
10 : Conditions on the sum of two parameters
11 : Store data in a peripheral memory (axis encoder card or PLC)
12 : Incrementation with modulo
13 : Multiply by a programme variable
14 : Arc tangent function
15 : Axis jog
16 : Third-degree polynomial and its derivative
17 : Feed rate on path
18 : Divide
19 : Square root
20 : Axis speed synchronisation
21 : Oscillation cycles
22 : Dynamic operators in C function
23 : Electronic cam
24 : Differential datum shift
en-938871/A 1-3
1.3 General Syntax Rules for the Operations
1.3.1 General Syntax of an Operation
On = m Operands
The character "=" separates the operation number from the operator.
Operation Number
Each operation to be performed is identified by the letter "O" followed by a decimal number n from 1 to 128.
The numbers assigned to the operations determine the order in which they are executed.
Type of Operation
The operation is defined by the decimal number of the operator "m" from 0 to 24 followed by operands.
Operands
Operands can be:
- external parameters
- immediate values (positive or negative integers)
- axis encoder addresses or parameters accessible by the PLC
- programme variables or symbolic variables.
The first operand is always the destination operand, i.e. the result of the operation is stored in this operand.
The character "/" separates consecutive operands.
Operation Results
When the result of an operation assigned to an E parameter is not an integer, the system automatically truncates the
decimal digits.
Notation Rules
In the operations described in Chapter 2 of this manual:
- the operands are symbolized by "E", "I", "@", "L" for the most commonly used ones or by symbols specific to certain
operations (see Sec. 1.7).
- the order in which consecutive operands are written is defined by a lower case letter a, b or c when an operation
includes several operands of the same type
- optional operands are enclosed in braces "{}".
1-4 en-938871/A
General
en-938871/A 1-5
1.4 End of Execution of an Operation
The execution of an operation ends with read of:
- its cancellation by the operator "0",
- its replacement by an operation with the same execution order number,
- the end of a programme (M02),
- an NC and/or PLC reset.
On = 0
On Operation No. n.
0 Cancellation of operation No. n.
Definition of Cancellation
The syntax does not include any operands.
Example:
O7 = 2 Ea/Eb/Ec/I Operation No. 7
...
O7 = 0 Cancellation of operation No. 7
1-6 en-938871/A
General
When it reads O1, the system stores the operands of O1 and performs O1.
On the next RTC cycle, the system performs O1 again (already stored), stores the operands of O9 and performs O9.
On the following RTC cycle, the system performs O1 and O9 then performs O5.
Therefore:
O1 First RTC Store and perform O1
O9 Second RTC Perform O1, store and perform O9
O5 Third RTC Perform O1 and O9, store and perform O5
X.. Next RTCs Perform O1, O5 and O9 by increasing order of the numbers.
On subsequent RTCs, all the operations stored are performed.
en-938871/A 1-7
1.6 Use of Dynamic Operators for Axis Multigroups
The operations can be used by NC and PLC axis groups.
An operation declared in a group can only be cancelled or modified in the same group. Any attempt to cancel or redefine
an operation declared in another group (and still active) returns "error 98".
It should be noted that:
- reset of a group destroys all the operations declared for that group,
- an NC reset destroys all the operations for all the NC groups,
- a PLC reset destroys all the operations for all the PLC groups.
1-8 en-938871/A
General
en-938871/A 1-9
E79007 Minimum setting of the spindle speed potentiometer assigned to the axis group
E79008 Maximum setting of the spindle speed potentiometer assigned to the axis group
E800xx General purpose parameters (xx = 0 to 50)
E81xxx Master axis position references (xxx = 0 to 999) or general purpose parameters
E82xxx Slave axis corrections (xxx = 0 to 999) or general purpose parameters
E900xx Axis measurement (xx = axis No. 0 to 31) (write if not servoed)
E9010xx Spindle position reference (x = spindle number, 0 to 4)
E950xx Machine axis reference corrections (xx = axis No. 0 to 31)
E951xx Origin switch positive relative to machine origin
E952xx Axis (or spindle) measurement offset
1 - 10 en-938871/A
General
XR + + - +Xm
Interpolator + Axis encoder
+ +
εp
CR
Cm
Dynamic
I.C Axis correction (UT2)
operators
en-938871/A 1 - 11
1.9 Order of Execution of the Measurement - Servo-Drive Task
The flowchart below defines the location of dynamic operators in execution of the Measurement - Servo-drive NC task.
1 - 12 en-938871/A
Description of the Operations
en-938871/A 2-1
2.23 Electronic Cam 2 - 49
2.24 Differential Datum Shift 2 - 50
2.24.1 General 2 - 50
2.24.2 Programming 2 - 50
2-2 en-938871/A
Description of the Operations
2.1 Add
This operation performs an addition and multiplies the result by a power of 2.
Syntax
2
On = 1 Ea / Eb / Ec {/I}
On Operation No. n.
1 Add.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
Ea integer part of (Eb + Ec) { x 2 I }
Exemple
On = 1 E81000/E81001/E81002/-7
is equivalent to: E81000 integer part of (E81001 + E81002) / 128
Processing Time
12 microseconds.
en-938871/A 2-3
2.2 Subtract
This operator performs a subtraction and multiplies the result by a power of 2.
Syntax
On = 2 Ea / Eb / Ec {/I}
On Operation No. n.
2 Subtract.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
Ea integer part of (Eb - Ec) { x 2 I }
Example
On = 2 E81000/E81001/E81002/1
is equivalent to: E81000 integer part of (E81001 - E81002) x 2
Processing Time
14 microseconds.
2-4 en-938871/A
Description of the Operations
2.3 Multiply
This operator performs a multiplication and multiplies the result by a power of 2.
Syntax
2
On = 3 Ea / Eb / Ec {/I}
On Operation No. n.
3 Multiply.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
Ea integer part modulo 232 of Eb x Ec { x 2 I }
Dans l’opération, Ea, Eb et Ec adressent les entiers sur 32 bits.
Example
On = 3 E81000/E81001/E81002/-16
is equivalent to: E81000 integer part module 232 of (E81001 x E81002) / 65536
Processing Time
25 microseconds.
en-938871/A 2-5
2.4 Rotate a Vector
This operation rotates a vector in the interpolation plane.
Syntax
On = 4 Ea / Eb / Ec / I
On Operation No. n.
4 Rotate a vector.
Ea Type 1 external parameter (see Sec. 1.7.1) pointing to two consecutive memory
locations (see Sec. 1.7.5).
Eb Type 2 external parameter (see Sec. 1.7.2) pointing to two consecutive memory
locations (see Sec. 1.7.5).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition of the Operation
In the operation:
- Ea points to two consecutive integers corresponding to the coordinates of the vector resulting from the rotation
- Eb points to two consecutive integers corresponding to the coordinates of the vector to be rotated
- Ec is the angle of rotation measured in the unit defined by I
- I defines the unit angle as a fraction of a complete revolution, e.g. i = 3,600,000 for one ten-thousandth of a degree.
The vector is rotated counterclockwise.
REMARK Vector rotation uses auxiliary tables (one per axis processed) similar to those used
with operators 14 (arc tangent) and 21 (oscillation cycles). The total number of
tables is limited to eight. If this number is exceeded, the system returns "error 93".
Representation of the Rotation
In the XY plane (G17)
Ea is loaded with X’ and Ea+1 is loaded with Y’ Y X'
Eb contains X and Eb+1 contains Y V' Y'
Ec contains angle A
X
V Y
A
2-6 en-938871/A
Description of the Operations
Example
The following operation is used to calculate the cosine and sine of an angle A.
On = 4 E81000/E81020/E80055/3600000
Where E80055 = A (angle in ten-thousandths of a degree)
2
If E81020 = 1000 and E81021 = 0 (vector with norm 1000 parallel to the X axis),
then E81000 = 1000 x cos A and E81001 = 1000 x sin A
Processing Time
100 microseconds.
en-938871/A 2-7
2.5 Load a Parameter With or Without Mask
This operation is used to load an external parameter with or without a mask.
Syntax
On = 5 Ea / Eb {/Ec} {/I}
On Operation No. n.
5 Load a parameter with or without mask.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Examples
Load of the second byte of a parameter to set the feed rate potentiometer
On = 5 E79002/E80021/E80001/-8
0 0 0 0 0 0 z y x w v u t s r q p o n m l k j i h g f e d c b a E80021
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 E80001 : mask
Application of the mask,
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 p o n m l k j i 0 0 0 0 0 0 0 0
shift by -8 bits and load
in E79002
p o n m l k j i
Processing Time
12 microseconds.
2-8 en-938871/A
Description of the Operations
On Operation No. n.
6 Load a peripheral memory with or without mask.
Ea Type 1 external parameter (see Sec. 1.7.1).
@.. Machine axis address (source).
Eb Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
On = 6 Ea / Eb {/Ec} {/I}
On Operation No. n.
6 Load a peripheral memory with or without mask.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 3 external parameter (see Sec. 1.7.3).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
en-938871/A 2-9
Definition
Example:
On = 6 E81000/E43050
Parameters E44xxy address the analogue inputs of the 8I/8O cards (the data read are signed values on 16 bits).
E44xxy: xx = card (0 to 13), y = channel (0 to 7).
Example:
On = 6 E81000/E44050
2 - 10 en-938871/A
Description of the Operations
Parameters E46xyz
The inputs of the 4I/2O analogue module (16 analogue bits) are read by external parameter E46xyz: x = rack (4 or 5),
y = card (0 to F), z = input (0 to 3).
Example:
2
E81000=0
O1 = 6 E81000/E46410 (read of input 1 of the 4I/2O module at address $41)
O1 = 6 E81000/E46411 (read of input 2 of the 4I/2O module at address $41)
O1 = 6 E81000/E46412 (read of input 3 of the 4I/2O module at address $41)
O1 = 6 E81000/E46413 (read of input 4 of the 4I/2O module at address $41)
The inputs of the 4I/2O module are read by part programme by:
E81000=0
E81000=E46410 (input 1)
E81000=E46411 (input 2)
E81000=E46412 (input 3)
E81000=E46413 (input 4)
Processing Time
12 microseconds.
en-938871/A 2 - 11
2.7 Indexed Load of a Parameter
This operator accesses an indexed value contained in a table.
Syntax
On = 7 Ea / Eb / Ec / I
On Operation No. n.
7 Indexed load of a parameter.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
In the operation:
- Ea is loaded (by read) with the contents of E(b + contents of Ec)
- Eb addresses the start of the table (index 0)
- Ec addresses the index
- I is a positive value giving the maximum index value.
The operation cannot be performed if the value of Ec is negative or higher than I.
Ea / Eb / Ec / I
Start of the table
Maximum index
Index
Value to be loaded
Example
Load parameter E82020 from a table.
On = 7 E82020/E81000/E82011/90
If E82011 = 35, then E82020 is loaded with the contents of E81035 (E81000 + 35).
If E82011 = 111, the operation is not performed (since 111 is higher than the maximum index).
Processing Time
12 microseconds.
2 - 12 en-938871/A
Description of the Operations
Syntax
2
On = 8 Ea / Eb / Ec / I
On Operation No. n.
8 Indexed storage of a parameter .
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
In the operation:
- Ea addresses the start of the table (index 0)
- Eb is stored (written) in E (a + contents of Ec)
- Ec contains the index
- I is a positive value giving the maximum value of the index.
The operation cannot be performed if the value of Ec is negative or higher than I.
Ea / Eb / Ec / I
Start of the table
Maximum index
Index
Value to be stored
Example
Store the contents of parameter E82001 in a table.
On = 8 E81000/E82000/E82011/70
If E82011 = 25, then E82000 is stored in E81025 (E81000 + 25).
If E82011 = 96, the operation is not performed (96 is higher than the maximum value of the index).
Processing Time
12 microseconds.
en-938871/A 2 - 13
2.9 Compare Two Parameters
This operator makes a comparison whose result can be:
- a conditional jump to a specific operation
- display of a machine error with a halt.
Syntax
On = 9 Ea / Eb / Ia {/ Ib {/ Ic}}
On Operation No. n.
9 Compare two parameters.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ia Immediate value (see Sec. 1.7.4).
Ib Immediate value (see Sec. 1.7.4).
Ic Immediate value (see Sec. 1.7.4).
Definition
See the flowchart on the following page.
The comparison of Ea and Eb determines the value of an intermediate operator, "v":
- if Ea < Eb: v = Ia
- if Ea = Eb: v = Ib (default Ia)
- if Ea > Eb: v = Ic (default Ib).
In the operation
- if v > n: jump to operation Ov
- if 0 < v < n: go to the next operation On + 1
- if v < 0: display a machine error with a halt (machine error -v) and go to the next operation On + 1.
In certain cases, operands Ia, Ib and Ic can be replaced by:
- L programme variables
- [symb] symbolic variables.
Example
O7 = 9 E81000/E81005/15/0/-5
In this example:
- if E81000 < E81005: jump to operation O15 (if operation 6 is specified instead of 15, go to next operation O8)
- if E81000 = E81005: go to next operation O8
- if E81000 > E81005: display CNC error number 5.
Processing Time
14 microseconds.
2 - 14 en-938871/A
Description of the Operations
Flowchart
On 2
Ea < Eb Ea > Eb
Compare
Ea with Eb
Ea = Eb
v = Ia v = Ib v = Ic
v<0 v>0
Compare
v with 0
v=0
v≤n
Compare
v with n
v>n
Go to next operation Go to
On+1 operation Ov
en-938871/A 2 - 15
2.10 Conditions on the Sum of Two Parameters
This operator is used to check whether the sum of two parameters is between a minimum and a maximum.
The result of the operation can cause:
- a conditional jump to a specific operation
- display of a machine error followed by a halt.
Syntax
On = 10 Ea / Eb / Ec / I or E42xxx
On Operation No. n.
10 Conditions on the sum of two parameters.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2) pointing to two consecutive memory
locations (see Sec. 1.7.5).
I or E42xxx Immediate value (see Sec. 1.7.4) or Type 3 external parameter (see Sec. 1.7.3).
Definition
Refer to the flowchart on the following page.
In the operation:
- Ea and Eb are two parameters whose sum must be within two limits (minimum and maximum)
- Ec defines the limits (minimum limit followed by maximum limit)
- I or E42xxx is the result of the comparison which can be defined by:
. a positive I value causing a jump or a negative I value corresponding to machine error number -I, or
. a parameter E42xxx which addresses a byte of the PLC field by E42000 to E42127 (loaded with the value -128).
This operation is for the purpose of checking axis travels, i.e.:
EOTx - X reference + corrections - EOTx + 1 (EOT: End of Travel)
Example
Parameter E42xxx
Check the sum of E81000 and E81001
On = 10 E81000/E81001/E82000/E42xxx
where:
- E82000 and E82001 contain the minimum and maximum limits of the sum E81000 + E81001
- E42xxx is the address of the byte to be loaded with the value -128.
If the sum is not within the limits, go to next operation.
Processing Time
15 microseconds.
2 - 16 en-938871/A
Description of the Operations
Flowchart
On
2
Yes Ec ≤
Ea + Eb
≤ Ec+1
No
E42xxx
I or E42xxx
I=0
I≤n
Compare
I with n
I>n
en-938871/A 2 - 17
2.11 Store Data in a Peripheral Memory
This operator is used to store data in an axis or a PLC memory.
The syntax differs according as the data are to be stored at:
- a machine axis address, or
- a PLC address.
On = 11 @.. / E..
On Operation No. n.
11 Store data in a peripheral memory.
@.. Machine axis storage address (destination).
E.. Type 2 external parameter (see Sec. 1.7.2).
Definition
The operation gives access to the axis card DAC for write.
@.. is the address of the axis encoder where the contents of E are to be stored (axis measurement).
The data are absolute signed values encoded on 16 bits.
The value of E is between $8000 (-10 V) and $7FFF (+10 V).
Example
Store the contents of E8000 (value encoded on 32 bits) at address @6.
On = 11 @6/E80000
In this case, only the first 15 bits of E80000 are stored at @6 ("S" = sign bit).
Schematic Representation
15 0
s
@6
E80000
Processing Time
10 microseconds.
2 - 18 en-938871/A
Description of the Operations
Syntax
On = 11 Ea / Eb / I 2
On Operation No. n.
11 Store data in a peripheral memory.
Ea Type 3 external parameter (see Sec. 1.7.3).
Eb Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
In the operation:
- the value at address Eb is stored in Ea
- I is the number of bits or bytes to be transmitted (I must always be specified for storage in the PLC memory).
Ea defines the following PLC parameters:
- E10000 to E10031
- E42000 to E42127
- E33xyz and E34xxy
- E36xyz
en-938871/A 2 - 19
Parameters E33xyz and E34xxy
Parameters E33xyz address the PLC output terminals (access to one byte at a time).
E33xyz: x = rack (0 to 6), y = card (0 to 9), z = channel (0 to 9).
Reminder: Parameters E33xyz are not accessible unless Ladder variable %Qrc3B.1 = 1.
Example
On = 11 E33070/E81000/1
Parameters E34xxy address the analogue outputs of the 8I/8O cards (the data written are signed values encoded on
16 bits).
E34xxy: xx = card (0 to 13), y = channel (0 to 7).
Example:
On = 11 E34070/E81000/1
Parameters E36xyz
The outputs of the 4I/2O analogue module (16 analogue bits) are written by external parameter E36xyz: x = rack (4 or
5), y = card (0 to F), z = output (0 to 1).
Example:
E81000=32767 (corresponds to 10 V is the module was configured for a range of 0 - 10 V in task %INI).
E80000=32767
E36410=E80000 (write of output 1)
E36411=E80000 (write of output 2)
Example
Using E42xxx.
1
On = 11 E42020/E80000/ 2
4
2 - 20 en-938871/A
Description of the Operations
Schematic Representation
I=1
2
I=2
I=4
Processing Time
12 microseconds.
en-938871/A 2 - 21
2.12 Increment with Modulo
This operator is used to perform one increment each RTC with iteration according to a modulo.
Syntax
On = 12 Ea / Eb / I
On Operation No. n.
12 Increment with modulo.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
Ea (RTCi) = (Ea (RTCi-1) + Eb) modulo I
I is always positive.
Examples
Increment by 3 modulo 11
On = 12 E81000/E80000/11
Where E80000 = 3
E81000 (RTCi-1) + E80000 E81000 (RTC i)
... ...
5 5
8 8
11 0
3 3
... ...
On = 12 E81000/E80000/3600000
Where E80000 = 1. Each RTC, the angle whose value is set in E81000 is incremented by one ten-thousandth of a degree
and is reset at the end of a complete revolution.
Processing Time
15 microseconds.
2 - 22 en-938871/A
Description of the Operations
Syntax
2
On = 13 Ea {/ Eb} / L..
On Operation No. n.
13 Multiply by a programme parameter.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
L.. Programme variable (see Sec. 1.7.6).
Definition
Ea integer part of {Eb} x L...
In the operation:
- if Ea is equal to L..: the integer part of L.. is loaded in Ea
- L.. is a variable from L0 to L19.
Examples
Case without Eb
If Eb is not specified, it is considered equal to 1.
On = 13 E81000/L10
is equivalent to E81000 = integer part of L10
Processing Time
30 microseconds.
en-938871/A 2 - 23
2.14 Arc Tangent Function
This operator calculates an angle by the arc tangent function.
Syntax
On = 14 Ea / Eb / Ec / I
On Operation No. n.
14 Arc tangent function.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
Ea integer part of arc tangent Ec/Eb (Ea is always positive and less than the modulo)
In the operation:
- Ea is loaded with the angle in the unit defined by I,
- Eb is the cosine of the angle (or adjacent side),
- Ec is the sine of the angle (or opposite site),
- I is the unit in which the modulo of the angle is expressed, i.e. I = 3,600,000 for ten-thousandths of a degree.
This type of operation used with parameters E7x004 checks the position of a tool to make sure it is always parallel to
the tangent of the curve being machined.
REMARK The arc tangent function uses auxiliary tables (one per axis processed) similar to
those used with operators 4 (vector rotation) and 21 (oscillation cycles). The total
number of tables is limited to eight. If this number is exceeded, the system returns
message "error 93".
Example
On = 14 E81000/E71004/E70004/3600000
Where:
- E71004 contains the length of the adjacent side
- E70004 contains the sine of the angle (negative value)
- 3600000 is the unit defining the angle in ten-thousandths of a degree
- E81000 contains the resulting value (i.e. 2700000)
Processing Time
Modulo 360: 45 microseconds.
Modulo 360000: 62 microseconds.
Modulo 3600000: 75 microseconds.
2 - 24 en-938871/A
Description of the Operations
Syntax 2
On = 15 @.. / E42xxx / Eb / I
On Operation No. n.
15 Manual control of an axis.
@.. Machine axis address.
E42xxx Type 3 external parameter (see Sec. 1.7.3).
Eb Type 2 external parameter (see Sec. 1.7.2) pointing to two consecutive memory
locations (see Sec. 1.7.5).
I Immediate value (see Sec. 1.7.4).
Definition
In the operation:
- @.. is the address (0 to 31) of the machine axis to be controlled
- E42xxx is a parameter from E42000 to E42127 containing the speed override coefficient (a value of 255 corresponds
to 100%)
- Eb points to two consecutive integers. The first contains the minimum travel and the second the maximum travel
- I is the unit in which the movement is expressed: I = mm/min.
The operation cannot be executed unless the axis is declared as non-interpolated by programming parameter
E910xx = 0 (xx = physical axis address). After resetting E910xx = 1, the operator remains valid.
Example
On = 15 @3/E42xxx/E81000/120
Where:
- @3 is the axis to be manually controlled
- E42xxx contains the override coefficient (e.g. E42xxx = 192, speed = 75%)
- E81000 contains the minimum travel (E81000) and maximum travel (E81001)
- 120 is the speed of movement in mm/min.
Processing Time
50 microseconds.
en-938871/A 2 - 25
2.16 Third-Degree Polynomial and Derivative
This operator computes a third-degree polynomial and its derivative from the three coefficients and the constant
contained in programme variables.
Syntax
On = 16 Ea / Eb / Lxx {/*}
On Operation No. n.
16 Third-degree polynomial and derivative.
Ea Type 1 external parameter (see Sec. 1.7.1) pointing to two consecutive memory
locations (see Sec. paragraphe 1.7.5).
Eb Type 2 external parameter (see Sec. 1.7.2).
Lxx First programme variable (see Sec. 1.7.6).
{/*} Request to calculate the derivative of the function.
Definition
Ea = integer part of Lxx x Eb3 + L(xx+1) x Eb2 + L(xx+2) x Eb + L(xx+3)
If /* is present: Ea + 1 = integer part of 3 x Lxx x Eb2 + 2 x L(xx+1) x Eb + L(xx+2)
In the operation:
- Lxx is the first of four consecutive programme variables (xx = 00 to 16). The three coefficients of the function and
the constant are set in these four variables.
- The optional symbol * in {/*} is the request to calculate the derivative of the function. This derivative is then stored
in memory Ea + 1.
Example
On = 16 Ea/Eb/L5/*
Processing Time
Derivative not requested: 70 microseconds.
Derivative requested: 100 microseconds.
2 - 26 en-938871/A
Description of the Operations
Syntax
2
On = 17 Ea / @.. {/@..} {/@..}
On Operation No. n.
17 Speed on the path.
Ea Type 1 external parameter (see Sec. 1.7.1).
@.. Address of first axis.
@.. Address of second axis.
@.. Address of third axis.
Definition
Ea = resultant speed on @.. + {@..} + {@..}
In the operation, @.. (0 to 31) is the address of each of the machine axes of a group.
The result of the operation is expressed as IU/Smp (Internal system unit/Sample).
The result of the operation corresponds to the value of parameter E79004 (unless there is a rotary axis).
Examples
Processing Time
1 axis: 10 microseconds.
2 axes: 24 microseconds.
3 axes: 30 microseconds.
en-938871/A 2 - 27
2.18 Divide
This operator performs a division and multiplies the result by a power of two.
Syntax
On = 18 Ea / Eb / Ec {/I}
On Operation No. n.
18 Divide.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
Ec Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
Ea integer part modulo 232 of (Eb / Ec) {x 2 I}
In the operation, Ea, Eb and Ec are values on 32 bits.
It should be noted that:
- no error is reported for a division by 0. The result is then the maximum value with the same sign as Eb,
- when the absolute value of Ec > Eb x 2I, Ea = 1 if the result of the division was negative and 0 if it was positive.
Example
On = 18 E81000/E80000/E81001/3
is equivalent to E81000 integer part modulo 232 of (E80000 / E81001) x 8
Processing Time
44 microseconds.
2 - 28 en-938871/A
Description of the Operations
Syntax
2
On = 19 Ea / Eb / I
On Operation No. n.
19 Square root.
Ea Type 1 external parameter (see Sec. 1.7.1).
Eb Type 2 external parameter (see Sec. 1.7.2).
I Immediate value (see Sec. 1.7.4).
Definition
Ea integer part modulo 232 of Eb {x 2I}
In the operation, Ea and Eb are values on 32 bits.
It should be noted that the result of the operation has the same sign as Eb.
Example
Calculate the square root
On = 19 E81000/E80000/3
Processing Time
80 microseconds.
en-938871/A 2 - 29
2.20 Axis Speed Synchronisation
This operator synchronises the speed of a slave axis with a master axis.
Syntax
On = 20 @e / @m / E200xx / E42xxx / I
On Operation No. n.
20 Axis speed synchronisation.
@e Slave axis address.
@m Master axis address.
E200xx Type 3 external parameter (see Sec. 1.7.3).
E42xxx Type 3 external parameter (see Sec. 1.7.3).
I Immediate value (see Sec. 1.7.4).
Definition
In the operation:
- E200xx is a parameter E20000 to E20031 (see below),
- E42xxx is a parameter E42000 to E42127 (see below),
- I (expressed in 1/256) sets the value of the coupling coefficient which may be different from 1 (positive or negative
integer).
When the speed of a slave axis @e is synchronised with a master axis @m:
- Synchronisation can be performed on the move, i.e. when synchronisation is activated, the master axis can be
moving. In this case, the slave axis is accelerated up to the master axis reference speed by a sin2 curve.
- Synchronisation can also be deactivated on the move. In this case, the slave axis is desynchronised from the master
axis and decelerates according to the same sin2 curve.
- Synchronisation is activated by the PLC by parameter E200xx (= 1: synchronisation active).
- Operator 20 transmits the current synchronisation state in parameter E42xxx, where:
. 0: synchronisation inactive
. 1: slave axis accelerated before synchronisation
. 2: slave axis decelerated after desynchronisation
. 3: axis synchronised (steady state).
The slave axis can be declared servoed or not, but its state must not change while this operator is programmed. If it
is declared servoed, the operator controls its reference correction (E950xx). If not, the operator controls its reference
(E7x000).
The acceleration used by the operator for starting and stopping is the second value of the pair assigned to this axis in
machine parameter P32.
2 - 30 en-938871/A
Description of the Operations
Speed
2
Master axis
Slave axis
Time
E42xxx 0 1 3 2 0
E200xx
1
Time
0
Example
On = 20 @5/@2/E20025/E42100/192
Where:
- the slave axis address is 5,
- the master axis address is 2,
- E20025 defines the synchronisation activation command,
- E42100 defines the synchronisation state,
- the slave axis speed is 0.75 times the master axis speed (192/256).
Processing Time
Phase 0: 20 microseconds.
Phases 1 and 2: 65 microseconds.
Phase 3: 40 microseconds.
en-938871/A 2 - 31
2.21 Oscillation Cycles
This operator is used to perform oscillation cycles on three axes.
Syntax
On Operation number n.
21 Oscillation cycles.
@x, @y, @z Physical addresses of the X, Y and Z axes.
[TX(5,2)], [TY(5,2)], [TZ(5,2)] Symbolic variables.
Definition
2 - 32 en-938871/A
Description of the Operations
REMARK Operator 21 uses auxiliary tables (one per axis) similar to those used with
operators 4 (vector rotation) and 14 (arc tangent). The total number of tables is
limited to eight. If this number is exceeded, the system returns "error 93".
Example
Oscillation cycle on the X axis
2
On = 21 @x = [V1(5,2)]
8 100 250 50 2
[V1(5,2)] =
-24 150 400 0 0
Schematic representation
24
16
0
t
V
en-938871/A 2 - 33
Time Base Modulation
The time base can be modulated by positioning an additional operand in the syntax of the operation. This operand
preceded by the character "/" (slash) is a parameter E42000 to E42127 that points to a byte whose value (between 0
and 255) is the speed override coefficient of the time base (a value of 255 corresponds to 100%).
Processing Time
First axis
Timeout: 50 microseconds.
Axis movement: 80 microseconds.
2 - 34 en-938871/A
Description of the Operations
Capabilities
The dynamic operators in C add new capabilities to the existing dynamic operators:
- Use of a powerful universal language consistent with other developments on the CNCs of the 1000 family, such as
PLC and human/machine interface (via PLCTool and MMITool)
- Floating point operations
- Extended function libraries
- Loop processing
- Increase in the number of operations performed by each operator (limit of 128 for “conventional” operators)
- Capability to execute real-time computations of varying complexity in times typically less than 1 ms.
Restrictions
Version D6 or above of PLCTool is required for writing and debugging programmes using dynamic operators in C.
Simplified use of the dynamic operators in C is possible with earlier versions of the CNC software.
The dynamic operators in C function is not available with a PLC programmed in UT6 assembler language.
2.22.2 Programming
Syntax
On = 22 COperatorName { / P1 /P2 / P3 / … / Pn }
en-938871/A 2 - 35
Notes
For each parameter, the CNC interface passes the programme in C a pointer SINT32*param_addr to the parameter
Exxxxx declared or the physical axis (measurement register).
Example: …/E80000 or /@3.
The number of parameters is checked. Refer to the section init (…,…,…)
Reminder
An editable ISO block (line) is limited to 120 characters. The number of associated parameters may be limited by the
length of the editable line.
! CAUTION
Example:
Example of call to the dynamic operator in C named REGUPOUR:
...
LO=1
OL0=22 REGUPOUR /E41005/E72000/E90002/E95002/E80002
...
2 - 36 en-938871/A
Description of the Operations
TOOL/ CNC
PC
SOFTWARE PLC CNC
2
PHASE 1: Development
Compile On = 22 .....
PLCTool C language
Convert
PHASE 3: Execution/Cycle
PRINC ( ) τ
QUIT ( )
On = 0
en-938871/A 2 - 37
2.22.4 Development Tools
The developer of dynamic operators in C should refer to the document Automatic Control Function Programming
Manual - Ladder Language (Chapter 16, Programming in C Language) and PLCTool Ladder Language Programming
Tool.
Text Editor
The choice of text editor is left up to the user:
- Numtool editor or an external editor such as Microsoft Visual C++ (version 1.51).
Compiler System
Microtec Research software development tools for PC are used.
The compiler options used are as follows:
- Version: V4.3
- Language standard: Compatible C-ANSI
- Structure: Word alignment (2 bytes)
- Optimisation: Standard optim.
Inline optim.
Local optim.
Register optim.
Instruction sequencing optim.
- Arithmetic coprocessor: possible on 1040 CNC.
The associated .opt file provides the following options:
- p68020 -Fsm -noc -Xc -aic -asc -Mcp -Mdp -Ml -s
- nf ( -f if the coprocessor is enabled)
- Og-Oi-OI-OR-Or
- Q20-Qi
- Z2
- A
- IC:\NUMTOOL\BD\DEVOPDYN.MCH
- JC:\MCC44\include
When using the compiler via PLCTool, these options are implicitly included except Coprocessor, which requires going
through the Compiler option menu, then Coprocessor and a check box.
Sample Project
Sample project file with NUMOPDYN.h and NUMOPDYN.obj
+c:\numtool\bd\devopdyn.mch\regupour.c
-<numopdyn.h
+ c:\mcc44\68020\numopdyn.obj
2 - 38 en-938871/A
Description of the Operations
Sample Directories
Example of DIRECTORY OPTIONS
- INCLUDES SYSTÈMES: C:\MCC44\INCLUDE
- INCLUDES USER: C:\NUMTOOL\BD\ DEVOPDYN.MCH
- FICHIERS OBJ:
- FICHIERS ASSEMBLEURS:
C:\NUMTOOL\BD\DEVOPDYN.MCH
C:\NUMTOOL\BD\DEVOPDYN.MCH
2
- LIBRAIRIES: C:\MCC44\68020
- EXECUTABLES: C:\NUMTOOL\BD\DEVOPDYN.MCH
- FICHIERS RESULTATS GRETA:C:\NUMTOOL\BD\DEVOPDYN.MCH [compulsory but not used]
Results
The C modules developed with PLCTool are of the exec.AP type.
.XCX files are obtained after development, compilation and conversion.
Report
main () returns zero if installation is OK.
System errors are possible and give rise to CNC error messages (for a detailed list of error messages 400 to 409, refer
to the section Error Messages).
Initialisations
It is possible to perform preparatory computations. However, if compiling with the arithmetic coprocessor (see the
section Compiler System), they cannot be called in routine main ().
en-938871/A 2 - 39
INIT (UINT16 gr_no, UINT16 no_arg, ARGUMENT *):
This subroutine is executed once under control of the low priority RSV task during analysis of the ISO block.
The input parameters of INIT are:
- The group number + 1 in which it was programmed (1 < gr_no < 8)
- The number of arguments programmed (0 < no_arg < 16)
- A pointer to the parameter table programmed in the dynamic operator in C.
The parameter table has the following format
Max. 16 entries
2 x 4 bytes
This subroutine is not critical from the standpoint of computation time. It can include precomputations or various
initialisations requiring a long computation time.
It returns an execution report:
- Zero if the part programme can continue
- Negative if an error is observed.
In this case, the part programme stops and a programme error is displayed.
The values which can be returned are:
ERR_RESERV1 (-1) is reserved by the system to indicate that the dynamic operator is unrecognised
ERR-PARAM (-3) generates error 410: Dyn. ops in C: Number of parameters passed doesn’t tally
ERR_UsrInit (*) (-2) generates error 411: Dyn. ops in C: USER ERROR from INIT: Negative return
(*) as well as all other negative values.
These values are defined in the numopdyn.h include file.
Princ (void)
This subroutine is executed each RTC under control of the AXE task. It is therefore critical from the standpoint of
computation time. The code must be optimised and long computations must be avoided. No execution report is
returned.
Local Memories
The programme includes 32 kbytes of static variables (-32 bytes used in numopdyn.obj) and 2000 stack bytes for auto
class variables.
2 - 40 en-938871/A
Description of the Operations
QUIT (void)
This subroutine is executed once under control of the low priority RSV task during cancellation of the operator by Oi = 0
or M02 or during reset of the axis group where it was programmed.
It returns an execution report
- Zero if the programme can continue
- Negative if an error is observed.
Except during a reset, In which case the part programme stops and a programme error is displayed.
The values which can be returned are:
- ERR_RESERV2 (-5) is reserved by the system to indicate that the dynamic operator number is unrecognised
- ERR_CLOSE (-6) generates error 420: Dyn. ops in C: USER ERROR from the QUIT function
- ERR_UsrQuit (*) (-7) generates error 421: Dyn. ops in C: USER ERROR from the QUIT function
(*) as well as all other negative values.
! CAUTION
Functions INIT (), PRINC () and QUIT () are executed by the CNC processor in supervisor
mode. This means that no check is made for an uninitialised or incorrectly initialised pointer.
en-938871/A 2 - 41
2.22.6 Transfer of Compiled Code from PC to CNC PLC
The .XCX files are transmitted (with the CNC on) by PLCTool under the same conditions as PLC programmes in C.
(Refer to PLCTool Ladder Language Programming Tool, chapter Transferring a Module.)
During transfer, the PLC inhibits operation of the CNC as it does during transfer of a PLC programme.
The operators in C are stored on the pHile disc managed by the PLC. The directory is accessible to the user from utility 7:
See the File Management item and following subitems:
- Application directory - Directory of C files
- File deletion
- Volume formatting (possibly).
These new modules are executable after transfer of the code for execution.
2 - 42 en-938871/A
Description of the Operations
en-938871/A 2 - 43
2.22.10 Library of Mathematical Functions
The Microtec Research C compiler comes with a library of mathematical functions operating on single or double
precision floating point variables.
Header files math.h and mathf.h contain the prototypes of these functions.
The choice of the variable precision (single or double) depends on precision and execution speed constraints.
The code generated is optimised for a system with a NUM 1040 arithmetic coprocessor (68882), and therefore executes
much more rapidly on such a system than a version compiled for a system without coprocessor.
REMARK Double precision floating point variables are used by default in all the functions.
Angles are in radians (360 degrees <=> 2 P radians).
! CAUTION
Do not omit to include file math.h before attempting to use these functions.
2 - 44 en-938871/A
Description of the Operations
%11000.2 2
(Pgm appele par raz - CN si P7 N1 bit 3 =1)
Æ 01 = 22 REGUPOUR/E41005/E70000/E90004/E95004/E80000
$0 Regulation de la poursuite active sur l’ axe X du Groupe 2 (@4)
/*D***************************************************************************************/
/*- Nom module : REGUPOUR -*/
/*- -*/
/*- Fonctions du module : OPÉRATEURS DYNAMIQUES EN C -*/
/*- Exemple traité : Régulateur de Poursuite -*/
/*- -*/
/*- Date de creation : Janvier 1996 -*/
/*--------------------------------------------------------------------------------------------------------------*/
/*- Evolution(s) : -*/
/*- Date de modification : Auteur : -*/
/*- Nature : -*/
/*F****************************************************************************************/
#include <numopdyn.h> /* voir liste ci-après */
/* Prototypage des fonctions */
SINT32 init (UINT16 no_gr, UINT16 nb_arg, ARGUMENT *); /* Point d’entrée de la 1ère exécution*/
void princ (void); /* Point d’entree de l’exécution courante */
SINT32 quitt (void); /* Point d’entrée de la dernière exécution */
/* Variables (globales) utilisées */
SINT32 ERPOURX, OREFX, ER_MESX, DIFREFX, P56P50, VITFIL, MVITFIL;
SINT32 *pE70000, *pE90000, *pE95000, *pE80000
SINT32 main( ) /* Appelé lors de l’installation du code en mémoire C.N. sur RAZ */
{
SINT32 ret;
ENTRY_PT pt_entrée;
pt_entree.INIT = init; /* Point d’entrée lors de la 1ère exécution */
pt_entree.MAIN = princ; /* Point d’entrée de l’exécution courante */
pt_entree.EXIT = quitt; /* Point d’entrée de la dernière exécution */
ret = EXPORT("REGUPOUR","OPDYN", &pt_entrée);
/* "REGUPOUR" sera l’identificateur utilisé dans le programme pièce */
/* "OPDYN" sera l’identificateur de la version d’ opérateurs dynamiques en "C" utilisée */
return (ret);
}
en-938871/A 2 - 45
SINT32 init (UINT16 no_gr, UINT16 nb_arg, ARGUMENT *pt)
{ /* routine exécutée 1 fois lors de la programmation de l’Opdyn Oi = 22 REGUPOUR/../.../.../ */
SINT32 P50;
if (nb_arg == 5) /* Contrôle du Nb de paramètres passés comme argument */
{ /* Le Nb de paramètres passés est celui qui est attendu: Initialisations */
P50 = *(pt[0].adr_param); /* Valeur du paramètre 0 : période d’ech en µs */
pE70000 = pt[1].adr_param; /* Pointeur sur la référence de position de l’axe */
pE90000 = pt[2].adr_param; /* Pointeur sur la mesure de l’axe */
pE95000 = pt[3].adr_param; /* Pointeur sur le décalage de référence de position */
pE80000 = pt[4].adr_param; /* Pointeur sur un paramètre banalisé E80000 */
OREFX = *pE70000;
P56P50 = 60000 / P50;
ER_MESX = MVITFIL = VITFIL = 0;
return(ERR_AUCUNE);
}
else return(ERR_PARAM); /* Le Nb de paramètres n’est pas celui qui est attendu: Erreur 410 */
}
void princ ( ) /* Exécutée à chaque période d’échantillonnage */
{
UINT32 debut, fin, i, ref_X;
debut = GET_RTC(); /* debug: permet de "dater" l’entrée dans le module */
ERPOURX = *pE70000 - *pE90000;
DIFREFX = *pE70000 - OREFX;
OREFX = *pE70000;
DIFREFX *= P56P50;
MVITFIL += (DIFREFX - VITFIL);
VITFIL = MVITFIL / P56P50;
ER_MESX += (ERPOURX - VITFIL);
*pE95000 = ER_MESX/10;
fin = GET_RTC(); /* debug: permet de "dater" la sortie du module */
*pE80000 = debut - fin; /* donne la durée de l’exécution de l’Opdyn en µs */
}
SINT32 quitt ( )
{ /* exécutée 1 fois lors de la programmation de Oi = 0 ou lors de M02 ou lors de la RAZ */
*pE80000 = 0;
return (ERR_AUCUNE);
}
2 - 46 en-938871/A
Description of the Operations
Include NUMOPDYN.H
/*D********************************************************************************************/
/*- Nom module : NUMOPDYN.H -*/
/*- -*/
/*- Fonctions du module : Définition de l’interface "C" - CN NUM1000 -*/ 2
/*- pour les opérateurs dynamiques en C -*/
/*- Date de création : Janvier 1996 -*/
/*————————————————————————————————————*/
/*- Evolution(s) : -*/
/*- -*/
/*- Date de modification : Auteur : -*/
/*- Nature : -*/
/*- -*/
/*F*********************************************************************************************/
#ifndef _CNUM_INCLUDE
#define _CNUM_INCLUDE
/*################################################################*/
/*################# DECLARATIONS GENERALES ###################*/
/*################################################################*/
#ifndef max
#define max(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
extern int errno ;
/*############################################################################*/
/*####################### DEFINITION DES CODES DE RETOUR ##################*/
/*############################################################################*/
#define ERR_AUCUNE 0
en-938871/A 2 - 47
/*########################## ROUTINE DE QUIT ###############################*/
#define ERR_RESERV2 -5 /* Rang de l’Op dyn incoherent Reservé SYSTEME */
#define ERR_CLOSE -6 /* Erreur lors du quit (derniere execution) :: Erreur 420 */
#define ERR_UsrQuit -7 /* Erreur User lors de la routine Quit :: Erreur 421 */
/*##########################################################################*/
/*##################### STRUCTURE DES PARAMÈTRES #######################*/
/*##########################################################################*/
typedef struct s_PARA_EXT
{
UINT32 parametre;
SINT32 *adr_param;
}ARGUMENT;
/*###########################################################################*/
/*############### STRUCTURE DES POINTS D’ENTREES DU MODULE C ############*/
/*##########################################################################*/
/*###########################################################################*/
/*##### STRUCTURE DES PRIMITIVES ACCESSIBLE PAR LE MODULE CLIENT #########*/
/*###########################################################################*/
2 - 48 en-938871/A
Description of the Operations
On Operator No. n
23 Electronic cam
@<axis> Physical axis address
<dim> Dimension in internal units
E42xxx External parameter of type 3 (see Sec. 1.7.3).
Definition
In the operation:
- @<axis> is the address (0 to 31) of a machine axis
- Two dimensions <dim> separated by / determine a range
- E42xxx denotes a parameter from E42000 to E42127 containing the axis position.
The axis number can be specified as an immediate value, a variable L or a parameter E.
The dimensions <dim> must be specified in increasing order.
The number of physical axes is limited to 3.
The value of <dim> can be specified as an immediate value, a variable L or a parameter E.
The number of dimensions required for each axis ranges from 2 (minimum) to 32 (maximum).
The value sent to the PLC is contained in E42xxx for the first axis, E42xxx+1 for the second axis and E42xxx+2 for the
third axis.
REMARK The electronic cam function uses auxiliary tables (one per axis processed) similar
to those used for operators 4, 14 and 21 (vector rotation, arc tangent and
oscillation cycles respectively). The total number of tables is limited to eight. If this
number is exceeded, the system returns "error 93".
If the current position of the axis is strictly below the lowest dimension, a value of zero is passed to the PLC.
If the current position of the axis is greater than or equal to the highest dimension, the value passed to the PLC is equal
to the number of dimensions (number of ranges + 1).
Example
en-938871/A 2 - 49
2.24 Differential Datum Shift
2.24.1 General
Dynamic operator 24 is used to set differential datum shifts by writing parameters E9530x and controlling 1 to 9 axes
and specifying the handwheel used.
Capabilities
At all times:
- Whether or not the machine is in a cycle, stopped or moving, it must be possible to move the axes with a handwheel
if authorised by a message from the PLC (%W2.5 = 1)
- The datum shifts obtained must be preserved and added to the programmed or manual movements (they are
cancelled only by homing) without affecting the machining parameters
- It must be possible to view the current values of the datum shifts.
Processing
The differential datum shift is processed as a measurement offset added to the existing offsets, axis and interaxis
calibration by machine parameter, backlash error compensation and offset by the PLC.
The differential datum shift is stored in a word addressed by programme parameter E9530x (x = physical axis address).
This parameter is accessible for read and write only by the dynamic operator. Its value is added to the other
measurement offsets in E9520x.
2.24.2 Programming
Syntax
Notes
Error 93 indicates absence of the selected handwheel or a measured axis or presence of one of the handwheel
coefficients set to zero.
When variable %W2.5 = 1, dynamic operator 24 takes the handwheel variations into account with the conversion
coefficients of P13 (fast Jog inoperative) and assigns them to E9530x of the axis assigned to this handwheel by the
PLC if it belongs to the list of axes specified in the operator.
These increments are assigned immediately (without management of the acceleration). Filtering or not of the
handwheel increments is defined in the second word of P14.
2 - 50 en-938871/A
Description of the Operations
In Jog mode using the handwheel, it is recommended to reset %W2.5 so as not to add the movements of the mode
and those of the differential datum shift.
Monitoring of the machine travels does not take the differential datum shifts into account. The value of a differential
datum shift is limited to +/- 32000 measurement increments.
en-938871/A 2 - 51
2 - 52 en-938871/A
Examples of Use
3 Examples of Use
en-938871/A 3-1
3-2 en-938871/A
Examples of Use
3.1 Example 1
This example is defined for a machine with axes X, Z and B. The machining to be performed on the part is an interpolation
between the B and Y axes (this example can also be processed using interaxis calibration).
The part programme is written for the U and Y axes. The U axis is a dummy axis declared in the following machine
parameters:
- P0 (axes displayed),
- P9 (axis assignment to a group),
- P3 (servoed and interpolated axes).
3
The U axis is not declared in parameter P2 (measured axis).
Main Programme
%1
R = 50 Cylinder radius
G77 H100 Subroutine call
...
...
... Description of the profile with Y and U
...
...
M02 End of programme
Subroutine
%100
L10 = 180/L917/3.1415926
O1 = 13 E95007/E73000/L10 In the operation, E95007 = B axis correction
and E73000 = real value of the U axis
Y Y
R
en-938871/A 3-3
3.2 Example 2
The example below describes a programme using dynamic operators to define the inclination of the X and Z axes with
respect to the programme zero reference.
%50
N10 (ENABLED)
E81002=E72000-E62000 E81000=E70000-E60000
E82002=1-CL900*E81002 E82002=-E81000*SL900+E82002
X X ’
E82000=1-CL900*E81000 E82000=E81002*SL900+E82000 C = f ( Delta )
(OFFSET INITIALISED) Z Z’
O5= 5 E95002/E82002 O8= 5 E95000/E82000
(ROTATION MATRIX COEFFICIENT COMPUTED)
E81100= CL900-1*65536*16384 E81101=SL900*65536*16384 Shift 30 bits left because
the value is equal
to 1 at most
(ESTABLISHMENT OF THE ROTATION)
O1= 2 E82002/E72000/E62000/2 Delta Z
O2= 2 E81000/E70000/E60000/2 Delta X
O3= 3 E81111/E81002/E81100/-32
O4= 3 E82222/E81000/E81101/-32
X
O5= 2 E95002/E81111/E82222 CZ = f ( Delta )
O6= 3 E81111/E81000/E81100/-32 Z
O7= 3 E82222/E81002/E81101/-32
X
O8= 1 E95000/E81111/E22222 CX = f ( Delta )
Z
N20 (MACHINING) Programme or subroutine
N.. (DISABLED) CZ= Delta Z’ (1-Cos A)-Delta X’ Sin A
E82000=E95000 E82002=E82000 CX= Delta X’ (1-Cos A)-Delta Z Sin A
O5= 5 E95002/E82002 08= 5 E95000/E82000 CZ= Delta Z (Cos A-1)+Delta X Sin A
CX= Delta X (Cos A-1)-Delta Z Sin A
O1=0 O2=0 O3=0 O4=0 O5=0 O6=0 O7=0 O8=0
N..
3-4 en-938871/A
Examples of Use
X X'
P' Z'
3
∆ X' CX
E70000
P
∆X A
E60000 CZ
OP ∆ Z'
∆Z
E62000 E72000 Z
en-938871/A 3-5
3.3 Example 3
The example below describes use of operator 21 in a scan cycle preparation subroutine %10136 called from the main
subroutine (for instance by function G136 calling the subroutine by a G function). The cycle is performed in the XY plane.
Subroutine
%10136: (Scan cycle)
VAR [ix]=1 [iy]=2 [tx(5,2)] [ty(5,2)] [vx(2)] [V] [Fp]
ENDV
[vx(1)] = [.IRX(1)] [V]=[..IRX(1)] X[V]
[vx(2)] = [.IRX(2)] [V]=[..IRX(2)] Y[V]
IF [.IBP(1)] = 0 THEN [ix]=2 [iy]=1 G79 [.IBP(2)]=0 N91
ENDI
IF [.IBE0(6)] = 1 THEN [Fp]=L905 (F.. programmed in cycle call block)
ELSE [Fp]=[.RF]
ENDI
3-6 en-938871/A
Examples of Use
3
Start
p
30
10
Ste
10
5 30
en-938871/A 3-7
3-8 en-938871/A
List of Operations
Syntax:
On = 0
Syntax:
On = 1 Ea / Eb / Ec {/I}
Syntax:
On = 3 Ea / Eb / Ec {/I}
Syntax:
On = 4 Ea / Eb / Ec / I
Syntax:
On = 5 Ea / Eb {/Ec} {/I}
Syntax:
On = 6 Ea / @.. {/Eb} {/I}
Syntaxe :
On = 6 Ea / Eb {/Ec} {/I}
Syntax:
On = 7 Ea / Eb / Ec / I
en-938871/A A-1
Indexed storage of a parameter (see Sec. 2.8)
Syntax:
On = 8 Ea / Eb / Ec / I
Syntax:
On = 9 Ea / Eb / Ia {/Ib {/Ic}}
Syntax:
On = 10 Ea / Eb / Ec / I
On = 10 Ea / Eb / Ec / E42xxx
Syntax:
On = 11 @.. / E
Syntax:
On = 11 Ea / Eb / I
Syntax:
On = 12 Ea / Eb / I
Syntax:
On = 13 Ea {/Eb} / L..
Syntax:
On = 14 Ea / Eb / Ec / I
Syntax:
On = 15 @.. / E42xxx / Eb / I
A-2 en-938871/A
List of Operations
Syntax:
On = 16 Ea / Eb / Lxx {/*}
Syntax:
On = 17 Ea / @.. {/@..} {/@..}
Syntax:
On = 19 Ea / Eb / I
Syntax:
On = 20 @e / @m / E200xx / E42xxx / I
Syntax:
On = 21 @x = [TX(5,2)] / @y = [TY(5,2)] / @z = [TZ(5,2)]
Syntax:
On = 22 COperateurName { / P1 / P2 / P3 / ... / Pn }
Syntax:
On = 23 @<axis> =<dim>/<dim>/<dim> @<axe> =<dim>/<dim>/.... @<axis> =<dim>/<dim> E42xxx
Syntax:
On = 24 @a0 / @a1 / @ ai / .../ Wm {/*}
en-938871/A A-3
A-4 en-938871/A