Lenze DDS Function library Drive User Manual

L
Manual
Global Drive PLC Developer Studio
Global Drive
Function library
LenzeDrive.lib
Type as of hardware version as of software version
9300 Servo PLC EVS93XX−xI 2K 1.0 9300 Servo PLC EVS93XX−xT 2K 1.0 Drive PLC EPL10200 VA 1.0 ECSxA ECSxAxxx 1C 7.0
Important note:
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.
Version 1.7 07/2006
Function library LenzeDrive.lib

Contents

1 Preface and general information 1−1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1 About this Manual 1−1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.1 Conventions used in this Manual 1−1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.2 Description layout 1−2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.3 Pictographs used in this Manual 1−2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.4 Terminology used 1−2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Lenze software guidelines for variable names 1−3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.1 Hungarian Notation 1−3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.1.1 Recommendation for designating variable types 1−4 . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.1.2 Designation of the signal type in the variable name 1−5 . . . . . . . . . . . . . . . . . . . . . . .
1.2.1.3 Special handling of system variables 1−5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Version identifiers of the function library 1−6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Function blocks 2−1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1 General signal processing 2−2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.1 Programming fixed setpoints (L_FIXSET) 2−2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Analog signal processing 2−4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1 Absolute value generation (L_ABS) 2−4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.2 Addition (L_ADD) 2−5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.3 Input gain and offset (L_AIN) 2−6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.4 Inversion (L_ANEG) 2−8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.5 Output gain and offset (L_AOUT) 2−9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.6 Arithmetic (L_ARIT) 2−11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.7 Changeover (L_ASW) 2−12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.8 Comparison (L_CMP) 2−13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.9 Curve function (L_CURVE) 2−17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.10 Dead−band (L_DB) 2−20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.11 Differentiation (L_DT1_) 2−21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.12 Limiting (L_LIM) 2−22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.13 Delay (L_PT1_) 2−23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.14 Ramp generator (L_RFG) 2−24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.15 Sample & Hold (L_SH) 2−26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.16 S−ramp generator (L_SRFG) 2−27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 Digital signal processing 2−29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.1 Logical AND (L_AND) 2−29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.2 Delay (L_DIGDEL) 2−30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.3 Up/down counter (L_FCNT) 2−32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.4 Flip−flop (L_FLIP) 2−33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.5 Logical NOT (L_NOT) 2−34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.6 Logical OR (L_OR) 2−35 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.7 Edge evaluation (L_TRANS) 2−36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4 Processing of phase−angle signals 2−38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.1 Arithmetic (L_ARITPH) 2−38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.2 Addition (L_PHADD) 2−39 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.3 Comparison (L_PHCMP) 2−40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.4 Difference (L_PHDIFF) 2−41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.5 Division (L_PHDIV) 2−42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.6 Integration (L_PHINT) 2−43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.7 Integration (L_PHINTK) 2−45 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
l
LenzeDrive.lib EN 1.7
i
Function library LenzeDrive.lib
Contents
2.5 Signal conversion 2−49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5.1 Normalization (L_CONV) 2−49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5.2 Conversion of phase−angle to analog (L_CONVPA) 2−50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5.3 Conversion of a phase−angle signal (L_CONVPP) 2−51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5.4 Conversion (L_CONVVV) 2−52 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5.5 Normalization with limiting (L_CONVX) 2−53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6 Communication 2−54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.1 Type conversion (L_ByteArrayToDint) 2−54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.2 Type conversion (L_DintToByteArray) 2−54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.3 Code index (L_FUNCodeIndexConv) 2−54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.4 Read codes (L_ParRead) 2−55 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.5 Write codes (L_ParWrite) 2−59 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7 Special functions 2−63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7.1 Transparent mode with keypad 9371BB/9371BC (L_Display9371BB) 2−63 . . . . . . . . . . . . . . . . . . . .
2.7.2 Fault trigger (L_FWM) 2−68 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7.3 Motor potentiometer (L_MPOT) 2−70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7.4 Speed preconditioning (L_NSET) 2−73 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7.5 Process controller (L_PCTRL) 2−79 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7.6 Right/Left/Quickstop (L_RLQ) 2−83 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Appendix 3−1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1 Code table 3−1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Index 4−1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ii
LenzeDrive.lib EN 1.7
l
Function library LenzeDrive.lib
Preface and general information

