Copyright 20001-2002 by OSAI
All rights reserved
Edition: July 2001
IMPORTANT USER INFORMATION
This document has been prepared in order to be used by OSAI. It describes the latest release of the
product.
OSAI reserves the right to modify and improve the product described by this document at any time
and without prior notice.
Actual application of this product is up to the user. In no event will OSAI be responsible or liable for
indirect or consequential damages that may result from installation or use of the equipment described
in this text.
ABC
ABC
Update
10 Series CNC PLUS Library - User Manual
SUMMARY OF CHANGES
General
This publication has been issued with the software release 6.1.
This issue completely replaces the previous ones (MOV.08)
PAGETYPE OF UPDATE
INDEXupdated
CHAPTERS 5, 6, 9, 10, 11updated: the various functions with maximum process number to 20
CHAPTER 7
page 16corrected: diagrams to which the $ANAIN function refers
CHAPTER 10
page 3inserted: parameter 9 RCM in function $GBPROVAR
CHAPTER 11
page 7inserted: Pilot Panel management in the multi-process environment
CHAPTER 12
pages 29, 32
pages 36, 38
page 41
page 63
page 65
pages 66, 67
APPENDIX Dmodified: field 7 in the axes table
APPENDIX Ginserted: missing error messages
inserted: parameters 24 and 25 for reading Jerk information in function
$AX_GET7
inserted: parameters 21 to 25 in function $AX-PUT1.
inserted: note concerning the parameter “STANDSTILL_GAIN”
inserted: examples and details for the parameters for using function
$AXD_RDD
inserted: new results in the description of function $AXD_WRD
added: new considerations in the description of functions $AXD_RDS
and $AXD_WRS.
10 Series CNC PLUS Library - User Manual (09)
asda
Preface
10 Series CNC PLUS Library - User Manual
PREFACE
This manual contains the description of all block functions (FB) needed for the logic application
projects of the 10 Series CNC.
It contains the corresponding instruction list (IL) code for each FB and a description of the input and
output variables.
This manual deals specifically with functions and function blocks. For further information on PLUS, its
language and its applications in the 10 Series CNC environment consult the following manuals:
10 Series CNC PLUS APPLICATION MANUALCode 45006677Z
10 Series CNC PLUS LANGUAGE & PLUSEDITCode 45006672 P
You can find an FB or a function more easily if you look up the Function Reference List below in this
preface.
In this list the functions are ordered alphabetically and for each of them there is a short description
plus the page number.
In this manual the various function blocks have been subdivided into groups depending on the type of
operation they fulfil or the environment to which they belong. So if you do not know the exact name of
an FB, but know the environment to which it refers, you can easily find the FB in the manual by
consulting the index.
COMMON FEATURES OF FUNCTION BLOCKS:
All function blocks can be used in the Ladder Diagram / Function Block Diagram (LD/FBD) editors
and in the MACRO Instruction List (MACRO-IL) editor. The function blocks discussed in Chapters 1
and 3 are base function blocks i.e. built from standard elements of the instruction list (IL). All the
other function blocks are extensions which internally use a function call. These functions can also be
used in the IL editor. For each FB there is an example for the calls and the necessary parameters in
IL.
NOTE:
When using function calls in IL, there is no control to ensure that the number and type of parameters
are correct.
When using the MACRO-IL editor, the function block parameters are always checked.
10 Series CNC PLUS Library - User Manual (09) 1
Preface
10 Series CNC PLUS Library - User Manual
enable input
Many of the function blocks shown in this manual have an “enable” input which enables/disables the
execution of the block.
• Enable is a Boolean variable which can be inverted if necessary.
• You can link all types of Boolean variables available in PLUS including the Boolean constants KB1
and KB0.
• The enable signal linked to the FB P1 (pulse) or the use of FBs for controlling the program flow
allows you to write faster and attain a more efficient machine code. In general it is better to try to
limit the number of always enabled FB (enable always = 1) by disabling them when their function
is not required, in order to increase the performance of the machine logic.
stat_wrd output (function status output word)
The function status output is available on all system function blocks. After the relevant function has
been completed, this word contain a value indicating that all went well or that there was some kind of
problem. When everything was ok, the status word will be zero. In case of problems the value of the
status word is different from zero. Please refer to the specific function block for the meaning of the
values returned in the status word.
Often you're not interested in knowing the status of the functions because your program has been
tested and always works well. You can then hook up only one single short variable, e.g. MW 999, to
the status output of many functions.
ax_id input (physical axis identifier)
The axis identifier is used for many system functions. It is a number identifying the internal resources
for one axis on an axes module. Each axes module supports 8 axes, 6 resources are reserved for
physical axes (which read encoders and/or write to D/A converters) and 2 for virtual axes. A machine
axis (e.g. "X") may be related to any of the available physical axis resources on any of the axes
modules.
There can be up to 4 axes modules in the 10 Series CNC chassis, allowing for up to 32 axes
(theoretically). The axis identifier now, is a number in the range of 1 through 32. It must be assigned
during the axes configuration in AMP and will also serve to define the page number of the axes table
on which this axis will be managed.
Even when you move the physical connections (encoder, D/A) of an axis to another axes module, its
ax_id will remain unchanged and the axis data will remain available on the same page of the axes
table.
The function A_TO_ID converts an ASCII axis address to its physical axis identifier number.
tc_id input (transducer/converter physical identifier)
The identifiers of the tansducer inputs are numbers in the range of 100Hex up to 1nnHex. On the first
servo module you will find (top to bottom) the transducers 100Hex through 105Hex, on the second
106Hex through 10BHex, on the third module 10CHex through 111, and so on.
The D/A converters have a similar numbering system. On the first module you will find the converters
200Hex through 205Hex, on the second module 206Hex through 20BHex, and so on.
210 Series CNC PLUS Library - User Manual (09)
Preface
10 Series CNC PLUS Library - User Manual
symbolic names
Symbolic names to be associated to the user subroutine (DSRB) and to the label (LBL) must be
different from those predefined in PLUS (FB names, predefined routines, etc.) and should never begin
with a $.
Furthermore, symbolic names should always begin with a letter and not with a number.
TYPES OF SYSTEM FUNCTION CALLS
There can be 3 different types of system function calls (system function blocks):
WAIT
A WAIT function call suspends the execution of the task that called it. This task will resume its
activity after the function has been completely executed.
The suspension of a task implies the suspension of all routines that make up this task. The WAIT
function is normally executed by an environment other than the I/O processor module (the system).
For this reason a WAIT function is a synchronous call: when the logic scan exits from a WAIT
function block, this block has been completely executed.
NOWAIT
A NOWAIT function call does not suspend the execution of the logic task that called it. Immediately
after the call has been issued, the logic task resumes execution. The function call will be executed
by an environment other than the I/O processor module (system).
For this reason a NOWAIT function is an asynchronous call: when the logic scan exits from a
NOWAIT function block, the function is still being executed by another environment.
The execution of many NOWAIT function calls from a logic task may cause a system overloading
since the simultaneous execution of many functions is required.
When 15 NOWAIT functions are in parallel execution, the function that has generated the last call is
in any case executed and it returns to the word status a warning code (1000 hexadecimal).
If you continue to call NOWAIT functions after the warning message, that is when 25 functions are in
parallel execution, an unrecoverable emergency is generated ("too many requests").
INTERNAL
An INTERNAL function is similar to a WAIT function call but its execution is much faster because it's
done by the same environment that calls the function (PLUS). An INTERNAL function call is in all
aspects like a subroutine available to the PLUS environment. For this reason an INTERNAL function
is a synchronous call: when the logic scan exits from an INTERNAL function block, this block has
been completely executed.
$AX_GET1: Get axis (spindle) servo parameters .................................................12-15
$AX_GET2: Get axis (spindle) servo parameters .................................................12-17
$AX_GET3: Get axis (spindle) servo parameters .................................................12-20
$AX_GET4: Get axis (spindle) servo parameters .................................................12-22
$AX_GET5: Get axis (spindle) servo parameters .................................................12-24
$AX_GET6: Get axis (spindle) servo parameters .................................................12-26
$AX_GET7: Get axis (spindle) servo parameters .................................................12-28
$AX_GET8: Get axis (spindle) servo parameters .................................................12-33
$AX_PUT1: Set axis servo parameter................................................................12-35
Notes concerning the “STANDSTILL-GAIN” parameter.........................................12-41
$AX_PUT2: Set axis servo parameter................................................................12-42
$AX_PUT3: Set axis servo parameter................................................................12-44
$AX_GETS: Get axis status .............................................................................12-46
$TC_CONF: It configures the transducer ERDC for read operations ......................12-48
$TC_READ1: It reads the physical position of the transducer...............................12-50
$TC_WRIT: Set D/A Converter output ................................................................12-52
$FAX_WCON:Configures the driver for real time data communication
from PLUS to AXES.........................................................................................12-55
$FAX_RCON: Configures the driver for real time data communication
from AXES to PLUS .........................................................................................12-57
$FAX_PUT: Real time updating of an axis' zero shift value ...................................12-59
$FAX_GET: Reads in real time axis parameters .................................................12-61
$AXD_RDD: It reads a numerical parameter from a digital drive
associated to a D.S.I. axis...............................................................................12-63
$AXD_WRD: It writes a numerical parameter to a digital drive
associated to a D.S.I. axis...............................................................................12-65
$AXD_RDS: It reads a string parameter from a digital drive
associated to a D.S.I. axis...............................................................................12-66
$AXD_WRS: It writes a string parameter to a digital drive associated
to a D.S.I. axis 12-67
$AXD_PUT: Sets Control Word bits of a digital drive associated with
a D.S.I. axis12-68
vi10 Series CNC PLUS Library - User Manual (09)
SPECIAL FUNCTIONS
$ACTRES: Request an active reset to be executed ............................................13-2
$LOCKTAB: Set table interlock status (inhibit third party access) ........................13-3
$UNLKTAB: Cancel table interlock status (enable third party access)..................13-5
$FAST_WR: Writes data in the DP dedicated area .............................................13-6
$FAST_RD: Reads data from a dedicated DP area.............................................13-8
$DE_ETH: enables or disables communication via Ethernet ................................13-10
The basic language function blocks are the direct equivalents of the corresponding instruction list
elements. Every time you use one of these function blocks, its internal (IL) code will be inserted in
your program. In this sense the basic language function block behave like macros. The function
blocks discussed in this chapter do not call any functions. Each one of the sections in this chapter
covers a group of function blocks which all work on the identical data format.
Those function blocks which internally use a system function call are covered in the other chapters of
this manual. They are called language extensions because they expand the capabilities of the
language beyond the capabilities of the single instructions.
For each of the basic language function blocks you will find a table which contains the attributes of
the inputs and outputs of a function block. The columns in this table are:
NAME :Name of the connection
INVERSION :Indicates whether the input or output can be logically inverted. This attribute
is only available for Boolean connections.
DUPLICATION :If this attribute shows yes, you are allowed to make one or more copies of
this connection. Each one of the copied connections will have the same
attributes as the original and the connected variable will be processed just
like the original variable.
FORMAT :The format of an operand to be connected to an input or an output can be
one of:
Booleanonly bits allowed
short16 bit integer operand
double64 bit floating point operand
charstring or string constant
allno check, all formats possible
specialfor special operands NAM and LAB only
As you enter an operand for a function block, it will be checked if it
matches the required format.
GROUP :The different types of operands are divided into groups. For certain function
block connections some groups will be excluded (e.g. it is not allowed to
connect an input to a Boolean function block output). The letters in this
column indicate which type of operand may be used:
10 Series CNC PLUS Library - User Manual (08)1-1
Chapter 1
WARNING
Basic Language Function Blocks
MM variables (depending on the format you must select M Boolean
MW -> short MD -> double).
Gglobal retentive G variables (depending on the format you must
select G -> Boolean, GW -> short or GD -> double).
SSystem flags or S variables. (again, select the S or SW
depending on the format of the connection; S -> Boolean or SW > short)
TTimer variables. T or TW depending on the format (T -> Boolean,
TW -> short).
CCounter variables. C or CW depending on the format (C ->
Boolean, CW short).
KConstants. KB -> Boolean, KW or KH -> short, KD -> double.
Xlocal variables. Select X -> Boolean, XW -> short or XD -> double,
depending on the format of the connection.
Ysubroutine parameters. select Y -> Boolean, YW -> short or YD -
> double in accordance with the format of the connection.
Double constants (KD) are defined with the following format:
KD ± x.yyyyE ± zzz
The decimal part yyyy must always be written in full (4 figures).
1-210 Series CNC PLUS Library - User Manual (08)
Chapter 1
IMPORTANT
Basic Language Function Blocks
LINE ELEMENT
The line element can be used to "connect" a variable or a constant (left side) with one or more other
variables (right side). The variables (constants) on both sides must have the same type (i.e. short).
The line element is only available to connect Boolean, short and double variables and constants.
Examples:
short constant c onnected to short variable s
KH00FF
Boolean constant connect ed to boolean variables
KB1O 24,03
Short constant connected to a timer preset word
KW100TW 020
MW 200
MW 201
G 010,00
.
Of course you cannot connect inputs and/or constants to the right side of a line element. For an
explanation of how to insert a line element please refer to the Plusedit manual.
When you design a logic program using Function Blocks please consider some
rules related to “broken” Line Elements. We will explain this using an example:
GD 00
I 00,00
SE TD
I1
En
O1
GD 01
The use of a 'broken' line element in this example forces the PLUS development package to assign
an automatic variable (MD 151) for this line. This variable will always be assigned to the destination
variable GD 1, independent of the status of I 00,00. The translation of the block shows clearly why:
rec. word instr. operand symbol comment
00001 ; Assignment with broken line
00005 L I 00,00
00006 AND(
00007 LDGD 00
00008 = MD 151
00009 )
00002 00010 L MD 151
00015 = GD 01
10 Series CNC PLUS Library - User Manual (08)1-3
Chapter 1
Basic Language Function Blocks
As you can see, the assignment of MD 115 to GD 01 is not conditioned by the input I 00,00 of the
Function Block SETD.
To avoid this probably undesired behaviour you should connect the destination variable GD 01 using a
straight line:
G D 00
I 0 0,0 0
S E T D
I1
E n
G D 0 1
Using this straight connection, the translation in IL does not require an automatic variable:
rec. word instr. operand symbol comment
00000 ; Assignment with straight line
00000 LI 00,00
00001 AND(
00002 LD GD 00
00003 =GD 01
00004 )
Please keep in mind these considerations when using FB programming:
• The use of 'broken' line elements as explained above can cause 'abnormal' behaviour of your logic
program. Problems due to an unwanted assignment as in above example
• Broken' line elements use automatic variables and generate extra code which requires more
memory and more execution time.
• Avoid to use 'broken' line elements to keep your logic as fast as possible.
1-410 Series CNC PLUS Library - User Manual (08)
Basic Language Function Blocks
BOOLEAN FUNCTION BLOCKS
$=NBOOLEAN INVERTER
=N
I1O1
nameinversionduplicationformatgroup
I1YESNOBooleanI O M G S X Y T C K
O1YESYESBooleanO M G S X Y
$ANDBOOLEAN AND GATETRUTH TABLE
AND
I1
I20
AND
O1
I20I1
00
1
0
Chapter 1
O1
0
0
1
0
11
Connection attributes:
nameinversionduplicationformatgroup
I1YESNOBooleanI O M G S X Y T C K
I2YESYESBooleanI O M G S X Y T C K
O1YESNOBooleanO M G S X Y
The output O1 will be true when Boolean input I1 and I20 are true.
$ORBOOLEAN OR GATETRUTH TABLE
OR
I1
I20
O1
OR
I20I1
000
1
0
11
0
1
O1
0
1
1
1
1
10 Series CNC PLUS Library - User Manual (08)1-5
Chapter 1
Basic Language Function Blocks
Connection attributes:
nameinversionduplicationformatgroup
I1YESNOBooleanI O M G S X Y T C K
I2YESYESBooleanI O M G S X Y T C K
O1YESNOBooleanO M G S X Y
The output O1 will be true when either Boolean input I1 or I20 or both are true.
$XORBOOLEAN XOR GATETRUTH TABLE
XORXO R
I1I2O1
000
1
0
11
I2I1
O1
0
1
1
1
0
nameinversionduplicationformatgroup
I1YESNOBooleanI O M G S X Y T C K
I2NONOBooleanI O M G S X Y T C K
O1NONOBooleanO M G S X Y
The output O1 will be true when either Boolean input I1 or Boolean input I2 is true.
$R/SRS FLIP FLOP WITH RESET PRIORITYTRUTH TABLE
RSQ
R/S
R
S
Q
R/S
00
1
0
11
NC = No Change
N C
0
0
1
Connection attributes:
nameinversionduplicationformatgroup
1
0
RYESNOBooleanI O M G S X Y T C
SYESNOBooleanI O M G S X Y T C
QNONOBooleanO M G S X Y
1-610 Series CNC PLUS Library - User Manual (08)
Basic Language Function Blocks
$S/RRS FLIP FLOP WITH SET PRIORITYTRUTH TABLE
Chapter 1
S/R
SQ
R
Connection attributes:
nameinversionduplicationformatgroup
RYESNOBooleanI O M G S X Y T C
SYESNOBooleanI O M G S X Y T C
QNONOBooleanO M G S X Y
S/R
00
1
11
NC = No Change
RSQ
001
1
NC
0
1
10 Series CNC PLUS Library - User Manual (08)1-7
Chapter 1
Basic Language Function Blocks
FUNCTION BLOCKS FOR WORD OPERATIONS
$ORWBITWISE LOGICAL OR 16 BIT WORDS
O R W
I1
I20
O 1
E X A M P L E :
I1 0 0 1 1 0 1 0 1 1 0 1 0 0 1 1 1 ( 1 3 7 3 5 )
I20 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 (17 9 6 1 )
O 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 ( 3 0 6 3 9 )
Connection attributes:
nameinversionduplicationformatgroup
I1NONOshortM G S X Y T C K
I20NOYESshortM G S X Y T C K
O1NONOshortM G S X Y T C