The software is supplied to the user as described in this document. Any risks resulting from its quality or use remain the responsibility
of the user. The user must provide all safety measures protecting against possible maloperation.
We do not take any liability for direct or indirect damage, e.g. profit loss, order loss or any loss regarding business.
2006 Lenze Drive Systems GmbH
No part of this documentation may be copied or made available to third parties without the explicit written approval of Lenze Drive
Systems GmbH.
All information given in this documentation has been carefully selected and tested for compliance with the hardware and software
described. Nevertheless, discrepancies cannot be ruled out. We do not accept any responsibility or liability for any damage that may
occur. Required corrections will be included in updates of this documentation.
All product names mentioned in this documentation are trademarks of the corresponding owners.
This Manual contains information on the function blocks that are included in the function library
LenzeDrive.lib for the Drive PLC Developer Studio.
These function blocks can be used in the 9300 Servo PLC, Drive PLC and ECSxA
automation system.
The function blocks are based on the functions that are available in the 9300 servo inverter
(V2.0).
In the Drive PLC Developer Studio (DDS) you make the basic settings for your drive applicationoffline by using variables (in accordance with the IEC61131−3 standard) as aids for parameterizing
the appropriate function blocks.
Via Global Drive Control (GDC) or the keypad you can then set the parameters for the required
functionality of your drive application online by accessing the codes of the function block instances.
1.1.1Conventions used in this Manual
This Manual uses the following conventions to distinguish between different types of information:
Variable names
are written in italics in the explanation:
"The signal at nIn_a ..."
Lenze functions/function blocks
can be recognized by their names. They always begin with an "L_":
"The FB L_ARIT can ..."
Program listings
are written in "Courier", keywords are printed in bold:
"IF (ReturnValue < 0)THEN..."
Instances
For function blocks that have one or more first instances there are tables that describe the
corresponding codes:
Variable nameL_ARIT1L_ARIT2Setting rangeLenze
byFunctionC0338C06000 ... 51
You can access these codes online with Global Drive Control (GDC) or keypad.
L
Tip!
You can use the Parameter Manager to assign the same codes to these instances that are assigned
in the 9300 servo inverter (V2.0).
LenzeDrive.lib EN 1.7
1−1
Function library LenzeDrive.lib
Preface and general information
1.1About this Manual
1.1.2Description layout
All function/function block and system block descriptions contained in this Manual have the same
structure:
FunctionFunction block (FB)/
Heading stating function and function identifier
Declaration of the function:
Data type of the return value
Function identifier
List of transfer parameters
Short description of the most important properties
Function chart including all
associated variables
Transfer parameters
Return value
Table giving information about the
transfer parameters:
Identifiers
Data type
Possible settings
Info
Table giving information about the
return value:
Data type of the return value
Possible return values and their
meaning
Additional information
(Notes, tips, application examples, etc.)
system block (SB)
−
FB/SB chart including all
associated variables
Input variables
Output variables
Table giving information about the
input and output variables:
Identifiers
Data type
Variable type
Possible settings
Info
−
1.1.3Pictographs used in this Manual
Pictographs usedSignal words
Warning of material
damage
Other notesTip!
Stop!Warns of potential damage to material.
Note!
1.1.4Terminology used
TermIn the following text used for
DDSDrive PLC Developer Studio
FBFunction block
GDCGlobal Drive Control (parameterization program from Lenze)
Parameter codesCodes for setting the functionality of a function block
PLC 9300 Servo PLC
SBSystem block
Drive PLC
ECSxA "Application" axis module
Possible consequences if disregarded:
Damage to the controller/drive system or its environment.
Indicates a tip or note.
1−2
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Preface and general information
1.2Lenze software guidelines for variable names
1.2Lenze software guidelines for variable names
The previous concepts for Lenze controllers were based on codes that represented the input and
output signals, and the parameters of function blocks.
For the sake of clarity, names were defined for the codes in the documentation.
In addition, the signal types were defined by graphical symbols.
The user could see at a glance which kind of signal (analog, phase−angle etc.) had to be present at
the particular interface.
The concept for the new automation system does not use direct codes in the
programming. The IEC 61131−3 standard is used instead.
This standard is based on a structure of variable names.
If the user applies variables in his project, then he can name the variables as he chooses.
In order to avoid the growth of a multitude of different conventions for naming variables in existing
and future projects and function libraries that are programmed by Lenze personnel, we have set up
software guidelines that must be followed by all Lenze staff.
In this convention for creating variable names, Lenze keeps to the Hungarian Notation that has been
specifically expanded by Lenze.
If you make use of Lenze−specific functions or function blocks, you will immediately be able to see,
for instance, which data type you must transfer to a function block, and which type of data you will
receive as an output value.
1.2.1Hungarian Notation
These conventions are used so that the most significant characteristics of a program variable can
instantly be recognized from its name.
Variable names
consist of
a prefix (optional)
a data−type entry
and an identifier
The prefix and data−type entry are usually formed by one or two characters. The identifier (the
"proper" name) should indicate the application, and is therefore usually somewhat longer.
An identifier begins with a capital letter.
If an identifier is assembled from several "words", then each "word" must start with a capital
letter.
All other letters are written in lower case.
Examples:
Array of integers anJogValue[10] ;
Bool bIsEmpty ;
Word wNumberOfValues ;
Integer nLoop ;
Byte byCurrentSelectedJogValue ;
1.2.1.1Recommendation for designating variable types
In order to be able to recognize the type of variable in a program according to the name, it makes
sense to use the following designations, which are placed in front of the proper variable name and
separated from it by an underline stroke:
for a global array of type integer that includes fixed setpoints (analog) for a speed setting:
g_anFixSetSpeedValue_a
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Preface and general information
1.2Lenze software guidelines for variable names
1.2.1.2Designation of the signal type in the variable name
The inputs and outputs of the Lenze function blocks each have a specific signal type assigned. These
may be: digital, analog, position, or speed signals.
For this reason, each variable name has an ending attached that provides information on the type of
signal.
Signal typeEndingPrevious designation
analog_a (analog)
digital_b (binary)
Phase−angle difference or speed_v (velocity)
Phase−angle or position_p (position)
Tip!
Normalizing to signal type phase−angle difference/speed: 16384 (INT) ¢ 15000 rpm
Normalizing to signal type analog: 16384 ¢ 100 % ¢ value under [C0011] = n
Normalizing to signal type angle or position: 65536 ¢ 1 motor revolution
Caution: The cyclic task PLC_PRG is not time−equidistant!
Function library LenzeDrive.lib
Function blocks
l
LenzeDrive.lib EN 1.7
2−1
Function library LenzeDrive.lib
General signal processing
2.1.1Programming fixed setpoints (L_FIXSET)
2.1General signal processing
2.1.1Programming fixed setpoints (L_FIXSET)
You can program up to 15 fixed setpoints with this FB. The addressing of the setpoint that is to be
output is made through the boolean (logic) inputs.
Fixed setpoints can be used, for example, for:
Different set dancer positions in a dancer position control
Different stretch ratios (gearbox factor) when using a speed ratio control with digital frequency
coupling
Fig. 2−1Programming fixed setpoints (L_FIXSET)
VariableNameDataTypeSignalTypeVariableTypeNote
nAin_aIntegeranalogVAR_INPUTnAin_a is connected to nOut_a , if (bIn1_b ... bIn4_b)
bIn1_bBoolbinaryVAR_INPUT
bIn2_bBoolbinaryVAR_INPUT
bIn3_bBoolbinaryVAR_INPUT
bIn4_bBoolbinaryVAR_INPUT
nOut_aIntegeranalogVAR_OUTPUT
anSollW[1...15]Array of integersVAR CONSTANT RETAIN Variable that can have fixed setpoints assigned to
nOut_a can be used as a setpoint source (signal source) for another FB (e.g. process controller,
arithmetic block, etc.). The parameterization and handling is the same as for JOG, but it is
independent of JOG. (^ 2−73: L_NSET)
Parameterization of the fixed setpoints
– The individual fixed setpoints can be parameterized through anSollW1 ... anSollW15.
Output of the selected fixed setpoint:
– If the binary inputs are triggered with a HIGH signal, a fixed setpoint from the table is
switched to nOut_a . (^ 2−3)
Range:
– You can enter values from −199.99% ... 199.99% (100 % corresponds to 16384).
nAin_a
bIn1_b
bIn2_b
bIn3_b
bIn4_b
DMUX
0
3
FIXSET1...15
0
15
anSollW1
anSollW2
anSollW15
L_FIXSET
nOut_a
FALSE is on all the selection inputs.
The number of inputs to be assigned depends on the
number of required fixed setpoints.
them.
2−2
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
General signal processing
2.1.1Programming fixed setpoints (L_FIXSET)
2.1.1.1Enable of the fixed setpoints
Number of required fixed setpointsNumber of the inputs to be assigned
1at least 1
1 ... 3at least 2
4 ... 7at least 3
8 ... 154
Decoding table of the binary input signals:
Output signal
nOut_a =
nAin_a0000
anSollW11000
anSollW20100
anSollW31100
anSollW40010
anSollW51010
anSollW60110
anSollW71110
anSollW80001
anSollW91001
anSollW100101
anSollW111101
anSollW120011
anSollW131011
anSollW140111
anSollW151111
0 = FALSE
1 = TRUE
1st input
bIn1_b
2nd input
bIn2_b
3rd input
bIn3_b
4th input
bIn4_b
L
LenzeDrive.lib EN 1.7
2−3
Function library LenzeDrive.lib
Analog signal processing
2.2.1Absolute value generation (L_ABS)
2.2Analog signal processing
2.2.1Absolute value generation (L_ABS)
This FB converts bipolar values into unipolar values. It calculates the absolute value of the input
signal.
This FB adds or subtracts input values, depending on the input that is used.
L _ A D D
± 3 2 7 6 7
Fig. 2−3Addition (L_ADD)
VariableNameDataTypeSignalTypeVariableTypeNote
nIn1_aIntegeranalogVAR_INPUTAddition input
nIn2_aIntegeranalogVAR_INPUTAddition input
nIn3_aIntegeranalogVAR_INPUTSubtraction input
nOut_aIntegeranalogVAR_OUTPUTSignal is limited to ±32767.
Functional sequence
1. The value at nIn1_a is added to the value of nIn2_a.
2. The value of nIn3_a is subtracted from the calculated result.
3. The result of the substraction is then limited to ±32767.
n I n 1 _ a
n I n 2 _ a
n I n 3 _ a
+
-+
n O u t _ a
L
LenzeDrive.lib EN 1.7
2−5
Function library LenzeDrive.lib
Analog signal processing
2.2.3Input gain and offset (L_AIN)
2.2.3Input gain and offset (L_AIN)
This FB is preferentially used for addition circuitry at the analog input terminals, to adjust the gain and
offset.
Fig. 2−4Input gain and offset (L_AIN)
VariableNameDataTypeSignalTypeVariableTypeNote
nIn_aIntegeranalogVAR_INPUTInput signal
nOffset_aIntegeranalogVAR_INPUTOffset of the input signal
nGain_aIntegeranalogVAR_INPUTGain of the input signal
nOut_aIntegeranalogVAR_OUTPUT
Function
Offset
– The value at nOffset_a is added to the value of nIn_a
– The result of the addition is limited to ±32767.
Gain
– The limited value (after the offset) is multiplied by the value at nGain_a .
– Next, the signal is limited to ±32767.
The signal is given out at nOut_a .
nOut_a
nIn_a
nOffset_a
nGain_a
+
+
L_AIN
nOut_a
Fig. 2−5Offset and gain of the analog input
nGain_a
nOffset_a
nIn_a
2−6
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Analog signal processing
2.2.3Input gain and offset (L_AIN)
Funtion in IL
LD nIn_a
INT_TO_DINT
ADD (nOffset_a
INT_TO_DINT
)
LIMIT −32767,32767
MUL (nGain_a
INT_TO_DINT
)
DIV 16384
LIMIT −32767,32767
DINT_TO_INT
ST nOut_a
L
LenzeDrive.lib EN 1.7
2−7
Function library LenzeDrive.lib
Analog signal processing
2.2.4Inversion (L_ANEG)
2.2.4Inversion (L_ANEG)
This FB inverts the sign of an input value. The input value is multiplied by −1 and then output.
This FB is preferentially used for additional circuitry at analog output terminals, to adjust the gain and
offset.
L_AOUT
+
nIn_a
nGain_a
nOffset_a
Fig. 2−7Output gain and offset (L_AOUT)
VariableNameDataTypeSignalTypeVariableTypeNote
nIn_aIntegeranalogVAR_INPUTInput signal
nGain_aIntegeranalogVAR_INPUTGain of the input signal
nOffset_aIntegeranalogVAR_INPUTOffset of the input signal
nOut_aIntegeranalogVAR_OUTPUT
Function
nOut_a
+
Gain
– The value at nIn_a is multiplied by the value at nGain_a .
– The multiplication is performed according to the formula:
16384 @ 16384 @ 2
*14
+ 16384
– The result of the multiplication is limited to ±2
[100% @ 100% + 100%]
14
Offset
– The limited value (after amplification) is added to the value at nOffset_a
– The result of the addition is limited to ±2
Next, the signal is limited to ±2
14
and output to nOut_a .
nOut_a
14
nGain_a
nOffset_a
nIn_a
Fig. 2−8Offset and gain of the analog output
L
LenzeDrive.lib EN 1.7
2−9
Function library LenzeDrive.lib
Analog signal processing
2.2.5Output gain and offset (L_AOUT)
Function in IL
LD nIn_a
INT_TO_DINT
MUL (nGain_a
INT_TO_DINT
)
DIV −32767,32767
ADD (nOffset_a
INT_TO_DINT
)
LIMIT −32767,32767
DINT_TO_INT
ST nOut_a
2−10
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Analog signal processing
2.2.6Arithmetic (L_ARIT)
2.2.6Arithmetic (L_ARIT)
This FB can arithmetically combine two analog signals.
Fig. 2−9Arithmetic (L_ARIT)
VariableNameDataTypeSignalTypeVariableTypeNote
nIn1_aIntegeranalogVAR_INPUT
nIn2_aIntegeranalogVAR_INPUT
nOut_aIntegeranalogVAR_OUTPUTThe signal is limited to ±32767.
byFunctionByteVAR CONSTANT RETAIN Selection of the function
This FB switches between two integer values. So it is, for example, possible to change between an
initial diameter and a calculated diameter during winding.
This FB compares two integer values with each other. You can use comparators to implement
threshold switches.
Fig. 2−11Comparison (L_CMP)
VariableNameDataTypeSignalTypeVariableTypeNote
nIn1_aIntegeranalogVAR_INPUT
nIn2_aIntegeranalogVAR_INPUT
bOut_bBoolbinaryVAR_OUTPUT
byFunctionByteVAR CONSTANT RETAIN Comparison function for the inputs
nHysteresisIntegerVAR CONSTANT RETAIN Hysteresis function
nWindowIntegerVAR CONSTANT RETAIN Window function
Selection: byFunction = 1
This function compares two signals for equality. For instance, you can make the V comparison
"actual speed is equal to set speed" (n
The exact function can be seen in the diagram. (^Fig. 2−12)
nWindow
nHysteresis
1
nWindow
act
nHysteresis
= n
set
).
0
nIn1_a
nHysteresis
nWindow
nIn2_a
nWindow
nHysteresis
bOut_b
Fig. 2−12Equality of signals (nIn1_a = nIn2_a)
Use nWindow to set the window within which the equality is valid.
Use nHysteresis to set a hysteresis, if the input signals are not stable and the output oscillates.
nIn2_a
nIn1_a
t
t
2−14
Note!
With this function, you must use the FB in a fast task, to achieve optimum sampling of the signals.
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Analog signal processing
2.2.8Comparison (L_CMP)
2.2.8.2Function 2: nIn1_a > nIn2_a
Selection: byFunction = 2
With this function, you can make the comparison "actual speed is above a limit" (n
one direction of rotation.
nIn1_a
nIn2_a
nHysteresis
bOut_b
nHysteresis
1
bOut_b
> nx ) for
act
t
0
Fig. 2−13Signal values exceeded (nIn1_a > nIn2_a)
Functional sequence
1. If the value at nIn1_a is below the value at nIn2_a, then bOut_b changes from FALSE to TRUE.
2. Only when the signal at nIn1_a is above the value of nIn2_a − nHysteresis again, will bOut_b
change from TRUE to FALSE.
2.2.8.3Function 3: nIn1_a < nIn2_a
Selection: byFunction = 3
With this function, for instance, you can make the comparison "actual speed is below a limit"
(n
< nx ) for one direction of rotation.
act
bOut_b
nHysteresis
1
nIn1_anIn2_a
nIn1_a
nHysteresis
nIn2_a
bOutb_b
t
t
0
nIn2_a
Fig. 2−14Gone below signal values (nIn1_a < nIn2_a)
nIn1_a
Functional sequence
1. If the value at nIn1_a is below the value at nIn2_a, then bOut_b changes from FALSE to TRUE.
2. Only when the signal at nIn1_a is above the value of nIn2_a − nHysteresis again, will bOut_b
change from TRUE to FALSE.
L
LenzeDrive.lib EN 1.7
t
2−15
Function library LenzeDrive.lib
Analog signal processing
2.2.8Comparison (L_CMP)
2.2.8.4Function 4: |nIn1_a| = |nIn2_a|
Selection: byFunction = 4
With this function, for instance, you can make the comparison "n
This function is the same as function 1. (^ 2−14)
– However, the absolute value of the input signals (without sign) is generated here before the
signal processing.
2.2.8.5Function 5: |nIn1_a| > |nIn2_a|
Selection: byFunction = 5
With this function, for instance, you can make the comparison "n
the direction of rotation.
This function is the same as function 2. (^ 2−15)
– However, the absolute value of the input signals (without sign) is generated here before the
signal processing.
= 0".
act
| > |nx |" independently of
act
2.2.8.6Function 6: |nIn1_a| < |nIn2_a|
Selection: byFunction = 6
With this function, you can make the comparison "n
of rotation.
This function is the same as function 3. (^ 2−15)
– However, the absolute value of the input signals (without sign) is generated here before the
signal processing.
| < |nx |" independently of the direction
act
2−16
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Analog signal processing
2.2.9Curve function (L_CURVE)
2.2.9Curve function (L_CURVE)
This FB converts an analog signal into a characteristic curve.
Fig. 2−15Curve function (L_CURVE)
VariableNameDataTypeSignalTypeVariableTypeNote
nIn_aIntegeranalogVAR_INPUT
nOut_aIntegeranalogVAR_OUTPUT
byFunctionByteVAR CONSTANT RETAIN Selection of the characteristic/curve function
nY0IntegerVAR CONSTANT RETAIN Entry of Y0 from vector (0, Y0)
nY1IntegerVAR CONSTANT RETAIN Entry of Y1 from vector (X1, Y1)
nY2IntegerVAR CONSTANT RETAIN Entry of Y2 from vector (X2, Y2)
nY100IntegerVAR CONSTANT RETAIN Entry of Y100 from vector (16384, Y100)
nX1IntegerVAR CONSTANT RETAIN Entry of X1 from vector (X1, Y1)
nX2IntegerVAR CONSTANT RETAIN Entry of X2 from vector (X2, Y2)
Selection of the functionCurve functionInformationen for entry of the interpolation points
byFunction = 1Characteristic with two co−ordinates^ Fig. 2−16
byFunction = 2Characteristic with three co−ordinates^ Fig. 2−17
byFunction = 3Characteristic with four interpolatio points ^ Fig. 2−18
100% corresponds to 16384.
A linear interpolation is carried out between the co−ordinates.
For negative values at nIn_a the settings of the interpolation points are processed inversely
(see line diagrams).
– If this is not required, insert an FB L_ABS or an FB L_LIM before or after the FB L_CURVE.
L
LenzeDrive.lib EN 1.7
2−17
Function library LenzeDrive.lib
a
Analog signal processing
2.2.9Curve function (L_CURVE)
2.2.9.1Characteristic with two co−ordinates
byFunction = 1
y
n O u t _ a
n Y 1 0 0
n Y 0
- 1 0 0 %
Fig. 2−16Line diagram with 2 co−ordinates
2.2.9.2Characteristic with three co−ordinates
byFunction = 2
y
n O u t _ a
n Y 1 0 0
n Y 1
y 0
- n Y 0
- n Y 1 0 0
y 1 0 0
1 0 0 %
y 1 0 0
y 1
x
n I n _
- 1 0 0 %
Fig. 2−17Line diagram with 3 co−ordinates
2−18
n Y 0
y 0
- n X 1
- Y 0
- n Y 1
- n Y 1 0 0
LenzeDrive.lib EN 1.7
x 1
n X 21 0 0 %
x
n I n _ a
L
Function library LenzeDrive.lib
a
Analog signal processing
2.2.9Curve function (L_CURVE)
2.2.9.3Characteristic with four co−ordinates
byFunction = 3
y
n O u t _ a
- 1 0 0 %
Fig. 2−18Line diagram characteristic with 4 co−ordinates
- n X 1- n X 2
n Y 1 0 0
n Y 1
n Y 0
n Y 2
y 0
- n Y 2
- n Y 0
- n Y 1
- n Y 1 0 0
y 1 0 0
y 1
y 2
x 1x 2
n X 1n X 2 1 0 0 %
x
n I n _
L
LenzeDrive.lib EN 1.7
2−19
Function library LenzeDrive.lib
Analog signal processing
2.2.10Dead−band (L_DB)
2.2.10Dead−band (L_DB)
This FB eliminates disturbances around the zero point (e.g. interfering influences on analog input
voltages).
Fig. 2−19Dead band (L_DB)
VariableNameDataTypeSignalTypeVariableTypeNote
nIn_aIntegeranalogVAR_INPUT
nOut_aIntegeranalogVAR_OUTPUTThe signal is limited to ±32767.
nGainInteger−VAR CONSTANT RETAIN Gain
nDeadBandInteger−VAR CONSTANT RETAINDead band