1.1 About this Manual

1 Preface and general information

1.1 About this Manual
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 application offline 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.1 Conventions 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 name L_ARIT1 L_ARIT2 Setting range Lenze
byFunction C0338 C0600 0 ... 5 1
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.1 About this Manual
1.1.2 Description layout
All function/function block and system block descriptions contained in this Manual have the same structure:
 
Function Function block (FB)/
Heading stating function and function identifier
Declaration of the function:
Data type of the return valueFunction identifierList of transfer parameters
Short description of the most important properties
Function chart including all
associated variables
Transfer parametersReturn value
Table giving information about the
transfer parameters:
IdentifiersData typePossible settingsInfo
Table giving information about the
return value:
Data type of the return valuePossible return values and their
meaning
Additional information
(Notes, tips, application examples, etc.)
system block (SB)
FB/SB chart including all associated variables
Input variablesOutput variables
Table giving information about the input and output variables:
IdentifiersData typeVariable typePossible settingsInfo
1.1.3 Pictographs used in this Manual
Pictographs used Signal words
Warning of material damage
Other notes Tip!
Stop! Warns of potential damage to material.
Note!
1.1.4 Terminology used
Term In the following text used for
DDS Drive PLC Developer Studio FB Function block GDC Global Drive Control (parameterization program from Lenze) Parameter codes Codes for setting the functionality of a function block PLC 9300 Servo PLC
SB System block
Drive PLCECSxA "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.2 Lenze software guidelines for variable names

1.2 Lenze 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.1 Hungarian 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.
Prefix examples
prefix Meaning
a Array (combined type), field p Pointer
L
LenzeDrive.lib EN 1.7
1−3
Function library LenzeDrive.lib
Preface and general information
1.2 Lenze software guidelines for variable names
Examples of the data−type entry
Examples of a data−type Meaning
b Bool by Byte n Integer w Word dn Double integer dw Double word s String f Real (float) sn Short integer t Time un Unsigned integer udn Unsigned double integer usn Unsigned short integer
Identifier (the proper variable name)
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.1 Recommendation 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:
I_<Variablename> VAR_INPUT Q_<Variablename> VAR_OUTPUT IQ_<Variablename> VAR_IN_OUT R_<Variablename> VAR RETAIN C_<Variablename> VAR CONSTANT CR_<Variablename> VAR CONSTANT RETAIN g_<Variablename> VAR_GLOBAL gR_<Variablename> VAR_GLOBAL RETAIN gC_<Variablename> VAR_GLOBAL CONSTANT gCR_<Variablename> VAR_GLOBAL CONSTANT RETAIN
1−4
Example
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.2 Lenze software guidelines for variable names
1.2.1.2 Designation 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 type Ending Previous 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
H G F E
max
Examples:
Variable name Signal type Type of variable
nIn_a Analog input value Integer dnPhiSet_p Phase signals Double integer bLoad_b Binary value (TRUE/FALSE) Bool nDigitalFrequencyIn_v Speed input value Integer
1.2.1.3 Special handling of system variables
System variables require special handling, since the system functions are only available for the user as I/O connections in the control configuration.
In order to be able to access a system variable quickly during programming, the variable name must include a label for the system function.
For this reason, the name of the corresponding system block is placed before the name of the variable.
Examples:
AIN1_nIn_a
CAN1_bCtrlTripSet_b
DIGIN_bIn3_b
L
LenzeDrive.lib EN 1.7
1−5
Function library LenzeDrive.lib
Preface and general information

1.3 Version identifiers of the function library

