Dynamic Operator Manual

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 84

NUM

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.

© Copyright NUM 2000.


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 2000 software NUM 1000 family.


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

Structure of the NUM 1000 Family Documentation


User Documents
These documents are designed for the operator of the numerical control.

NUM NUM NUM NUM NUM


M/W T M T G

OPERATOR OPERATOR PROGRAMMING PROGRAMMING CYLINDRICAL


MANUAL MANUAL GRINDING
MANUAL MANUAL Volume 1 Volume 1 PROGRAMMING
Volume 2 Volume 2 MANUAL

938821 938822 938819 938820 938930

OEM Documents
These documents are designed for the OEM integrating the numerical control on a machine.

NUM NUM NUM NUM NUM


1060 1020/1040 1050

AUTOMATIC
INSTALLATION INSTALLATION INSTALLATION PARAMETER
CONTROL
AND AND AND
FUNCTION
COMMISSIONING COMMISSIONING COMMISSIONING MANUAL
PROGRAMMING
MANUAL MANUAL MANUAL
MANUAL LADDER
LANGUAGE

938816 938938 938977 938818 938846

NUM NUM NUM NUM


G H/HG

PROCAM DYNAMIC CYLINDRICAL GEAR


DESCRIPTION OPERATOR GRINDING CUTTING AND
LANGUAGE MANUAL COMMISSIONING GRINDING
MANUAL MANUAL

938904 938871 938929 938932

en-938871/A 5
Special Programming Documents
These documents concern special numerical control programming applications.

NUM NUM NUM NUM NUM


M T G

SUPPLEMENTARY PROCAM MILL PROCAM TURN PROCAM GRIND RIGID


PROGRAMMING INTERACTIVE INTERACTIVE INTERACTIVE TAPPING
MANUAL PROGRAMMING PROGRAMMING PROGRAMMING MANUAL
MANUAL MANUAL

938872 938873 938874 938931 938881

NUM NUM NUM

DUPLICATED SYNCHRONISATION PROFIL


AND OF TWO SPINDLES FUNCTION
SYNCHRONISED OPERATING
AXES MANUAL

938875 938854 938937

6 en-938871/A
Preliminary

Dynamic Operator Manual


Chapter Guidelines

Overview of the dynamic operators used to define operations performed at the rate
of the real-time clock.

CHAPTER 1

GENERAL

Overview and description of the syntax specific to each operator.

CHAPTER 2

DESCRIPTION OF
THE OPERATIONS

Examples of programmes using the dynamic operators.

CHAPTER 3

EXAMPLES
OF USE

Summary of operation syntax in table form.

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

1.1 Use of the Dynamic Operators 1-3


1.2 Types of Operations 1-3 1
1.2.1 List of Operators 1-3
1.3 General Syntax Rules for the Operations 1-4
1.3.1 General Syntax of an Operation 1-4
1.3.2 Example of Definition of an Operation 1-5
1.4 End of Execution of an Operation 1-6
1.4.1 Cancellation of an Operation by Operator "O" 1 - 6
1.4.2 Replacement by an Operation with the
Same Number 1-6
1.5 Details on Execution of the Operations 1-7
1.5.1 Order of Execution of the Operations 1-7
1.5.2 Execution of Consecutive Operations 1-7
1.6 Use of Dynamic Operators for Axis Multigroups 1-8
1.7 Types of Operands Used 1-8
1.7.1 Type 1 External Parameters 1-8
1.7.2 Type 2 External Parameters 1-9
1.7.3 Type 3 External Parameters 1 - 10
1.7.4 Immediate Values 1 - 10
1.7.5 Operands Pointing to Two Consecutive
Memory Locations 1 - 11
1.7.6 L Programme Variables 1 - 11
1.7.7 Symbolic Variables 1 - 11
1.7.8 Axis Addresses 1 - 11
1.8 Use of Parameters E950xx 1 - 11
1.9 Order of Execution of the Measurement - Servo-Drive Task 1 - 12

en-938871/A 1-1
1-2 en-938871/A
General

1.1 Use of the Dynamic Operators


The "dynamic operators" define various operations. These operators are used for rapid transfers at the rate of the real- 1
time clock (RTC).
The operations are executed each RTC. The processing time specific to each operation is expressed in microseconds
(ms).
The operations can be included in a part programme or a subroutine.
The execution of each programmed operation begins when it is read and is repeated until the operation is cancelled.

1.2 Types of Operations


Each operation specifies an operator numbered from 1 to 24.
Operator 0 is used to cancel an operation (see Sec. 1.4).
The syntax of the operations is described in Chapter 2 of this manual.

1.2.1 List of Operators

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

Operation number Operator (type of operation)

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

1.3.2 Example of Definition of an Operation


1
O35 = 2 Ea / Eb / Ec {/I}

O35 Operation with order number 35.


2 Dynamic operator 2 (subtract).
Ea / Eb / Ec {/I} Operands used to perform the operation.

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.

1.4.1 Cancellation of an Operation by Operator "0"


Syntax

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.4.2 Replacement by an Operation with the Same Number


