L AIF ProgrammingGuide
L AIF ProgrammingGuide
AIF Function
_ _ _ _ _ _Blocks
________________________ Reference Manual EN
This manual applies to the Automation Building Blocks AIF Function Blocks.
Copyright
© 2025 Lenze SE. All rights reserved.
Imprint
Lenze SE
Hans-Lenze-Strasse 1, D-31855 Aerzen, Germany
Phone: +49 (0)5154 / 82-0
Fax: +49 (0)5154 / 82-2111
E-Mail: Lenze@[Link]
Copyright information
All texts, photos and graphics contained in this documentation are subject to copyright
protection. No part of this documentation may be copied or made available to third parties
without the explicit written approval of Lenze SE.
Liability
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 correction will be included in updates of this documentation.
Trademarks
Microsoft, Windows and Windows NT are registered trademarks or trademarks of the Mi-
crosoft Corporation in the USA and/or other countries.
Adobe and Reader are registered trademarks or trademarks of Adobe System Incorporated in
the USA and/or other countries.
Any additional trade names given in this documentation are trademarks of their correspond-
ing owners.
Contents
1 Function Blocks
Version Desciption
0.1 24/11/2025 LSE MH(SL) first edition
0.2 04/12/2025 LSE MH(SL) update to simplified GSD identification method
Note:
The terminal connection diagrams appearing in this manual show the wiring required
to operate the software on a sample demo rig.
This manual uses the following conventions to distinguish between different types of information:
Variable Names
The conventions used by Lenze for the variable names of Lenze system blocks, function blocks and
functions are based on the "Hungarian Notation". This notation makes it possible to identify the
most important properties (e.g. the data type) of the corresponding variable by means of its name,
e.g. xAxisEnabled.
2 Function Blocks
The function blocks L_AIF_Base, L_AIF_IN and L_AIF_OUT aim at replacement scenarios of the 9300
servo inverter series by Lenze’s latest CbM/DbM systems such as the i950.
EMF2133IB
???????
(PROFIBUS slave module)
(PROFIBUS slave module)
Illustration 1: 9300 servo inverter with PROFIBUS module1 Illustration 2: i950 servo inverter with PROFIBUS slot module
Note:
In many cases, a one-to-one replacement might be required, not touching the logic
PLC’s program.
1 For Lenze devices such as 9300, two AIF modules for PROFIBUS were available:
1 = EMF2133IB with an extended scope of GSD/GSE configurations (see chapter 4.1)
2 = EMF2131IB with a basic scope of GSD/GSE configurations (only Drivecom drive profile with 1 … 4 process data)
Automation Building Blocks 2-3
2 Function Blocks
1.3 Conventions used
Three function blocks exist, splitting the AIF field bus communication into three sub-functions:
L_AIF_IN: L_AIF_OUT:
field bus process data from the field bus data process data to
logic PLC the logic PLC
L_AIF_Base:
- field bus initialization
- request data of the field bus DP V0 parameter
channel from the logic PLC (optional)
- response data of the field bus DP V0 parameter
channel to the logic PLC (optional)
Illustration 3: overview on the process data communication (PDO) and parameter channel communication (SDO)
1. A function block L_AIF_IN to extract the process data control information from the raw data
received on PROFIBUS. The method provides the process data in the form of the AIF-IN format
of the 9300 servo inverter (see chapters 2.2.1 and 3).
2. A function block L_AIF_OUT to compile the complete field bus telegram to be transmitted to
the logic PLC. The method reads the process data control information in the form of the AIF-
OUT format of the 9300 servo inverter (see chapters 2.2.1 and 0).
3. The function block L_AIF_Base, processing the communication set-up and the DP V0 parameter
channel (see chapter 0).
Note:
Always declare and call the AIF function blocks in the following order:
• L_ AIF_Base
• L_ AIF_IN
• L_ AIF_OUT
The function block L_AIF_Base must always be integrated in the PLC project for correct initialization
of the GSD/GSE configuration. If configured, the block additionally processes the DP V0 parameter
channel if selected.
process data communication (PZD) process data communication (PZD) + parameter channel (PAR)
Illustration 4: no parameter channel (PZD only) Illustration 5: with parameter channel (PZD + PAR)
In case of a parameter channel configured, the lowest 8 bytes of the raw data received on
L_AIF_IN.adwFieldBusIn / transmit on L_AIF_OUT.adwFieldBusOut are interpreted as shown in the
appendix, chapters 4.6 and 4.7.
In migration scenarios, the superposed logic PLC still addresses codes/sub-codes of the Lenze GDC3
devices 8200/9300 (legacy devices), not available on the i950 servo inverter.
3 GDC = Global Drive Control, one of the most successful inverter/servo inverter series of Lenze
Automation Building Blocks 2-6
2 Function Blocks
2.1 Function Block L_AIF_Base
Example:
Illustration 7: 9300 servo inverter (legacy product) Illustration 8: i950 servo inverter (actual product)
Because of the mismatch between the old GDC device’s code list and the current i950’s index list,
an internal re-mapping of codes/sub-codes to current (user-) indexes is required. The correspond-
ence between old GDC codes and the i950 indexes is defined via a mapping table on the input/out-
put ascParReference.
The generation of the mapping list must be done by the user in the following way:
start
Step 1 Define the number of objects in your mapping list: The amount of objects defines on
how many different codes/indexes you would like to get access to.
Example: The logic PLC uses the DP V0 parameter channel to read the following codes
from a 9300 servo inverter:
• C0051/000: actual motor speed, scaled in [rpm]
• C0053/000: actual DC bus voltage, scaled in [V]
• C0063/000: actual motor temperature, scaled in [°C]
In this example, the mapping list requires three entries.
Step 2 In the i950’s PLC program, declare a data array with a corresponding number of
entries of type sc93ParReference as follows:
ascParReference: ARRAY[1..3] OF sc93ParReference; // mapping table
4 The FIX32 format uses a 4-byte data size and a scaling factor of 10000, meaning a value of 10000 represents a physical value of 1.0000[rpm]. This format is also
known as the ‘_e4’ format in the Lenze terminology.
5 The ‘_s’ scaling was introduced with the Lenze 9400 series and scales the motor speed as a 32-bit value. A raw value of 231 represents a physical value of
480000[rpm].
Automation Building Blocks 2-7
2 Function Blocks
2.1 Function Block L_AIF_Base
*) use greatest common denominator calculations to shorten the numbers for the numerator/denominator
Assign the mapping table’s data array to the function block L_AIF_Base:
Step 4
Tip:
Call the function block L_AIF_Base in a freewheeling task with low priority
to unload the high-priority motion task.
Still, the function blocks L_AIF_IN and L_AIF_OUT for process data may be
called in the high-priority motion task.
end
Note:
In contrary to the 9300 series, i950 allows parameters using a floating-point data type
(LREAL) with 8 bytes data size. Even this i950 parameter type can be handled by the
function block L_AIF_Base.
To receive a data value with four decimal remainder digits on your machine PLC, apply
a numerator/denominator scaling of diNum = 10000 and diDen = 1 in the parameter
reference list.
To monitor the parameter channel, the function block L_AIF_Base includes a built-in visualization
screen:
2.1.4 Interface
Note:
Make sure to have included the CAA Memory library in your PLC project to get a fault-
free built of your code.
2.1.2 Inputs
Identifier Description
Data type
eFieldBusType type of field bus
FieldBusType In the default, this signal is set to 1 (‘PROFIBUS_2133’)
So far, this variable is not used in the function block L_AIF_Base, as the AIF function blocks only support PROFI-
BUS communication.
Note: In future, the input may allow to support various field bus systems Lenze offered on the 9300 series such as
CAN, INTERBUS, …
Identifier Description
Data type
wCode code number of the 9300 servo drive
WORD Note: The 9300 code number results from subtracting the index value (byte 3 and 4 of the parameter channel) from
a fixed value of 24575 (0x5FFF).
bySubCode sub-code number of the 9300 servo drive
BYTE
wIndex corresponding index number of the i950 servo drive
WORD
bySubIndex sub-index number of the i950 servo drive
BYTE
bySize data size of the i950’s index value
BYTE Note: This information is required, as the data size of the i950’s index value does not necessarily match the data
size of the 9300 code value.
diNum scaling factor between the 9300 code value and the i950 index value (split to numerator/denominator values)
diDen The values for the scaling numerator/denominator can be obtained as shown on the next page. More details can be
BYTE found in chapter 2.1.2.
Note:
An application example is given in the appendix in chapter 2.1.2.
The actual motor speed 0x606C:000 of the i950 servo drive should be read via parameter channel
and be returned to the PLC in the 9300 format of code C0051/000:
9300: i950:
Illustration 11: code scaling 9300 Illustration 12: code scaling i950
From the above example, the total numerator/denominator values diNum and diDen can be calcu-
lated:
10000
𝑑𝑖𝑁𝑢𝑚 1 2400000000 1171875
= = =
𝑑𝑖𝐷𝑒𝑛 1073741824 1073741824 524288
240000
2.1.3 Outputs
Identifier Description
Data type
scStateMachine data of the communication state machine
StateMachine This value must be connected to the corresponding input/output variables of the function blocks L_AIF_IN and
L_AIF_OUT to ensure consistent operation of the AIF function blocks. A detailed description is given on the next
page.
xInit status signal: initialization of the GSD/GSE configuration ongoing
BOOL FALSE GSD/GSE configuration has finished without errors
TRUE GSD/GSE configuration ongoing/has finished with errors
xError status signal: error during GSD/GSE configuration
BOOL FALSE no error during GSD/GSE configuration.
TRUE An error occurred during GSD/GSE configuration:
• Initialization sequence cannot be terminated – status signal xInit remains on TRUE.
• Refer to the wError output for more information.
wErrorId current error ID:
WORD 0: no error active
110: GSD/GSE configuration could not be identified – please select a GSD/GSE configuration as listed
in chapter.4.1
Notes:
-
Identifier Description
Data type
eFieldBusType current error ID:
FieldBusType PROFIBUS_2133: The L_AIF function blocks behave like the EMF2133IB PROFIBUS module for 9300.
Notes: So far, only ‘PROFIBUS_2133’ is supported.
byGsdConfig number of the active GSD/GSE configuration found during communication initialization
BYTE A complete overview on all possible GSD/GSE configurations is listed in chapter 4.1.
byGsdGroup group of the active GSD/GSE configuration of the active GSD/GSE configuration, set-up during communication ini-
BYTE tialization
A complete overview on all possible GSD/GSE configurations is listed in chapter 4.1.
byGsdGroup current error ID:
BYTE 1: no parameter channel / process data (Drivecom control)
2: consistent Drivecom parameter channel / process data (Drivecom control)
3: consistent Drivecom parameter channel / consistent process data (Drivecom control)
4: Drivecom parameter channel / process data (Drivecom control)
5: Drivecom parameter channel / consistent process data (Drivecom control)
6: no parameter channel / consistent process data (Drivecom control)
7: no parameter channel / process data (Lenze device control)
8: consistent Drivecom parameter channel / process data (Lenze device control)
9: consistent Drivecom parameter channel / consistent process data (Lenze device control)
10: Drivecom parameter channel / process data (Lenze device control)
11: Drivecom parameter channel / consistent process data (Lenze device control)
12: no parameter channel / consistent process data (Lenze device control)
Notes: A complete overview on all possible GSD/GSE configurations is listed in chapter 4.1.
byPzdSize size of the process data (PZD), scaled in [byte]
BYTE
wDrivecomCtrl Drivecom control word
BYTE This variable is only used in a configuration with Drivecom process data communication (byGsdGroup = 1 … 6).
The meaning of each control bit of wDrivecomCtrl is explained in the appendix in chapter 4.4.
wDrivecomStat Drivecom status word
BYTE This variable is only used in a configuration with Drivecom process data communication (byGsdGroup = 1 … 6).
The meaning of each control bit of wDrivecomStat is explained in the appendix in chapter 4.5.
eDrivecomState current state of the Drivecom state machine:
DrivecomState 0: NOT_READY_TO_SWITCH_ON
32: SWITCH_ON_INHIBIT
1: READY_TO_SWITCH_ON
3: SWITCHED_ON
23: QUICK_STOP_ACTIVE
7: OPERATION_ENABLED
15: FAULT_REACTION_ACTIVE
8: FAULT
Notes: This variable is only used in a configuration with Drivecom process data communication (byGsdGroup = 1
… 6). The Drivecom state machine is shown in chapters 2.2.2 and 2.3.2.
xInit status signal: initialization of the GSD/GSE configuration ongoing
BOOL FALSE GSD/GSE configuration has finished without errors
TRUE GSD/GSE configuration ongoing/has finished with errors
Note: This signal mirrors the output signal L_AIF_Base.xInit.
xError status signal: error during GSD/GSE configuration
BOOL FALSE no error during GSD/GSE configuration.
TRUE An error occurred during GSD/GSE configuration:
• Initialization sequence cannot be terminated – status signal xInit remains on TRUE.
• Refer to the L_AIF_Base.wError output for more information.
Note: This signal mirrors the output signal L_AIF_Base.xError.
Identifier Description
Data type
adwRawDataIn raw input data on the field bus interface
ARRAY [0..15] OF DWORD The variable data array is a copy of the field bus raw input data in, received on the input adwFieldBusIn of function
block L_AIF_IN.
adwRawDataOut raw output data on the field bus interface
ARRAY [0..15] OF DWORD The variable data array is a copy of the field bus raw output data in, generated on the output adwFieldBusOut of
function block L_AIF_OUT.
AxisState This structure includes important status signals of the i950 drive:
MC_ReadAxisInfo LimitSwitchPos: positive limit switch has triggered (i.e. on L_TF2P_SpeedControlBase1.scCtrl-
[Link])
LimitSwitchNeg: negative limit switch has triggered (i.e. on L_TF2P_SpeedControlBase1.scCtrl-
[Link])
Simulation: axis is operated in the virtual mode
On an i950 axis, this signal is always FALSE.
CommunicationReady: motion bus communication interface between axis driver (AXIS_REF) and motor
control is in operation
On an i950 axis, this signal is always TRUE.
ReadyForPowerOn: drive is ready for being powered on (i.e. via control signal L_TF2P_SpeedCon-
[Link]).
This signal state comprises the following states:
• drive is fault-free
• no STO command is active (safe torque off)
• DC bus voltage is switched on
PowerOn: i950 drive is powered on (same status as L_TF2P_SpeedControlBase1.xOpera-
tionEnabled)
IsHomed: zero position of the i950 drive’s measuring system is known
AxisError: error in the axis driver (AXIS_REF)
AxisWarning: warning in the axis driver (AXIS_REF)
DriveError: error in the inverter’s motor control
DriveWarning: warning in the inverter’s motor control
SWLimitSwitchPos: positive software limit has triggered
SWLimitSwitchNeg: negative software limit has triggered
ReadyForMotion: drive is ready for receiving motion commands
This signal state comprises the following states:
• drive is enabled
• drive is fault-free
• a motor brake (if available) has opened
STOActive: STO command is active (safe torque off)
VoltageEnabled: DC bus voltage is switched on
MotorMagnetised: motor is magnetization complete
QSPApplActive: quickstop command of the axis driver (AXIS_REF) is active
QSPDriveActive: quickstop command of the inverter’s motor control is active
Find more information about MC_ReadAxisInfo in the »PLC Designer« online help.
Caution:
The above-listed variables are read-only! Never change any of these variables as this
may have unpredictable consequences in field bus communication and drive behav-
iour!
The function block L_ AIF_IN reads 16 double words of the field bus input data on the input data
array adwFieldBusIn. Once a valid GSD/GSE configuration was detected ([Link] =
FALSE), the raw data on the input signal adwFieldBusIn of the function block L_ AIF_IN are mapped
to …
process data communication (PZD) process data communication (PZD) + parameter channel (PAR)
Illustration 13: no parameter channel (PZD only) Illustration 14: with parameter channel (PZD + PAR)
Note:
The i950 PROFIBUS slot module handles up to 16 double words of input data. The
function block L_AIF_IN only processes the double words 0 to 7. The double word 8
to 15 are not considered in the evaluation of the field bus raw data.
However, always assign a data array ARRAY [0..15] OF DWORD to the input signal
L_AIF_IN.adwFieldBusIn.
L_AIF_IN:
conversion of the of raw input process data adwFieldBusIn to the data sets AIF_IN1, AIF_IN2 and AIF_IN3
(16 DWORD)
Illustration 15: principle of process input data handling / detailed signal list of the AIF_IN interfaces of function block L_AIF_IN
Illustration 16: flow chart of the Drivecom state machine (affecting control/status word 1)
The actual state of the Drivecom state machine is displayed on the variable scStateMa-
[Link].
2.2.4 Interface
Note:
Make sure to have included the CAA Memory library in your PLC project to get a fault-
free built of your code.
2.2.7 Inputs
Identifier Description
Data type
adwFieldBusIn input of the field bus raw data
ARRAY [0..15] OF DWORD These values can directly be mapped to the input data of the field bus IO interface.
2.2.8 Outputs
Identifier Description
Data type
AIF_IN1 AIF field bus input data (first group)
AIF_IN1 The values comprise a four-word data structure, following the structure of the AIF-IN system block of the 9300 servo
inverter. A detailed description is given on the next page.
AIF_IN2 AIF field bus input data (second group)
AIF_IN The values comprise a four-word data structure, following the structure of the AIF-IN system block of the 9300 Ser-
voPLC inverter. A detailed description is given on the next pages.
AIF_IN3 AIF field bus input data (third group)
AIF_IN The values comprise a four-word data structure, following the structure of the AIF-IN system block of the 9300 Ser-
voPLC inverter. A detailed description is given on the next pages.
Identifier Description
Data type
xBit00 bit 0 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit01 bit 1 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit02 bit 2 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xQsp bit 3 of the AIF-IN control word: activate quick stop
BIT FALSE: quick stop not activated
TRUE: quick stop activated
Note: This bit must be connected to a quick stop command in the application (i.e. implemented by the function blocks
MC_Stop, L_MC1P_SetQuickStopAppl, …).
xBit04 bit 4 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit05 bit 5 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit06 bit 6 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit07 bit 7 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xDisable bit 08 of the AIF-IN control word: disable the drive
BIT FALSE: do not disable drive (xCInh=FALSE leads to power-up the drive)
TRUE: disable drive (xCInh=FALSE has no effect)
Notes:
- Use this bit to interlock enabling the drive’s operation. On xDisable=TRUE, the drive must remain shut-down, even
if xCInh is on FALSE.
- If xDisable is on TRUE, the ‘drive ready’ status remains on FALSE.
xCInh bit 09 of the AIF-IN control word: inhibit the drive controller
BIT FALSE: drive controller enabled
TRUE: drive controller inhibited
Notes:
- The bit is used to power-up the drive (i.e. by means of the MC_Power function block).
- If xDisable is on TRUE, the xCInh control bit has no effect.
Identifier Description
Data type
xTripSet bit 10 of the AIF-IN control word: set a user error on the drive
BIT FALSE: user error is triggered
TRUE: no user error is triggered
Note: As there is no corresponding function in the operating system of i950 available, the xTripSet bit has no practi-
cal meaning.
xTripReset bit 11 of the AIF-IN control word: error reset command
BIT FALSE=>TRUE reset error command
Notes:
- The bit is used to reset an error on the drive (i.e. by means of the MC_Reset function block).
- Resetting an error only works if the cause of the error does not apply any more.
xBit12 bit 12 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit13 bit 13 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit14 bit 14 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit15 bit 15 of the AIF-IN control word
BIT FALSE: control function deactivated
TRUE: control function activated
Note: This bit does not have a fixed meaning but can be connected freely by the user.
wCtrl AIF-IN control word
WORD The AIF-IN control word mirrors the 16 control bits as listed above in a WORD format.
wIn1 input of a 16 bit integer number
WORD Typically, the second WORD on AIF-IN1 is interpreted as the drive’s speed set value, scaled in [%] (0 … 16384 = 0.0
… 100.0[%]). However, it is up to the user to define the meaning in the application.
wIn2 input of a free 16 bit WORD value
WORD
wIn3 input of a free 16 bit WORD value
WORD
Tip:
Do you need to merge AIF_IN1.wIn2 and AIF_IN1.wIn3 to a 32-bit value? The function
PackWordsToDword6 provides this function. Use it in the following way:
Illustration 18: conversion of two 16-bit WORD values to a 32-bit DWORD value
Identifier Description
Data type
wIn0 input of a free 16 bit WORD value
WORD
wIn1 input of a free 16 bit WORD value
WORD
wIn2 input of a free 16 bit WORD value
WORD
wIn3 input of a free 16 bit WORD value
WORD
The function block L_ AIF_OUT reads the AIF data structure known from the 8200/9300 device se-
ries and transfers its information to the 16 field bus output double-words on a data array. Once a
valid GSD/GSE configuration was detected ( [Link] = FALSE), the following data are
mapped to the output data array adwFieldBusOut:
process data communication (PZD) process data communication (PZD) + parameter channel (PAR)
Illustration 19: no parameter channel (PZD only) Illustration 20: with parameter channel (PZD + PAR)
Note:
The i950 PROFIBUS slot module handles up to 16 double words of output data. The
output data range of the function block L_AIF_OUT (output adwFieldBusOut) com-
prises the full scope of 16 double words, even if only double words 0 to 7 are in use.
L_AIF_OUT:
conversion of the output data set AIF_OUT1, AIF_OUT2 and AIF_OUT3 to raw output process data adwFieldBusOut
(16 DWORD)
Illustration 21: principle of process output data handling / detailed signal list of the AIF_OUT interfaces of function block L_AIF_IN
Tip:
Use the user-defined function block L_STAT to generate the status signals on
L_AIF_OUT.xStat1 … L_AIF_OUT.xStat8.
Illustration 22: flow chart of the Drivecom state machine (affecting control/status word 1)
The actual state of the Drivecom state machine is displayed on the variable scStateMa-
[Link].
DCTRL-STAT*4
DCTRL-STAT*2
value DCTRL-STAT*1 note
0 0 0 0 0 initialization after the supply voltage has been connected
1 0 0 0 1 lock mode, restart protection is active C0142
3 0 0 1 1 drive is in controller inhibit mode
4 0 1 0 0 flying restart active
5 0 1 0 1 DC brake active
6 0 1 1 0 controller enabled
7 0 1 1 1 the release of a monitoring function resulted in a "message"
8 1 0 0 0 the release of a monitoring function resulted in a "trip"
10 1 0 1 0 the release of a monitoring function resulted in a "FAIL-QSP"
15 1 1 1 1 communication fail (PROFIBUS communication module inverter)
2.3.4 Interface
Note:
Make sure to have included the CAA Memory library in your PLC project to get a fault-
free built of your code.
2.3.2 Inputs
Identifier Description
Data type
AIF_OUT1 AIF field bus output data (first group)
AIF_OUT1 The values comprise a four-word data structure, following the structure of the AIF-OUT system block of the 9300
servo inverter. A detailed description is given on the next page.
AIF_OUT2 AIF field bus output data (second group)
AIF_OUT The values comprise a four-word data structure, following the structure of the AIF-OUT system block of the 9300
ServoPLC inverter. A detailed description is given on the next pages.
AIF_OUT3 AIF field bus output data (third group)
AIF_OUT The values comprise a four-word data structure, following the structure of the AIF-OUT system block of the 9300
ServoPLC inverter. A detailed description is given on the next pages.
2.3.3 Outputs
Identifier Description
Data type
adwFieldBusOut output of the field bus raw data
ARRAY [0..15] OF DWORD These values can directly be mapped to the output data of the field bus IO interface.
Identifier Description
Data type
xBit00 bit 0 of the AIF-OUT status word
BIT FALSE: status inactive
TRUE: status active
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xImp bit 1 of the AIF-OUT status word: pulse inhibit active
BIT FALSE: The drive’s power stage is active and provides voltage/current to the motor.
TRUE: The drive’s power stage is inactive and no current is applied to the motor.
Note: This bit must be connected to the corresponding signal in the application (i.e. by the status signal xImpActive
of function block L_TB2P_AxisInterface).
xBit02 bit 2 of the AIF-OUT status word
BIT FALSE: status inactive
TRUE: status active
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit03 bit 3 of the AIF-OUT status word
BIT FALSE: status inactive
TRUE: status active
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit04 bit 4 of the AIF-OUT status word
BIT FALSE: status inactive
TRUE: status active
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit05 bit 5 of the AIF-OUT status word
BIT FALSE: status inactive
TRUE: status active
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xNActEqZero bit 6 of the AIF-OUT status word: drive speed signal is zero
BIT FALSE: drive is moving (absolute drive speed is greater than the speed tolerance window)
TRUE: drive is in standstill (absolute drive speed below the speed tolerance window)
Note: Generate this signal by a suitable logic (i.e. (ABS(MCTRL_nNAct_v)<=scPar.wC0019_Nmin)).
xCInh bit 7 of the AIF-OUT status word: drive controllers are inhibited
BIT FALSE: position/speed/current control is active
TRUE: position/speed/current control is reset
Note: This bit must be connected to the corresponding signal in the application (i.e. by the status signal Status of
function block MC_Power).
xStat1 bits 8 to 11 of the AIF-OUT status word: indication of the drive state
xStat2
xStat8
xStat4
xStat2
xStat1
xStat4
xStat8
BIT 0 0 0 0 initialisation after the supply voltage has been connected
0 0 1 1 drive is in controller inhibit state
0 1 1 0 controller is enabled
0 1 1 1 a monitoring function triggered in a "message"
1 0 0 0 a monitoring function triggered in a "fault"
1 0 1 0 a monitoring function triggered in a "FAIL-QSP"
Notes: These bits must be connected to the corresponding signal in the application (i.e. by the status signals of func-
tion block L_TB2P_AxisInterface). Some states known from 9300 may not be possible to be indicated (see chapter
2.3.3).
Identifier Description
Data type
xWarning bit 12 of the AIF-OUT status word: warning active
BIT FALSE: no drive warning is active
TRUE: a drive warning is active
Note: This bit must be connected to the corresponding signal in the application (i.e. by the status signals of function
block MC_ReadAxisError).
xMessage bit 13 of the AIF-OUT status word: message is active (i.e. under-/overvoltage state)
BIT FALSE: no message is active
TRUE: a message is active (i.e. under-/overvoltage state)
Note: This bit must be connected to the corresponding signal in the application (i.e. by the inverted status signal
xVoltageEnabled of function block L_TB2P_AxisInterface).
xBit14 bit 14 of the AIF-OUT status word
BIT FALSE: status inactive
TRUE: status active
Note: This bit does not have a fixed meaning but can be connected freely by the user.
xBit15 bit 15 of the AIF-OUT status word
BIT FALSE: status inactive
TRUE: status active
Note: This bit does not have a fixed meaning but can be connected freely by the user.
wStat AIF-OUT status word
WORD The wStat signal is logically OR-connected with the bits xBit00 … xBit15. This leaves it up to the user if the status is
compiled indivually via the Boolean inputs xBit00 … xBit15 or via the wStat status word.
wOut1 output of a 16 bit integer number
WORD Typically, the second WORD on AIF-OUT1 is interpreted as the drive’s speed set value, scaled in [%] (0 … 16384 =
0.0 … 100.0[%]). However, it is up to the user to define the meaning in the application.
wOut2 output of a free 16 bit WORD value
WORD
wOut3 output of a free 16 bit WORD value
WORD
Tip:
Do you need to split a 32-bit value to two 16-bit values on AIF_OUT1.wOut2 and
AIF_Out1.wOut3? The function block UnpackDword7 provides this function. Use it in
the following way:
Illustration 24: conversion of a 32-bit DWORD value to two 16-bit WORD values
Identifier Description
Data type
wOut0 output of a free 16 bit WORD value
WORD
wOut1 output of a free 16 bit WORD value
WORD
wOut2 output of a free 16 bit WORD value
WORD
wOut3 output of a free 16 bit WORD value
WORD
3 Application Example
Typically, PROFIBUS is not used in new machines as there are more advanced field bus systems
available such as EtherCAT or PROFInet. The PROFIBUS field bus moreover appears in existing ma-
chines in operation. This document focusses on previous Lenze servo inverters8, which now need to
be replaced by the latest device generation of i950 drives. In the best case, the replacement i950
unit requires a functional twin of the previous servo inverter. Instead of the well-known function
block connection of the GDC, the PLC program of the i950 bases on Lenze’s technology modules
with some slight extensions to generate a 100% functional compatibility between the previous and
actual drive system.
The following example shows how to migrate a 9300 servo inverter in speed control 9 to a compat-
ible i950 signal flow, using the Lenze technology module L_TF2P_SpeedControlBase.
start Pre-Requisites:
• »PLC Designer« is already open on your PC10.
• No project is open in »PLC Designer«.
Illustration 26: select an i950 (BS) with firmware version V1.14 or higher as a target system
Illustration 27: Build the project to allow access to the commissioning dialogues of »PLC Designer«
motor type/data
axis kinematics
quickstop profile
monitoring functions
Tips:
• Use the motor catalogue of »PLC Designer« to quickly find/set the mo-
tor data.
• The auto-tuning feature of the i950 allows to find optimum controller
settings for dynamic response of the servo drive.
When entering the first letters of the library name in the search
window, you can easily find it in the selection list below.
In the same way as shown in step 5, also include the L_TB2P_TechModulesBasic library
Step 6 in the Library Manager of your project.
Open the PLC_PRG program and write a small CFC program as follows:
Step 7
Illustration 30: calling the function blocks L_TF2P_SpeedControlBase1 and L_TB2P_AxisInterface1 in PLC_PRG
Illustration 31: adding a visualization screen to operate the function block L_TF2P_SpeedControlBase
By means of the visualization screen, operate the i950 drive in different operation
Step 11 modes and check all functions:
end
The following chapter describes how to set the PROFIBUS communication into operation with the
help of the L_AIF function blocks.
Start Pre-Requisites:
• The field bus system is wired according to the PROFIBUS specifications.
• The logic PLC (PROFIBUS master) as well as all PROFIBUS slave devices are sup-
plied with control voltage (24VDC).
• The PLC program of the i950 is open in »PLC Designer« but not yet online.
• The application signal flow has been implemented in the i950’s PLC program as
described in the previous chapter 3.1, for example migrating motion applications
of competitors or Lenze legacy devices.
• The CAA Memory library is included in the i950’s PLC project.
Step 1 In the device tree of »PLC Designer«, import the L_AIF function blocks:
Declare the following global interface variable arrays for field bus communication in a
Step 2 separate GVL item TA_IO:
{attribute 'qualified_only'}
VAR_GLOBAL
adwPROFIBUS_IN: ARRAY [0..15] OF DWORD; // raw data input from PROFIBUS
adwPROFIBUS_OUT: ARRAY [0..15] OF DWORD; // raw data output to PROFIBUS
END_VAR
Map the variable arrays declared in step 3 to the field bus interface as follows:
Step 3
Illustration 35: assignment of global variable arrays to the i950’s field bus interface
In the i950 motion program PLC_PRG, declare the following function blocks:
Step 4
VAR
L_AIF_Base1: L_AIF_Base; // handling of basic PROFIBUS communication
L_AIF_IN1: L_AIF_IN; // reading/processing field bus inputs to AIF_IN
L_AIF_OUT1: L_AIF_OUT; // processing/writing field bus outputs from AIF_OUT
L_STAT1: L_STAT; // generating the 4-bit pattern of the drive status
L_MC1A_ZeroDetect1: L_MC1A_ZeroDetect; // detection of rotation sense/zero speed
END_VAR
Prepare the parameter correspondence list11 by extending the declaration list in the
Step 5 i950’s motion program PLC_PRG:
…
ascParReference: ARRAY [0..15] OF sc93ParReference; // parameter reference list
…
NO
? 12
Does your GSD configuration include a Drivecom V0 parameter channel?
YES
Extend the parameter correspondence list started in step 5 with the necessary
Step 6 initialization values as described in chapter 2.1.2:
…
ascParReference: ARRAY [0..15] OF sc93ParReference; // parameter reference list
(wCode:=51, bySubCode:=0, wIndex:=16#606C, bySubIndex:=0, bySize:=4, diNum:=1171875, diDen:=524288),
(wCode:=53, bySubCode:=0, wIndex:=16#6079, bySubIndex:=0, bySize:=4, diNum:=10, diDen:=1),
(wCode:=63, bySubCode:=0, wIndex:=16#2D49, bySubIndex:=5, bySize:=2, diNum:=1000, diDen:=1),
(wCode:=52, bySubCode:=0, wIndex:=16#2D82, bySubIndex:=0, bySize:=4, diNum:=10, diDen:=1),
(wCode:=54, bySubCode:=0, wIndex:=16#2DD1, bySubIndex:=5, bySize:=4, diNum:=10, diDen:=1),
(wCode:=61, bySubCode:=0, wIndex:=16#2D84, bySubIndex:=1, bySize:=2, diNum:=10, diDen:=1),
(wCode:=64, bySubCode:=0, wIndex:=16#2D40, bySubIndex:=7, bySize:=2, diNum:=1, diDen:=1),
…
(wCode:=84, bySubCode:=0, wIndex:=16#2C01, bySubIndex:=2, bySize:=4, diNum:=100, diDen:=1),
(wCode:=85, bySubCode:=0, wIndex:=16#2C01, bySubIndex:=3, bySize:=4, diNum:=10, diDen:=1)];
…
First, call the function block L_AIF_Base in your PLC program and connect the
Step 7
variables as shown:
Illustration 36: call of function block L_AIF_Base at the beginning of the PLC program
Call the function block L_AIF_IN directly after the function block L_AIF_Base in your
Step 8 PLC program and connect the variables as shown:
Illustration 37: call of function block L_AIF_IN directly behind the function block L_AIF_Base
Read the maximum speed value nmax12 from the legacy drives13 and convert it with
Step 9
the help of the drive axis’ kinematic parameters to a reference velocity Vmax.
𝑛𝑚𝑎𝑥 1 1
𝑉𝑚𝑎𝑥 = 𝑠 ∙ 𝐹𝑒𝑒𝑑𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 ∙ 𝑖 ∙ =
60 𝑖
𝑔𝑒𝑎𝑟 𝑔𝑒𝑎𝑟,𝑎𝑑𝑑
𝑚𝑖𝑛
12 scaled in [rpm]
13 In the Lenze legacy devices, the maximum speed was set in code C0011/000.
Automation Building Blocks 3-46
3 Application Example
3.2 Commissioning Sequence (PROFIBUS)
Read and scale the speed set value on L_AIF_IN.AIF_IN1.wIn1, and route it via the
Step 11 following signal flow to the speed control technology module
L_TF2P_SpeedControlBase. Modify your program as follows:
The control bit L_AIF_IN.AIF_IN1.xBit05 switches the target velocity for the
L_TF2P_SpeedControlBase technology module to a zero value. The function
has priority over the ‘freeze’ function.
As currently this function is not included in the technology module itself, it must
be programmed outside the technology module by means of a selector (SEL op-
erator).
The selector’s output is assigned to the target velocity lrSetVel of the technology
module L_TF2P_SpeedControlBase.
To prepare the status word on the L_AIF_OUT function block, three steps of preparation
Step 12 work is necessary:
In the first step, declare a variable lrZeroSpeedThreshold for a velocity tolerance
window. The tolerance window defines the behavior/stability of the zero-speed signal.
…
Initialize the variable with a velocity threshold limit value. Whenever the drive’s actual
velocity is smaller/equal the threshold value, the (n=0) status flag goes to a TRUE level.
In the next step, call the function block L_MC1A_ZeroDetect at the end of your program
Step 13
and connect it in the signal flow as follows:
Assign the following element variables of the Motion_Axis structure to the inputs Call the function block L_MC1A_ZeroDe-
of the L_MC1A_ZeroDetect function block: tect. The block is included in the export
• Motion_Axis.lrActPosition => L_MC1A_ZeroDetect.lrPosIn file loaded to the project in step 1. For
more information to this function block,
• Motion_Axis.eTraversingRange => L_MC1A_ZeroDetect.eTraversingRange
please refer to the PDF document in AKB
• Motion_Axis.lrCycleLength => L_MC1A_ZeroDetect.lrCycleLength article 202000349.
Illustration 40: zero speed detection by means of the function block L_MC1A_ZeroDetect
Call the function block L_STAT at the end of your program and connect the following
Step 14 variables:
Call the function block L_STAT at the end of
your program.
The function block L_STAT is included in the
Please consider the negations in the signal flow on the input export file loaded to the project in step 1.
signals L_STAT.bCInh_b and L_STAT.bMessage_b.
Illustration 41: generation of status bits bStat1_b … bStat8_b by means of the function block L_STAT
Illustration 42: assignment of status signals/of normalized motor speed to the AIF_OUT1 composer
Insert the AIF_OUT function block at the end of your program, link the AIF_OUT1
Step 16
composer’s output to the AIF_OUT1 input of the L_AIF_OUT block and assign the
generation of the AIF status word via function block L_AIF_OUT:
Insert the function block L_AIF_OUT.
Connect the AIF_OUT1 composer’s output to
the AIF_OUT1 input of the AIF_OUT block.
Illustration 43: call of function block L_AIF_OUT at the end of the program and assignment to the field bus output variables
Compile, download and start the project to the i950 drive. You are now ready to
Step 19 control the i950 drive in the same way as the 9300 drive.
end
14 This setting defines which device type is reported via PROFIBUS to the logic PLC. A setting of 0x2341:11=1 makes the logic PLC believe that the connected device
is a 8200/9300 with a PROFIBUS module EMF2133IB.
15 A setting of 0x2341:11=2 makes the logic PLC believe that the connected device is a 8200/9300 with a PROFIBUS module EMF2131IB.
4 Appendix
Illustration 44: signal flow of the AIF-IN interface on the 9300 servo inverter (excerpt from GDC help)
Illustration 45: signal flow of the AIF-OUT interface on the 9300 servo inverter (excerpt from GDC help)
The following chart describes the meaning of the transmit parameter channel request (8 bytes),
sent by the PLC to the slave device (drive):
Illustration 46: structure of the Drivecom DP V0 parameter channel Tx telegram on the 9300 servo inverter (PLC => drive)
17 The 9300 index number results from subtracting the 9300 code number from a fixed value of 24575 (=0x5FFF).
18 length of data in bytes 5 ... 8 (data/error 1 ... 4) to be read/written to the slave device index
Automation Building Blocks 4-56
4 Appendix
4.7 Drivecom DP V0 Parameter Channel (Rx)
The following chart describes the meaning of the receive parameter channel response (8 bytes),
returned by the slave device (drive) to the PLC:
status bit:
Status information from the slave device to the PLC when sending the request confirmation. This bit
informs the master PLC whether the request has been carried out without any faults.
0 = request completed without fault
(The data of bytes 5 ... 8 represent the data read from the target index.)
1 = request not completed - an error has occurred.
(The data of bytes 5 ... 8 represent the error number.)
Illustration 47: structure of the Drivecom DP V0 parameter channel Rx telegram on the 9300 servo inverter (drive => PLC)
19 The 9300 index number results from subtracting the 9300 code number from a fixed value of 24575 (=0x5FFF).
20 length of the return data in bytes 5 ... 8 (data/error 1 ... 4)
Automation Building Blocks 4-57