1.3 Version identifiers of the function library
The version of the function library can be found under the global constant C_w[Function library name]Version .
Version identifiers as of PLC software version 7.x:
Constant Meaning
C_w[FunctionLibraryName]VersionER External Release 01
C_w[FunctionLibraryName]VersionEL External Level 05
C_w[FunctionLibraryName]VersionIR Internal Release 00
C_w[FunctionLibraryName]VersionBN Build No. 00
The value of this constant is a hexadecimal code.
In the example, "01050000" stands for version "1.05".
Example value
Version: 01 05 00 00
1−6
LenzeDrive.lib EN 1.7
L

2 Function blocks

Note!
Due to their internal structure, the below function blocks have to be called in a time−equidistant task (e.g. in a 5−ms task):
L_DIGDELL_DT1_L_MPOTL_NSETL_ParReadL_ParWriteL_PCTRLL_PHDIFFL_PHINTL_PHINTKL_PT1_L_RFGL_SRFGL_TRANS
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.1 Programming fixed setpoints (L_FIXSET)

2.1 General signal processing

2.1.1 Programming 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 controlDifferent stretch ratios (gearbox factor) when using a speed ratio control with digital frequency
coupling
Fig. 2−1 Programming fixed setpoints (L_FIXSET)
VariableName DataType SignalType VariableType Note
nAin_a Integer analog VAR_INPUT nAin_a is connected to nOut_a , if (bIn1_b ... bIn4_b)
bIn1_b Bool binary VAR_INPUT bIn2_b Bool binary VAR_INPUT bIn3_b Bool binary VAR_INPUT bIn4_b Bool binary VAR_INPUT nOut_a Integer analog VAR_OUTPUT anSollW[1...15] Array of integers VAR CONSTANT RETAIN Variable that can have fixed setpoints assigned to
Parameter codes of the instances
VariableName L_FIXSET1 SettingRange Lenze
anSollW[1...15] C0560/1 ... 15 −199.99 ... 199.99 % 0.00
Function
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.1 Programming fixed setpoints (L_FIXSET)
2.1.1.1 Enable of the fixed setpoints
Number of required fixed setpoints Number of the inputs to be assigned
1 at least 1
1 ... 3 at least 2
4 ... 7 at least 3
8 ... 15 4
Decoding table of the binary input signals:
Output signal nOut_a =
nAin_a 0 0 0 0
anSollW1 1 0 0 0
anSollW2 0 1 0 0
anSollW3 1 1 0 0
anSollW4 0 0 1 0
anSollW5 1 0 1 0
anSollW6 0 1 1 0
anSollW7 1 1 1 0
anSollW8 0 0 0 1
anSollW9 1 0 0 1
anSollW10 0 1 0 1
anSollW11 1 1 0 1
anSollW12 0 0 1 1
anSollW13 1 0 1 1
anSollW14 0 1 1 1
anSollW15 1 1 1 1
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.1 Absolute value generation (L_ABS)

2.2 Analog signal processing