A new operation with the same number cancels the previous one.
Example:
%..
N..
N30 O1 = m Ea/Eb Execution of operation O1 each RTC
N40 X.. F..
N50 Z..
N..
N100 O1 = m' Ea'/Eb'/Ec Cancellation of O1 = m replaced by O1 = m’
N..
N.. M02 End of programme

1-6 en-938871/A
General

1.5 Details on Execution of the Operations


1.5.1 Order of Execution of the Operations
1
The system performs the operations by increasing order of the numbers, which do not have to follow one another.
Example:
O1 = 3 ...
O7 = 18 ...
O56 = 2 ...

1.5.2 Execution of Consecutive Operations


Several numbers of operations of different types can be written on the same line of a programme (or subroutine).
REMARK When an operation is the result of other operations, they must be written in the right
order or read errors could occur.
Example
O1 = 2 ... O9 = 19 ... O5 = 3 ... Operations
X100 Next line

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.7 Types of Operands Used


The operands used include:
- type 1 external parameters (listed in Sec. 1.7.1),
- type 2 external parameters (listed in Sec. 1.7.2),
- type 3 external parameters (listed in Sec. 1.7.3),
- immediate values (see Sec. 1.7.4),
- operands pointing to two consecutive memory locations (see Sec. 1.7.5),
- L programme variables (see Sec. 1.7.6),
- symbolic variables (see Sec. 1.7.7),
- axis addresses (listed in 1.7.8).

1.7.1 Type 1 External Parameters


These parameters are symbolised by the letter "E.." in the syntax.
Parameters E81xxx and E82xxx can be used for interaxis calibration (see Installation Manual). If not, they are general
purpose parameters.
E7x000 Position reference of a programme axis in the axis group (x = axis No. 0 to 8)
E7x001 Axis reference memory for on-the-fly measurement (x = axis No. 0 to 8)
E7x100 Position reference from the interpolators (read/write if no feedback)
E79001 Speed setting of the spindle controlled by the axis group
E79002 Setting of the feed rate potentiometer assigned to the axis group
E79003 Distance remaining to be travelled on the path in the current block
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)
E9020x Spindle speed setting (n = spindle No. 0 to 4)
E950xx Reference corrections of a machine axis (xx = axis No. 0 to 31)

1-8 en-938871/A
General

1.7.2 Type 2 External Parameters


These parameters are symbolised by the letter "E.." in the syntax. 1
For parameters of series E50xxx to E57xxx, xxx = correction number 1 to 255.
For parameters of series E6x000 to E6x003 and E6x005 to E7x006, x = axis No. 0 to 8.
Parameters E81xxx and E82xxx can be used for interaxis calibration (see Installation and Commissioning Manual). If
not, they are general purpose parameters.
E50xxx Tool length "L" (milling). Tool X dimension (turning)
E51xxx Tip radius "@" (milling). Tool Z dimension (turning)
E52xxx Tool radius "R" (milling, turning)
E53xxx Dynamic correction of length "L" (milling) or X dimension (turning)
E54xxx Dynamic correction of radius "R" (milling) or Z dimension (turning)
E55xxx Tool nose direction (turning)
E56xxx H of the table of dynamic corrections (milling, turning)
E57xxx Parameter defining the tool type
E6x000 DAT1 on the axis
E6x001 DAT2 on the axis
E6x002 Minimum dynamic machine travel
E6x003 Maximum dynamic machine travel
E6x004 Off-centring on the axis (milling) (x = axis No. 0 to 5)
E6x005 Programmed shift on the axis
E7x001 Axis reference memory measured on the fly
E7x002 Minimum static machine travel
E7x003 Maximum static machine travel
E7x004 Movement increment
E7x005 Axis assignment
E7x006 Axis coupling
E7x007 Axes programmed by diameter (turning) (x = axis No. 0 or 3)
E79000 Position reference of the spindle for the axis group
E79001 Speed setting of the spindle controlled by the axis group
E79002 Setting of the feed rate potentiometer assigned to the axis group
E79003 Distance remaining to be travelled on the path in the current block
E79004 Current path speed programmed in the block
E79005 Minimum setting of the feed rate potentiometer for the axis group
E79006 Maximum setting of the feed rate potentiometer for the axis group

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.7.3 Type 3 External Parameters


These parameters are symbolised by the letter "E.." in the syntax.
For parameters of series E100xx and E200xx, xx = 0 to 31.
For parameters E33xyz and E43xyz: x = rack, y = card and z = channel.
For parameters E34xxy and E44xxy: xx = rack and y = card.
For parameters E36xyz: x = rack, y = card, z = output
For parameters E46xyz: x = rack, y = card, z = input
REMARK Parameters E33xyz and E43xyz are not accessible unless Ladder variable
%Qrc3B.1 = 1 (refer to the Automatic Control Function Ladder Language
Programming Manual).
E100xx PLC access parameter
E200xx PLC access parameter
E33xyz PLC output terminal write
E34xxy 8I/8O card analogue output write
E42xxx PLC access parameter (xxx = 0 to 127)
E43xyz PLC input terminal status
E44xxy 8I/8O card analogue input status

1.7.4 Immediate Values


