You are on page 1of 103

efesotomasyon.

com - Lenze

L
Manual

Global Drive PLC Developer Studio

Global Drive
Function library

LenzeDrive.lib

efesotomasyon.com - Lenze

The function library LenzeDrive.lib can be used for the following Lenze PLC devices:
9300 Servo PLC 9300 Servo PLC Drive PLC ECSxA Type EVS93XXxI EVS93XXxT EPL10200 ECSxAxxx as of hardware version 2K 2K VA 1C as of software version 1.0 1.0 1.0 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

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Contents

1 Preface and general information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


1.1 About this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 Conventions used in this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.2 Description layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.3 Pictographs used in this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.4 Terminology used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Lenze software guidelines for variable names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.1 Hungarian Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.1.1 Recommendation for designating variable types . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.1.2 Designation of the signal type in the variable name . . . . . . . . . . . . . . . . . . . . . . . 1.2.1.3 Special handling of system variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Version identifiers of the function library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11
11 11 12 12 12 13 13 14 15 15 16

1.2

1.3

2 Function blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1 2.2 General signal processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Programming fixed setpoints (L_FIXSET) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Analog signal processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Absolute value generation (L_ABS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Addition (L_ADD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Input gain and offset (L_AIN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.4 Inversion (L_ANEG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.5 Output gain and offset (L_AOUT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.6 Arithmetic (L_ARIT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.7 Changeover (L_ASW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.8 Comparison (L_CMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.9 Curve function (L_CURVE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.10 Deadband (L_DB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.11 Differentiation (L_DT1_) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.12 Limiting (L_LIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.13 Delay (L_PT1_) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.14 Ramp generator (L_RFG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.15 Sample & Hold (L_SH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.16 Sramp generator (L_SRFG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Digital signal processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Logical AND (L_AND) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2 Delay (L_DIGDEL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.3 Up/down counter (L_FCNT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.4 Flipflop (L_FLIP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.5 Logical NOT (L_NOT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.6 Logical OR (L_OR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.7 Edge evaluation (L_TRANS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Processing of phaseangle signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 Arithmetic (L_ARITPH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.2 Addition (L_PHADD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.3 Comparison (L_PHCMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.4 Difference (L_PHDIFF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.5 Division (L_PHDIV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.6 Integration (L_PHINT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.7 Integration (L_PHINTK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

21
22 22 24 24 25 26 28 29 211 212 213 217 220 221 222 223 224 226 227 229 229 230 232 233 234 235 236 238 238 239 240 241 242 243 245

2.3

2.4

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Contents

2.5

Signal conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.1 Normalization (L_CONV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.2 Conversion of phaseangle to analog (L_CONVPA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.3 Conversion of a phaseangle signal (L_CONVPP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.4 Conversion (L_CONVVV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.5 Normalization with limiting (L_CONVX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.1 Type conversion (L_ByteArrayToDint) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.2 Type conversion (L_DintToByteArray) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.3 Code index (L_FUNCodeIndexConv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.4 Read codes (L_ParRead) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.5 Write codes (L_ParWrite) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Special functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.1 Transparent mode with keypad 9371BB/9371BC (L_Display9371BB) . . . . . . . . . . . . . . . . . . . . 2.7.2 Fault trigger (L_FWM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.3 Motor potentiometer (L_MPOT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.4 Speed preconditioning (L_NSET) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.5 Process controller (L_PCTRL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.6 Right/Left/Quickstop (L_RLQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

249 249 250 251 252 253 254 254 254 254 255 259 263 263 268 270 273 279 283

2.6

2.7

3 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1 Code table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31
31

4 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

41

ii

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Preface and general information
1.1 About this Manual

1
1.1

Preface and general information


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

The function blocks are based on the functions that are available in the 9300 servo inverter
In the Drive PLC Developer Studio (DDS) you make the basic settings for your drive application offline by using variables (in accordance with the IEC611313 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 byFunction L_ARIT1 C0338 L_ARIT2 C0600 Setting range 0 ... 5 Lenze 1

You can access these codes online with Global Drive Control (GDC) or keypad.

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

11

efesotomasyon.com - Lenze

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 block (FB)/ system block (SB) Heading stating function and function identifier Function

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

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

1.1.3

Pictographs used in this Manual


Pictographs used Warning of material damage Other notes Signal words Stop! Warns of potential damage to material. Possible consequences if disregarded: Damage to the controller/drive system or its environment. Tip! Note! Indicates a tip or note.

1.1.4

Terminology used
Term DDS FB GDC Parameter codes PLC In the following text used for Drive PLC Developer Studio Function block Global Drive Control (parameterization program from Lenze) Codes for setting the functionality of a function block 9300 Servo PLC Drive PLC ECSxA "Application" axis module System block

SB

12

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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, phaseangle 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 611313 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 Lenzespecific 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 datatype entry and an identifier


The prefix and datatype 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 a p Meaning Array (combined type), field Pointer

LenzeDrive.lib EN 1.7

13

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Preface and general information
1.2 Lenze software guidelines for variable names

Examples of the datatype entry


Examples of a datatype b by n w dn dw s f sn t un udn usn Meaning Bool Byte Integer Word Double integer Double word String Real (float) Short integer Time Unsigned integer Unsigned double integer 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 Bool Word Integer Byte anJogValue[10] ; bIsEmpty ; wNumberOfValues ; nLoop ; 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> Q_<Variablename> IQ_<Variablename> R_<Variablename> C_<Variablename> CR_<Variablename> g_<Variablename> gR_<Variablename> gC_<Variablename> gCR_<Variablename> VAR_INPUT VAR_OUTPUT VAR_IN_OUT VAR RETAIN VAR CONSTANT VAR CONSTANT RETAIN VAR_GLOBAL VAR_GLOBAL RETAIN VAR_GLOBAL CONSTANT VAR_GLOBAL CONSTANT RETAIN

Example for a global array of type integer that includes fixed setpoints (analog) for a speed setting: g_anFixSetSpeedValue_a

14

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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 analog digital Phaseangle difference or speed Phaseangle or position Ending _a _b _v _p (analog) (binary) (velocity) (position) Previous designation

H G F E

Tip!
Normalizing to signal type phaseangle difference/speed: 16384 (INT) 15000 rpm Normalizing to signal type analog: 16384 100 % value under [C0011] = nmax Normalizing to signal type angle or position: 65536 1 motor revolution Examples:
Variable name nIn_a dnPhiSet_p bLoad_b nDigitalFrequencyIn_v Signal type Analog input value Phase signals Binary value (TRUE/FALSE) Speed input value Type of variable Integer Double integer Bool 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

LenzeDrive.lib EN 1.7

15

efesotomasyon.com - Lenze

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 C_w[Function library name]Version . Version identifiers as of PLC software version 7.x:
Constant C_w[FunctionLibraryName]VersionER C_w[FunctionLibraryName]VersionEL C_w[FunctionLibraryName]VersionIR C_w[FunctionLibraryName]VersionBN Meaning External Release External Level Internal Release Build No. Example value 01 05 00 00 Version: 01 05 00 00

be

found

under

the

global

constant

The value of this constant is a hexadecimal code.

In the example, "01050000" stands for version "1.05".

16

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Function blocks

Function blocks
Note!
Due to their internal structure, the below function blocks have to be called in a timeequidistant task (e.g. in a 5ms task):

L_DIGDEL L_DT1_ L_MPOT L_NSET L_ParRead L_ParWrite L_PCTRL L_PHDIFF L_PHINT L_PHINTK L_PT1_ L_RFG L_SRFG L_TRANS
Caution: The cyclic task PLC_PRG is not timeequidistant!

LenzeDrive.lib EN 1.7

21

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


General signal processing
2.1.1 Programming fixed setpoints (L_FIXSET)

2.1
2.1.1

General signal processing


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 control Different stretch ratios (gearbox factor) when using a speed ratio control with digital frequency
coupling
nAin_a
anSollW1 anSollW2

L_FIXSET
nOut_a

bIn1_b bIn2_b bIn3_b bIn4_b

DMUX
0

anSollW15

0 FIXSET1...15 15 3

Fig. 21

Programming fixed setpoints (L_FIXSET) VariableName nAin_a bIn1_b bIn2_b bIn3_b bIn4_b nOut_a anSollW[1...15] DataType Integer Bool Bool Bool Bool Integer Array of integers SignalType analog binary binary binary binary analog VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN Note nAin_a is connected to nOut_a , if (bIn1_b ... bIn4_b) FALSE is on all the selection inputs. The number of inputs to be assigned depends on the number of required fixed setpoints.

Variable that can have fixed setpoints assigned to them.

Parameter codes of the instances


VariableName anSollW[1...15] L_FIXSET1 C0560/1 ... 15 SettingRange 199.99 ... 199.99 % Lenze 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. (^ 273: 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 . (^ 23)

Range:
You can enter values from 199.99% ... 199.99% (100 % corresponds to 16384).

22

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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 1 1 ... 3 4 ... 7 8 ... 15 Number of the inputs to be assigned at least 1 at least 2 at least 3 4

Decoding table of the binary input signals:


Output signal nOut_a = nAin_a anSollW1 anSollW2 anSollW3 anSollW4 anSollW5 anSollW6 anSollW7 anSollW8 anSollW9 anSollW10 anSollW11 anSollW12 anSollW13 anSollW14 anSollW15 0 = FALSE 1 = TRUE 1st input bIn1_b 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2nd input bIn2_b 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 3rd input bIn3_b 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 4th input bIn4_b 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

LenzeDrive.lib EN 1.7

23

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.1 Absolute value generation (L_ABS)

2.2
2.2.1

Analog signal processing


Absolute value generation (L_ABS)
This FB converts bipolar values into unipolar values. It calculates the absolute value of the input signal.
L _ A B S
n In _ a n O u t_ a

Fig. 22

Absolute value generation (L_ABS) VariableName nIn_a nOut_a DataType Integer Integer SignalType analog analog VariableType VAR_INPUT VAR_OUTPUT Note

24

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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.
3 2 7 6 7 n In 1 _ a n In 2 _ a n In 3 _ a
+ +

L _ A D D

n O u t_ a

Fig. 23

Addition (L_ADD) VariableName nIn1_a nIn2_a nIn3_a nOut_a DataType Integer Integer Integer Integer SignalType analog analog analog analog VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note Addition input Addition input Subtraction input 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.

LenzeDrive.lib EN 1.7

25

efesotomasyon.com - Lenze

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.
L_AIN
nIn_a nOffset_a nGain_a + + nOut_a

Fig. 24

Input gain and offset (L_AIN) VariableName nIn_a nOffset_a nGain_a nOut_a DataType Integer Integer Integer Integer SignalType analog analog analog analog VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note Input signal Offset of the input signal Gain of the input signal

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

nGain_a

Fig. 25

Offset and gain of the analog input

26

LenzeDrive.lib EN 1.7


nOffset_a

nIn_a

efesotomasyon.com - Lenze

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

LenzeDrive.lib EN 1.7

27

efesotomasyon.com - Lenze

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.
n In _ a

L _ A N E G

*(-1 )

n O u t_ a

Fig. 26

Inversion (L_ANEG) VariableName nIn_a nOut_a DataType Integer Integer SignalType analog analog VariableType VAR_INPUT VAR_OUTPUT Note

28

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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

Fig. 27

Output gain and offset (L_AOUT) VariableName nIn_a nGain_a nOffset_a nOut_a DataType Integer Integer Integer Integer SignalType analog analog analog analog VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note Input signal Gain of the input signal Offset of the input signal

Function

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 [100 % @ 100 % + 100 %]

The result of the multiplication is limited to 214

Offset
The limited value (after amplification) is added to the value at nOffset_a The result of the addition is limited to 214

Next, the signal is limited to 214 and output to nOut_a .

nOut_a

nGain_a

Fig. 28

Offset and gain of the analog output

LenzeDrive.lib EN 1.7

nOffset_a

nIn_a

29

efesotomasyon.com - Lenze

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

210

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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.
nIn1_a x + nIn2_a y / byFunction

L_ARIT
32767 nOut_a

x/(1-y)

Fig. 29

Arithmetic (L_ARIT) VariableName nIn1_a nIn2_a nOut_a byFunction DataType Integer Integer Integer Byte SignalType analog analog analog VariableType VAR_INPUT VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN Note

The signal is limited to 32767. Selection of the function

Parameter codes of the instances


VariableName byFunction L_ARIT1 C0338 L_ARIT2 C0600 SettingRange 0 ... 5 Lenze 1

Function
Selection of the function byFunction = 0 byFunction = 1 byFunction = 2 byFunction = 3 byFunction = 4 byFunction = 5 Arithmetic function nOut_a = nIn1_a nOut_a = nIn1_a + nIn2_a nOut_a = nIn1_a nIn2_a nOut_a + (nIn1_a) @ (nIn2_a) 16384 nIn1_a nOut_a + | @ 164 nIn2 a| nIn1_a nOut_a + @ 16384 16384 * nIn2_a Notes

If the denominator = 0, the denominator is set = 1.

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 ELSIF (16384 INT_TO_DINT (nIn2_a)>32767) THEN nOut_a= DINT_TO_INT ( LIMIT (32767,(( INT_TO_DINT ELSIF (16384 INT_TO_DINT (nIn2_a)<32767) THEN nOut_a= DINT_TO_INT ( LIMIT (32767,(( INT_TO_DINT ELSE nOut_a= DINT_TO_INT ( LIMIT (32767,(( INT_TO_DINT END_IF END_CASE ; (nIn1_a)*16384),32767)); (nIn1_a)*16384/32767),32767)); (nIn1_a)*16384/32767),32767)); (nIn1_a)*16384)/(16384 INT_TO_DINT (nIn2_a)))

LenzeDrive.lib EN 1.7

211

efesotomasyon.com - Lenze

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.
n In 1 _ a
0 1

L _ A S W
n O u t_ a

n In 2 _ a b S e t_ b

Fig. 210

Changeover (L_ASW) VariableName nIn1_a nIn2_a bSet_b nOut_a DataType Integer Integer Bool Integer SignalType analog analog binary analog VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note

Function
Control signal bSet_b = TRUE bSet_b = FALSE Output signal nOut_a = nIn2_a nOut_a = nIn1_a

212

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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.
b y F u n c tio n n H y s te r e s is n W in d o w n In 1 _ a n In 2 _ a

L _ C M P
b O u t_ b

Fig. 211

Comparison (L_CMP) VariableName nIn1_a nIn2_a bOut_b byFunction nHysteresis nWindow DataType Integer Integer Bool Byte Integer Integer SignalType analog analog binary VariableType VAR_INPUT VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note

Comparison function for the inputs Hysteresis function Window function

Parameter codes of the instances


VariableName byFunction nHysteresis nWindow L_CMP1 C0680 C0681 C0682 L_CMP2 C0685 C0686 C0687 L_CMP3 C0690 C0691 C0692 SettingRange 1 ... 6 0.00 ... 100.00 % 0.00 ... 100.00 % Lenze 6 1.00 1.00

Function
Selection of the function byFunction = 1 byFunction = 2 byFunction = 3 byFunction = 4 byFunction = 5 byFunction = 6 Comparison function nIn1_a = nIn2_a nIn1_a > nIn2_a nIn1_a < nIn2_a nIn1_a = nIn2_a nIn1_a > nIn2_a nIn1_a < nIn2_a

LenzeDrive.lib EN 1.7

213

efesotomasyon.com - Lenze

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 = 1 This function compares two signals for equality. For instance, you can make the V comparison
"actual speed is equal to set speed" (nact = nset).

The exact function can be seen in the diagram. (^Fig. 212)


nHysteresis nWindow nWindow nHysteresis

nIn2_a

nIn1_a

nIn1_a nHysteresis nWindow nIn2_a nWindow nHysteresis

t bOut_b

Fig. 212

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.

Note!
With this function, you must use the FB in a fast task, to achieve optimum sampling of the signals.

214

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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 = 2 With this function, you can make the comparison "actual speed is above a limit" (nact > nx ) for
one direction of rotation.
nIn1_a nIn2_a nHysteresis bOut_b 1 bOut_b
nHysteresis

0 nIn2_a nIn1_a t

Fig. 213

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_a nHysteresis again, will bOut_b change from TRUE to FALSE.

2.2.8.3

Function 3: nIn1_a < nIn2_a


Selection: byFunction = 3 With this function, for instance, you can make the comparison "actual speed is below a limit"
(nact < nx ) for one direction of rotation.

nIn1_a nHysteresis nIn2_a bOut_b 1 bOutb_b nHysteresis t

0 nIn2_a nIn1_a t

Fig. 214

Gone below signal values (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.

LenzeDrive.lib EN 1.7

215

efesotomasyon.com - Lenze

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 = 4 With this function, for instance, you can make the comparison "nact = 0". This function is the same as function 1. (^ 214)
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 = 5 With this function, for instance, you can make the comparison "n act| > |nx |" independently of
the direction of rotation.

This function is the same as function 2. (^ 215)


However, the absolute value of the input signals (without sign) is generated here before the signal processing.

2.2.8.6

Function 6: |nIn1_a| < |nIn2_a|


Selection: byFunction = 6 With this function, you can make the comparison "nact| < |nx |" independently of the direction
of rotation.

This function is the same as function 3. (^ 215)


However, the absolute value of the input signals (without sign) is generated here before the signal processing.

216

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

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.
Characteristic 1
y y100

L_CURVE

y0

byFunction 1 nIn_a 2 3 Y0 Y1 Y2 Y100 X1 X2 = = = = = = nY0 nY1 nY2 nY100 nX1 nX2


y0 x1

Characteristic 2
y y1 y100

1 2 nOut_a

Characteristic 3
y y100 y2 y0 y1 x1 x2 x

Fig. 215

Curve function (L_CURVE) VariableName nIn_a nOut_a byFunction nY0 nY1 nY2 nY100 nX1 nX2 DataType Integer Integer Byte Integer Integer Integer Integer Integer Integer SignalType analog analog VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note

Selection of the characteristic/curve function Entry of Y0 from vector (0, Y0) Entry of Y1 from vector (X1, Y1) Entry of Y2 from vector (X2, Y2) Entry of Y100 from vector (16384, Y100) Entry of X1 from vector (X1, Y1) Entry of X2 from vector (X2, Y2)

Parameter codes of the instances


VariableName byFunction nY0 nY1 nY2 nY100 nX1 nX2 L_CURVE1 C0960 C0961 C0962 C0963 C0964 C0965 C0966 SettingRange 1 ... 3 0 ... 199.99 % 0 ... 199.99 % 0 ... 199.99 % 0 ... 199.99 % 0.01 ... 99.99 % 0.01 ... 99.99 % Lenze 1 0.00 50.00 75.00 100.00 50.00 75.00

Function
Selection of the function byFunction = 1 byFunction = 2 byFunction = 3 Curve function Characteristic with two coordinates Characteristic with three coordinates Characteristic with four interpolatio points Informationen for entry of the interpolation points ^ Fig. 216 ^ Fig. 217 ^ Fig. 218

100% corresponds to 16384. A linear interpolation is carried out between the coordinates. 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.

LenzeDrive.lib EN 1.7

217

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.9 Curve function (L_CURVE)

2.2.9.1

Characteristic with two coordinates


byFunction = 1
n O u t_ a y

n Y 1 0 0

y 1 0 0

n Y 0 -1 0 0 %

y 0

1 0 0 % -n Y 0

x n In _ a

-n Y 1 0 0

Fig. 216

Line diagram with 2 coordinates

2.2.9.2

Characteristic with three coordinates


byFunction = 2
n O u t_ a y

n Y 1 0 0 n Y 1 y 1

y 1 0 0

n Y 0 -1 0 0 % -n X 1

y 0 x 1 n X 2 -Y 0 1 0 0 % x n In _ a

-n Y 1 -n Y 1 0 0

Fig. 217

Line diagram with 3 coordinates

218

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.9 Curve function (L_CURVE)

2.2.9.3

Characteristic with four coordinates


byFunction = 3
n O u t_ a y

n Y 1 0 0 n Y 1 y 1

y 1 0 0

n Y 0 -1 0 0 % -n X 2 -n X 1 n Y 2

y 0 x 1 -n Y 2 -n Y 0 n X 1

y 2 n X 2

x 2 1 0 0 % x n In _ a

-n Y 1 -n Y 1 0 0

Fig. 218

Line diagram characteristic with 4 coordinates

LenzeDrive.lib EN 1.7

219

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.10 Deadband (L_DB)

2.2.10

Deadband (L_DB)
This FB eliminates disturbances around the zero point (e.g. interfering influences on analog input voltages).
nGain nDeadBand nIn_a

L_DB
32767 nOut_a

Fig. 219

Dead band (L_DB) VariableName nIn_a nOut_a nGain nDeadBand DataType Integer Integer Integer Integer SignalType analog analog VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note The signal is limited to 32767. Gain Dead band

Parameter codes of the instances


VariableName nGain nDeadBand L_DB1 C0620 C0621 SettingRange 10.00 ... 10.00 0 ... 100.00 % Lenze 1.00 1.00

Function
n O u t_ a n O u t_ a
n G a in

n G a in = 1 ,0 0 n D e a d B a n d = 6 ,1 0 % = 1 0 0 0

n D e a d B a n d

n G a in = 2 ,0 0 n D e a d B a n d = 0 %

n In _ a

n In _ a

n D e a d B a n d

Fig. 220

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.

220

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.11 Differentiation (L_DT1_)

2.2.11

Differentiation (L_DT1_)
This FB differentiates signals. You can use it, for instance, for the acceleration injection (dv/dt).
nGain bySensibility nDelayTime nIn_a

L_DT1_
32767 nOut_a

Fig. 221

Differentiation (L_DT1_) VariableName nIn_a nOut_a nGain nDelayTime bySensibility DataType Integer Integer Integer Integer Byte SignalType analog analog VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note The signal is limited to 32767. Gain K Delay time Tloss Input sensitivity of nIn_a The FB only evaluates the specified most significant bits, according to the setting.

Parameter codes of the instances


VariableName nGain nDelayTime bySensibility L_DT1_1 C0650 C0651 C0653 SettingRange 320.00 ... 320.00 0.005 ... 5.000 s 1 ... 7 Lenze 1.00 1.000 1

Function
Selection of the function bySensibility = 1 bySensibility = 2 bySensibility = 3 bySensibility = 4 bySensibility = 5 bySensibility = 6 bySensibility = 7 Function 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 bit 9 Bit

Tloss Fig. 222 Delay time Tloss of the 1st order differential section

LenzeDrive.lib EN 1.7

221

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.12 Limiting (L_LIM)

2.2.12

Limiting (L_LIM)
This FB limits signals to preset ranges of values. You can fix the range of values by defining an upper and a lower limit.
n M a x L im it n In _ a

L _ L IM
n O u t_ a

n M in L im it

Fig. 223

Limiting (L_LIM) VariableName nIn_a nOut_a nMaxLimit nMinLimit DataType Integer Integer Integer Integer SignalType analog/velocity analog/velocity VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note

Defines the upper limit. (100 % 16384) Defines the lower limit. (100 % 16384)

Parameter codes of the instances


VariableName nMaxLimit nMinLimit L_LIM1 C0630 C0631 SettingRange 199.99 ... 199.99 % 199.99 ... 199.99 % Lenze 100.00 100.00

Note!
The lower limit must always be set lower than the upper limit. Otherwise nOut_a is set = 0.

222

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.13 Delay (L_PT1_)

2.2.13

Delay (L_PT1_)
This FB filters and delays analog signals.
nDelayTime nIn_a

L_PT1_
nOut_a

Fig. 224

Delay (L_PT1_) VariableName nIn_a nOut_a nDelayTime DataType Integer Integer Integer SignalType analog analog VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN Note

Time constant

Parameter codes of the instances


VariableName nDelayTime L_PT1_1 C0640 SettingRange 0.01 ... 50.00 Lenze 20.00

Function

K=1

T Fig. 225 Delay T of the firstorder delay element

Use the constant nDelayTime to set the delay time. The proportional value is fixed at K = 1 .

LenzeDrive.lib EN 1.7

223

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.14 Ramp generator (L_RFG)

2.2.14

Ramp generator (L_RFG)


This FB functions as a ramp generator to control the rate of rise of signals.
d n T ir d n T if n In _ a
0

L _ R F G
n O u t_ a

n S e t_ a
1

b L o a d _ b

Fig. 226

Ramp generator (L_RFG) VariableName nIn_a nSet_a bLoad_b nOut_a dnTir dnTif DataType Integer Integer Boo Integer Double Integer Double Integer SignalType analog/velocity analog/velocity binary analog/velocity VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note

Acceleration time Tir Deceleration time Tif

Parameter codes of the instances


Variable name dnTir dnTif L_RFG1 C0671 C0672 SettingRange 0.000 ... 999.999 s 0.000 ... 999.999 s Lenze 0.000 0.000

Range of functions

Calculation and setting of the acceleration and deceleration times Loading of the ramp generator

224

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.14 Ramp generator (L_RFG)

2.2.14.1

Calculation and setting of the acceleration and deceleration times


The acceleration time and deceleration times refer to a change of the output value from 0 to 100 % (100% = 16384). The times to be set: Tir and Tif can be calculated from the formula in Fig. 227:
[%] nOut_a 100% w2

w1 0 t ir T ir t if T if t

T ir + t ir 100% w2 * w1 Fig. 227 Acceleration and deceleration times of L_RFG w1, w2 Change of the main setpoint, depending on tir resp. tif

T if + t if 100% w2 * w1

Here tir and tif are the required times for the change between w1 and w2. The calculated values Tir and Tif are entered under dnTir and dnTif.

2.2.14.2

Loading of the ramp generator


By using nSet_a and bLoad_b you can initialize the ramp generator with defined values.

As long as bLoad_b = TRUE, the signal at nSet_a is output to nOut_a. If bLoad_b is set = FALSE, then the ramp generator runs with the preset Titimes from the
loaded value through nSet_a to the value at nIn_a.

Note!
16384 100 % C0011 (nmax)

LenzeDrive.lib EN 1.7

225

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.15 Sample & Hold (L_SH)

2.2.15

Sample & Hold (L_SH)


This FB can store analog signals. The stored value is also available after mains disconnection.
n In _ a b L o a d _ b

L _ S H
S & H

n O u t_ a

n C u r V a lR e ta in

Fig. 228

Sample & Hold (L_SH) VariableName nIn_a bLoad_b nOut_a nCurValRetain DataType Integer Bool Integer Integer SignalType analog/velocity binary analog/velocity VariableType VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_GLOBAL RETAIN Note FALSE = store

Function

By using bLoad_b = TRUE the signal at nIn_a is switched to nOut_a. By using bLoad_b = FALSE the last valid value is stored and output at nOut_a. A signal change
at nIn_a does not produce any change at nOut_a.

Storing in the case of mains disconnection:


Set bLoad_b = FALSE, when the supply voltage is switched off (either mains/line supply, DCbus, or voltage supply of the control terminals). Set bLoad_b = FALSE, when the supply voltage is switched on again (either mains/line supply, DCbus, or voltage supply of the control terminals). Store the present output value after power interruption
n In _ a b L o a d _ b [V A R _ G L O B A L R E T A IN ]

L _ S H
S & H

n O u t_ a

n C u r V a lR e ta in

[V A R _ G L O B A L R E T A IN ]

Fig. 229

Programming to store the present output value after a supply interruption

Inorder to store the latest value at nOut_a after a supply interruption, you must declare a global variable of type RETAIN (VAR_GLOBAL RETAIN). Link this variable as shown in Fig. 229.

In this variable, the present value is always stored at nOut_a The variable will hold the value
after a supply interruption.

When the supply is switched on again, the stored value is read into the FB L_SH from the
variable and applied as the starting value.

226

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.16 Sramp generator (L_SRFG)

2.2.16

Sramp generator (L_SRFG)


This FB conditions a setpoint through an Scurve (sin2curve).
dwTi dwJerk nIn_a 0 nSet_a 1

L_SRFG
nOut_a nDeltaOut_a

bLoad_b

Fig. 230

Sramp generator (L_SRFG) VariableName nIn_a nSet_a bLoad_b nOut_a nDeltaOut_a dwTi dwJerk DataType Integer Integer Bool Integer Integer Unsigned Long Unsigned Long SignalType analog analog binary analog analog VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note Input Start value for the ramp generator. The ramp is initiated by bLoad_b = TRUE. TRUE = takes the value at nSet_a and outputs this at nOut_a; nDeltaOut_a remains at 0 %. The signal is limited to 100 %. (100 % = 16384)

Provides the acceleration of the ramp generator. The signal is limited to 100 %.
Acceleration in [%] (100 % = 16384) Jerk

Parameter codes of the instances


VariableName dwTi dwJerk L_SRFG1 C1040 C1041 SettingRange 0.001 ... 5000.000 % 0.001 ... 999.999 s Lenze 100.000 0.200

Note!
16384 100 % C0011 (nmax)

LenzeDrive.lib EN 1.7

227

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Analog signal processing
2.2.16 Sramp generator (L_SRFG)

Function Load ramp generator

By using bLoad_b = TRUE loads the ramp generator with the signal at nSet_a. This value is instantly accepted and output to nOut_a. No rampup or rampdown through an
Scurve takes place.

As long as bLoad_b remains = TRUE, the ramp generator is disabled.


Acceleration and jerk The maximum acceleration and the jerk can be adjusted separately.

n In _ a

t n O u t_ a

t n D e lta O u t_ a d w T i t d w T i d w J e rk

R
t

Fig. 231

Line diagram Acceleration Jerk

Max. acceleration:
By using dwTi you set the positive as well as the negative acceleration. The setting is calculated according to the formula: 1 s @ 100 % dwTi Jerk: By using dwJerk you set up a jerkfree acceleration of the drive. The jerk is entered in [s] until the ramp generator operates with maximum acceleration (see Fig. 231).

228

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.1 Logical AND (L_AND)

2.3
2.3.1

Digital signal processing


Logical AND (L_AND)
This FB implements the logical AND combination of binary signals. These operations can be used for the control of functions or the generation of status information.
bIn1_b bIn2_b bIn3_b

L_AND
&
bOut_b

Fig. 232

Logical AND (L_AND) VariableName bIn1_b bIn2_b bIn3_b bOut_b DataType Bool Bool Bool Bool SignalType binary binary binary binary VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note

Truth table
bIn1_b 0 1 0 1 0 1 0 1 0 = FALSE 1 = TRUE bIn2_b 0 0 1 1 0 0 1 1 bIn3_b 0 0 0 0 1 1 1 1 bOut_b 0 0 0 0 0 0 0 1

The function corresponds to a series connection of normallyopen contacts in a contactor control.

bIn1_b bIn2_b bIn3_b

bOut_b

Fig. 233

AND function as a series connection of normallyopen contacts

Note!
Use the inputs bIn1_b and bIn2_b if you only need two inputs. Fix input bIn3_b to TRUE.

LenzeDrive.lib EN 1.7

229

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.2 Delay (L_DIGDEL)

2.3.2

Delay (L_DIGDEL)
This FB delays binary signals.
byFunction wDelayTime bIn_b 0 t

L_DIGDEL
bOut_b

Fig. 234

Delay element (L_DIGDEL) VariableName bIn_b bOut_b byFunction wDelayTime DataType Bool Bool Byte Word SignalType binary binary VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note

Selection of the function Delay time

Parameter codes of the instances


VariableName byFunction wDelayTime L_DIGDEL1 C0720 C0721 C0725 C0726 L_DIGDEL2 SettingRange 0 ... 2 0.001 ... 60.000 s Lenze 2 0 1.000

Range of functions

Ondelay Dropout delay General delay

2.3.2.1

Ondelay
byFunction = 0

bIn_b

wDelayTime

wDelayTime

bOut_b

t Fig. 235 Ondelay

The FB L_DIGDEL operates like a retriggerable monostable circuit. Functional sequence 1. A FALSETRUE transition at nIn_b starts the timer element. 2. If the delay time has elapsed, that is set by wDelayTim has elapsed, bOut_b switches immediately = TRUE. 3. A TRUEFALSE edge at nIn_b resets the timer element, and switches bOut_b = FALSE, immediately.

230

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.2 Delay (L_DIGDEL)

2.3.2.2

Dropout delay
byFunction = 1
bIn_b

wDelayTime

wDelayTime

bOut_b

t Fig. 236 Dropout delay

Functional sequence 1. A FALSETRUE transition at nIn_b switches bOut_b = TRUE and resets the timer element. 2. A TRUEFALSE edge at nIn_b starts the timer element. 3. If the delay time has elapsed, that is set by wDelayTime has elapsed, bOut_b = FALSE, immediately.

2.3.2.3

General delay
byFunction = 2
bIn_b

wDelay Time

t bOut_b

t Fig. 237 General delay

Functional sequence 1. Any edge/transition at nIn_b resets the timer element, and starts it. 2. After the delay time, that is set by wDelayTime has elapsed, bOut_b = nIn_b.

LenzeDrive.lib EN 1.7

231

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.3 Up/down counter (L_FCNT)

2.3.3

Up/down counter (L_FCNT)


This FB is a digital up/down counter, that is limited to the value nCmpVal_a.
byFunction bClkUp_b bClkDown_b nLdVal_a bLoad_b nCmpVal_a

L_FCNT
nOut_a

CTRL

bEqual_b

Fig. 238

Up/down counter (L_FCNT) VariableName bClkUp_b bClkDwn_b nLdVal_a bLoad_b nCmpVal_a nOut_a bEqual_b byFunction DataType Bool Bool Integer Bool Integer Integer Bool Byte SignalType binary binary analog binary analog analog binary VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_OUTPUT VAR CONSTANT RETAIN Note FALSETRUE edge = counts up by 1. FALSETRUE edge = counts down by 1. Start value TRUE = accept start value The input has the highest priority. Comparison value The count value is limited to 32767. TRUE = comparison value reached. Selection of the function

Parameter codes of the instances


VariableName byFunction L_FCNT1 C1100 SettingRange 1 ... 2 Lenze 1

Function
Selection of the Function byFunction = 1 byFunction = 2 Description

If the count value nCmpVal_a , the output bEqual_b is set to TRUE. At the next clock cyle, the
counter is reset to the value nLdVal_a and the output bEqual_b is set to FALSE.

If the count value = nCmpVal_a , the counter stops( bClkUp_b / bClkDwn_b are ignored). bLoad_b = TRUE sets the counter to the value at nLdVal_a and responds to bClkUp_b / bClkDwn_b
again.

232

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.4 Flipflop (L_FLIP)

2.3.4

Flipflop (L_FLIP)
This FB is implemented as a D flipflop. You can use this function to evaluate and store digital signal transitions (edges).
L_FLIP
bD_b bClk_b bClr_b D CLR Q bOut_b

Fig. 239

Flipflop (L_FLIP) VariableName bD_b bClk_b bClr_b bOut_b DataType Bool Bool Bool Bool SignalType binary binary binary binary VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note Evaluates FALSETRUE edges only (edgetriggered). Evaluates the input level only; input has highest priority (reset input).

Functional sequence

bD_b

t bClk_b

t bOut_b

t Fig. 240 Sequence of a flipflop

bClr_b always has priority. 1. If bClr_b = TRUE, then bOut_b switches = FALSE. This state is held as long as bClr_b = TRUE. 2. A FALSETRUE edge at bClk_b switches bD_b = bOut_b. This state is stored until another FALSETRUE edge occurs at bClk_b or bClr_b switches = TRUE.

LenzeDrive.lib EN 1.7

233

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.5 Logical NOT (L_NOT)

2.3.5

Logical NOT (L_NOT)


This FB enables the logical inversion of digital signals. You can use this FB for the control of functions or the generation of status information.
L_NOT
bIn_b 1 bOut_b

Fig. 241

Logical NOT (L_NOT) VariableName bIn_b bOut_b DataType Bool Bool SignalType binary binary VariableType VAR_INPUT VAR_OUTPUT Note

Truth table
bIn_b 0 1 0 = FALSE 1 = TRUE bOut_b 1 0

The function corresponds to a change from a normallyopen contact to a normallyclosed contact in a control with contactors.

bIn_b

bOut_b Fig. 242 Function of L_NOT as a change from a normallyopen to a normallyclosed contact

234

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.6 Logical OR (L_OR)

2.3.6

Logical OR (L_OR)
This FB enables the logical OR combination of digital signals. You can use this combination for the control of functions or the generation of status information.
bIn1_b bIn2_b bIn3_b

L_OR >1
bOut_b

Fig. 243

Logical OR (L_OR VariableName bIn1_b bIn2_b bIn3_b bOut_b DataType Bool Bool Bool Bool SignalType binary binary binary binary VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note

Truth table
bIn1_b 0 1 0 1 0 1 0 1 0 = FALSE 1 = TRUE bIn2_b 0 0 1 1 0 0 1 1 bIn3_b 0 0 0 0 1 1 1 1 bOut_b 0 1 1 1 1 1 1 1

The function corresponds to a parallel connection of normallyopen contacts in a contactor control.

bIn1_b

bIn2_b

bIn3_b

bOut_b Fig. 244 Function of L_OR as a parallel connection of normallyopen contacts

Note!
If you only need 2 inputs, use the inputs bIn1_b and bIn2_b. Fix the input bIn3_b to FALSE.

LenzeDrive.lib EN 1.7

235

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.7 Edge evaluation (L_TRANS)

2.3.7

Edge evaluation (L_TRANS)


This FB is a posttriggered edge detector. You can use this function to detect digital signal transitions (edges) and turn them into defined pulses.
byFunction wPulseTime bIn_b 0 t

L_TRANS
bOut_b

Fig. 245

Edge evaluation (L_TRANS) VariableName bIn_b bOut_b byFunction wPulseTime DataType Bool Bool Byte Word SignalType binary binary VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note (retriggerable) Selection of the function Pulse duration of the output signal

Parameter codes of the instances


VariableName byFunction wPulseTime VariableName byFunction wPulseTime L_TRANS1 C0710 C0711 L_TRANS4 C1145 C1146 L_TRANS2 C0715 C0716 L_TRANS3 C1140 C1141 SettingRange 0 ... 2 0.001 ... 60.000 s SettingRange 0 ... 2 0.001 ... 60.000 s Lenze 0 0.001 Lenze 0 0.001

Range of functions

Evaluate rising edges Evaluate falling edges Evaluate rising and falling edges

2.3.7.1

Evaluate rising edges


byFunction = 0

bIn_b

wPulseTime

wPulseTime

bOut_b

t Fig. 246 Evaluation of FALSETRUE transitions

Functional sequence 1. If a TRUEFALSE or a FALSTRUE transition occurs at nIn_b, then bOut_b switches = TRUE. 2. After the time defined as wPulseTime has elapsed, then bOut_b switches = FALSE, provided no further FALSETRUE transition has occurred at nIn_b.

236

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Digital signal processing
2.3.7 Edge evaluation (L_TRANS)

2.3.7.2

Evaluate falling edges


byFunction = 1

bInb

wPulseTime

wPulseTime

bOut_b

t Fig. 247 Evaluation of TRUEFALSE transitions

Functional sequence 1. If a TRUEFALSE or a FALSETRUE transition occurs at nIn_b, then bOut_b switches = TRUE. 2. After the time defined as wPulseTime has elapsed, then bOut_b switches = FALSE, provided no further TRUEFALSE transition has occurred at nIn_b.

2.3.7.3

Evaluate rising and falling edges


byFunction = 2

bIn_b

wPulsTime

wPulsTime

bOut_b

t Fig. 248 Evaluation of both transitions

Functional sequence 1. If a TRUEFALSE or a FALSTRUE transition occurs at nIn_b, then bOut_b switches = TRUE. 2. After the time defined as wPulseTime has elapsed, then bOut_b switches = FALSE, provided no further TRUEFALSE or FALSETRUE transition has occurred at nIn_b.

LenzeDrive.lib EN 1.7

237

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.1 Arithmetic (L_ARITPH)

2.4
2.4.1

Processing of phaseangle signals


Arithmetic (L_ARITPH)
This FB calculates a phase output signal from two phase input signals.
d n In 1 _ p x + y b y F u n c tio n 2

L _ A R IT P H
3 0

d n In 2 _ p

*
/

d n O u t_ p

Fig. 249

Arithmetic (L_ARITPH) VariableName dnIn1_p dnIn2_p dnOut_p byFunction DataType Double Integer Double Integer Double Integer Byte SignalType position position position VariableType VAR_INPUT VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN Note

The signal is limited to 230. Selection of the function

Parameter codes of the instances


VariableName byFunction L_ARITPH1 C1010 SettingRange 0 ... 3, 14, 21, 22 Lenze 1

Function
Selection of the function byFunction = 0 byFunction = 1 byFunction = 2 byFunction = 3 byFunction = 14 byFunction = 21 byFunction = 22 Arithmetic function dnOut_p = dnIn1_p dnOut_p = dnIn1_p + dnIn2_p dnOut_p = dnIn1_p dnIn2_p dnOut_p = (dnIn1_p dnIn2_p) / 2 30 dnOut_p = dnIn1_p / dnIn2_p dnOut_p = dnIn1_p + dnIn2_p dnOut_p = dnIn1_p dnIn2_p Limiting of the result without 230 230 230 230 without without Note dnOut_p is not limited.

(remainder not considered) (remainder not considered) with overflow with overflow

byFunction = 21/22: byFunction = 14:

Please note, that an overflow may occur, and then the numerical value of dnOut_p does not match the result. If the denominator = 0, then dnOut_p = 230 The sign depends on the sign of dnIn1_p.

238

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.2 Addition (L_PHADD)

2.4.2

Addition (L_PHADD)
This FB adds or subtracts phase signals, depending on the input that is used.
2 3 1 -1
d n In 1 _ p + + d n In 2 _ p d n In 3 _ p

L _ P H A D D
d n O u t_ p d n O u t2 _ p

Fig. 250

Addition (L_PHADD) VariableName dnIn1_p dnIn2_p dnIn3_p dnOut_p dnOut2_p DataType Doubleinteger Doubleinteger Doubleinteger Doubleinteger Doubleinteger SignalType position position position position position VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_OUTPUT Note Addition input Addition input Subtraction input The signal is limited to 2147483647 Signal without limiting / with overflow

Functional sequence 1. The signal at dnIn1_p is added to the signal at dnIn2_p 2. The signal at dnIn3_p is subtracted from the calculated result. 3. The result of the subtraction is then limited to 2147483647 and output to dnOut_p and output as unlimited to dnOut2_p. Please observe, that at dnOut2_p there may be an overflow, thus producing a false value.

LenzeDrive.lib EN 1.7

239

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.3 Comparison (L_PHCMP)

2.4.3

Comparison (L_PHCMP)
This FB compares two phase signals (paths) with each other.
byFunction dnIn1_p dnIn2_p

L_PHCMP
bOut_b

Fig. 251

Comparison (L_PHCMP) VariableName dnIn1_p dnIn2_p bOut_b byFunction DataType Doubleinteger Doubleinteger Bool Byte SignalType position position binary VariableType VAR_INPUT VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN Note Signal to be compared Comparison value Selection of the function

Parameter codes of the instances


VariableName byFunction L_PHCMP1 C0695 L_PHCMP2 C1207 L_PHCMP3 C1272 SettingRange 1 ... 2 Lenze 2

Function
Selection byFunction = 1 byFunction = 2 Comparison function dnIn1_p < dnIn2_p dnIn1_p dnIn2_p dnIn1_p<dnIn2_p dnIn1_pdnIn2_p If the comparison condition is fulfilled bOut_b = HIGH bOut_b = LOW bOut_b = HIGH bOut_b = LOW Note

Compares the absolute value of the inputs.

240

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.4 Difference (L_PHDIFF)

2.4.4

Difference (L_PHDIFF)
This FB adds a phaseangle signal to the phase setpoint. A setpoint/actual value comparison is also possible.
d n S e t_ p d n A d d _ p b E n _ b n In _ v b R e s e t_ b
In te r v a lT im e T A S K

L _ P H D IF F
+ -

d n O u t_ p

Fig. 252

Difference (L_PHDIFF) VariableName dnSet_p dnAdd_p bEn_b nIn_v bReset_b dnOut_p DataType Doubleinteger Doubleinteger Bool Integer Bool Doubleinteger SignalType position position binary velocity binary position VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note Provision of a position setpoint Adaptive position value for an actual position TRUE = Adaptive position value is added on. Provision of the actual speed for conversion/calculation of the position value TRUE = Actual phaseangle integrator is set to 0. Signal is not limited.

Functional sequence If bEn_b = TRUE : 1. The speed (rpm) signal at nIn_v is integrated by the phaseangle integrator. 2. The phaseangle signal at dnAdd_p is added to the integrated speed signal in each task cycle. 3. The result of the phaseangle integrator is subtracted from the phaseangle signal at dnSet_p and then output at dnOut_p. If bEn_b = FALSE 1. The speed (rpm) signal at nIn_v is integrated by the phaseangle integrator. 2. The result of the phaseangle integrator is subtracted from the phaseangle signal at dnSet_p and then output at dnOut_p.

Note!
The phaseangle integrator derives a position from a speed.

In nIn_v the speed can be defined (16384 15000 rpm ). (INT)65536 corresponds to one encoder turn.

LenzeDrive.lib EN 1.7

241

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.5 Division (L_PHDIV)

2.4.5

Division (L_PHDIV)
This FB divides or multiplies phaseangle signals in binaryexponent format.
2 31 R e v o lu tio n

L _ P H D IV
d n O u t_ p

d n In _ p 1 2

b y D iv is io n

Fig. 253

Division (L_PHDIV) VariableName dnIn_p dnOut_p byDivision DataType Double integer Double integer Short Integer SignalType position position VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN Note 65536 inc = 1 encoder revlution Exponent of the divisor

Parameter codes of the instances


VariableName byDivision L_PHDIV1 C0995 SettingRange 31 ... 31 Lenze 0

Function You can calculate the result of the arithmetical function according to the formula: dnOut_p + dnIn_p 2 byDivision

Positive values in byDivision result in a division. Negative values in byDivision result in a multiplication. The output signal is limited to 2311 encoder turns.
The output signal cannot exceed this limit value.

242

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.6 Integration (L_PHINT)

2.4.6

Integration (L_PHINT)
This FB can integrate a speed or a velocity to a phaseangle (path/distance). The integrator can accept max. 32000 encoder revolutions.
In te r v a lT im e T A S K
3 2 0 0 0 R e v o lu tio n

L _ P H IN T

n In _ v

d n O u t_ p b F a il_ b

b R e s e t_ b

Fig. 254

Integration (L_PHINT) VariableName nIn_v bReset_b dnOut_p bFail_b DataType Integer Bool Doubleinteger Bool SignalType velocity binary position binary VariableType VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_OUTPUT Note Actual speed value: 16384 15000 rpm TRUE sets the phaseangle integrator = 0 and bFail_b = FALSE . 65536 inc = 1 encoder revolution (Overflow is possible.) TRUE = Overflow occurred.

Range of functions

Constant input value Calculation of the output signal

2.4.6.1

Constant input value


dnOut_p +32767 revolutions +32000 revolutions

-32000 revolutions -32767 revolutions bFail_b

Fig. 255

Function of L_PHINT with constant input value

A positive signal at nIn_v is incremented (the counter value is increased at every call of the
function). function).

A negative signal at nIn_v is decremented (the counter value is decreased at every call of the dnOut_p produces the count value of the bipolar integrator. If the count exceeds the value of +32000 encoder revolutions, then
bFail_b switches = TRUE.

If the count exceeds the value of +32767 encoder revolutions (corresponds to +2147483647

inc.) there is an overflow, and the count procedure continues from a value of 32768 encoder turns.

LenzeDrive.lib EN 1.7

243

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.6 Integration (L_PHINT)

If the count falls below the value of 32000 encoder revolutions, then
bFail_b switches= TRUE.

If the count falls below the value of 32768 encoder revolutions (corresponds to 2147483648
inc.) there is an overflow, and the count procedure continues from a value of +32767 encoder turns. the integrator switches to 0. sets dnOut_p to 0, as long as nIn_v has a positive signal applied. switches bFail_b = FALSE .

bReset_b = TRUE:

2.4.6.2

Calculation of the output signal


The output value at dnOut_p can be derived from the formula: dnOut_p [inc] + nIn_v [rpm] @ t [s] @ 65536 [inc Umdr.]
(t = integration time, 16384 15000 rpm, 1 inc. = 1)

Example: You want to determine the count of the integrator with a certain speed at the input and a certain integration time t.

Given values:
nIn_v = 1000 rpm (INT)1092 t = 10 s Start value of the integrator is 0.

Solution:
Conversion of the input signal nIn_v: 1000 rpm + 1000 rev. 60 s Calculation of the output signal dnOut_p + 1000 rev. @ 10 s @ 65536 inc + 10922666 inc rev. 60 s

244

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.7 Integration (L_PHINTK)

2.4.7

Integration (L_PHINTK)
This FB can integrate a speed or a velocity to a phaseangle (path/distance). It can also recognize a relative distance. The integrator can accept max. 32000 encoder revolutions.
In te r v a lT im e T A S K

b y M o d e d n C m p

L _ P H IN T K
d n O u t_ p b S ta tu s _ b

n In _ v b L o a d _ b d n S e t_ p

Fig. 256

Integration (L_PHINTK) VariableName nIn_v bLoad_b dnSet_p dnOut_p bStatus_b byMode dnCmp DataType Integer Bool Doubleinteger Doubleinteger Bool Byte Doubleinteger SignalType velocity binary position position binary VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note Actual speed value: 16384 15000 rpm = TRUE sets the phaseangle integrator to the signal at nIn_v and bStatus_b = FALSE . 65536 inc = 1 encoder revolution (Overflow is possible.) TRUE = Overflow occurred or distance processed. Selection of the function Comparison value

Parameter codes of the instances


VariableName byMode dnCmp L_PHINTK1 C1150 C1151 SettingRange 0 ... 2 0 ... 2000000000 Lenze 0 2000000000

Range of functions

Constant input value Input value with change of sign Calculation of the output signal

LenzeDrive.lib EN 1.7

245

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.7 Integration (L_PHINTK)

2.4.7.1

Constant input value


3 functions are available, that you can select with byMode. byMode = 0 The input bLoad_b is leveltriggered (TRUElevel).

bLoad_b = TRUE
The integrator is loaded with the value at dnSet_p. The FB switches bStatus_b = FALSE. byMode = 1 The input bLoad_b is edgetriggered (FALSETRUE transition).

bLoad_b = FALSETRUE edge/transition


The integrator is loaded with the value at dnSet_p and immediately integrated from then on. The FB switches bStatus_b= FALSE.
dnOut_p +32767 revolutions (+) dnCmp

(-) dnCmp -32767 revolutions bStatus_b

Fig. 257

Function of L_PHINTK with constant input value (+) Variable with positive value () Variable with negative value

A positive value at nIn_v is incremented

(the counter value is increased at every call of the function).

A negative value at nIn_v is decremented

(the counter value is decreased at every call of the function).

dnOut_p produces the count value of the bipolar integrator. If the count exceeds the value of +32767 encoder revolutions (corresponds to
+2147483647 inc): There is an overflow, and counting continues at the value 32768 encoder turns. Switches bStatus_b = TRUE, when a positive preset value is reached at dnCmp. 2147483648 inc): There is an overflow, and counting continues at the value +32767 encoder turns. Switches bStatus_b = TRUE, when a negative preset value is reached at dnCmp.

If the count falls below the value of 32768 encoder revolutions (corresponds to

246

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.7 Integration (L_PHINTK)

2.4.7.2

Input value with change of sign


byMode = 2 The input bLoad_b is leveltriggered (TRUElevel).

bLoad_b = TRUE
The integrator is loaded with the value at dnSet_p. The FB switches bStatus_b = FALSE.
dnOut_p (+) dnCmp

(-) dnCmp

bStatus_b

Fig. 258

Function of L_PHINTK with change of sign for the input value (+) Variable with positive value () Variable with negative value Change of sign for the value at nIn_v

A positive value at nIn_v is incremented (the counter value is increased at every call of the
function).

A negative value at nIn_v is decremented (the counter value is decreased at every call of the
function).

dnOut_p produces the count value of the bipolar integrator. If the count value exceeds a preset positive value at dnCmp:
The count value is reduced by the value of dnCmp. Switches bStatus_b = TRUE for the time of one cycle.

If the count value goes below a preset negative value in dnCmp:


The count value is increased by the value of dnCmp. Switches bStatus_b = TRUE for the time of one cycle.

LenzeDrive.lib EN 1.7

247

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Processing of phaseangle signals
2.4.7 Integration (L_PHINTK)

2.4.7.3

Calculation of the output signal


The output value at dnOut_p can be derived from the formula: dnOut_p [inc] + nIn_v [rpm] @ t [s] @ 65536 [inc rev.]
(t = integration time, 16384 15000 rpm, 1 incr. = 1)

Example: You want to determine the count of the integrator with a certain speed at the input and a certain integration time t.

Given values:
nIn_v = 1000 rpm (INT)1092 t = 10 s Start value of the integrator is 0.

Solution:
Conversion of the input signal at nIn_v: 1000 rpm + 1000 rev. 60 s Calculation of the output signal dnOut_p + 1000 rev. @ 10 s @ 65536 inc + 10922666 inc rev. 60 s

248

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Signal conversion
2.5.1 Normalization (L_CONV)

2.5
2.5.1

Signal conversion
Normalization (L_CONV)
This FB normalizes signals. The calculation is made quite precisely, with remainder processing and definition of the conversion factor as a numerator and denominator.
n In _ a n N u m e ra to r n D e n o m in a to r

L _ C O N V

n O u t_ a

Fig. 259

Normalization (L_CONV) VariableName nIn_a nOut_a nNumerator nDenominator DataType Integer Integer Integer Integer SignalType analog analog VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note 100 % 16384 C0011 (nmax) The signal it limited to 199.99 % (100 % 16384). Numerator Denominator

Parameter codes of the instances


VariableName nNumerator nDenominator VariableName nNumerator nDenominator L_CONV1 C0940 C0941 L_CONV4 C0955 C0956 L_CONV2 C0945 C0946 L_CONV5 C0655 C0656 L_CONV3 C0950 C0951 L_CONV6 C1170 C1171 SettingRange 32767 ... 32767 1 ... 32767 SettingRange 32767 ... 32767 1 ... 32767 Lenze 1 1 Lenze 1 1

Function The multiplication or division of signals is made according to the formula: nOut + nIn @ nNumerator nDenominator

LenzeDrive.lib EN 1.7

249

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Signal conversion
2.5.2 Conversion of phaseangle to analog (L_CONVPA)

2.5.2

Conversion of phaseangle to analog (L_CONVPA)


This FB converts a phaseangle signal into an integer signal. This function corresponds to the function of the FB CONVPHA in the 9300 servo inverter.
3 2 7 6 7 1 2
b y D iv is io n

L _ C O N V P A
n O u t

d n In _ p

Fig. 260

Conversion of phaseangle to analog (L_CONVPA) VariableName dnIn_p nOut byDivision DataType Double Integer Integer Byte SignalType position analog VariableType VAR_INPUT VAR_OUTPUT VAR CONSTANT RETAIN Note

The signal is limited to 32767. Remainder handling


Division factor

Parameter codes of the instances


VariableName byDivision L_CONVPA1 C1000 SettingRange 0 ... 31 Lenze 1

Function The conversion is made according to the formula: nOut_a + dnIn_p @ 1 2 byDivision

Note!
This FB operates with remainder handling.

250

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Signal conversion
2.5.3 Conversion of a phaseangle signal (L_CONVPP)

2.5.3

Conversion of a phaseangle signal (L_CONVPP)


This FB converts a phase signal with a dynamic fraction. This function corresponds to the function of the FB CONVPHPH in the 9300 servo inverter.
nNum_a dnIn_p bAct_b nDen_a
1

L_CONVPP
x y dnOut_p

Fig. 261

Conversion of a phaseangle signal (L_CONVPP) VariableName nNum_a dnIn_p bAct_b nDen_a dnOut_p DataType Integer Double Integer Bool Integer Double Integer SignalType analog position binary analog position VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note Numerator

Denominator (with absolute value generation) The signal is not limited. Remainder handling

Function

STOP!
The conversion result is not limited. The result must therefore not exceed the range of 2147483647. The conversion is made according to the formula:

With bAct_b = TRUE


dnOut_p + dnIn_p @ nNum_a nDen_a

With bAct_b = FALSE


dnOut_p + Remainder @ nNum_a nDen_a

Tip!
This FB operates with remainder handling. The denominator can only be 1. (INT)65536 corresponds to one encoder turn (one encoder turn corresponds to
65536 increments).

LenzeDrive.lib EN 1.7

251

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Signal conversion
2.5.4 Conversion (L_CONVVV)

2.5.4

Conversion (L_CONVVV)
This FB converts a phase signal with a dynamic fraction. This function corresponds to the function of the FB CONVPP in the 9300 servo inverter.
d n N u m _ p n In _ v x y d n D e n _ p
1

L _ C O N V V V
n O u t_ v

Fig. 262

Conversion (L_CONVVV) VariableName dnNum_p nIn_v dnDen_p nOut_v DataType Double Integer Integer Double Integer Integer SignalType position analog/velocity position analog/velocity VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note Numerator Denominator (with absolute value generation) The signal is not limited. Remainder handling

Function

Stop!
The conversion result is not limited. The result must therefore not exceed the range of 32767. The conversion is made according to the formula: nOut_v + nIn_v @ dnNum_p dnDen_p

Note!
This FB operates with remainder handling. The denominator can only be 1. 16384 15000 rpm.

252

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Signal conversion
2.5.5 Normalization with limiting (L_CONVX)

2.5.5

Normalization with limiting (L_CONVX)


This FB normalizes signals. The calculation is made with highprecision and remainder handling, using the conversion factor for numerator and denominator.
L_CONVX
32767

nIn nNum nDenom bInvers_b *


a

a b
b 1

0 1

nOut

Fig. 263

Conversion (L_CONVX) VariableName nIn nNum nDenom bInvers_b nOut DataType Integer Integer Integer Bool Integer SignalType analog/velocity analog/velocity analog/velocity binary analog/velocity VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT Note Counter Denominator

Function The multiplication or division of signals is made according to the formula: nOut + nIn @ dnNum @ sgn |bInvers| |dnDenom|

Division by zero is prevented: if nDenom = 0 the the value of nDenom is set to 1. The input value is calculated for nDenominator. bInvers_b = TRUE means that the sign is reversed for the output variable nOut. The calculation is made using remainder handling.

LenzeDrive.lib EN 1.7

253

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.1 Type conversion (L_ByteArrayToDint)

2.6
2.6.1

Communication
Type conversion (L_ByteArrayToDint)
This FB converts a 4byte array into a variable of type DINT.

VariableName abyIn dnOut

DataType Byte [0 ... 3] Doubleinteger

SignalType

VariableType VAR_INPUT VAR_OUTPUT

Note

2.6.2

Type conversion (L_DintToByteArray)


This FB converts a variable of type DINT into a 4byte array, as, for instance, the FB L_ParWrite expects for the input abyData.

VariableName dnIn abyOut

DataType Doubleinteger Byte [0 ... 3]

SignalType

VariableType VAR_INPUT VAR_OUTPUT

Note

2.6.3

Code index (L_FUNCodeIndexConv)


This function checks the value range 1 ... 8000 of a code index and transmits the index to, e. g. the FB L_ParWrite via the wIndex input. If the code numbers are invalid, the function transmits the 0000 index.

VariableName wCodenumber

DataType Word

SignalType

VariableType VAR_INPUT

Note

254

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.4 Read codes (L_ParRead)

2.6.4

Read codes (L_ParRead)


This FB is used to read parameters, with Lenze socalled codes. The FB can read both the PLC codes and codes of other devices via the system bus (CAN).
L_ParRead bExecute bDone wIndex bBusy bySubIndex bFail byFraction wFailNumber byComChannel abyData wTargetAddress

VariableName wTimeOut

DataType Word

VariableType

Note Timeout time in ms is the time for processing the order. Initialized with 1000 ms. This variable can be parameterized by means of a user code.

VAR CONSTANT 1 ... 65335 RETAIN

bExecute wIndex bySubIndex byFraction

Bool Word Byte Byte

VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT

byComChannel

Byte

VAR_INPUT

wTargetAddress

Word

VAR_INPUT

FALSE/TRUE transition activates a read request. Code index Conversion formula: Index = 24575 code number 0 ... 255 Subindex (subcode number) of the code 0 ... 254 Number of decimal places of the code to be read 255 Code without decimal places (e.g. hexadecimal code). 0 Reading a PLC code. Constant: C_PLC 10 Reading a code from a device connected via the system bus (CAN). Constant: C_SYSTEMBUS_CAN Selecting the parameter data channel of the target device (only with byComChannel = 10) 0 ... 65535 1 ... 64 65 ... 127 Data transfer via SDO1 of the target device: wTargetAddress = CAN device address of the target device Data transfer via SDO2 of the target device: wTargetAddress = CAN device address of the target device + 64 Order has been processed (observe bFail). Order is being processed. Error occurred. OK read request was executed without error. Error during data transfer via system bus (CAN). External device did not respond within the set timeout time. Subindex does not exist. Index does not exist. Parameter value to be read is not within the valid range. Invalid communication channel (byComChannel). There are not enough free CAN objects available. The Send Order memory is full. The four data bytes with the read code value.

bDone bBusy bFail wFailNumber

Bool Bool Bool Word

VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT

TRUE TRUE TRUE 0 1 2 4 5 13 117 118 119

abyData

Byte [0 ... 3]

VAR_OUTPUT

LenzeDrive.lib EN 1.7

255

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.4 Read codes (L_ParRead)

Note!
The FB L_ParRead must be cyclically called to ensure that the read response is received. Due to the cycle time of the receiver, it may happen that the PLC receives the read response only after a few program cycles. If the FB is not cyclically called (e.g. in an eventcontrolled task) the FB might "get stuck" as a result.

Selection of the transmission channel The transmission channel is selected under code C2118:
Code C2118 LCD Possible settings Lenze Selection 0 0 PDO channel (CAN1_IO ... CAN3_IO) Info Data is transferred via a free PDO channel of the PLC. For the selection you need: A free CAN transmitter (CAN1_OUT ... CAN3_OUT) to transmit the read request. A free CAN receiver (CAN1_IN ... CAN3_IN) to receive the read response from the other device. Data is transferred via the SDO2 channel of the PLC.

SDO2 channel

Selection of the bus participant and the parameter data channel for the bus participant The bus participant whose codes are to be accessed is selected under wTargetAddress. The parameter data channel (SOD1 or SDO2) to be used for the bus participant is also selected under wTargetAddress:

For data transfer via parameter data channel SDO1 enter the corresponding CAN device
address (1 ... 64) of the bus participant under wTargetAddress.

For data transfer via parameter data channel SDO2 enter the corresponding CAN device

address (1 ... 64) of the bus participant incremented by 64, i.e. a value between 65 and 127 under wTargetAddress.
PLC Target device

wTargetAddress = 2 SDO1 SDO2 wTargetAddress = 2 + 64 = 66 Node-ID 1 Node-ID 2

Note!
Please ensure that the bus participant is not at the same time accessed by other bus participants via the same parameter data channel since the system bus changes to the state "bus off" if a "collision" occurs.

256

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.4 Read codes (L_ParRead)

Tip!
General information about the CAN objects and the system bus (CAN) can be found in the Manual "System bus (CAN) for PLC devices". Example Read value of code C0011 of the device with CAN device address 2:

Tip!
For converting the code number into the value required for wIndex you can use the function L_FUNCodeIndexConv (see example). If you want to process the read value in DINT format you can use the FB L_DintToByteArray to convert the 4byte array abyData into a DINT value (see example).

LenzeDrive.lib EN 1.7

257

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.4 Read codes (L_ParRead)

Parameter values with decimal places

Tip!
The parameters of the Lenze controllers are stored in different formats. Detailed information about this can be found in the "Table of attributes" in the corresponding drive controller Manual. If the code to be read uses a data format with decimal places the number of decimal places has to be communicated to the function block L_ParRead via the input byFraction. The following formats apply:
byFraction (number of decimal places) 0 1 2 3 4 Value output by FB L_ParRead 1 10 100 1000 10000 Read code value 1 1.0 1.00 1.000 1.0000

Example: Reading a code with the value "43" in fixed32 data format.

Fixed32 is a fixedpoint format with 4 decimal places. For data transfer the value therefore has
to be multiplied by 10000: Data 1...4 + 43 @ 10000 + 430000 + 00 06 8F B0 hex

Select the value "4" at the input byFraction. The FB L_ParRead outputs the value "430000".

Tip!
If the code does not use the fixedpoint format the value "255" has to be selected at the input byFraction. Detailed information about reading and writing parameters via the system bus (CAN) can be found in the Manual "System bus (CAN) for PLC devices".

258

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.5 Write codes (L_ParWrite)

2.6.5

Write codes (L_ParWrite)


This FB is used to write parameters, with Lenze socalled codes. The FB can write both the PLC codes and codes of other devices via the system bus (CAN).
L_ParWrite bDone bExecute bBusy wIndex bFail bySubIndex wFailNumber abyData byFraction byComChannel wTargetAddress

VariableName wTimeOut

DataType Word

VariableType

Note Timeout time in ms is the time for processing the order. Initialized with 1000 ms. This variable can be parameterized by means of a user code.

VAR CONSTANT 1 ... 65335 RETAIN

bExecute wIndex bySubIndex abyData byFraction

Bool Word Byte Byte [0 ... 3] Byte

VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT

byComChannel

Byte

VAR_INPUT

wTargetAddress

Word

VAR_INPUT

FALSE/TRUE transition activates a write request. Code index Conversion formula: Index = 24575 code number 0 ... 255 Subindex (subcode number) of the code The four data bytes with the code value to be written. 0 ... 254 Number of decimal places of the code to be written. 255 Code without decimal places (e.g. hexadecimal code). 0 Writing a PLC code. Constant: C_PLC 10 Writing a code in a device connected via the system bus (CAN). C_SYSTEMBUS_CAN Constant: Selecting the parameter data channel of the target device (only with byComChannel = 10) 1 ... 64 Data transfer via SDO1 of the target device: wTargetAddress = CAN device address of the target device 65 ... 127 Data transfer via SDO2 of the target device: wTargetAddress = CAN device address of the target device + 64 0 ... 65535 TRUE TRUE TRUE Order has been processed (observe bFail ). Order is being processed. Error occurred.

bDone bBusy bFail

Bool Bool Bool

VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT

LenzeDrive.lib EN 1.7

259

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.5 Write codes (L_ParWrite)

VariableName wFailNumber

DataType Word

VariableType VAR_OUTPUT

Note 0 1 2 4 5 7 13 117 118 119 OK write request was executed without error. Error during data transfer via system bus (CAN). External device did not respond within the set timeout time. Subindex does not exist. Index does not exist. The controller inhibit required for writing the code has not been set in the target device. Parameter value to be written is not within the valid range. Invalid communication channel (byComChannel) There are not enough free CAN objects available. The Send Order memory is full.

Note!
The FB L_ParWrite must be cyclically called to ensure that the write response is received. Due to the cycle time of the receiver, it may happen that the PLC receives the write response only after a few program cycles. If the FB is not cyclically called (e.g. in an eventcontrolled task) the FB might "get stuck" as a result. Selection of the transmission channel The transmission channel is selected under code C2118:
Code C2118 LCD Possible settings Lenze Selection 0 0 PDO channel (CAN1_IO ... CAN3_IO) Info Data is transferred via a free PDO channel of the PLC. For the selection you need: A free CAN transmitter (CAN1_OUT ... CAN3_OUT) to transmit the write request. A free CAN receiver (CAN1_IN ... CAN3_IN) to receive the write response from the other device. Data is transferred via the SDO2 channel of the PLC.

SDO2 channel

260

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.5 Write codes (L_ParWrite)

Selection of the bus participant and the parameter data channel for the bus participant The bus participant whose codes are to be accessed is selected under wTargetAddress. The parameter data channel (SOD1 or SDO2) to be used for the bus participant is also selected under wTargetAddress:

For data transfer via parameter data channel SDO1 enter the corresponding CAN device
address (1 ... 64) of the bus participant under wTargetAddress.

For data transfer via parameter data channel SDP2 enter the corresponding CAN device

address (1 ... 64) of the bus participant incremented by 64, i.e. a value between 65 and 127 under wTargetAddress.
PLC Target device

wTargetAddress = 2 SDO1 SDO2 wTargetAddress = 2 + 64 = 66 Node-ID 1 Node-ID 2

Note!
Please ensure that the bus participant is not at the same time accessed by other bus participants via the same parameter data channel since the system bus changes to the state "bus off" if a "collision" occurs.

Tip!
General information about the CAN objects and the system bus (CAN) can be found in the Manual "System bus (CAN) for PLC devices".

Example Transfer the value of the analog input AIN1 (terminal 1/2 for 9300 Servo PLC) to code C0472/1 of the controller using the CAN device address 2:

LenzeDrive.lib EN 1.7

261

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Communication
2.6.5 Write codes (L_ParWrite)

Tip!
For converting the code number into the value required for wIndex you can use the function L_FUNCodeIndexConv (see example). If you want to write the value to be written in DINT format you can use the FB L_DintToByteArray to convert the DINT value into the 4byte array required for abyData (see example). Parameter values with decimal places

Tip!
The parameters of the Lenze controllers are stored in different formats. Detailed information about this can be found in the "Table of attributes" in the corresponding drive controller Manual. If the code to be written uses a data format with decimal places the number of decimal places has to be communicated to the function block L_ParWrite via the input byFraction. The following formats apply:
byFraction (number of decimal places) 0 1 2 3 4 Value assigned to FB L_ParWrite 1 10 100 1000 10000 Code value to be written 1 1.0 1.00 1.000 1.0000

Example: Transmitting the value "20" for a code in fixed32 data format.

Fixed32 is a fixedpoint format with 4 decimal places. For data transfer the value therefore has
to be multiplied by 10000: Data 1...4 + 20 @ 10000 + 200000 + 00 03 0D 40 hex

Select the value "4" at the input byFraction. Enter the value "20,0000" under the code.

Tip!
If the code does not use the fixedpoint format the value "255" has to be selected at the input byFraction. Detailed information about reading and writing parameters via the system bus (CAN) can be found in the Manual "System bus (CAN) for PLC devices".

262

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.1 Transparent mode with keypad 9371BB/9371BC (L_Display9371BB)

2.7
2.7.1

Special functions
Transparent mode with keypad 9371BB/9371BC (L_Display9371BB)
With the keypad 9371BB and 9371BC you can enter parameters (e.g. setpoints), display operating data, and transfer parameter sets to other target systems via a keyboard. This FB is used to switch the keypad to a "transparent" mode which makes it possible to access all display elements and keys of keypad 9371BB/9371BC from the program.

Note!
Due to its internal structure, the FB must be called in a timeequidistant task (30 ... 50 ms). Data will only be sent to the keypad if changes occur at the FB inputs.

L_Display9371BB
bTrnActivate bFailOn bMmaxOn bImaxOn bIMPOn bRDYOn bSHPRGSymbolOn bEnterArrowSymbolOn bMenuSymbolOn b1SymbolOn b2SymbolOn bCodeSymbolOn bParSymbolOn bParaSymbolOn bStopLEDOn byLcdCursorPositionOn bLcdDisplayOff bLcdCursorOn bLcdCharacterBlinkOn bUpdateCharCodeMap pString1 pString2 pString3 pString4 abyCharCode abyCharMap

CTRL

bTimeOut bUpdateBaeBusy bUpdateKeys bKeyArrowUp bKeyArrowDown bKeyArrowLeft bKeyArrowRight bKeyShift bKeyPrg bKeyStop bKeyRun

A B b c d

z y Y SHPRG Z p T Menu V 1 S 2 U
Code Par Para

dcbBA
SHPRG Par12

Menu Code Para

S T

z Y Z y

Fig. 264

FB L_Display9371BB VariableName bTrnActivate bFailOn bMmaxOn bImaxOn bIMPOn bRDYOn bSHPRGSymbolOn DataType Bool Bool Bool Bool Bool Bool Bool SignalType binary binary binary binary binary binary binary VariableType Note VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT TRUE: Activates transparent mode. TRUE: The display indicates A. TRUE: The display indicates B. TRUE: The display indicates b. TRUE: The display indicates c. TRUE: The display indicates d. TRUE: The display indicates "SHPRG".

U V

LenzeDrive.lib EN 1.7

263

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.1 Transparent mode with keypad 9371BB/9371BC (L_Display9371BB)

VariableName bEnterArrowSymbolOn bMenuSymbolOn b1SymbolOn b2SymbolOn bCodeSymbolOn bParSymbolOn bParaSymbolOn bStopLEDOn byLcdCursor PositionOn

DataType Bool Bool Bool Bool Bool Bool Bool Bool Bool

SignalType binary binary binary binary binary binary binary binary binary

VariableType Note VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT TRUE: The display indicates p. TRUE: The display indicates "Menu". TRUE: The display indicates "1". TRUE: The display indicates "2". TRUE: The display indicates "Code". TRUE: The display indicates "Par". TRUE: The display indicates "Para". TRUE: The key S lights up. Selection of the cursor position (0 ... 30) String 1: Position 0 ... 3 String 2: Position 4 ... 5 String 3: Position 6 ... 17 String 4: Position 18 ... 30 TRUE: Display is switched off. TRUE: Cursor is activated. TRUE: The character at the cursor position is blinking. TRUE: The inputs abyCharCode and abyCharMap with the special character definition are read again. String 1, length: 4 characters String 2, length: 2 characters String 3, length: 12 characters String 4, length: 13 characters ASCII code assigned to special characters 0 ... 6 Definition of special characters 0 ... 6 TRUE: The keypad has been disconnected from the PLC and the timeout time has expired. TRUE: The keypad display is updated, the inputs should not be changed. TRUE: Keypad keys are pressed. TRUE: Keypad key z is pressed. TRUE: Keypad key y is pressed. TRUE: Keypad key Y is pressed. TRUE: Keypad key Z is pressed. TRUE: Keypad key T is pressed. TRUE: Keypad key V is pressed. TRUE: Keypad key S is pressed. TRUE: Keypad key U is pressed.

bLcdDisplayOff bLcdCursorOn bLcdCharacterBlinkOn bUpdateCharCodeMap pString1 pString2 pString3 pString4 abyCharCode abyCharMap bTimeOut bUpdateBaeBusy bUpdateKeys bKeyArrowUp bKeyArrowDown bKeyArrowLeft bKeyArrowRight bKeyShift bKeyPrg bKeyStop bKeyRun

Bool Bool Bool Bool String String String String Array of byte Array of byte Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool

binary binary binary binary binary binary binary binary binary binary binary binary binary binary binary

VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_IN_OUT VAR_IN_OUT VAR_IN_OUT VAR_IN_OUT VAR_IN_OUT VAR_IN_OUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT VAR_OUTPUT

Activation of transparent mode The transparent mode is activated on the keypad by setting bTrnActivate to TRUE. All display elements and keys of keypad 9371BB/9371BC can then be accessed via the FB.

264

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.1 Transparent mode with keypad 9371BB/9371BC (L_Display9371BB)

Display of ASCII characters on the keypad The keypad has four fields to display ASCII strings:

pString1

pString2
3 4 5

pString3

6 pString4

17

18

30

Under pString ... pString4 you can select the ASCII strings to be displayed. Under byLcdCursorPositionOn you can select the cursor position (0 ... 30). By setting bLcdCursorOn to TRUE you can display the cursor. If bLcdCharacterBlinkOn is set to TRUE the character at the cursor position blinks.

LenzeDrive.lib EN 1.7

265

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.1 Transparent mode with keypad 9371BB/9371BC (L_Display9371BB)

Table of ASCII characters The below table shows the ASCII characters which can be displayed on the keypad:
HEX 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F DEC 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 CHAR [Space] ! " # $ % & ( ) * + , . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? HEX 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F DEC 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 CHAR @ A B C D U F G H I J K A M N O P Q R S T V V W X Y Z [ ] ^ _ HEX 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F DEC 96 97 98 99 100 101 102 103 104 105 106 107 108 109 100 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 s t u v w x y z { | } a b c d e f g h i j k l m n o p q CHAR

266

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.1 Transparent mode with keypad 9371BB/9371BC (L_Display9371BB)

Layout and definition of the special characters The FB enables the definition of 7 special characters. It is possible to assign an individual ASCII code to each of these special characters.

The 5 x 7 matrix of a character is defined via the array variable abyCharMap. Each array
element of data type byte is bitcoded and represents one column of the matrix (0 = white pixel, 1 = black pixel).

The array variable abyCharCode is used to define the ASCII codes for the special characters.
Example: Define a "m" as second special character under ASCII code "200":

abyCharCode[1] = 200 Bit 7 6 5 4 3 2 1 0 abyCharMap[9] abyCharMap[8] abyCharMap[7] abyCharMap[6] abyCharMap[5]


Fig. 265 Example: Defining the matrix of a special character

= = = = =

2#00000000 2#01111110 2#00010000 2#00001110 2#00000000

The following figure shows the assignment of the array index to the matrix column:
abyCharMap index = 4 3 2 1 0 Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 abyCharCode index = 0 1 2 3 4 5 6 9 8 7 6 5 14 13 12 11 10 19 18 17 16 15 24 23 22 21 20 29 28 27 26 25 34 33 32 31 30

Fig. 266

Assignment of the array index [0...30] to the matrix column

Note!
If special characters are defined under ASCII codes between 32 and 127 the special
characters will be indicated instead of the standard ASCII characters. bUpdateCharCodeMap is set to TRUE.

The defined special characters are only transferred to the strings pString1 ... pString4 if

LenzeDrive.lib EN 1.7

267

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.2 Fault trigger (L_FWM)

2.7.2

Fault trigger (L_FWM) Note!


The FB L_FWM of function library LenzeDrive0201.lib has been revised and can be used for the following Lenze PLCs:

9300 Servo PLC EVS93XXxI version 7.0 9300 Servo PLC EVS93XXxT version 7.0 Drive PLC EPL10200 version 7.2 ECSxAxxx version 7.0
If the FB L_FWM is used from older LenzeDrivel.lib versions, it should be replaced or only be used after consultation with Lenze! The FB L_FWM is used to transmit error messages to the PLC. In this way, a TRIP, FAILQSP, message or warning can be triggered in the PLC while the PLC program is running. The fault number that is transmitted is stored in the history buffer of the PLC (C0168/x).
L_FWM
bExecute byTypeOfFault wFaultNumber

Fig. 267

Fault trigger (L_FWM) VariableName bExecute byTypeOfFault DataType Bool Byte SignalType VariableType VAR_INPUT VAR_INPUT Note A High transition triggers a fault signal. Triggered by fault type 0: TRIP 1: Message 2: Warning 3: Switched off 4: FAILQSP Fault number (400999) The fault number that is transmitted is stored in the history buffer of the PLC (C0168/x) together with the offset for the fault type.

wFaultNumber

Word

VAR_INPUT

268

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.2 Fault trigger (L_FWM)

Fig. 268

Configuration for triggering the various fault types

Note!
Each FB instance may only be called once! If you need the FB L_FWM several times, create the corresponding number of FB instances.

If the program includes several instances of the FB L_FWM which are of the same fault type,
then only the first fault of this fault type that is detected will be recorded.

If several faults with a different response occur at the same time, only the fault whose
response has the highest priority will be recorded in the history buffer: TRIP (highest priority) message FAILQSP warning (lowest priority).

Only edit L_FWM() in a task. If byTypeOfFault has an invalid value, then the value 0 (TRIP) is used for byTypeOfFault. If the value of wFaultNumber < 400, then the value 400 is used for wFaultNumber, if
wFaultNumber > 999, then the value 999 is used for wFaultNumber.

If a fault occurs, it can be read out by using the system variable DCTRL_wFaultNumber.

LenzeDrive.lib EN 1.7

269

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.3 Motor potentiometer (L_MPOT)

2.7.3

Motor potentiometer (L_MPOT)


This FB replaces a hardware motor potentiometer. It is used as an alternative setpoint source that is operated via two inputs.
bUp_b bInAct_b bDown_b dnActRetain byInitFunction nHighLimit byFunction wTir CTRL wTif nLowLimit

L_MPOT
nOut_a

dnActRetain

Fig. 269

Motor potentiometer (L_MPOT) VariableName bUp_b bDown_b bInAct_b nOut_a dnActRetain nHighLimit nLowLimit wTir wTif byFunction byInitFunction DataType Bool Bool Bool Integer Double integer Integer Integer Unsigned Integer Unsigned Integer Byte Byte SignalType binary binary binary analog VariableType VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_IN_OUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN Note Motor potentiometer runs up to the upper limit. Motor potentiometer runs down to the lower limit. Activates a function. Setpoint output Stores the current setpoint. Upper limit (16384 100% C0011) Lower limit (16384 100% C0011) Acceleration time Tir (10 1 s) Deceleration time Tif (10 1 s) Deactivation function Initialization function

Parameter codes of the instances


VariableName nHighLimit nLowLimit wTir wTif byFunction byInitFunction L_MPOT1 C0260 C0261 C0262 C0263 C0264 C0265 SettingRange 199.99 ... 199.99% 199.99 ... 199.99% 0.1 ... 6000.0 s 0.1 ... 6000.0 s 0 ... 5 0 ... 2 Lenze 100.00 100.00 10.00 10.00 0 0

Range of functions

Operation of the motor potentiometer Initialization of the motor potentiometer Store the current output value after supply interruption.

270

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.3 Motor potentiometer (L_MPOT)

2.7.3.1

Operation of the motor potentiometer


wTir wTir wTif nOut_a wTir nLowLimit + 0 nHighLimit

nUp_b nDown_b Fig. 270 Control signals for the motor potentiometer

bUp_b = TRUE:
The signal at nOut_a runs up to its upper limit (nHighLimit).

nDown_b = TRUE:
The signal at nOut_a runs down to its lower limit (nDownLimit).

bUp_b = FALSE and nDown_b = FALSE or bUp_b = TRUE and nDown_b = TRUE:
The signal at nOut_a does not change. Deactivation of the motor potentiometer
nHighLimit wTif nOut_a wTif wTir 0 wTir wTif nLowLimit

bUp_b bDown_b

bInAct_b Fig. 271 Deactivation of the motor potentiometer

If bInAct_ = TRUE, then the motor potentiometer is deactivated


bInAct_b has priority over bUp_b and bDown_b. If the motor potentiometer is deactivated, the signal at nOut_a follows the function set by byFunction. You can set the following functions:
byFunction 0 1 2 3 4 5 Meaning No further action; nOut_a retains its value. The motor potentiometer runs down to 0 %, using the rundown time Tif. The motor potentiometer runs down to the lower limit, using the rundown time Tif nLowLimit. The motor potentiometer immediately changes its output to 0 % (Important for the EMERGENCY STOP function). The motor potentiometer immediately changes its output to the lower limit (nLowLimit). The motor potentiometer runs up to the upper limit, using the runup time Tir nHighLimit).

LenzeDrive.lib EN 1.7

271

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.3 Motor potentiometer (L_MPOT)

Activation of the motor potentiometer

If bInAct_b = FALSE, then the motor potentiometer is activated. The function that is now
performed depends on the momentary output signal. the preset limit values. the control signals at bUp_b and bDown_b.

If the signal at nOut_a


is outside the limits that have been set, then the output signal moves to the nearest limit, using the Titimes that have been set. The sequence is independent of the control signals at bUp_b and bDown_b. within the limits that have been set, then the output signal moves according to the control signals at bUp_b and bDown_b.

2.7.3.2

Initialization of the motor potentiometer


On initialization after poweron, the motor potentiometer is loaded with a specific initial value. Under byInitFunction you can select the initialization function.
byInitFunction 0 1 2 Function The output value that is output on poweroff, is stored in the internal nonvolatile memory of the drive controller. This value is loaded in again at poweron. On mains poweron the lower limit (defined by nLowLimit) is loaded. On mains poweron an initial value = 0 % is loaded.

2.7.3.3

Storing the current output value after supply interruption


bUp_b bInAct_b bDown_b [VAR_GLOBAL RETAIN] dnActRetain byInitFunction nHighLimit byFunction wTir CTRL wTif nLowLimit

L_MPOT
nOut_a

dnActRetain

[VAR_GLOBAL RETAIN]

Fig. 272

Programming to store the current output value after a supply interruption

In order to store the latest value at nOut_a after a supply interruption, you must declare a global variable of type RETAIN (VAR_GLOBAL RETAIN). Combine the variable as described in Fig. 272.

The current value at nOut_a is always stored in this variable. The variable will hold the value
after a supply interruption.

When the power is switched on again, the stored value is read into the FB L_MPOT from the
variable and applied as the starting value.

272

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.4 Speed preconditioning (L_NSET)

2.7.4

Speed preconditioning (L_NSET)


This FB conditions the main speed setpoint as well as an additional setpoint (or other signals) for the subsequent controller structure by using a ramp generator or fixed speeds.

nCInhVal_a bRfgStop_b bRfg0_b bNSetInv_b

ramp generator main setpoint

L_NSET
linking main setpoint and additional setpoint byArithFunction x +
/ - * x/(1-y) 32767

S-shape main setpoint nTiSShaped

nNSet_a
anJogSetValue(0) anJogSetValue(1) anJogSetValue(14)

0 1

nNOut_a

...

y bSShapeActive
nIEqOHysterisis

bJog1_b bJog2_b bJog4_b bJog8_b

DMUX
0 0 15 3
dnTir adnTir(0) adnTir(1) dnTif adnTif(0) adnTif(1) adnTif(14)

JOG 0...15

bRfgIEqO_b

...

adnTir(14)

bTI1_b bTI2_b bTI4_b bTI8_b nSet_a bLoad_b bNAddInv_b

DMUX
0 0 15 3

TI 0...15

...

dnTirAdd dnTifAdd
0 1

nNAdd_a bExternalCINH_b

CINH

ramp generator additional setpoint

Fig. 273

Speed preconditioning (L_NSET) Variable name nCInhVal_a Data type Integer Signal type analog Variable type VAR_INPUT Comment Here the signal is applied that the main setpoint integrator is to accept when the controller is inhibited (CINH). Holding (freezing) of the main setpoint integrator to its current value. Leads the mainsetpoint integrator via the current Titimes to 0. Control of the signal inversion for the main setpoint. Provided for main setpoint; other signals are permissible. Selection and control of overriding "fixed setpoints" for the main setpoint.

bRfgStop_b bRfg0_b bNSetInv_b nNSet_a bJog1_b bJog2_b bJog4_b bJog8_b bTI1_b bTI2_b bTI4_b bTI8_b nSet_a bLoad_b bAddInv_b

Bool Bool Bool Integer Bool Bool Bool Bool Bool Bool Bool Bool Integer Bool Bool

binary binary binary analog binary binary binary binary binary binary binary binary analog binary binary

VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT

Selection and control of alternative "fixed setpoints" for the main setpoint.

Here the signal is applied that the mainsetpoint integrator is to accept when bLoad_b = TRUE. Control of the two ramp generators in special situations, e.g. quick stop (QSP) Control of the signal inversion for the additional setpoint

LenzeDrive.lib EN 1.7

273

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.4 Speed preconditioning (L_NSET)

Variable name nNAdd_a bExternalCINH nNOut_a bRfgIEqO_b dnTir dnTif adnTir[0...14] adnTif[0...14] anJogSetValue[0...14] bSShapeActive nTiSShaped byArithFunction dnTirAdd dnTifAdd nlEqOHysteresis

Data type Integer Bool Integer Bool Double integer Double integer Array of double integers Array of double integers Array of integers Bool Integer Byte Double integer Double integer Integer

Signal type analog binary analog binary

Variable type VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN

Comment Provided for additional setpoint; other signals are permissible. Resets the ramp function generator and the additional ramp generator. Speed setpoint (16384 100 % nmax (C0011)) Status check Acceleration time Tir for the main setpoint Deceleration time Tif for the main setpoint Acceleration time Tir for the main setpoint Deceleration time Tif for the main setpoint Selectable fixed speeds Scurve ramp generator characteristic for the main setpoint Titime for the Scurve ramp generator Arithmetic function, combines mains and additional setpoints. Acceleration time Tir for the additional setpoint Deceleration time Tif for the additional setpoint Ramp generator threshold for the main setpoint

Parameter codes of the instances


Variable name dnTir adnTir[0...14] dnTif adnTif[0...14] anJogSetValue[0...14] bSShapeActive nTiSShaped byArithFunction dnTirAdd dnTifAdd nlEqOHysteresis L_NSET1 C0012 C0101/1 ... 15 C0013 C0103/1 ... 15 C0039/1 ... 15 C0134 C0182 C0190 C0220 C0221 C0241 Setting range 0.000 ... 999.900 sec 0.000 ... 999.900 sec 0.000 ... 999.900 sec 0.000 ... 999.900 sec 199.99 ... 199.99% 0 ... 1 0.01 ... 50.00 sec 0 ... 5 0.000 ... 999.900 sec 0.000 ... 999.900 sec 0.00 ... 100.00% Lenze 0.000 0.000 0.000 0.000 0.00 0 20.00 0 0.000 0.000 1.00

2.7.4.1

Main setpoint channel


The signals in the main setpoint channel are limited to the range of 32767. The signal at nNSet_a is initially led by the function JOGselect. A selected JOG value switches the input nNSet_a inactive. Then the following signal
conditioning uses the JOG value.

274

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.4 Speed preconditioning (L_NSET)

2.7.4.2

JOG setpoints
JOG setpoints are fixed values that are stored under anJogSetValue[0] ... anJogSetValue[14] in the memory.

The JOG values can be called up from the memory by bJog1_b ... bJog8_b.
These inputs are binary coded, so that 15 JOG values can be called.

The decoding for the enabling of the JOG values (calling from the memory) is carried out
according to the following table:
bJog8_b 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 Main setpoint of nNSet_a anJogSetValue[0] anJogSetValue[1] anJogSetValue[2] anJogSetValue[3] anJogSetValue[4] anJogSetValue[5] anJogSetValue[6] anJogSetValue[7] anJogSetValue[8] anJogSetValue[9] anJogSetValue[10] anJogSetValue[11] anJogSetValue[12] anJogSetValue[13] anJogSetValue[14] 0 = FALSE 1 = TRUE bJog4_b 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 bJog2_b 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 bJog1_b 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

The number of VAR_INPUT variables to be assigned depends on the number of JOG setpoints
required. A maximum of 4 VAR_INPUT variables and thus 15 selection possibilities are available.
Number of VAR_INPUT (bJog1_b ... bJog8_b) to be assigned at least 1 at least 2 at least 3 4

Number of the required JOG setpoints 1 1 ... 3 4 ... 7 8 ... 15

2.7.4.3

Setpoint inversion
The output signal of the JOG function is led via an inverter. The sign of the setpoint is inverted, when bNSetInv_b switches = TRUE .

LenzeDrive.lib EN 1.7

275

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.4 Speed preconditioning (L_NSET)

2.7.4.4

Ramp generator for the main setpoint


The setpoint is then led via a ramp generator with a linear characteristic. The ramp generator converts setpoint jumps at the input into a ramp.
[%] RFGOUT 100% w2

w1 0 t ir T ir t if T if t

T ir + t ir 100% w2 * w1 Fig. 274 Acceleration and deceleration times of the ramp generator w1 ,w2 RFGOUT Change of the main setpoint, depending on tir or tif Output of the ramp generator

T if + t if 100% w2 * w1

Titimes are fixed values that are stored under


adnTir[0] ... adnTir[14] (rampup times) and adnTif[0] ... adnTif[14] (rampdown times) in the memory.

The Titimes can be called from the memory by bTI1_b ... bTI8_b
These inputs are binary coded, so that 16 Titimes can be called. The Titimes can only be activated in pairs.

The decoding for the enabling of the Titimes (calling from the memory) is made according to
the following plan:
Acceleration time dnTir adnTir[0] adnTir[1] adnTir[2] adnTir[3] adnTir[4] adnTir[5] adnTir[6] adnTir[7] adnTir[8] adnTir[9] adnTir[10] adnTir[11] adnTir[12] adnTir[13] adnTir[14] 0 = FALSE 1 = TRUE Deceleration time dnTif adnTif[0] adnTif[1] adnTif[2] adnTif[3] adnTif[4] adnTif[5] adnTif[6] adnTif[7] adnTif[8] adnTif[9] adnTif[10] adnTif[11] adnTif[12] adnTif[13] adnTif[14] bTI8_b 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 bTI4_b 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 bTI2_b 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 bTI1_b 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

276

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.4 Speed preconditioning (L_NSET)

When the controller inhibit (CINH) is set, the ramp generator accepts the value at nCInhVal_a
and passes it on to the following function. This function has priority over all other functions.

bRfgStop_b = TRUE:
The ramp generator is stopped. Changes at the input of the ramp generator have no effect on the output signal.

bRfg0_b = TRUE:
The ramp generator decelerates to zero along its deceleration ramp.

It is also possible to load the ramp generator online with a defined value. For this bLoad_b

must be set = TRUE. As long as this input is set, the value at nNSet_a is accepted by the ramp generator and provided at the output.

Priorities:
CINH 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 = FALSE 1 = TRUE 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 bLoad_b 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 bRfg0_b bRfgStop_b 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Function RFG follows the input value via the set ramps. The value at the output of RFG is frozen. RFG decelerates to zero along the set deceleration ramp. RFG takes the value at nSet_a and provides it at its output.

RFG takes the value at nCInhVal_a and provides it at its output.

2.7.4.5

Sramp
A PT1 element is connected to the linear ramp generator. This arrangement implements an Sramp for an almost jerkfree acceleration and deceleration.

The PT1 section is switched on/off with bSShapeActive. The time constant is set with nTiSShaped.

2.7.4.6

Arithmetic operation
The arithmetic module makes an arithmetical combination of the main setpoint and the additional setpoint. The arithmetical combination is selected by byArithFunction.
byArithFunction 0 1 2 3 4 5 Function nNout_a = x (y is not processed) nNout_a = x + y nNout_a = x y nNout_a = x * y nNout_a = x / |y| nNout_a = x / (100% y) x@y 16384 nNOut_a + |x| @ 164 y nNOut_a + nNOut_a + x @ 16384 16384 * y Example

LenzeDrive.lib EN 1.7

277

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.4 Speed preconditioning (L_NSET)

2.7.4.7

Additional setpoint
Via nNAdd_a you can combine an additional setpoint (e.g. a correction signal) with the main
setpoint.

Via bNAddInv_b you can invert the input signal, before it is applied to the ramp generator. The
ramp generator has a linear characteristic. Its Titimes are set with dnTirAdd (rampup time) and dnTifAdd (rampdown time). Titimes. The same applies when controller inhibit (CINH) is set.

If bLoad_b = TRUE, the ramp generator is set to 0 and held there, without considering the

278

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.5 Process controller (L_PCTRL)

2.7.5

Process controller (L_PCTRL)


This FB is used, for instance, as a higherlevel controller (dancer position controller, tension controller, pressure controller, etc.). Setpoint and actual value are sent to the process controller via the corresponding inputs and processed according to the selected control algorithm (PID, PI or Palgorithm).
b y P C h a r a c te r is tic n V p

L _ P C T R L
n A c tV p

n A d a p t_ a
2 3 n S e t1 A d a p t s o ll1

V p

n V p 1 2 3

V p 2 n V p 2 A d a p t V p n V p

V p 2 n V p 2 A d a p t V p 3 n V p 3 A d a p t s o ll2 n S e t2 A d a p t

d n T ir

b B iU n ip o la r d n T n n K d

1 6 3 8 4 n O u t_ a

n S e t_ a

n A c t_ a b In A c t_ b b IO ff_ b n In flu _ a

d n T if R E S E T

Fig. 275

Process controller (L_PCTRL) VariableName nAdapt_a DataType Integer SignalType analog VariableType VAR_INPUT Note Gain Vp Value range: 32767 You can alter the gain online. Input of the process setpoint. Range of possible values: 32767 The rate of change of stepchange signals can be slowed by using the ramp generator (with dnTir and dnTif). Actual value input Value range: 32767 Deactivation of the process controller. You can carry out this function online. Set Icomponent to 0. You can carry out this function online. Evaluation or suppression of the output signal. Value range: 32767 Output signal. Value range 16384 (bipolar), or 0 ... 16384 (unipolar) Shows the actual gain. Gain Vp (10 1.0) Integralaction time Tn (20 20 ms) Differential component Kd (10 1.0) Vp2 process controller adaptation (64 1.0) Vp3 process controller adaptation (64 1.0) Set1 process controller adaptation (16384 100.00 %) Set2 process controller adaptation (16384 100.00 %) Function selection for the provision of the Pgain Acceleration time Tir (1000 1.000 s) Deceleration time Tif (1000 1.000 s) Value range of the output signal

nSet_a

Integer

analog

VAR_INPUT

nAct_a bInAct_b bIOff_b nInflu_a nOut_a nActVp nVp dnTn nKd nVp2Adapt nVp3Adapt nSet1Adapt nSet2Adapt byPCharacteristic dnTir dnTif bBiUnipolar

Integer Bool Bool Integer Integer Integer Integer Double integer Integer Integer Integer Integer Integer Byte Double integer Double integer Bool

analog binary binary analogs analog

VAR_INPUT VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_OUTPUT VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN VAR CONSTANT RETAIN

LenzeDrive.lib EN 1.7

279

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.5 Process controller (L_PCTRL)

Parameter codes of the instances


VariableName nVp dnTn nKd nVp2Adapt nVp3Adapt nSet1Adapt nSet2Adapt byPCharacteristic dnTir dnTif bBiUnipolar L_PCTRL1 C0222 C0223 C0224 C0325 C0326 C0328 C0327 C0329 C0332 C0333 C0337 SettingRange 0.1 ... 500.0 20 ... 99999 ms 0.0 ... 5.0 0.1 ... 500.0 0.1 ... 500.0 0.00 ... 100.00 % 0.00 ... 100.00 % 0 ... 3 0.000 ... 999.900 sec 0.000 ... 999.900 sec 0 ... 1 Lenze 1.0 400 0.0 1.0 1.0 0.00 100.00 0 0.000 0.000 0

Range of functions

Control characteristic Ramp generator Value range of the output signal Evaluation of the output signal Deactivation of the process controller

2.7.5.1

Control characteristic
In the default setting, the PID algorithm is active. Differential component Kd You can deactivate the Kdcomponent by setting nKd = 0.0. The controller now becomes a PIcontroller (or Pcontroller if the Icomponent is also switched off). Integralaction component I You can switch off the Icomponent with

bIOff_b = TRUE, or on with bIOff_b = FALSE.


Switching on and off can also be done online. If the Icomponent is to be switched off permanently, set bIOff_b to TRUE. Integralaction time Tn By using nTn you can set the parameter for the integralaction time.

280

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.5 Process controller (L_PCTRL)

Gain Vp The gain Vp can be set in different ways. By using byPCharacteristic you can select the function you require. With nActVp you can display the actual value of the gain Vp. byPCharacteristic = 0:

The gain Vp is provided by nVp.


byPCharacteristic = 1:
Vp nVp

nVp2Adapt nAdapt_a 0 Fig. 276 The gain Vp is provided by nAdapt_a 100%

The gain Vp is provided by nAdapt_a. The input value is led via a linear characteristic. The

slope of the characteristic is fixed by nVp(upper limit) and nVp2Adapt (lower limit). The value in nVp is valid if the input value = +100 % or 100 % (100 % = 16384). The value in nVp2Adapt is valid if the input value = 0.

byPCharacteristic = 2:
Vp nVp nVp2Adapt nVp3Adapt nSet1Adapt Fig. 277 The gain Vp derived from the process setpoint nSet_a nSet_a nSet2Adapt

The gain Vp is derived from the process setpoint nSet_a. The setpoint is acquired after the
ramp generator, and calculated from a characteristic with 3 interpolation points. byPCharacteristic = 3:

The gain Vp is derived from the control difference, and led by the same characteristic
generation as for byPCharacteristic = 2.

LenzeDrive.lib EN 1.7

281

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.5 Process controller (L_PCTRL)

2.7.5.2

Ramp generator
The setpoint at nSet_a is led via a ramp generator with a linear characteristic (100 % 16384 nmax (C0011)). This means that setpoint jumps at the input can be converted into a ramp.
[%] RFGOUT 100% w2

w1 0 t ir t ir t if t if t

T ir + t ir 100% w2 * w1 Fig. 278 Acceleration and deceleration times of the ramp generator w1 ,w2 RFGOUT Change of the main setpoint, depending on tir or tif Output of the ramp generator

T if + t if 100% w2 * w1

The ramps can be adjusted separately for acceleration and deceleration:


Acceleration time tir with dnTir Deceleration time tif with dnTif

Using bInAct_b = TRUE sets the ramp generator immediately to 0.

2.7.5.3

Value range of the output signal


In the factory setting, the process controller has bipolar operation (bBiUnipolar = 0).
The output signal is limited to 100 % (16384).

Using bBiUnipolar = 1 the process controller has unipolar operation.


The output signal is limited to 0 ... +100 % (0 ... 16384).

2.7.5.4

Evaluation of the output signal


The limitation is followed by an evaluation of the output signal by nInflu_a.
The calculation is done according to the following formula: nOut_a + (Values after the limitation) @ nInflu_a 16384

2.7.5.5

Deactivation of the process controller


bInAct_b = TRUE deactivates the process controller. This means that
nOut_a is set = 0. the Icomponent is set = 0. the ramp generator is set = 0.

282

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.6 Right/Left/Quickstop (L_RLQ)

2.7.6

Right/Left/Quickstop (L_RLQ)
This FB links the input for the direction of rotation and the QSP function, and is safe against an open circuit.
L_RLQ
bCw_b bCCw_b bQSP_b bCwCCw_b

Fig. 279

Right/Left/Quickstop (L_RLQ) VariableName bCw_b bCCw_b bCwCCw_b bQSP_b DataType Bool Bool Bool Bool SignalType binary binary binary binary VariableType VAR_INPUT VAR_INPUT VAR_OUTPUT VAR_OUTPUT Note Right Left Status Right/Left Set Quickstop

Function

After mains connection and simultaneous TRUE at both inputs, the outputs are set as
follows:
Inputs bCw_b 1 0 = FALSE 1 = TRUE bCCw_b 1 bCwCCw_b 0 Outputs bQSP_b 1

The following truthtable results only if the inputs were set to TRUE once after power
switchon
Inputs bCw_b 0 1 0 1 bCCw_b 0 0 1 1 bCwCCw_b 0 1 1 unchanged Outputs bQSP_b 1 0 0 unchanged

0 = FALSE 1 = TRUE If you set both inputs to TRUE during operation, both outputs still have their previous output value.

LenzeDrive.lib EN 1.7

283

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Special functions
2.7.6 Right/Left/Quickstop (L_RLQ)

284

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Appendix

Appendix

3.1

Code table
How to read the code table:

Column Code

Abbreviation Cxxxx 1 2 [Cxxxx]

LCD

Lenze Choice 1 IMPORTANT {1 %}

Meaning Code Cxxxx Subcode 1 of code Cxxxx Subcode 2 of code Cxxxx Parameter value of the code can only be modified when the controller is inhibited. Keypad LCD DIS: Display only All others are parameter values. Lenze setting of the code The column IMPORTANT contains further information. 99 Minimum value {Smallest step/unit} Maximum value Additional, important explanation of the code

Code

LCD

Possible settings Lenze Choice 0.000 {0.001 s} 0.000

IMPORTANT 999.900 Acceleration time Tir for the main setpoint of L_NSET1 Related to the speed change 0 ... nmax. 999.900 Deceleration time Tif for the main setpoint of L_NSET1 Related to the speed change nmax ... 0. 199.99 Fixed speeds (JOG setpoints) can be selected for L_NSET1 using digital inputs.

Info ^ 273

C0012 dnTir

C0013 dnTif

0.000

0.000

{0.001 sec}

^ 273

C0039 1 ... 14 15 C0101 1 2 ... 15 C0103 1 2 ... 15

199.99 anJOGSetValue1 ... anJOGSetValue14 anJOGSetValue15 adnTir1 adnTir2 ... adnTir15 adnTif1 adnTif2 ... adnTif15 0.00 ... 0.00 0.00 0.000 0.000 0.000 ... 0.000 0.000 0.000 0.000 ... 0.000

{0.01}

^ 273

{0.001 sec}

999.900 Additional acceleration times Tir for the ^ 273 main setpoint of L_NSET1 Related to the speed change 0 ... nmax. 999.900 Additional deceleration times Tif for the ^ 273 main setpoint of L_NSET1 Related to the speed change nmax ... 0. Ramp generator characteristic for the main setpoint of L_NSET1 ^ 273 ^ 273 ^ 273

{0.001 sec}

C0134 bSShapeActive 0 C0182 nTiSShaped 20.00 0 linear 1 Sshaped 0.01 sec

Linear Sshaped {0.01 sec} 50.00 sec Titime of the Scurve ramp generator for L_NSET1 Determines the S curve Low values small Srounding High values large Srounding

LenzeDrive.lib EN 1.7

31

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Appendix

Code

LCD

Possible settings Lenze Choice 0 1 2 3 4 5 0.000 OUT = C46 C46 + C49 C46 C49 C46 * C49 C46 / C49 C46/(100 C49) {0.001 sec} 0

IMPORTANT

Info

C0190 byArithFunction

Arithmetic block in the function block ^ 273 L_NSET1 Combines main setpoint C0046 and additional setpoint C0049.

C0220 dnTirAdd

0.000

999.900 Acceleration time Tir of the additional setpoint for L_NSET1 Related to the speed change 0 ... nmax. 999.900 Deceleration time Tif of the additional setpoint for L_NSET1 Related to the speed change nmax ... 0. 500.0 Gain Vpof L_PCTRL1 99999 Integral component Trof L_PCTRL1

^ 273

C0221 dnTifAdd

0.000

0.000

{0.001 sec}

^ 273

C0222 nVp C0223 nTn C0224 nKd C0241 nIEqOHysteresis

1.0 400 0.0 1.00

0.1 20 99999 ms 0.0 0.00 100 % = nmax 199.99 199.99 0.1 0.1

{0.1} {1 msec} switched off {0.1} {0.01 %}

^ 279 ^ 279

5.0 Differential component Kd of L_PCTRL1 ^ 279 100.00 Threshold ramp generator for main ^ 273 setpoint of L_NSET1 Input = output 199.99 Upper limit of L_MPOT1 Mandatory is: C0260 > C0261 199.99 Lower limit of L_MPOT1 Mandatory is: C0261 < C0260 6000.0 Acceleration time Tir of L_MPOT1 Related to change 0 ... 100 %. 6000.0 Deceleration time Tif of L_MPOT1 Related to change 0 ... 100 %. Deactivation function of L_MPOT1 Function which is executed when motor pot is deactivated via the input MPOT1INACTIVE. No change Deceleration with Tif to 0 % Deceleration with Tif to C0261 Inhibit with Tif = 0 to 0 % Inhibit with Tif = 0 to C0261 Acceleration with Tir to C0260 Initialisation function of L_MPOT1 Value which is accepted during mains switching and activated motor pot. Value during mains failure Lower limit of C0261: 0 % ^ 270 ^ 270 ^ 270 ^ 270 ^ 270

C0260 nHighLimit C0261 nLowLimit C0262 wTir C0263 wTif C0264 byFunction

100.00 100.0 10.0 10.0 0

{0.01 %} {0.01 %} {0.1 s} {0.1 s}

0 1 2 3 4 5 C0265 byInitFunction 0

No function Down to 0 % Down to C261 Jump 0 % Jump to C261 Up to C260

^ 270

^ 270

C0325 nVp2Vdapt C0326 nVp3Adapt C0327 nSet2Adapt

1.0 1.0 100.00

0 1 2 0.1 0.1 0.00

Power off C0261 0% {0.1} {0.1} {0.01 %}

^ 270

500.0 Gain adaptation (Vp2) of L_PCTRL1 500.0 Gain adaptation (Vp3) of L_PCTRL1 100.00 Adaptation nset2of L_PCTRL1 Set speed threshold of the process controller adaptation Mandatory is: C0327 > C0328 100.00 Adaptation nset1of L_PCTRL1 Set speed threshold of the process controller adaptation Mandatory is: C0328 < C0327

^ 279 ^ 279 ^ 279

C0328 nSet1Adapt

0.00

0.00

{0.01 %}

^ 279

32

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Appendix

Code

LCD

Possible settings Lenze 0 Choice 0 1 2 3 no External Vp Setpoint Ctrl diff {0.001 sec}

IMPORTANT Activate adaptation of L_PCTRL1 no process controller adaptation external via input Adaptation via setpoint Adaptation via control difference 999.900 Acceleration time Tirof L_PCTRL1 Referred to the setpoint change 0 ... 100 %. 999.900 Deceleration time Tirof L_PCTRL1 Referred to the setpoint change 0 ... 100 %. Effective range bipolar/unipolar of L_PCTRL1 Function arithmetic block L_ARIT1 Combines inputs nIn1_a and nIn2_a .

Info ^ 279 ^ 279

C0329 byPCharacteristic

C0332 PCTRLdnTir

0.000

0.000

^ 279

C0333 dnTif

0.000

0.000

{0.001 sec}

^ 279

C0337 bBiUnipolar C0338 byFunction

0 1

0 1 0 1 2 3 4 5 199.99

bipolar unipolar OUT = nIn1_a nIn1_a + nIn2_a nIn1_a nIn2_a nIn1_a * nIn2_a nIn1_a / nIn2_a nIn1_a / (100 nIn2_a) {0.01 %}

^ 279 ^ 211

C0560 1 ... 14 15

199.99 Fixed setpoints for L_FIXSET1

^ 22

anSollW1 ... anSollW14 anSollW15

0.00 ... 0.00 0.00 1 0 1 2 3 4 5 OUT = nIn1_a nIn1_a + nIn2_a nIn1_a nIn2_a nIn1_a * nIn2_a nIn1_a / nIn2_a nIn1_a / (100 nIn2_a) {0.01} {0.01 %} {0.01 %} {0.01 %} {0.01 sec} {0.01} {0.001 sec} 10.00 100.00 199.99 199.99 50.00 320.00 5.000 Function arithmetic block L_ARIT2 Combines inputs nIn1_a and nIn2_a . ^ 211

C0600 byFunction

C0620 C0621 C0630 C0631 C0640 C0650 C0651 C0653

nGain nDeadBand nMaxLimit nMinLimit nDelayTime nGain nDelayTime bySensibility

1.00 1.00 100.00 100.0 20.00 1.00 1.000 1

10.00 0.00 199.99 199.99 0.01 320.00 0.005 1 15 Bit 2 14 Bit 3 13 Bit 4 12 Bit 5 11 Bit 6 10 bit 7 9 Bit 32767 1 0.000 0.000 1 2 3 4 5 6 0.00 0.00

Gain for deadband component L_DB1 Deadband of DB1 Upper limit of limiter L_LIM1 Upper limit of limiter L_LIM1 Time constant of L_PT1_1 Gain of LDT1_1 Time constant of L_DT1_1 Input sensitivity of L_DT1_1

^ ^ ^ ^ ^ ^ ^ ^

220 220 222 222 223 221 221 221

C0655 nNumerator C0656 nDenominator C0671 dnTir C0672 dnTif C0680 byFunction

1 1 0.000 0.000 6

{1} {1} {0.01 sec} {0.01 sec} nIn1 = nIn2 nIn1 > nIn2 nIn1 < nIn2 |nIn1| = |nIn2| |nIn1| > |nIn2| |nIn1| < |nIn2| {0.01 %} {0.01 %}

32767 Numerator for L_CONV5 ^ 249 32767 Denominator for L_CONV5 ^ 249 999.900 Acceleration time Tir of ramp generator ^ 224 L_RFG1 999.900 Deceleration time Tif of L_RFG1 Function comparator L_CMP1 Compares the inputs nIn1 and nIn2 ^ 224 ^ 213

C0681 nHysteresis C0682 nWindow

1.00 1.00

100.00 % Hysteresis of L_CMP1 100.00 % Window of L_CMP1

^ 213 ^ 213

LenzeDrive.lib EN 1.7

33

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Appendix

Code

LCD

Possible settings Lenze Choice 1 2 3 4 5 6 0.00 0.00 1 2 3 4 5 6 0.00 0.00 1 2 nIn1 = nIn2 nIn1 > nIn2 nIn1 < nIn2 |nIn1| = |nIn2| |nIn1| > |nIn2| |nIn1| < |nIn2| {0.01 %} {0.01 %} nIn1 = nIn2 nIn1 > nIn2 nIn1 < nIn2 |nIn1| = |nIn2| |nIn1| > |nIn2| |nIn1| < |nIn2| {0.01 %} {0.01 %} dnIn1_p < dnIn2_p |dnIn1_p| < |dnIn2_p| 1

IMPORTANT Function comparator L_CMP2 Compares the inputs nIn1 and nIn2

Info

C0685 byFunction

C0686 nHysteresis C0687 nWindow C0690 byFunction

1.00 1.00 1

100.00 % Hysteresis of L_CMP2 ^ 213 100.00 % Window of L_CMP2 ^ 213 Function comparator L_CMP3 Compares the inputs nIn1 and nIn2

C0691 nHysteresis C0692 nWindow C0695 byFunction

1.00 1.00 2

100.00 % Hysteresis of L_CMP3 100.00 % Window of L_CMP3 Function comparator for phase signals L_PHCMP1 Compares the inputs dnIn1_p and dnIn2_p Edgeevaluation function of L_TRANS1

^ 213 ^ 213 ^ 240

C0710 byFunction

C0711 wPulseTime C0715 byFunction

0.001 0

C0716 wPulseTime C0720 byFunction

0.001 2

C0721 wDelayTime C0725 byFunction

1.000 0

C0726 C0940 C0941 C0945 C0946 C0950 C0951 C0955 C0956 C0960

WDelayTime nNumerator nDenominator nNumerator nDenominator nNumerator nDenominator nNumerator nDenominator byFunction

1.000 1 1 1 1 1 1 1 1 1

C0961 ny0 C0962 ny1 C0963 ny2 C0964 ny100 C0965 nx1

0.00 50.00 75.00 100.00 50.00

0 1 2 0.001 0 1 2 0.001 0 1 2 0.001 0 1 2 0.001 32767 1 32767 1 32767 1 32767 1 1 2 3 0.00 0.00 0.00 0.00 0.01

Rising edge Falling edge Both edges {0.001 sec} Rising edge Falling edge Both edges {0.001 sec} On delay Off delay On/Off delay {0.001 sec} On delay Off delay On/Off delay {0.001 sec} {1} {1} {1} {1} {1} {1} {1} {1} Function 1 Function 2 Function 3 {0.01 %} {0.01 %} {0.01 %} {0.01 %} {0.01 %}

^ 236

60.000 Pulse time of TRANS1 Edgeevaluation function of L_TRANS2

^ 236 ^ 236

60.000 Pulse duration of L_TRANS2 Function digital delay component L_DIGDEL1 60.000 Delay time of L_DIGDEL1 Function digital delay component L_DIGDEL2 60.000 32767 32767 32767 32767 32767 32767 32767 32767 Delay time of L_DIGDEL2 Numerator for L_CONV1 Denominator for L_CONV1 Numerator for L_CONV2 Denominator for L_CONV2 Numerator for L_CONV3 Denominator for L_CONV3 Numerator for L_CONV4 Denominator for L_CONV4 Characteristic CURVE1IN

^ 236 ^ 230

^ 230 ^ 230

^ ^ ^ ^ ^ ^ ^ ^ ^ ^

230 249 249 249 249 249 249 249 249 217

199.99 Ordinate of the valuepair (x = 0 % / y0) of L_CURVE1 199.99 Ordinate of the valuepair (x1 / y1) of L_CURVE1 199.99 Ordinate of the valuepair (x2 / y2) of L_CURVE1 199.99 Ordinate of the valuepair (x = 100 % / y100) of L_CURVE1 100.00 Abscissa of the valuepair (x1 / y1) of L_CURVE1

^ 217 ^ 217 ^ 217 ^ 217 ^ 217

34

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Appendix

Code

LCD

Possible settings Lenze Choice 0.01 31 0 0 1 2 3 14 21 22 {0.01 %} {1} {1} OUT = dnIn1_p dnIn1_p + dnIn2_p dnIn1_p dnIn2_p dnIn1_p * dnIn2_p dnIn1_p / dnIn2_p dnIn1_p + dnIn2_p (no limit) dnIn1_p dnIn2_p (no limit) {0.001 %} {0.001 sec} Return Hold Rising edge Falling edge Both edges {0.001 sec} Rising edge Falling edge Both edges {0.001 sec} Load perm Load edge Cmp & sub {1} {1} {1} dnIn1_p < dnIn2_p |dnIn1_p| < |dnIn2_p| 75.00 0 1 1

IMPORTANT 99.00 Abscissa of the valuepair (x2 / y2) of L_CURVE1 31 Division factor of phase division L_PHDIV1 31 Factor Function of L_ARITPH1

Info ^ 217 ^ 242 ^ 250 ^ 238

C0966 nx2 C0995 byDivision C1000 nDivision C1010 byFunction

C1040 dwTi C1041 dwJerk C1100 byFunction C1140 byFunction

C1141 wPulseTime C1145 byFunction

C1146 wPulseTime C1150 byMode

C1151 C1170 C1171 C1207

dnCmp nNumerator nDenominator byFunction

100.000 0.001 0.200 0.001 1 1 2 0 0 1 2 0.001 0.001 0 0 1 2 0.001 0.001 0 0 1 2 2 109 0 1 32767 1 1 2 1 2

5000.000 Acceleration of L_SRFG1 999.999 Jolt of L_SRFG1 Function of L_FCNT1 Edgeevaluation function of L_TRANS3

^ 228 ^ 228 ^ 232 ^ 236

60.000 Pulse duration of L_TRANS3 Edgeevaluation function of L_TRANS4

^ 236 ^ 236

60.000 Pulse duration of L_TRANS4 Function of L_PHINTK

^ 236 ^ 243

2000000000 Comparison value of L_PHINTK 32767 Numerator for L_CONV6 32767 Denominator for L_CONV6 Function comparator for phase signals L_PHCMP2 Compares the inputs dnIn1_p and dnIn2_p Function comparator for phase signals L_PHCMP3 Compares the inputs dnIn1_p and dnIn2_p Channel selection for communication via system bus with L_ParWrite/L_ParRead

^ ^ ^ ^

243 249 249 240

C1272 byFunction

1 2

dnIn1_p < dnIn2_p |dnIn1_p| < |dnIn2_p|

^ 240

C2118

0 1

Communication via 2 free PDO channels Communication via SDO 2channel

^ 255 ^ 259

LenzeDrive.lib EN 1.7

35

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Appendix

36

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Index

4
A

Index
F
Fault trigger (L_FWM), 268 Flipflop (FLIP), 233

Absolute value generation (L_ABS), 24 Actual phaseangle integrator (L_PHDIFF), 241 Addition (L_ADD), 25 Additional setpoint, 278 Appendix, 31 Arithmetic (L_ARIT), 211 Arithmetic (L_ARITPH), 238

Function blocks
Absolute value generation (L_ABS), 24 Addition (L_ADD), 25 Addition (L_PHADD), 239 Arithmetic (L_ARIT), 211 Arithmetic (L_ARITPH), 238 Changeover (L_ASW), 212 Comparison (L_CMP), 213 Comparison (L_PHCMP), 240 Conversion (L_CONVVV), 252 conversion of a phaseangle signal (L_CONVPP), 251 Conversion of phaseangle to analog (L_CONVPA), 250 Curve function (L_CURVE), 217 Dead band (L_DB), 220 Delay (L_DIGDEL), 230 Delay (L_PT1_), 223 Difference (L_PHDIFF), 241 Differentiation (L_DT1_), 221 Division (L_PHDIV), 242 Edge evaluation (L_TRANS), 236 fault trigger (L_FWM), 268 Flipflop (L_FLIP), 233 Input gain and offset (L_AIN), 26 Integration (L_PHINT), 243 Integration (L_PHINTK), 245 Inversion (L_ANEG), 28 L_ByteArrayToDint, 254 L_DintToByteArray, 254 L_FUNCodeIndexConv, 254 L_ParRead, 255 L_ParWrite, 259 Limiting (L_LIM), 222 Logical AND (L_AND), 229 Logical NOT (L_NOT), 234 Logical OR (L_OR), 235 Motor potentiometer (L_MPOT), 270 Normalization (L_CONV), 249 Normalization with limiting (L_CONVX), 253 Output gain and offset (L_AOUT), 29 process controller (L_PCTRL), dancer position, tension, pressure controller, 279 Programming fixed setpoints (L_FIXSET), 22 Ramp generator (L_RFG), 224 Right/Left/Quickstop (L_RLQ), 283 Sramp generator (L_SRFG), 227 Sample & Hold (L_SH), 226 Speed preconditioning (L_NSET), 273 Transparent mode with EMZ9371BB/BC (L_Display9371BB), 263 Up/down counter (L_FCNT), 232

C
Changeover (L_ASW), 212 Code index (L_FUNCodeIndexConv), 254 Code table, 31 Comparison (L_CMP), 213 Control characteristic, 280 Conversion (L_CONVVV), 252 Conversion of a phaseangle signal (L_CONVPP), 251 Conversion of phaseangle to analog (L_CONVPA), 250 Curve function (L_CURVE), 217

D
datatype entry, Explanation of, 14 Dead band (L_DB), 220 Delay (L_DIGDEL), 230 Delay (L_PT1_), 223 Differentiation (L_DT1_), 221 Division (L_PHDIV), 242

E
Edge evaluation (L_TRANS), 236

LenzeDrive.lib EN 1.7

41

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Index

I
identifier, Explanation of, 14 Input gain and offset (L_AIN), 26 Integration (L_PHINT), 243
Calculate the output signal, 244 Constant input value , 243

L_FLIP, 233 L_FUNCodeIndexConv, 254 L_FWM, 268 L_LIM, 222 L_MPOT, 270 L_NOT, 234 L_NSET, 273 L_OR, 235 L_ParRead, 255 L_ParWrite, 259

Integration (L_PHINTK), 245


Calculate the output signal, 248 Constant input value , 246 Input value with change of sign , 247

Inversion (L_ANEG), 28

J
JOG setpoints, 275

L_PHADD, 239 L_PHCMP, 240 L_PHDIFF, 241 L_PHDIV, 242 L_PHINT, 243 L_PHINTK, 245 L_PT1_, 223 L_RFG, 224 L_RLQ, 283 L_SH, 226 L_SRFG, 227 L_TRANS, 236 Lenze software guidelines, Hungarian Notation, 13 Limiting (L_LIM), 222 Logical AND (L_AND), 229 Logical NOT (L_NOT), 234 Logical OR (L_OR), 235

K
Keypad, 265

L
L_ABS, 24 L_ADD, 25 L_AIN, 26 L_AND, 229 L_ANEG, 28 L_AOUT, 29 L_ARIT, 211 L_ARITPH, 238 L_ASW, 212 L_ByteArrayToDint, 254 L_CMP, 213 L_CONV, 249 L_CONVPA, 250 L_CONVPP, 251 L_CONVVV, 252 L_CONVX, 253 L_CURVE, 217 L_DB, 220 L_DIGDEL, 230 L_DintToByteArray, 254 L_Display9371BB, 263 L_DT1_, 221 L_FCNT, 232 L_FIXSET, 22

M
Main setpoint channel, 274 Motor potentiometer (L_MPOT), 270

N
Normalization (L_CONV), 249 Normalization with limiting (L_CONVX), 253

O
Output gain and offset (L_AOUT), 29

42

LenzeDrive.lib EN 1.7

efesotomasyon.com - Lenze

Function library LenzeDrive.lib


Index

P
Phase addition block (L_PHADD), 239 Phase comparator (L_PHCMP), 240 prefix, Explanation of, 13 Process controller (L_PCTRL)
control characteristic, 280 dancer position, tension, pressure controller, 279 ramp generator, 282

Speed preconditioning (L_NSET), 273


Additional setpoint, 278 JOG setpoints, 275 Main setpoint, 274 Sramp, PT1 element, 277 Setpoint inversion, Ramp generator, main setpoint, 275

System variables, Explanation of, 15

T
Table of ASCII characters, 266 Term definitions, 12

Programming fixed setpoints (L_FIXSET), 22

R
Ramp generator, 282 Ramp generator (L_RFG), 224 Read codes (L_ParRead), 255 Right/Left/Quickstop (L_RLQ), 283

Transparent mode with EMZ9371BB/BC (L_Display9371BB), 263 Type conversion (L_ByteArrayToDint), 254 Type conversion (L_DintToByteArray), 254 Type of variable, Identification, 14

S
Sramp, PT1 element, 277 Sramp generator (L_SRFG), 227 Safety information, Layout
Other notes, 12 Warning of material damage, 12

U
Up/down counter (L_FCNT), 232

V
Variable names
Conventions, Hungarian Notation, 13 Lenze software guidelines, Explanation of, 13

Sample & Hold (L_SH), 226 Setpoint inversion, Ramp generator, main setpoint , 275 Signal type, Explanation of, 15 Sin(2)curve, 227

Version identifiers of the function library, 16

W
Write codes (L_ParWrite), 259

LenzeDrive.lib EN 1.7

43

You might also like