2.2.1 Absolute value generation (L_ABS)
This FB converts bipolar values into unipolar values. It calculates the absolute value of the input signal.
Fig. 2−2 Absolute value generation (L_ABS)
VariableName DataType SignalType VariableType Note
nIn_a Integer analog VAR_INPUT nOut_a Integer analog VAR_OUTPUT
n I n _ a
L _ A B S
n O u t _ a
2−4
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Analog signal processing
2.2.2 Addition (L_ADD)
2.2.2 Addition (L_ADD)
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−3 Addition (L_ADD)
VariableName DataType SignalType VariableType Note
nIn1_a Integer analog VAR_INPUT Addition input nIn2_a Integer analog VAR_INPUT Addition input nIn3_a Integer analog VAR_INPUT Subtraction input nOut_a Integer analog VAR_OUTPUT Signal 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.3 Input gain and offset (L_AIN)
2.2.3 Input 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−4 Input gain and offset (L_AIN)
VariableName DataType SignalType VariableType Note
nIn_a Integer analog VAR_INPUT Input signal nOffset_a Integer analog VAR_INPUT Offset of the input signal nGain_a Integer analog VAR_INPUT Gain of the input signal nOut_a Integer analog VAR_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−5 Offset 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.3 Input 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.4 Inversion (L_ANEG)
2.2.4 Inversion (L_ANEG)
This FB inverts the sign of an input value. The input value is multiplied by −1 and then output.
Fig. 2−6 Inversion (L_ANEG)
VariableName DataType SignalType VariableType Note
nIn_a Integer analog VAR_INPUT nOut_a Integer analog VAR_OUTPUT
n I n _ a
* ( - 1 )
L _ A N E G
n O u t _ a
2−8
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Analog signal processing
2.2.5 Output gain and offset (L_AOUT)
2.2.5 Output gain and offset (L_AOUT)
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−7 Output gain and offset (L_AOUT)
VariableName DataType SignalType VariableType Note
nIn_a Integer analog VAR_INPUT Input signal nGain_a Integer analog VAR_INPUT Gain of the input signal nOffset_a Integer analog VAR_INPUT Offset of the input signal nOut_a Integer analog VAR_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−8 Offset and gain of the analog output
L
LenzeDrive.lib EN 1.7
2−9
Function library LenzeDrive.lib
Analog signal processing
2.2.5 Output 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.6 Arithmetic (L_ARIT)
2.2.6 Arithmetic (L_ARIT)
This FB can arithmetically combine two analog signals.
Fig. 2−9 Arithmetic (L_ARIT)
VariableName DataType SignalType VariableType Note
nIn1_a Integer analog VAR_INPUT nIn2_a Integer analog VAR_INPUT nOut_a Integer analog VAR_OUTPUT The signal is limited to ±32767. byFunction Byte VAR CONSTANT RETAIN Selection of the function
Parameter codes of the instances
VariableName L_ARIT1 L_ARIT2 SettingRange Lenze
byFunction C0338 C0600 0 ... 5 1
Function
Selection of the function Arithmetic function Notes
byFunction = 0 nOut_a = nIn1_a byFunction = 1 nOut_a = nIn1_a + nIn2_a byFunction = 2 nOut_a = nIn1_a − nIn2_a byFunction = 3
byFunction = 4
byFunction = 5
nOut_a +
nOut_a +
nOut_a +
nIn1_a
nIn2_a
byFunction
x
+
y
(nIn1_a) @ (nIn2_a)
16384
nIn1_a
@ 164
|
|
nIn2 a
nIn1_a
16384 * nIn2_a
L_ARIT
±32767
­*
x/(1-y)/
nOut_a
If the denominator = 0, the denominator is set = 1.
@ 16384
Function in ST
CASE byFunktion OF
0: nOut_a:=nIn1_a;
1: nOut_a:= DINT_TO_INT ( LIMIT (−32767,( INT_TO_DINT (nIn1_a)+ INT_TO_DINT (nIn2_a)),32767));
2: nOut_a:= DINT_TO_INT ( LIMIT (−32767,( INT_TO_DINT (nIn1_a)− INT_TO_DINT (nIn2_a)),32767));
3: nOut_a:= DINT_TO_INT ( LIMIT (−32767,(( INT_TO_DINT (nIn1_a)* INT_TO_DINT (nIn2_a))/16384),32767));
4: IF (nIN2_a=0) THEN nOut_a= DINT_TO_INT ( LIMIT (−32767,(( INT_TO_DINT (nIn1_a)*164)),32767)); ELSE nOut_a= DINT_TO_INT ( LIMIT (−32767,(( INT_TO_DINT (nIn1_a)*164)/ ABS (nIn2_a)),32767)); END_IF
5: IF (16384− INT_TO_DINT (nIn2_a)=0) THEN nOut_a= DINT_TO_INT ( LIMIT (−32767,(( INT_TO_DINT (nIn1_a)*16384),32767)); ELSIF (16384− INT_TO_DINT (nIn2_a)>32767) THEN nOut_a= DINT_TO_INT ( LIMIT (−32767,(( INT_TO_DINT (nIn1_a)*16384/32767),32767)); ELSIF (16384− INT_TO_DINT (nIn2_a)<−32767) THEN nOut_a= DINT_TO_INT ( LIMIT (−32767,(( INT_TO_DINT (nIn1_a)*16384/−32767),32767)); ELSE nOut_a= DINT_TO_INT ( LIMIT (−32767,(( INT_TO_DINT (nIn1_a)*16384)/(16384− INT_TO_DINT (nIn2_a))) END_IF
END_CASE ;
L
LenzeDrive.lib EN 1.7
2−11
Function library LenzeDrive.lib
Analog signal processing
2.2.7 Changeover (L_ASW)
2.2.7 Changeover (L_ASW)
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.
Fig. 2−10 Changeover (L_ASW)
VariableName DataType SignalType VariableType Note
nIn1_a Integer analog VAR_INPUT nIn2_a Integer analog VAR_INPUT bSet_b Bool binary VAR_INPUT nOut_a Integer analog VAR_OUTPUT
Function
Control signal Output signal
bSet_b = TRUE nOut_a = nIn2_a bSet_b = FALSE nOut_a = nIn1_a
n I n 1 _ a
n I n 2 _ a
b S e t _ b
L _ A S W
0
n O u t _ a
1
2−12
LenzeDrive.lib EN 1.7
L
Function library LenzeDrive.lib
Analog signal processing
2.2.8 Comparison (L_CMP)
2.2.8 Comparison (L_CMP)
This FB compares two integer values with each other. You can use comparators to implement threshold switches.
Fig. 2−11 Comparison (L_CMP)
VariableName DataType SignalType VariableType Note
nIn1_a Integer analog VAR_INPUT nIn2_a Integer analog VAR_INPUT bOut_b Bool binary VAR_OUTPUT byFunction Byte VAR CONSTANT RETAIN Comparison function for the inputs nHysteresis Integer VAR CONSTANT RETAIN Hysteresis function nWindow Integer VAR CONSTANT RETAIN Window function
Parameter codes of the instances
VariableName L_CMP1 L_CMP2 L_CMP3 SettingRange Lenze
byFunction C0680 C0685 C0690 1 ... 6 6 nHysteresis C0681 C0686 C0691 0.00 ... 100.00 % 1.00 nWindow C0682 C0687 C0692 0.00 ... 100.00 % 1.00
Function
Selection of the function Comparison function
byFunction = 1 nIn1_a = nIn2_a byFunction = 2 nIn1_a > nIn2_a byFunction = 3 nIn1_a < nIn2_a byFunction = 4 nIn1_a  = nIn2_a  byFunction = 5 nIn1_a  > nIn2_a  byFunction = 6 nIn1_a  < nIn2_a 
b y F u n c t i o n
n H y s t e r e s i s
n I n 1 _ a b O u t _ b
n I n 2 _ a
L _ C M P
n W i n d o w
L
LenzeDrive.lib EN 1.7
2−13
Function library LenzeDrive.lib
Analog signal processing
2.2.8 Comparison (L_CMP)
2.2.8.1 Function 1: nIn1_a = nIn2_a
Selection: byFunction = 1This 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−12 Equality 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.8 Comparison (L_CMP)
2.2.8.2 Function 2: nIn1_a > nIn2_a
Selection: byFunction = 2With 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−13 Signal 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_anHysteresis again, will bOut_b change from TRUE to FALSE.
2.2.8.3 Function 3: nIn1_a < nIn2_a
Selection: byFunction = 3With 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−14 Gone 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_anHysteresis 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.8 Comparison (L_CMP)
2.2.8.4 Function 4: |nIn1_a| = |nIn2_a|
Selection: byFunction = 4With this function, for instance, you can make the comparison "nThis 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.5 Function 5: |nIn1_a| > |nIn2_a|
Selection: byFunction = 5With 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.6 Function 6: |nIn1_a| < |nIn2_a|
Selection: byFunction = 6With 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.9 Curve function (L_CURVE)
2.2.9 Curve function (L_CURVE)
This FB converts an analog signal into a characteristic curve.
Fig. 2−15 Curve function (L_CURVE)
VariableName DataType SignalType VariableType Note
nIn_a Integer analog VAR_INPUT nOut_a Integer analog VAR_OUTPUT byFunction Byte VAR CONSTANT RETAIN Selection of the characteristic/curve function nY0 Integer VAR CONSTANT RETAIN Entry of Y0 from vector (0, Y0) nY1 Integer VAR CONSTANT RETAIN Entry of Y1 from vector (X1, Y1) nY2 Integer VAR CONSTANT RETAIN Entry of Y2 from vector (X2, Y2) nY100 Integer VAR CONSTANT RETAIN Entry of Y100 from vector (16384, Y100) nX1 Integer VAR CONSTANT RETAIN Entry of X1 from vector (X1, Y1) nX2 Integer VAR CONSTANT RETAIN Entry of X2 from vector (X2, Y2)
Parameter codes of the instances
nIn_a
Y0 = nY0 Y1 = nY1 Y2 = nY2 Y100 = nY100 X1 = nX1 X2 = nX2
byFunction
1
2
3
Characteristic 1
y
y100
y0
Characteristic 2
y
y100
y1
y0
x1
Characteristic 3
y
y100
y2
y1
y0
x1 x2
L_CURVE
x
1
2
3
x
x
nOut_a
VariableName L_CURVE1 SettingRange Lenze
byFunction C0960 1 ... 3 1 nY0 C0961 0 ... 199.99 % 0.00 nY1 C0962 0 ... 199.99 % 50.00 nY2 C0963 0 ... 199.99 % 75.00 nY100 C0964 0 ... 199.99 % 100.00 nX1 C0965 0.01 ... 99.99 % 50.00 nX2 C0966 0.01 ... 99.99 % 75.00
Function
Selection of the function Curve function Informationen for entry of the interpolation points
byFunction = 1 Characteristic with two co−ordinates ^ Fig. 2−16 byFunction = 2 Characteristic with three co−ordinates ^ Fig. 2−17 byFunction = 3 Characteristic 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.9 Curve function (L_CURVE)
2.2.9.1 Characteristic 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−16 Line diagram with 2 co−ordinates
2.2.9.2 Characteristic 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−17 Line 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 2 1 0 0 %
x
n I n _ a
L
Function library LenzeDrive.lib
a
Analog signal processing
2.2.9 Curve function (L_CURVE)
2.2.9.3 Characteristic with four co−ordinates
byFunction = 3
y
n O u t _ a
- 1 0 0 %
Fig. 2−18 Line 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 1 x 2
n X 1 n 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.10 Dead−band (L_DB)
2.2.10 Dead−band (L_DB)
This FB eliminates disturbances around the zero point (e.g. interfering influences on analog input voltages).
Fig. 2−19 Dead band (L_DB)
VariableName DataType SignalType VariableType Note
nIn_a Integer analog VAR_INPUT nOut_a Integer analog VAR_OUTPUT The signal is limited to ±32767. nGain Integer VAR CONSTANT RETAIN Gain nDeadBand Integer VAR CONSTANT RETAIN Dead band
Parameter codes of the instances
VariableName L_DB1 SettingRange Lenze
nGain C0620 −10.00 ... 10.00 1.00 nDeadBand C0621 0 ... 100.00 % 1.00
Function
n G a i n = 1 , 0 0 n D e a d B a n d = 6 , 1 0 % = 1 0 0 0
n O u t _ a
n D e a d B a n d
nIn_a
nGain
nDeadBand
±32767
L_DB
nOut_a
n G a i n = 2 , 0 0 n D e a d B a n d = 0 %
n O u t _ a
n G a i n
n D e a d B a n d
Fig. 2−20 Dead band and gain
In nDeadBand you can set the parameters for the dead band.In nGain you can alter the gain.100 % corresponds to 16384.
n I n _ a
n I n _ a
2−20
LenzeDrive.lib EN 1.7
L
Loading...
+ 73 hidden pages