The immediate operands are positive or negative integers.
In arithmetic operations, the immediate value is the power of 2 by which the result is multiplied before loading of the
destination operand, which amounts to a shift.
For instance, -2 = shift right by 2 bits, +3 = shift left by 3 bits.
In operations used for jumps (operators 9 and 10), the immediate value is the operation number to which the jump is
to be made.

1 - 10 en-938871/A
General

1.7.5 Operands Pointing to Two Consecutive Memory Locations


These operands are external parameters symbolised by the letter "E.." (type 1 or 2) pointing to two consecutive memory 1
locations.
Example: E61000 points two memories E61000 and E61001.

1.7.6 L Programme Variables


These operands are symbolised by the letter "L". They include variables L0 to L19 (see Programming Manual,
Sec. 6.1).

1.7.7 Symbolic Variables


Symbolic variables of type [symb] between square brackets can be used in certain operations (see Programming
Manual, Sec. 7.3).

1.7.8 Axis Addresses


These operands specify the addresses of the axis encoder.
Depending on the operation, the axes are defined by:
- @..: physical address of any machine axis
- @x or @y or @z: physical addresses of the X, Y and Z axes
- @m or @e: physical address of a master axis or a slave axis respectively.

1.8 Use of Parameters E950xx


Parameters E950xx specify the address of a machine axis correction.
Used with the dynamic operators, these parameters are used to add a shift to an axis reference created by interpolators.
The shift is calculated by operators or obtained from interaxis calibration (see Installation and Commissioning Manual).

Backlash correction Interaxis calibration


(Parameter P18) (UT20)

XR + + - +Xm
Interpolator + Axis encoder
+ +
εp
CR

Cm
Dynamic
I.C Axis correction (UT2)
operators

Interaxis calibration Motor


(dynamic)

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.

Calculate spindle speed and position

For each axis:


- calculate Xm
- calculate XR

For each axis, calculate CR by the interaxis calibration table

Execute the dynamic operators

For each axis:


- calculate Cm by reading:
the measurement correction table (UT2),
the backlash correction (P18),
the interaxis calibration table (UT20)
- calculate the following error
X
= (XR + CR ) - (Xm + Cm )

For each axis, generate the axis speed reference


VX = X x K

Generate the spindle speed references

1 - 12 en-938871/A
Description of the Operations

2 Description of the Operations

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
2.6 Load of a Peripheral Memory With or Without Mask 2-9
2.6.1 Load From a Machine Axis Address 2-9
2.6.2 Load from PLC Data 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.11.1 Storage at a Machine Axis Address 2 - 18
2.11.2 Store in a PLC Memory 2 - 19
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.22.1 General 2 - 35
2.22.2 Programming 2 - 35
2.22.3 General Development Diagram 2 - 37
2.22.4 Development Tools 2 - 38
2.22.5 Structure of the C Modules 2 - 39
2.22.5.1 main (void) 2 - 39
2.22.5.2 User Entry Points 2 - 39
2.22.6 Transfer of Compiled Code from PC to
CNC PLC 2 - 42
2.22.7 Transferring the Code for Execution 2 - 42
2.22.8 Limits and Precautions 2 - 43
2.22.9 Error Messages 2 - 43
2.22.10 Library of Mathematical Functions 2 - 44
2.22.11 Example of Use 2 - 45
2.22.11.1 Sample Part Programme 2 - 45
2.22.11.2 Sample Part Programme in "C" 2 - 45

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

Definition of the Operation

Load with or without a mask


Ea is loaded with the 32 LSBs of the result of Eb {AND Ec} shifted I bits left (I positive) or right (I negative).

Examples

Load without mask to address the spindle reference (for milling)


On = 5 E79001/E80000
Where:
- E80000 is the spindle reference
- E79001 is loaded with the contents of E80000.
E79001 can be replaced by E9020x (spindle speed setting).

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

2.6 Load of a Peripheral Memory With or Without Mask


This operator is used to load an axis or PLC memory with or without a mask.
Two syntaxes can be used for the operation, according as the loading source is:
- the machine axis address
- a PLC address. 2
2.6.1 Load From a Machine Axis Address
Syntax

On = 6 Ea / @.. {/Eb} {/I}

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

Load with or without mask


Ea integer part of @.. {AND Eb} { x 2 I }
In the operations, @.. is the address of the axis encoder input word, i.e. the value read in the axis measurement register
modulo 65536 (equivalent to E900xx).

2.6.2 Load from PLC Data


Syntax

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

Load with or without mask


Ea is the integer part of Eb {AND Ec} {x 2 I }
In the operation, Eb is the source operand from which the load is made.
Eb defines the following PLC data:
- E10000 (only address authorised)
- E20000 (only address authorised)
- E42000 to E42124
- E43xyz and E44xxy
- E46xyz

Use of the Parameters

Parameters E10000 and E20000


Parameters E10000 and E20000 recover parameters E10000 to E10031 and E20000 to E20031 respectively (list of
32 bits).

- E10000 (or E20000) on bit 0


- E10001 (or E20001) on bit 1 and so forth up to E10031 (or E20031) on bit 31.
In this case, operand Ec is the mask and I is the shift to select the bit(s) concerned.
Example: read of E20020 and assignment to bit 0 (mask on bit 20):
On = 6 E81001/E20000/E81000/-20

Parameters E42000 to E42124


Parameters E42000 to E42124 address four consecutive bytes starting on the address specified.
For instance, E42100 addresses bytes E42100, E42101, E42102, E42103.
In this case, operand Ec is the mask and I is the shift to select the bit(s) concerned.

Parameters E43xyz and E44xxy


Parameters E43xyz address the input terminals of the PLC (access to only one byte at a time).
E43xyz: x = rack (0 to 6), y = card (0 to 9), z = channel (0 to 3)
Reminder: Parameters E43xyz are not accessible unless Ladder variable %Qrc3B.1 = 1.

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.

Schematic Representation of the Table

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

2.8 Indexed Storage of a Parameter


This operation is used to store an indexed value in a table.

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.

Schematic Representation of the Table

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

CNC error No. = - v

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

Write -128 at address I


E42xxx

I<0 Compare I>0


I with 0

I=0

CNC error number = - I

I≤n
Compare
I with n

I>n

Go to next operation Jump to


On+1 operation OI

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.

2.11.1 Storage at a Machine Axis Address


Syntax

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

2.11.2 Store in a PLC Memory

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

Use of the Parameters

Parameters E10000 to E10031


The operation is used to write one or more consecutive bits in the list.
Example
On = 11 E100xx/Eb/I
In this case, the I LSBs of Eb are stored in parameters E100xx (MSBs) to E100xx + (I - 1) (LSBs) (if I = 1, only bit 0
is written in E100xx).

Parameters E42000 to E42127


Example:
On = 11 E42xxx/Eb/I
In this case:
- if I is equal to 1: the 8 LSBs of Eb are stored in E42xxx
- if I is equal to 2: the 16 LSBs of Eb are stored in E42xxx (MSBs) and E42xxx + 1 (LSBs)
- if I is equal to 4: the 32 bits of Eb are stored in E42xxx (MSBs) to E42xxx + 3 (LSBs).

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

O1 = 11 E36410/E81000/1 (output 1 of the 4I/2O module at address $41)


O1 = 11 E36521/E81000/1 (output 2 of the 4I/2O module at address $52)
The outputs of the 4I/2O module are written by part programme by:

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

E80000 E42020 E42021 E42022 E42023

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

Rotation by ten-thousandths of a degree

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

2.13 Multiply by a Programme Variable


This operator multiplies the contents of a parameter by a programme variable.

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 when Eb is present


On = 13 E81000/E80001/L19
is equivalent to E81000 integer part of E80001 x L19
If E80001 = 10 and 19 = 1.55, then:
E81000 = 15 (truncated value of the result, 15.5).

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

2.15 Manual Control of an Axis


This operator allows control of an axis by the jogs when executing a part programme. The operator manages the axis
movement memory (transmitted to the PLC) and complies with the maximum speed and acceleration on the axis.

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

Derivative calculation not requested


Ea = L5 x Eb3 + L6 x Eb2 + L7 x Eb + L8

Derivative calculation requested


Ea+1 = 3 x L5 x Eb2 + 2 x L6 x Eb + L7

Processing Time
Derivative not requested: 70 microseconds.
Derivative requested: 100 microseconds.

2 - 26 en-938871/A
Description of the Operations

2.17 Speed on Path


This operator measures the speed on an axis or the resultant speed on two or three axes.

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

Calculation of the resultant speed on 3 axes (X, Z and U)


The machine axes are declared:
- X:0
- Z:2
- U:4
On = 17 Ea/@0/@2/@4

Calculation of the speed on a single axis declared 01


10 s sample for IU = 1 mm (see machine parameter P50).
On = 17 E82000/@1
Soit :
E82000 x 1000 (s) x 60 (min) = (E82000 x 6) mm/min
10 (ms) x 1000 (mm)

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

2.19 Square Root


This operator is used to calculate a square root and multiply the result by a power of two.

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

is equivalent to: E81000 integer part modulo 232 of E80000 x 8

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

Schematic Representation of Synchronisation

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 = 21 @x = [TX(5,2)] / @y = [TY(5,2)] / @z = [TZ(5,2)]

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

Description of the symbolic variable for each axis


For each axis, the cycle description is declared in a symbolic variable with 2 x 5 elements.
Example:
Xa Ta0 Ta1 Ta2 Ra
[V1(5,2)] =
Xr Tr0 Tr1 Tr2 Tr
The 2 x 5 elements of this symbolic variable are used as follows:
- the first five define the forward phases of the cycle,
- the next five define the return phases of the cycle.
Cycle forward phase:
- Xa: displacement (in mm)
- Ta0: initial timeout used before the start of the first cycle (in ms)
- Ta1: time of movement Xa (in ms)
- Ta2: if Ra is different from zero, timeout between two consecutive Xa movements (in ms)
- Ra: number of times movement Xa is repeated.
Cycle return phase: elements Xr, Tr0, Tr1, Tr2 and Tr have the same meanings of the corresponding elements of the
forward phases.
The sum of movements Xr must be equal to the opposite of the sum of movements Xa.
Tr0 is substituted for Ta0 at the beginning of the following cycles.
The maximum timeout is 60,000 ms.
The acceleration and positioning phases are carried out according to a sin2 curve. The maximum acceleration is the
one defined for the axis considered in the second word of parameter P32.
The axis can be declared servoed or not, but its state must not change while this operator is programmed:
- if the axis is declared servoed, the operator controls the reference correction (E950xx),
- if it is declared nonservoed, the operator controls its reference (E7x000).
When operator 21 is cancelled by writing On = 0, each axis stops its cycle during the timeout and operator 21 is cancelled
once all the axes have stopped.
An example of use of this operator is defined in Chapter 3 below.

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

100 250 50 250 50 250 150 400 150

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.

For each additional axis


Timeout: 15 microseconds.
Axis movement: 50 microseconds.

2 - 34 en-938871/A
Description of the Operations

2.22 Dynamic Operators in C Function


2.22.1 General
Dynamic operator 22 is used to activate a programme written in C called dynamic operators in C.
Starting with version L of the CNC software, a user on a CNC which includes options 11 (dynamic operators) and 19 2
(dynamic operators in C) can use the AXE task to run a programme written with the dynamic operators in C function.

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 }

On Operator No. n (1<n<128)


22 Dynamic operator in C
COperatorName Operator identifier (alphanumeric string of 1 to 13 characters)
/ P1 /P2 / P3 / … / Pn Parameters or axis addresses separated by / (maximum 16, optional):
- Parameters Exxxxx of types 1, 2 or 3 (see Secs. 1.7.1 to 1.7.3) except in special
cases
- Axis addresses symbolised by @x.

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

Only parameters Exxxxx already accessible by conventional dynamic operators can be


accessed. In particular:
- E100xx and E200xx are accessed by long word addresses
- E300xx and E400xx are not accessible.

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

2.22.3 General Development Diagram

TOOL/ CNC
PC
SOFTWARE PLC CNC
2
PHASE 1: Development

Text editor Write C module Write part


programme

Compile On = 22 .....
PLCTool C language
Convert

exec.AP type modules


PLCTool Transfer PC CNC

UT7 File management


Directory

PHASE 2: Transfer for execution

Transfer C code to CNC RAM


CNC Reset &
%W2.3=1 PLC CNC
main ( )

PHASE 3: Execution/Cycle

On = 22 xxxxx ... INIT (... , ... , )

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.

Modules Supplied by NUM


NUM supplies:
- Module NUMOPDYN.H which contains the prototypings and user error codes. It must be included with the sources:
#include <numopdyn.h>
- Library module NUMOPDYN.OBJ which contains the interfaces and user functions. It must be added to the link
before the Microtec libraries:
"Load c:\mcc44\68020\numopdyn.obj"

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.

2.22.5 Structure of the C Modules


Each of the following subsections is illustrated in the section Sample Programme in C below.

2.22.5.1 main (void)


The module entry point is main (). It is called during installation in the CNC memory at power on and may also be called
after a reset (refer to the section Code Transfer for Execution). main () must declare each of the operators contained
in the module to the CNC executive using the export (…,…,…) primitive supplied.
export (COPERATORNAME, OPDYN, &entry_pt);
export (…,…,…) contains three arguments:
- The name of the dynamic operator (1- to 13-character string)
- Dynamic operator version used, OPDYN for this version
- A pointer to a structure giving the three entry points of each dynamic operator (see details below in the section User
Entry Points). The prototypings are included in the NUMOPDYN.H include module described below.

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

2.22.5.2 User Entry Points


Three steps are considered in execution of a dynamic operator. With each step is associated a subroutine whose entry
point must be defined:
- Call and first execution: Entry point: INIT
- Subsequent executions: Entry point: PRINC
- Cancellation: Entry point: QUIT

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

Variable No. (4bytes) Variable @ (4bytes)

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

Measuring the Execution Time


The get_rtc () function can be called at the beginning and end of the module (for instance during debugging) to determine
the execution time of princ (). The difference between the two measurements is stored in a parameter E800xx passed
as argument for display on the CNC COMMUNICATION DISPLAY page (refer to the example given below).

Validity of the Measurement


2
1060 Series 2 UC SII CNC (processor PR40)
The accuracy of measurement Dt is 20 µs.
Approximately 40 µs should be subtracted from the difference stored in parameter E800xx to obtain the real time spent
in the operator excluding the measurement mechanism (2 get_rtc + 1 subtraction + 1 write of E800xx).
Timedynop (within Dt) = tE800xx - 40 µs

1060 Series 1 or Series 2 CNC (16 MHz CNC or GR processors)


The accuracy depends on the value t of the RTC given by machine parameter P50 N0:
t Î [2000.. 5000] ==> Dt = 20µs
t Î ]5000.. 10000] ==> Dt = 40µs
t Î ]10000.. 20000] ==> Dt = 60µs
Approximately 10 µs should be subtracted from the difference stored in parameter E800xx to obtain the real time spent
in the operator excluding the measurement mechanism.
Timedynop (within Dt) = tE800xx - 10 µs

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.22.7 Transferring the Code for Execution


The modules identified as dynamic operators in C must be transferred into the dynamic RAM of the main CNC processor
and be known to this processor. This is done automatically when the CNC is powered up.
This operation can be repeated on a general CNC reset if requested by the PLC (bit %W2.3 set) and enabled by the
CNC.
It is not enabled if (at least) one dynamic operator in C is active in a PLC group not affected by the CNC reset. In this
case, the MSG indicator turns green and an information message is displayed on the CNC COMMUNICATION
DISPLAY page: OPERATOR MESSAGES, item SYSTEM MESSAGES:
WR: C.N.: Ops in C active on PLC group = > Reloading not done
Acknowledge this message and reset the PLC groups, then perform a general CNC reset.
After installation of each of the .XCX files, the main () routine described above is executed.
If the code could not be transferred or the execution report of main () is different from zero, the following information
message is displayed:
WR: C.N.: Interruption reloading dyn. ops in C - Error: 4xx
When the faulty operators are activated by a part programme, error 4xx is displayed as a programming error. The
complete list of errors is given below (see the section Error Messages).
REMARKS With a multichannel CNC, if the axis groups are independent, no installation is
carried out for a group reset.
The operators are always installed globally, i.e. all the C operators resident on the
PLC disc are installed for execution. The operators previously installed are lost.

2 - 42 en-938871/A
Description of the Operations

2.22.8 Limits and Precautions


The code is executed under the developer’s responsibility. The dynamic operator is loaded in the dynamic RAM named
Mast of the processor supporting the AXE task. It is executed in supervisor mode. No checks are made.
Location of the dynamic operators in C on the PLC disc:
- It is limited by the size of the PLC programme area 2
- The number of files managed must be < 100.
Installation of the dynamic operators in C in the CNC memory for execution:
- 32 kybtes are allocated, including the internal data required (excluding the stacks: 2000 bytes).
As an illustration, numopdyn.obj occupies 104 code bytes and 32 data bytes. Unless the developer takes special
precautions, the code is non-reentrant. The same operator in C should not be called under two different numbers.
Use of the malloc () function is not allowed.
REMARK The dynamic operators in C can be used in a PLC group or a CNC group (in
common mode or independent mode), including in a %11000.i programme called
by a CNC reset.
2.22.9 Error Messages
Error No. Description
400 Loading dyn. ops in C: The size of user code is too big
401 Loading dyn. ops in C: Format error
402 Loading dyn. ops in C: Checksum error
403 The system has insufficient memory for dyn. ops in C
404 Loading dyn. ops in C: Open error
405 Loading dyn. ops in C: Read error
406 Loading dyn. ops in C: Close error
407 Loading dyn. ops in C: The directory is empty
410 Dyn. ops in C: Number of parameters passed doesn’t tally
411 Dyn. ops in C: USER ERROR from INIT: negative return
413 Unrecognised dyn. ops in C
414 Dyn. ops in C without MAIN
420 Dyn. ops in C: USER ERROR from the QUIT function
421 Dyn. ops in C: USER ERROR from the QUIT function: negative return
423 Dyn. ops in C: Range of function in C not from (0..100)
Errors 400, 401, 402, 404, 405, 406 and 407 can occur during a CNC reset or at power on.
Error 403 can occur at power on.
Errors 410 to 414 can occur when the dynamic operator is programmed.
Errors 420 to 423 can occur when the dynamic operator is cancelled.
Errors 401, 402, 404, 405, 406 and 423 are system errors which should (theoretically) never occur.
If one of these errors does occur, record the circumstances, contact NUM and format the volume with UT7.

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.

- x = acos(y) Arc cosine


- x = asin(y) Arc sine
- x = atan(y) Arc tangent
- x = atan2(y, z) Arc tangent of y/z
- x = ceil(y) Round up to the next higher integer
- x = cos(y) Cosine
- x = cosh(y) Hyperbolic cosine
- x = exp(y) e to the power of y
- x = fabs(y) Absolute value
- x = floor(y) Round down to the next lower integer
- x = fmod(y, z) Remainder of the division of y by z
- x = frexp(y, z) Split into integer part and fractional part
- x = ldexp(y, z) y*2 to the power of z
- x = log(y) Natural log
- x = log10(y) Base 10 log
- x = modf(y) Signed fractional part of y
- x = pow(y, z) y to the power of z
- x = sin(y) Sine
- x = sinh(y) Hyperbolic sine
- x = sqrt(y) Square root
- x = tan(y) Tangent
- x = tanh(y) Hyperbolic tangent

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

2.22.11 Example of Use

2.22.11.1 Sample Part Programme

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

2.22.11.2 Sample Programme in "C"

/*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 ###################*/
/*################################################################*/

typedef unsigned char UINT8 ;


typedef unsigned short int UINT16 ;
typedef unsigned long UINT32 ;
typedef char SINT8 ;
typedef short intSINT16 ;
typedef long int SINT32 ;
typedef unsigned short S_BIT ;
typedef enum _BOOL {FALSE, TRUE} BOOLEAN;

#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

/*############################# ROUTINE D’INIT ###############################*/


#define ERR_RESERV1 -1 /* Nom d’Op dyn en C inconnu Reservé SYSTEME */
#define ERR_PARAM -3 /* Nbre de parametres passés non conforme :: Erreur 410 */
#define ERR_UsrInit -2 /* Erreur User lors de la routine Init :: Erreur 411 */

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 ############*/
/*##########################################################################*/

typedef struct s_ENTRY_PT


{ /* Structure donnant les 3 Points d’entrée de l’Op. correspondant à: */
SINT32 ( *INIT) (UINT16, UINT16, ARGUMENT *); /* la 1ère exécution - lorsque l’Op dyn est programmé */
void ( *MAIN) (void); /* l’ exécution courante - à chaque période d’échantillonage */
SINT32 ( *EXIT) (void); /* la dernière exécution - Oi = 0 ou M2 ou Raz C.N. */
}ENTRY_PT;

/*###########################################################################*/
/*##### STRUCTURE DES PRIMITIVES ACCESSIBLE PAR LE MODULE CLIENT #########*/
/*###########################################################################*/

typedef struct s_PRIMITIVES_CN


{
SINT32 ( *EXPORT) (SINT8 *, char *, ENTRY_PT *);
SINT32 ( *IMPORT) (SINT8 *, void **); /* non utilisée */
UINT32 ( *GET_RTC) (void); /* retourne la valeur courante du dateur en ms */
}PRIM_C ;

extern PRIM_C *pPrim_CN;

#define EXPORT(a,b,c) pPrim_CN->EXPORT(a,b,c)


#define GET_RTC() pPrim_CN->GET_RTC()
/*########################## FIN ##########################*/
#endif

2 - 48 en-938871/A
Description of the Operations

2.23 Electronic Cam


This operator informs the PLC that an axis has reached or overrun a position.
Syntax

On = 23 @<axe> =<cote>/<cote>/<cote> @<axe> =<cote>/<cote>/.... @<axe> =<cote>/<cote> E42xxx


2

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

On = 23 @0=150000/155000/200000/300000 @1=500000/600000/620000 @3=100654/135675 E42005


This is interpreted as follows:
- E42005 can contain the values 0, 1, 2, 3, 4 (representation of axis 0)
- E42006 can contain the values 0, 1, 2, 3 (representation of axis 1)
- E42007 can contain the values 0, 1, 2 (representation of axis 3)

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

On = 24 @a0 / @a1 / @ ai / ... / Wm {/


*}
On Operator No. n
24 Differential datum shift
@ai Physical address of the axis to be controlled (1 to 9 axes)
Wm Handwheel number (0 to 3)
* Datum shift of slave, duplicated or synchronised axes (see Notes).

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.

Special Case of Slave, Duplicated or Synchronised Axes


2
In order to apply the datum shift to the slave, duplicated or synchronised axes at the same time as to the master axis,
a variant of dynamic operator 24 consists of adding an argument to its syntax (star character *). This argument also
assigns the datum shifts addressed to the master by the PLC to the slave axes specified in the list of axis arguments
in forward or reverse mode.
For instance, if axes 2 and 3 are slaves of axis 0:

On = 24 @a0 / @a1 / @ a2 /@ a3/ Wm /*


When the PLC addresses axis 0 to assign it to handwheel Wm, it also assigns axes 2 and 3 to the same handwheel.
However, if it addresses axis 2 or 3, only the slave axis is assigned to the handwheel. When a master axis controls
slaves, the check of the limit values is made only on the master, but not on the slaves, which may in this case have
datum shifts which exceed the limit of +/- 32000.

Viewing the Differential Datum Shifts


The differential datum shifts can be viewed on a display page.
This page is obtained from the CURRENT POSITION page by clicking the ../.. (Next) button if there are no duplicated
or synchronised axes in the group or double-clicking the button if such axes exist.
The new page shows the measurement offsets set in the machine parameters (axis calibration + backlash error
compensation), those specified by the PLC and the differential datum shifts of the group displayed. The values are in
measurement increments.
Parameters E9530x can be accessed by a request to view the differential datum shifts on a remote HMI.

en-938871/A 2 - 51
2 - 52 en-938871/A
Examples of Use

3 Examples of Use

3.1 Example 1 3-3


3.2 Example 2 3-4
3.3 Example 3 3-6

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

Variables and Parameters Used in the Programme


- L10: programme variable
- L917: programme variable defining the radius of the circle
- E95007: B axis correction (physical address 7)
- E73000: position reference of an axis in the group (physical address 3 for the U axis).

Dynamic Operator Used


- Operator 13: multiplication by a programme variable.

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

Description of the Inclination on the X and Z Axes

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.

Call of Cycle G136 in a Part Programme


%100
...
G1 X5 Y10 Z10 Scan cycle start point
G136 X30 Y30 Q10 F1500 Cycle, position of the end point (XY) and step (Q)
Z5 F10 Depth of cut
...

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

(Position the dimensions and number of measurements in TX and TY)


[ty(1,1)]=[vx(iy)] [ty(1,2)]=-[vx(iy)]
[V]=[vx(ix)]/[.IRP(ix)]+.5 [V]=T[V] G79 [V]=0 N91
[tx(5,1)]=[V]-1 [tx(5,2)]=[V]-1
[V]=[vx(ix)]/[V] [tx(1,1)]=[V] [tx(1,2)]=-[V]

(Calculate the scan times on IY)


(The timeout separating two scans is 10 ms)
[V]=[vx(iy)]/[Fp]*60000 [ty(3,1)=T[V] [ty(3,2)=T[V] [ty(2,2)]=100
(and on IX)
[V]=[tx(1,1)]/[Fp]*60000/2 [V]=T[V] [tx(3,1)=[V]*2 [tx(3,2)]=[V]*2
[tx(2,1)]=[ty(3,1)]+50-[V] [V]=[ty(3,2)]+100-[V]-[V]
[tx(4,1)]=[V] [tx(2,2)]=[V] [tx(4,2)]=[V]

(Get the axis addresses of IX and IY)


[V]=[ix]-1*1000+70005 [ix]=E[V] [V]=[iy]-1*1000+70005 [iy]=E[V]

(Get an available operation number)


[V]=49000
REPEAT [V]=[V]+1
UNTIL E[V] = 0

(Create the oscillation operator)


[V]=[V]-49000 O[V]= 21 @[ix]=[tx(5,2)] / @[iy]=[ty(5,2)] G79 N99
N91 E.636
N99 G80 G997

3-6 en-938871/A
Examples of Use

Description of the Scan Cycle

3
Start

p
30

10
Ste
10

5 30

en-938871/A 3-7
3-8 en-938871/A
List of Operations

Appendix A List of Operations

Cancel an operation (see Sec. 1.4.1)

Syntax:
On = 0

Add (see Sec. 2.1)

Syntax:
On = 1 Ea / Eb / Ec {/I}

Subtract (see Sec. 2.2) A


Syntax:
On = 2 Ea / Eb / Ec {/I}

Multiply (see Sec. 2.3)

Syntax:
On = 3 Ea / Eb / Ec {/I}

Rotate a vector (see Sec. 2.4)

Syntax:
On = 4 Ea / Eb / Ec / I

Load a parameter with or without mask (see Sec. 2.5)

Syntax:
On = 5 Ea / Eb {/Ec} {/I}

Load a peripheral memory with or without mask (see Sec. 2.6)

Load from a machine axis number (see Sec. 2.6.1)

Syntax:
On = 6 Ea / @.. {/Eb} {/I}

Load from a PLC data (see Sec. 2.6.2)

Syntaxe :
On = 6 Ea / Eb {/Ec} {/I}

Indexed load of a parameter (see Sec. 2.7)

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

Compare two parameters (see Sec. 2.9)

Syntax:
On = 9 Ea / Eb / Ia {/Ib {/Ic}}

Conditions on the sum of two parameters (see Sec. 2.10)

Syntax:
On = 10 Ea / Eb / Ec / I
On = 10 Ea / Eb / Ec / E42xxx

Store data in a peripheral memory (see Sec. 2.11)

Store to a machine axis number (see Sec. 2.11.1)

Syntax:
On = 11 @.. / E

Store to a PLC data memory (see Sec. 2.11.2)

Syntax:
On = 11 Ea / Eb / I

Increment with modulo (see Sec. 2.12)

Syntax:
On = 12 Ea / Eb / I

Multiply by a programme variable (see Sec. 2.13)

Syntax:
On = 13 Ea {/Eb} / L..

Arc tangent function (see Sec. 2.14)

Syntax:
On = 14 Ea / Eb / Ec / I

Manual control of an axis (see Sec. 2.15)

Syntax:
On = 15 @.. / E42xxx / Eb / I

A-2 en-938871/A
List of Operations

Third-degree polynomial and its derivative (see Sec. 2.16)

Syntax:
On = 16 Ea / Eb / Lxx {/*}

Speed on path (see Sec. 2.17)

Syntax:
On = 17 Ea / @.. {/@..} {/@..}

Divide (see Sec. 2.18) A


Syntax:
On = 18 Ea / Eb / Ec {/I}

Square root (see Sec. 2.19)

Syntax:
On = 19 Ea / Eb / I

Synchronise the speed of an axis (see Sec. 2.20)

Syntax:
On = 20 @e / @m / E200xx / E42xxx / I

Oscillation cycles (see Sec. 2.21)

Syntax:
On = 21 @x = [TX(5,2)] / @y = [TY(5,2)] / @z = [TZ(5,2)]

Dynamic operator in C (see Sec. 2.22)

Syntax:
On = 22 COperateurName { / P1 / P2 / P3 / ... / Pn }

Electronic cam (see Sec. 2.23)

Syntax:
On = 23 @<axis> =<dim>/<dim>/<dim> @<axe> =<dim>/<dim>/.... @<axis> =<dim>/<dim> E42xxx

Differential datum shift (see Sec. 2.24)

Syntax:
On = 24 @a0 / @a1 / @ ai / .../ Wm {/*}

en-938871/A A-3
A-4 en-938871/A

You might also like