Manual Converting Library V2.2.7 2018-10-30
Manual Converting Library V2.2.7 2018-10-30
Converting Library
Siemens
Manual - V2.2.7 - 10/2018 Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/48805235 Support
Legal information
Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several
components in the form of text, graphics and/or software modules. The application examples are
a free service by Siemens AG and/or a subsidiary of Siemens AG (“Siemens”). They are non-
binding and make no claim to completeness or functionality regarding configuration and
equipment. The application examples merely offer help with typical tasks; they do not constitute
customer-specific solutions. You yourself are responsible for the proper and safe operation of the
products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the
application examples used by technically trained personnel. Any change to the application
examples is your responsibility. Sharing the application examples with third parties or copying the
application examples or excerpts thereof is permitted only in combination with your own products.
The application examples are not required to undergo the customary tests and quality inspections
of a chargeable product; they may have functional and performance defects as well as errors. It is
your responsibility to use them in such a manner that any malfunctions that may occur do not
result in property damage or injury to persons.
Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without
limitation, liability for the usability, availability, completeness and freedom from defects of the
application examples as well as for related information, configuration and performance data and
any damage caused thereby. This shall not apply in cases of mandatory liability, for example
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent
non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for
damages arising from a breach of material contractual obligations shall however be limited to the
Siemens AG 2018 All rights reserved
foreseeable damage typical of the type of agreement, unless liability arises from intent or gross
negligence or is based on loss of life, bodily injury or damage to health. The foregoing provisions
do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens
against existing or future claims of third parties in this connection except where Siemens is
mandatorily liable.
By using the application examples you acknowledge that Siemens cannot be held liable for any
damage beyond the liability provisions described.
Other information
Siemens reserves the right to make changes to the application examples at any time without
notice. In case of discrepancies between the suggestions in the application examples and other
Siemens publications such as catalogs, the content of the other documentation shall have
precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.
Security information
Siemens provides products and solutions with industrial security functions that support the secure
operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary
to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept.
Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines
and networks. Such systems, machines and components should only be connected to an
enterprise network or the Internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
For additional information on industrial security measures that may be implemented, please visit
https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the latest updates may increase customer’s exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
at: https://www.siemens.com/industrialsecurity.
Table of contents
Legal information ......................................................................................................... 2
1 Introduction ........................................................................................................ 5
1.1 Functional scope .................................................................................. 6
1.2 Possible applications ............................................................................ 8
1.3 Hardware .............................................................................................. 8
1.4 Software ............................................................................................... 8
1.5 Data types, Enumeration types and structures .................................... 9
1.6 Abbreviations of the units ..................................................................... 9
2 Tools ................................................................................................................. 10
2.1 FCLConTaskIdentification – Determining the cycle time ................... 10
2.2 Scaling functions ................................................................................ 12
2.2.1 FCLConScalingDWDRL ..................................................................... 12
2.2.2 FCLConScalingRLDWD ..................................................................... 14
2.2.3 FCLConScalingRLWD........................................................................ 16
2.2.4 FCLConScalingWDRL........................................................................ 18
2.2.5 FCLConScaling .................................................................................. 20
2.3 FCLConLinear – Linear interpolation ................................................. 21
2.4 FBLConPolygonA / FBLConPolygonB – Non-linear
characteristic ...................................................................................... 23
2.5 FBLConRFG – Basic ramp-function generator .................................. 26
2.6 FBLConRFGJerkLimit – Ramp-function generator with
Siemens AG 2018 All rights reserved
rounding-off ........................................................................................ 33
2.7 FCLConCalculateDistance ................................................................. 41
2.8 FCLConEvaluateModulo .................................................................... 45
3 Drive functions ................................................................................................. 48
3.1 FBLConFrictionMeasurement – Friction characteristic ...................... 48
3.2 FBLConEnableInterface – Activate Interfaces ................................... 51
4 Closed-loop control functions ....................................................................... 56
4.1 FBLConPT1 – PT1 element ............................................................... 56
4.2 FBLConINT – Integrator ..................................................................... 60
4.3 FBLConDIF – Differentiating element ................................................ 64
4.4 FBLConDT1 – DT1 filter ..................................................................... 66
4.5 FBLConLIM – Limiter with feedback signal ........................................ 69
4.6 FBLConLevelControl – Limit value monitor........................................ 71
4.7 FCLConDeadBand – Dead band element ......................................... 73
4.8 FCLConDeadZone – Dead zone element .......................................... 75
4.9 FBLConAverageValue – Average value generator ............................ 77
4.10 FBLConPIDController ......................................................................... 79
4.11 FBLConTechnologyController – Technology controller ..................... 87
5 Winding functions ........................................................................................... 95
5.1 FBLConDiameterCalculation – Diameter calculator .......................... 95
5.2 FBLConTorquePrecontrol – Torque pre-control .............................. 116
5.3 FBLConTaperCharacteristic – Tension taper characteristic ............ 124
5.4 FCLConRLC – Residual length calculation ...................................... 130
5.5 FBLConCalcTargetDiamStopCondition ........................................... 132
5.6 FCLConRDC – Target diameter calculation..................................... 135
5.7 FBLConThicknessAverage – High resolution thickness
calculation ........................................................................................ 137
5.8 FBLConSetUnits – Setting conversion factors ................................. 141
6 Glossary ......................................................................................................... 143
1 Introduction
The "Converting Library" is intended to provide SIMOTION users with help when
engineering and programming converting machinery.
The Converter Library provides standards that can be adapted depending on the
particular machine and application. These standards cover the typical basic
functions of a converting machine. The functions are available as open source.
The appropriate interfaces are provided to make adaptations depending on the
specific machine and application. These interfaces are described in detail in the
following documentation. Changes to standard functions that go beyond this should
only be made in exceptional cases as this is not in-line with the level of
standardization that we wish to achieve here.
Only functions that are not covered by the standard applications are described in
this documentation. Additional information is provided in the corresponding
application examples.
SIMOTION Winder
SIMOTION Web Accumulator
SIMOTION Easy Basics
SIMOTION Messagehandling
SIMOTION Axis Function Block
All of the software packages are available through the application database of the
Application Centers.
of a roll.
FBLConThicknessAverage LConLib /fWinderTools Calculation of the material
thickness with increased
resolution – external option
block for FBWinder /
FBDiameterCalculation
FBLConSetUnits LConlib / fWinderTools Sets the units for the winder
blocks.
Limit, Min, Max <System function> Limiting, Minimum, Maximum
determination
_getAxisStoppingData <System function> Function to calculate the braking
distance and the braking time
when specifying the velocity,
acceleration and jerk at the start
of braking.
_readDriveParameter <System function> Function to read/write drive
_readDriveMultiParameter parameters.
_writeDriveParameter
_writeDriveMultiParameter
_readDriveFaults <System function> Reading the actual fault buffer
entries of the drive
1.3 Hardware
The functions of the Converting Library are available for the following hardware
platforms:
SIMOTION C2xx
SIMOTION P3xx
Siemens AG 2018 All rights reserved
SIMOTION D4xx
1.4 Software
The following software versions are required to implement the standard functions
contained in this library:
SIMOTION SCOUT from V4.2
SIMOTION kernel from V4.2
SIMOTION technology packages from V4.2
The interface parameters of each function or function block are described in this
document in the respective sections.
Additionally to the interface parameter, some of the function blocks using a
configuration structure for parameterization and a diagnostic structure for feedback
reason. These structures are defined as sub-structures of the sWinderConfig and
sWinderDiag structures and are described in the FBLConWinder documentation.
2 Tools
2.1 FCLConTaskIdentification – Determining the cycle time
Identifies the task and outputs the associated cycle time
Block name
FCLConTaskIdentification
Task
The function identifies the type of task in which this is called, determines the actual
cycle time and outputs this.
FCLConTaskIdentification
Block parameters
Input parameters
Name Data type Initial value Description
Calling task:
SERVO_SYNCHRONOUS_TASK:
Servo Synchronous Task
eTaskName
taskEnum - IPO_SYNCHRONOUS_TASK: Ipo Synchronous Task
Type
IPO_SYNCHRONOUS_TASK_2:
Ipo Synchronous Task 2
TIMER_INTERRUPT_TASK: in a Timer Interrupt Task
Output parameters
Name Data type Initial value Description
[ ms ] The actual real cycle time of the task in the REAL
FCLConTask format,
REAL -
Identification If the function outputs a 0, the task is not time
synchronous and Ipo-dependent.
Functionality
Using the input parameter taskMode of type eTaskNameType, the function
determines the actual task in which the FC is called. If the task is known, then the
cycle time can be determined. By mapping the cycle time in the Time Format in the
TaskStartInfo, this time must be interrogated using the system variables and
precisely calculated. The precise cycle time of the task is output at
FCLConTaskIdentification output in the REAL format. This function can only work
when called in a time synchronous Ipo-dependent task. 0.0 is output when called in
another task.
In systems where the cycle time of the IPO task shorter is than 1.0ms the cycle
time of the TIMER_INTERRUPT_TASK can not be identified. In this case the
function returns with 0.0.
Siemens AG 2018 All rights reserved
Block name
FCLConScalingDWDRL
Task
Converting a DWORD into an REAL value
FCLConScalingDWDRL
Siemens AG 2018 All rights reserved
REAL maxValue
REAL base
Block parameters
Input parameters
Name Data type Initial value Description
x DWORD - [ - ] Input value as DWORD
maxValue REAL 2147483647.0 [ - ] Maximum value
[ - ] Normalization value
base REAL -
(FCScalingDWDRL = 0 if base = 0)
Output parameters
Name Data type Initial value Description
FCLConScaling
REAL - [ - ] Output value in REAL [ -2*maxValue - 2*maxValue]
DWDRL
Functionality
The function converts a DWord (x) using a normalization value (base) and the
maximum reference value (maxValue) into a real value (FCLConScalingDWDRL).
In so doing, the output value is limited between the values -2*maxValue and
2*MaxValue.
x
FCLConScalingDWDRL * max Value
base
Siemens AG 2018 All rights reserved
2.2.2 FCLConScalingRLDWD
Block name
FCLConScalingRLDWD
Task
The block converts a REAL value into a DWORD
FCLConScalingRLDWD
REAL maxValue
Siemens AG 2018 All rights reserved
REAL base
Block parameters
Input parameters
Name Data type Initial value Description
x REAL - [ - ] Input value as REAL [ -2*maxValue - 2*maxValue]
[ - ] Maximum value
maxValue REAL -
(FCScalingRLDWD = 0 if maxValue = 0)
base REAL 2147483647.0 [ - ] Normalization value
Output parameters
Name Data type Initial value Description
FCLConScaling
DWORD [ - ] Output value as DWORD
RLDWD
Functionality
The function converts a real value (x) into a DWord (FCLConScalingLRLDWD)
using a normalization value (base) and the maximum reference value (maxValue).
In so doing, input value x is limited between the values -2*maxValue and
2*maxValue.
x
FCLConScalingRLDWD * base
max Value
Siemens AG 2018 All rights reserved
2.2.3 FCLConScalingRLWD
Block name
FCLConScalingRLWD
Task
This block converts a REAL value into a WORD value
FCLConScalingRLWD
REAL maxValue
Siemens AG 2018 All rights reserved
REAL base
Block parameters
Input parameters
Name Data type Initial value Description
x REAL - [ - ] Input value as REAL [ -2*maxValue - 2*maxValue]
[ - ] Maximum value
maxValue REAL -
(FCScalingRLWD = 0 if maxValue = 0)
base REAL 16384.0 [ - ] Normalization value
Output parameters
Name Data type Initial value Description
FCLConScalingRLWD WORD - [ - ] Output value as WORD
Functionality
This function converts a real value (x) into a word value (FCLConScalingRLWD)
using a normalization value (base) and the maximum reference value (maxValue).
In so doing, input value x is limited between the values -2*maxValue and
2*maxValue.
x
FCLConScalingRLWD * base
max Value
Siemens AG 2018 All rights reserved
2.2.4 FCLConScalingWDRL
Block name
FCLConScalingWDRL
Task
This block converts a WORD value into a REAL value
FCLConScalingWDRL
REAL maxValue
Siemens AG 2018 All rights reserved
REAL base
Block parameters
Input parameters
Name Data type Initial value Description
x WORD - [ - ] Input value as WORD
maxValue REAL - [ - ] Maximum value
[ - ] Normalization value
base REAL 16384.0
(FCScalingWDRL = 0 if base = 0)
Output parameters
Name Data type Initial value Description
FCLConScaling
REAL - [ - ] Output value in REAL [ -2*maxValue - 2*maxValue]
WDRL
Functionality
This function converts a word value (x) into a Real value (FCLConScalingWDRL)
using a normalization value (base) and the maximum reference value (maxValue).
In so doing, the output value is limited between the values -2*maxValue and
2*maxValue.
x
FCLConScalingWDRL * max Value
base
Siemens AG 2018 All rights reserved
2.2.5 FCLConScaling
Block name
FCLConScaling
Task
This block scales a real value
FCLConScaling
REAL maxValue
Siemens AG 2018 All rights reserved
REAL base
Block parameters
Input parameters
Name Data type Initial value Description
x REAL 0.0 [ - ] Input value as WORD
maxValue REAL 0.0 [ - ] Maximum value
[ - ] Normalization value
base REAL 16384.0
(FCScaling = 0 if base = 0)
Output parameters
Name Data type Initial value Description
FCLConScaling REAL - [ - ] Output value in REAL
Functionality
This function scales a word value (x) using a normalization value (base) and the
maximum reference value (maxValue).
x
FCLConScaling * max Value
base
Task
This function interpolates a point from a specified straight line.
FCLConLinear
REAL pointX1
Siemens AG 2018 All rights reserved
REAL pointY1
REAL pointX2
REAL pointY2
Block parameters
Input parameters
Name Data type Initial value Description
x REAL 0.0 Input point X
pointX1 REAL 0.0 X Coordinate point 1
pointY1 REAL 0.0 Y Coordinate point 1
pointX2 REAL 0.0 X Coordinate point 2
pointY2 REAL 0.0 Y Coordinate point 2
Output parameters
Name Data type Initial value Description
FCLConLinear REAL - Output point Y
Functionality
Using the straight lines entered, this function determines the matching Y coordinate
of the coordinate X present at input x. The straight line is defined by point 1
(pointX1 / pointY1) and point 2 (pointX2 / pointY2). The interpolated Y coordinate is
provided as return value of the function with FCLConLinear. The input point x is
limited by the coordinates pointX1 and pointX2. The calculation is continued with
pointX1 or pointX2. If the coordinates pointX1 and pointX2 are equal, 0.0 is
displayed at output FCLConLinear and no interpolation is carried-out.
X po int X 1
FCLConLinear * po int Y 2 po int Y 1 po int Y 1
po int X 2 po int X 1
pointY2
Siemens AG 2018 All rights reserved
FCLCon
Linear
pointY1
pointX1 X pointX1
Block name
FBLConPolygonA, FBLConPolygonB
Task
The function block implements the function of a non-linear characteristic by linearly
interpolating between two table values entered using the input quantities.
FBLConPolygonA, FBLConPolygonB
REAL x y REAL
Block parameters
Input parameters
Name Data type Initial value Description
The individual weighting is enabled
NO_POLYGON: No Polygon calculation (y = x).
eLConPolygonMo ORDINATE_ ORDINATE_FACTORS_USED: Weighting successful,
mode de FACTORS_ interpolated with the product
Type NEGLECTED (ordinateValue*ordinateFactor).
ORDINATE_FACTORS_NEGLECTED: No weighting,
interpolated with (ordinateValue).
FBPolygonA
Number of grid points [1… LCONLIB_
LCONLIB_MAX_IDX_A+1] (21)
entryNum UINT 0
FBPolygonB
Number of grid points [1 … LCONLIB_
LCONLIB_MAX_IDX_B+1] (181)
x REAL 0.0 [ - ] Actual input value of the FB
Output parameters
Name Data type Initial value Description
FALSE: No error
error BOOL FALSE
Siemens AG 2018 All rights reserved
Input/Output parameters
Name Data type Initial value Description
FBLConPolygonA:
ARRAY Abscissa grid points, monotonically (steadily) increasing
[0.. from a value perspective [2 … LCONLIB_MAX_IDX_A+1]
abscissaValue -
LCONLIB_MAX_I FBLConPolygonB:
DX_x] OF REAL Abscissa grid points, monotonically (steadily) increasing
from a value perspective [2 … LCONLIB_MAX_IDX_B+1]
ARRAY FBLConPolygonA:
[0.. Ordinate grid points [2 … LCONLIB_MAX_IDX_A+1]
ordinateValue -
LCONLIB_MAX_I FBLConPolygonB:
DX_x] OF REAL Ordinate grid points [2 … LCONLIB_MAX_IDX_B+1]
ARRAY FBLConPolygonA:
[0.. Ordinate weighting factor [2 … LCONLIB_MAX_IDX_A+1]
ordinateFactor -
LCONLIB_MAX_I FBLConPolygonB:
DX_x] OF REAL Ordinate weighting factor [2 … LCONLIB_MAX_IDX_B+1]
Functionality
Input mode specifies a mode for the function block to calculate the interpolating
value y; this is determined using the input x. For the mode NO_POLYGON there is
no calculation and the Output Value is the same like the Input Value. In mode
ORDINATE_FACTORS_USED, the factors in the field ordinateFactors are included
in the calculation (ordinateValue * ordinateFactor).
Ordinate Values of
ordinateValues Polygon
Polygon
Input Value
Siemens AG 2018 All rights reserved
[M]
Mode: without ordinate factors
mode
Values of Abscissa
abscissaValues
Warnings
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No warning
16#0105_4005 The table of entered values is not monotonically (steadily) increasing -> no matching
value found
16#0105_4008 The table of entered values is not monotonically (steadily) increasing -> 2 values are
identical
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0105_8003 The number of grid points that have been entered is too small
16#0105_8004 The number of grid points that have been entered is too large
Block name
FBLConRFG
Task
The basic ramp-function generator is a ramp-function generator to limit the rate of
change of input quantity x. The output quantity of the FBLConRFG can be limited.
The following quantities can be independently set and changed during operation:
Ramp-up and ramp-down times
Output limiting upper Limit and lower Limit
Setting value
Flexible ramp-function generator function:
Integrating, tracking setpoint x
The ramp-function generator output can be set to the initial value (load
setValue into the supply integrator)
Siemens AG 2018 All rights reserved
FBLConRFG
REAL nominalValue
errorID DWORD
REAL upperLimit
y REAL
REAL lowerLimit
ya REAL
REAL setValue
setpointReached BOOL
eLConRampTime
rampTimeMode
ModeType
upperLimitReached BOOL
REAL rampUpTime
lowerLimitReached BOOL
REAL rampDownTime
BOOL set
Siemens AG 2018 All rights reserved
BOOL followUp
BOOL increase
BOOL decrease
eTaskNameType taskMode
Block parameters
Input parameters
Name Data type Initial value Description
x REAL 0.0 [ - ] Input quantity
nominalValue REAL 1.0 [ - ] Normalization value
upperLimit REAL 0.0 [ - ] Upper limit value
lowerLimit REAL 0.0 [ - ] Lower limit value
setValue REAL 0.0 [ - ] Setting value
Selection how ramp times are selected.
eLConRamp DIFF_TO_ZERO: ramp up: output value Y moves away
rampTimeMode TimeModeT DIFF_TO_ZERO from zero; ramp down: output value Y approaches zero.
ype DIFF_OF_CHANGE: ramp up: target value > start value;
ramp down: target value < start value
rampUpTime REAL 0.0 [ ms ] Ramp-up time [ cycle time – MaxTU]
rampDownTime REAL 0.0 [ ms ] Braking time constant [ cycle time – MaxTD]
FALSE: A setting value is not accepted/transferred
set BOOL FALSE
TRUE: A setting value is accepted/transferred
Output parameters
Name Data type Initial value Description
FALSE: No error
error BOOL FALSE
TRUE: An error has occurred, refer to error identification
Error identification, refer to error messages
errorID DWORD 0 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
Y REAL 0.0 [ - ] Output quantity
Siemens AG 2018 All rights reserved
Functionality
The function block includes an integrator with two integration time constants that
can be set independently of one another. Output Y changes according to the
following algorithm:
Yn Yn1 YAn
The acceleration value YA is separately calculated for the up ramp and down ramp
and is output.
Dependent on the input parameter rampTimeMode, rampUpTime and
rampDownTime will be used differently.
rampTimeMode = DIFF_TO_ZERO:
An up ramp is when the output value Y moves away from zero. A down ramp is
when the output value Y approaches zero.
rampTimeMode = DIFF_OF_CHANGE:
An up ramp is when the target value is bigger than the output value Y. A down
ramp is when the target value is smaller than the output value Y.
By this there is no change between rampUpTime and rampDownTime when the
output value Y moves through 0.0.
TA
YA * no min alValue für Y 0
rampupTime
TA
YA * no min alValue für Y 0
rampupTime
For the acceleration value when ramping-down the following applies:
TA
YA * no min alValue für Y 0
rampdownTime
TA
YA * no min alValue für Y 0
rampDownTime
The ramp-up time rampupTime is the time in which the absolute value of the output
quantity increases by nominalValue.
The ramp-down rampdownTime is the time in which the absolute value of the
output quantity decreases by nominalValue.
The ramp-up time and ramp-down time can be selected to be different. The lower
TA/rampupTime or TA/rampDownTime, the lower the amplitude change at y from
one sampling instant to the next.
For the control inputs, the following sequence of priority applies:
set before followup before increase and decrease
If the integrator is at the limit and the limit value is changed the integrator behaves
differently depending on the direction in which the limit value was changed.
If the absolute value of a limit value is increased, and if the control logic specifies
that the ramp-function generator should run in the same direction, then the
integrator integrates from the previously defined value according to the selected
ramp-up time until the output again reaches the limit value.
If the absolute value of a limit value is reduced, the integrator integrates from the
previously held value – according to the selected ramp-down time – until the output
again reaches the limit value.
The integrator operates internally with an increased accuracy so that even for small
setpoint-actual value differences it still integrates. However, it should be carefully
noted that the sampling time is sufficiently low referred to the ramp-up or ramp-
down time.
rampupTime and TD are internally limited:
rampupTime ≥ TA, rampdownTime ≥ TA.
1) 1) 1)
1 Step setValuen Sets output to setValue is any
setValue value, fixed or
variable
1) 1)
0 1 TA/rampu yn-1+yan Normal rampupTime for [x >
pTime; operation y ⋀ y ≥ 0] ⋁ [x < y ⋀
TA/rampd y→ x y ≤ 0]
ownTime rampdownTime for [x
> y ⋀ y < 0] ⋁ [x < y
⋀ y > 0]
0 0 1 0 TA/ yn-1+yan Approach the rampupTime,
rampupTi upper limit rampdownTime as
me value before, dependent on
(TA/ y→upperLimit the starting (initial)
rampdow position
nTime)
0 0 0 1 TA/ yn-1+yan Approach the rampupTime,
rampdow lower limit rampdownTime as
nTime value before, dependent on
(TA/ y→lowerLimit the starting (initial)
rampupTi position
me)
1) = any
upperLimit
x1
nominalValue
nominalValue
rampup rampdown
Time Time
x2
x4 nominal t
rampup rampdown Value
Time Time
nominal
Value
y
x3
x
Siemens AG 2018 All rights reserved
lowerLimit
Example 1: followup = 1 with lowerLimit < upperLimit and lowerLimit < x <
upperLimit, as well as x1 = 1.5, x2 = x4 = 0.0, x3 = –1.5, upperLimit = 2.0,
lowerLimit = –2.0, rampupTime > rampdownTime
Figure 2-4
1
increase 0
1
decrease 0
upperLimit
lowerLimit
Example 2: Motor potentiometer function with increase and decrease and with
lowerLimit < upperLimit
Figure 2-5
1
set 0
1
followup 0
1
decrease 0
upperLimit
x
setValue
lowerLimit
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
Siemens AG 2018 All rights reserved
ErrorID Description
16#0000_0000 No error.
16#0106_8001 The function block is called in an incorrect task.
Block name
FBLConRFGJerkLimit
Task
Depending on the entered integration values and the specified setpoint function
block FBLConRFGJerkLimit calculates an appropriate output value. In so doing,
the acceleration and deceleration times are taken into account as well as a
selected rounding-off. There is a special input for a fast stop. The status of the
ramp-function generator is output via additional outputs.
Timer).
FBLConRFGJerkLimit
REAL rampdownTime
REAL fastRampdownTime
REAL roundingTime
eTaskNameType taskMode
Block parameters
Input parameters
Name Data type Initial value Description
FALSE: FB de-activated
run BOOL FALSE
TRUE: FB activated
FALSE: No calculation
enable BOOL FALSE
TRUE: The output values are calculated
FALSE: Emergency Stop
mode BOOL TRUE
TRUE: Normal sequence
FALSE: Without rounding-off
enableRounding BOOL TRUE
TRUE: With rounding-off
TRUE: Ramping will be hold, with respect to jerk limiting.
Acceleration will be ramped to zero. The input x is
hold BOOL FALSE ineffective.
FALSE: Normal sequence
TRUE: Rounding at zero crossing
zeroRounding BOOL FALSE
FALSE: No rounding at zero crossing
x REAL 0.0 Setpoint, always positive
Nominal Value
nominalValue REAL 1000.0 Internally, the absolute value is always taken from this
input value
Siemens AG 2018 All rights reserved
[ s ] Ramp-up time
rampupTime REAL 1.0
Internally limited to between 0.001 – 1000.0
[ s ] Ramp-down time
rampdownTime REAL 1.0
Internally limited to between 0.001 – 1000.0
[ s ] Fast stop ramp-down time
fastRampdownTime REAL 0.1
Internally limited to between 0.001 – 1000.0
[ s ] Rounding-off time
roundingTime REAL 0.5
Internally limited to between 0.001 – 1000.0
Specification of the task in which the block is called.
IPO_ SERVO_SYNCHRONOUS_TASK
eTaskName
taskMode SYNCHRONOUS_ IPO_SYNCHRONOUS_TASK
Type
TASK IPO_SYNCHRONOUS_TASK_2
TIMER_INTERRUPT_TASK
Output parameters
Name Data type Initial value Description
FALSE: It is not calculated
busy BOOL FALSE
TRUE: FB calculates an Output_Value
FALSE: No error
error BOOL FALSE
TRUE: An error has occurred, refer to error identification
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
Setpoint FALSE: Setpoint not reached
BOOL FALSE
Reached TRUE: Setpoint reached
FALSE: Calculated setpoint is not zero
setpointZero BOOL FALSE
TRUE: Calculated setpoint is zero
FALSE: Is not accelerated
accelerating BOOL FALSE
TRUE: Is accelerated
Functionality
The function block is active with the input run at TRUE and the calculation can be
started or stopped with enable. Depending on the parameterization of the inputs, a
ramp function is calculated. Various options can be set by selecting the inputs. If
mode is at False, the ramp is braked using a special entered deceleration time
(fastRampdownTime) and without jerk limiting. This means that the ramp can be
effectively decelerated for an Emergency Stop – this is also possible while
accelerating. If mode is at True, then the drive is braked normally with the entered
deceleration time (rampdownTime). The acceleration is always calculated with the
entered acceleration time (rampupTime) independent of mode. In order to calculate
the acceleration and deceleration stages with reference to the entered
nominalValue, then the sampling time must be specified using the taskMode input.
In order to reach the setpoint (x), the appropriate interval values are output (at y)
and the actual acceleration is output (at ya). If input enableRounding is set to
TRUE, the ramp is calculated with jerk limiting. The rounding-off is determined by
Siemens AG 2018 All rights reserved
the rounding-off time (roundingTime). The zero crossing (when the input x changes
direction) can be parameterized with or without rounding. As soon as the output
value is zero this is displayed using the setpointZero output. Further, when
accelerating output acceleration is set, when decelerating, output deceleration is
set and for a constant value setpointReached is set. If the block is in the enable
mode, then output busy is set to TRUE. If the hold input is set to TRUE, the ramp-
function generator is stopped (held) and the actual acceleration is ramped-down to
zero. As long as hold is TRUE, setpoint x is ignored and output ya is set to zero.
nominalValue
t
rampupTime rampdownTime
x
Enable
Run
accelerating
decelerating
setpoint
Zero
Siemens AG 2018 All rights reserved
setpoint
Reached
t
Rounding
Time
t
pos
t
neg
ya
pos
t
neg
nominal
Value
rampdown t
rampupTime
Time
enable
run
accelerating
decelerating
setpoint
Zero
Siemens AG 2018 All rights reserved
setpoint
Reached
t
pos
t
neg
pos
t
neg
Figure 2-8: With rounding-off and Emergency Stop function (mode = FALSE)
y
nominalValue
fastRampDownTime fastRampdownTime t
rampupTime rampdownTime
run
enable
mode
accelerating
decelerating
t
Siemens AG 2018 All rights reserved
setpoint
Zero
t
setpoint
Reached
t
pos
t
neg
ya
pos
t
neg
0.0 0.0
t t
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.Error = TRUE
ErrorID Description
16#0000_0000 No error
16#010E_8001 The function block is called in an incorrect task.
16#010E_8005 Invalid input parameter
nominalValue = 0.0
Siemens AG 2018 All rights reserved
2.7 FCLConCalculateDistance
Calculates the braking distance and time, taking into consideration the dynamic
parameters of the motion sequence.
Block name
FCLConCalculateDistance
Task
This block calculates the braking distance and the associated time for the axis to
brake down to standstill (zero speed) - taking into account the actual motion vector
(velocity, acceleration, jerk).
FCLConCalculateDistance
REAL initialAccel
REAL negativeAccelLimit
REAL positiveAccelEndJerkLimit
REAL negativeAccelStartJerkLimit
REAL negativeAccelEndJerkLimit
Block parameters
Input parameters
Name Data Type Initial value Description
[LU / t] actual velocity of the axis – initialVelocity >
initialVelocity REAL 0.0
0.0
[LU/ t²] actual acceleration of the axis - if
initialAccel REAL 0.0 initialVelocity = 0.0 then initialAccel must be
equal = 0.0.
[LU / t²] maximum deceleration –
negativeAccelLimit REAL 0.0 negativeAccelLimit < 0.0 and the absolute value
must be greater than or equal to initialAccel.
[LU / t³] jerk to decrease the acceleration –
positiveAccelEndJerkLimit REAL 0.0
positiveAccelEndJerkLimit <= 0.0
Output parameters
Name Data Type Initial-value Description
sRet
Return structure of the function with
FCLConCalculateDistance Calculate
subsequently described elements
DistanceType
FALSE: No error
.boError BOOL FALSE TRUE: An error has occurred, refer to error
identification
DWORD Error identification, refer to error messages
.b32ErrorID 16#0000_0000 b32errorID <= 16#000_8000: warning
b32errorID >= 16#0000_8000: error
.r32GrossDistance REAL 0.0 Calculated braking distance
.r32GrossTime REAL 0.0 Calculated braking time
Siemens AG 2018 All rights reserved
sRetCalculateDistance
The following type definition applies:
I/O Element Data type Description
FALSE: No error
OUT boError BOOL TRUE: An error has occurred, refer to error
identification
Error identification, refer to error messages
OUT b32ErrorID DWORD b32errorID <= 16#000_8000: warning
b32errorID >= 16#0000_8000: error
The gross distance needed for
OUT r32GrossDistance REAL
axis stop with given inputs.
OUT r32GrossTime REAL The gross time need for axis stop.
Functionality
The motion profile is sub-divided into four segments for jerk-limited stopping of an
axis. In this case, a certain initial velocity and initial acceleration are used as basis.
- In the first segment (S2) the initial acceleration (initialAcceleration) is
decreased with the specified jerk (positiveAccelEndJerkLimit). The velocity
increase is taken into account.
- In the second segment (S3) it is checked as to whether the maximum
deceleration is reached with the specified jerk
(negativeAccelStartJerkLimit). The maximum deceleration is calculated.
- In the third segment (SD), the axis is braked with maximum deceleration
(negativeAccelLimit).
- In the fourth segment (S4) the actual acceleration is reduced with the
specified jerk (negativeAccelEndJerkLimit).
Starting from the parameterization of the block, not all of the segments are always
taken into account in the calculation. An overview of the use is given in the
following table. If a return parameter is zero, then the corresponding segment is
deactivated.
da dv ds dt
S2 neg pos pos T2
S3 neg neg pos T3
SD - neg pos TD
Siemens AG 2018 All rights reserved
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No Error
16#010F_8005 Invalid input parameter
The specification of the input parameter was not maintained as described.
negativeAccelLimit >= 0.0
positiveAccelEndJerkLimit > 0.0
Siemens AG 2018 All rights reserved
2.8 FCLConEvaluateModulo
Calculates the difference between two sampling values of a signal with overflow
property.
Block name
FCLConEvaluateModulo
Task
The block calculates the difference of an input signal between two calls taking into
account the overflow behavior, e.g. to determine the position difference of modulo
axes.
FCLConEvaluateModulo
LREAL valueLast
LREAL moduloLength
Block parameters
Input parameters
Name Data type Initial value Description
valueAct LREAL 0.0 [ - ] actual sampling value [ n ]
valueLast LREAL 0.0 [ - ] previous sampling value [ n – 1 ]
[ - ] modulo length, corresponds to #POSAXIS.
activeconfigdata.Modulo.Length.
moduloLength LREAL 0.0
For moduloLength < 0.0, the calculation is made
without modulo correction.
Output parameters
Name Data type Initial value Description
FCLConEvaluateModulo LREAL - [ - ] calculated difference
Functionality
The block calculates the position difference between two block calls and corrects
the calculated value taking into account the modulo length. The evaluation is
realized by comparing the actual and last position value referred to the modulo
length.
In order that the block correctly operates, it must be ensured that a modulo length
is run through in not less than 2 sampling cycles – as otherwise, reliable detection
is not possible.
Fig. 2-10
Fall #1 Fall #2 Fall #3
[n ]
[n]
[n
]
-1
[n
-1
[n
] - 1]
[n
]
moduloLength
Siemens AG 2018 All rights reserved
Case #1:
Value [ n ] > Value [ n – 1 ], no modulo overflow, no modulo correction.
FCLConEvaluateModulo = Value [ n ] – Value [ n – 1 ]
Case #2:
Value [ n ] < Value [ n - 1 ], modulo overflow in positive direction
FCLConEvaluateModulo = Value [ n ] – Value [ n – 1 ] + moduloLength
Case #3:
Value [ n ] > Value [ n – 1 ], modulo overflow in negative direction
FCLConEvaluateModulo = Value [ n ] – Value [ n – 1 ] - moduloLength
Error messages
The block does not generate any error messages.
If the input parameters are incorrect, then the difference is calculated without taking
the modulo into consideration.
Siemens AG 2018 All rights reserved
3 Drive functions
3.1 FBLConFrictionMeasurement – Friction characteristic
The friction characteristic is measured in SIMOTION
Block name
FBLConFrictionMeasurement
Task
The function block runs up to the speeds, stored in the input array, and stores the
corresponding average of the actual moments in the output array. E.g. the stored
friction characteristic can be in the winder function block.
FBLConFrictionMeasurement
sLConDynamics dynamics
Type
Block parameters
Input parameters
Name Data type Initial value Description
execute BOOL FALSE FALSE->TRUE starts the friction measurement
FALSE->TRUE: Sequence interrupt and axis
abort BOOL FALSE
stopped
Axis for which the friction characteristic should be
axis DRIVEAXIS TO#NIL
measured [ min. speed axis ]
Number of values to generate the average value [ 0
measurements UINT 50
– 50]
measurementDelay [ms] Delay time before starting the measurement at
REAL 100
Time each speed level
sLConDynamics
dynamics - Axis dynamics from config structure
Type
Input/Output parameters
Name Data type Initial value Description
Number of grid points (Input):
frictionCurveEntryNum UINT 0 [2 ≤ frictionCurveEntryNum ≤
LCONLIB_MAX_IDX_A+1]
Siemens AG 2018 All rights reserved
Output parameters
Name Data type Initial value Description
FALSE: A friction characteristic is not generated
done BOOL FALSE TRUE: Measurement completed, friction
characteristic generated
FALSE: A measurement is not made
busy BOOL FALSE
TRUE: A measurement is made
FALSE: Measurement was not interrupted
commandAborted BOOL FALSE
TRUE: Measurement was prematurely interrupted
FALSE: No error
error BOOL FALSE TRUE: An error has occurred, refer to error
identification
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
Functionality
Dependent on a request entered via the request input, the function block measures
the friction characteristic of the axis axis. If the axis is inactive, then it is enabled
and after the measurement has been completed it is inhibited again; for an active
axis, this remains active. With the measurement, the velocities or speeds – that
should be approached one after the other - are entered via the array
frictionCurveAbscissa. At each velocity or speed level that is reached (constant
move) and after the delay time measurementDelayTime the actual torque is saved
in the array frictionCurveOrdinate. In order to have the actual torque in the TO axis,
the technology data block must be activated. Parameter frictionCurveEntryNum
specifies how many values are to be taken. The average value is calculated over
several cycles. The number of measurements involved in generating the average
value can be defined using the input measurements. In this case, the input is
limited to 50 measurements. Output busy is set to True during the measurement.
After all of the velocities or speeds have been approached, and the measurement
completed, the done output is set to TRUE. If an error occurs during the
measurement, this is displayed at the error output and the associated errorID. If, at
the input, the abort signal abort is set to TRUE, the measurement is interrupted and
the axis stopped. For errors involving the system commands (_enableAxis, _move,
_stop, _disableAxis) and when the measurement is interrupted (aborted) by abort,
the commandAborted output is set.
After the friction characteristic measurement has been successfully completed the
values are in the array frictionCurveAbscissa.
Siemens AG 2018 All rights reserved
Note The units of the velocity or speed in the array frictionCurveOrdinate, should
correspond to the units of the TO axis. If possible, [RPM] should also be plotted
because FBLConTorquePreControl calculates the friction torque with these units.
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0108_C001 Non-compatible TO at the axis input
16#0108_C002 Technology data block is not activated
16#0108_8100 Error when enabling the axis
16#0108_8101 Error for a motion command
16#0108_8103 Error when stopping the axis
16#0108_8104 Error when inhibiting the axis
16#0108_C000 Internal program error
Task
The function block activates or deactivates the cyclical interface for position,
velocity and torque. The interfaces are necessary e.g. for controlling of an axis
winder or a drive with overlaid tension control.
FBLConEnableInterface
sLConDynamics dynamics
Type
Block parameters
Input parameters
Name Data type Initial value Description
axis DRIVEAXIS - Technology object axis
TRUE: the function block is active, interfaces will be
activated/deactivated accordingly
enable BOOL FALSE
TRUE>FALSE: all interfaces will be deactivated
FALSE: function block inactive
enumMoving SPEED_ Mode selection for axis control.
movingMode
Mode CONTROLLED Only relevant, if the axis is a positioning axis.
TRUE: position interface is activated
FALSE: position interface is deactivated
The position interface is only on available for
positioning axes.
motionInPosition BOOL FALSE
The velocity interface has priority over the position
interface.
No messages are output if the command is not
allowed.
TRUE: velocity interface is activated
FALSE: velocity interface is deactivated
motionInVelocity BOOL FALSE
The velocity interface has priority over the position
interface.
TRUE: Interface for additive torque is activated
Siemens AG 2018 All rights reserved
Output parameters
Name Data type Initial value Description
FALSE: no processing active
busy BOOL FALSE TRUE: at least one interface is active or being
activated/deactivated or enable = TRUE.
FALSE: No error
error BOOL FALSE TRUE: An error has occurred, refer to error
identification
All interfaces will be deactivated.
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
motionInPosition TRUE: The interface is active.
BOOL FALSE
Active FALSE: The interface is inactive.
Functionality
The Function Block activates and deactivates interfaces on a SIMOTION axis. The
input parameter axis transfers the name of the axis on which the interfaces should
be activated. Following input parameters de- or activate the interfaces:
motionInVelocity controls the MotionIn interface with velocity-Reference,
motionInPosition controls the MotionIn interface with position-reference,
additiveTorque controls the additive torque and
torqueLimitNegative/torqueLimitPositive are controlling the lower and upper torque
limits.
The interfaces are getting activated/deactivated in the following sequence:
1.) Interface for velocity/ position (_runvelocitybasedmotionin /
Siemens AG 2018 All rights reserved
_runPositionBasedMotionIn / _move)
System variable: axis.defaultmotionin.velocity / axis.defaultmotionin.position
2.) Interface for additive torque (_enableaxisadditivetorque /
_disableaxisadditivetorque)
System variable: axis.defaultadditivetorque
3.) Interface for negative torque limit (_enableaxistorquelimitnegative /
_disableaxistorquelimitnegative)
System variable: axis.defaulttorquelimitnegative
4.) Interface for positive torque limit (_enableaxistorquelimitpositive /
_disableaxistorquelimitpositive)
System variable: axis.defaulttorquelimitpositive
While calling the commands, the respective system variables are set to zero once.
Exception is the activation of the MotionInPosition where the actual position is set.
Is enable set to FALSE all interfaces become deactivated. As long as the function
block is enabled the interfaces will always be activated and deactivated according
to the respective inputs.
If an error occurs, the output error is set to TRUE and the identification is shown on
output errorID.
busy (5)
<<interface>> (6)
<<interface (7)
active>>
(1) (2) (3) (4)
t
ta td ta td
3.) Interface will be activated as the command is set once again, ta is the required
activation time.
4.) Interface will be deactivated as the function block enable is switched off, td is
the required deactivation time.
5.) The output busy is set to FALSE when all interfaces are inactive.
6.) And 7.) The sequence for activation/deactivation is the same for all (velocity,
position, additive torque and torque limit) interfaces.
Note For activation of the motion Interface, the current values of UserDefaultDynamics
are taken and can not be changed later. For changing the dynamic values during
run, without calling the command again it is recommended to raise the
userDefaultDynamics and control the dynamic of the axis with
plusLimitsOfDynamics / minusLimitsOfDynamics.
Errors
Error messages are indicated by the status of the outputs error and errorID:error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0109_810C Error while activating the MotionIn interface with position-reference.
The return value of the command _runPositionBasedMotionin is not 0.
16#0109_8105 Error while activating the MotionIn interface with velocity-reference.
The return value of the command _runVelocityBasedMotionin is not 0.
16#0109_8106 Error while activating the additive torque interface.
The return value of the command _disableAxisAdditiveTorque is not 0.
16#0109_8107 Error while activating the negative torque limit interface.
The return value of the command _disableAxisTorqueLimitNegative is not 0.
16#0109_8108 Error while activating the positive torque limit interface.
The return value of the command _enableAxisTorqueLimitPositive is not 0.
16#0109_8109 Error while deactivating the positive torque limit interface.
The return value of the command _disableaxistorquelimitpositive is not 0.
16#0109_810A Error while deactivating the negative torque limit interface.
The return value of the command _disableaxistorquelimitnegative is not 0.
Siemens AG 2018 All rights reserved
Block name
FBLConPT1
Task
This function block has the function of a PT1 filter. The input value is output filtered.
The filter effect can be influenced by the entered smoothing time. Further, it is
possible to set the output to a specific value.
FBLConPT1
REAL smoothingTime
eTaskNameType taskMode
Block parameters
Input parameters
Name Data type Initial value Description
x REAL 0.0 [ - ] Input value to be filtered
[ ms ] Smoothing time
SmoothingTime REAL 100.0 Internal limiting in the standard mode – at least one
cycle time
setValue REAL 0.0 [ - ] Value to be set for S = TRUE
FALSE: Normal operation of the filter
set BOOL FALSE
TRUE: Sets the output to the value SV
Output parameters
Name Data type Initial value Description
FALSE: No error
error BOOL FALSE TRUE: An error has occurred, refer to error
identification
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
y REAL 0.0 [ - ] Filtered output value
Functionality
A value (x) is entered into the function block. This value is filtered using the
smoothing time (smoothingTime) and output at output (y). To precisely calculate
Siemens AG 2018 All rights reserved
the internal steps, the sampling time in which the block is processed is internally
determined. Further, it is possible to permanently set the output to the value of the
input (setValue) by setting the input (set).
Interconnection possibility:
In order to generate a HOLD, output (y) should be connected to the input
(setValue) using a variable. This means that when setting set to TRUE, the output
value is maintained until set is again set to FALSE. If the smoothing time
(smoothingTime) is set to zero, the filter is de-activated and the output value is
equal to the input value.
63% of the input value is reached at the output after the smoothing time
(smoothingTime).
95% of the input value is reached at the output after three times (300%) of the
smoothing time (smoothingTime).
The proportional gain – internally set – is 1 and cannot be varied.
For an appropriately high smoothingTime /TA (smoothingTime /TA > 10) the
transfer function corresponds to the following characteristic
Y (t ) X * (1 e t / smoothingTime ) with t n * TA
* X n Yn 1
TA
Yn Yn 1
smoothingTime
Yn Value of Y in sampling interval n
Yn-1 Value of Y in sampling interval n – 1
Xn Value of X in sampling interval n
Note The higher the smoothingTime /TA, the lower the amplitude change at Y from
one sampling instant to the next sampling instant. TA is the sampling time in
which the function block is processed. smoothingTime is internally limited: T >=
TA.
95%
Siemens AG 2018 All rights reserved
63%
X
( 100%)
3 x smoothingTime t
smoothingTime
X
100 %
50 %
t
set
smoothing
Time
100 %
50%
95%
63%
X
( 100%)
3 x smoothingTime t
smoothingTime
X
100 %
50 %
0% t
setValue
100 %
50 %
0% t
set
smoothing
Siemens AG 2018 All rights reserved
Time
100 %
50%
0%
t
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0101_8001 The function block is called in an incorrect task.
Block name
FBLConINT
Task
The function block represents an integrator with upper and lower limiting. Further,
the output can be set to a defined output value.
FBLConINT
REAL integralTime
eTaskNameType taskMode
Block parameters
Input parameters
Name Data type Initial value Description
FALSE: Normal integrator function
set BOOL FALSE
TRUE: Output is set value
x REAL 0.0 [ - ] Input quantity, integration value
setValue REAL 0.0 [ - ] Setpoint input for the setting function
upperLimit REAL 1.0 [ - ] Upper integration limit
lowerLimit REAL 0.0 [ - ] Lower integration limit
integralTime REAL 5.0 [ ms ] Integration time TI [ sampling time – 1000]
Specification of the task in which the block is called.
IPO_
SERVO_SYNCHRONOUS_TASK
eTaskName SYNCHRONOUS_
taskMode IPO_SYNCHRONOUS_TASK
Type TASK
IPO_SYNCHRONOUS_TASK_2
TIMER_INTERRUPT_TASK
Output parameters
Name Data type Initial value Description
FALSE: No error
Siemens AG 2018 All rights reserved
Functionality
The function block integrates input quantity x with integration time integralTime.
The result is output at y. The integrator is limited by the upper limit upperLimit and
the lower limit lowerLimit. If the integrator reaches one of the limits, then this is
connected to the output and saved as internal buffer value. Further, when the
particular limit at the output is reached, this is indicated using upperLimitReached
and lowerLimitReached. Using the setting function, which is activated with set
=True, the output can be set to a pre-defined value (setValue). If set is reset, then
starting from the setting value, the integrator continues to integrate in the direction
specified using input value x.
integralTime is internally limited with
TA integralTime 1000
The discrete values (TA is the sampling time in which the function block is
processed) are calculated using the following algorithm:
TA
Yn Yn 1 * Xn
integralTime
Yn Value of Y in sampling interval n
Yn-1 Value of Y in sampling interval n-1
X Value of X in sampling interval n
setValue upperLimitReached
y
x
lowerLimitReached
set
Siemens AG 2018 All rights reserved
* = any
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0102_8001 The function block is called in an incorrect task.
Siemens AG 2018 All rights reserved
Block name
FBLConDIF
Task
Function block with differentiating behavior
FBLConDIF
Siemens AG 2018 All rights reserved
Block parameters
Input parameters
Name Data type Initial value Description
x REAL 0.0 [ - ] Input quantity
diffTime REAL 0.0 [ ms ] Differentiating time constant
Specification of the task in which the block is called.
IPO_ SERVO_SYNCHRONOUS_TASK
eTaskName
taskMode SYNCHRONOUS_ IPO_SYNCHRONOUS_TASK
Type
TASK IPO_SYNCHRONOUS_TASK_2
TIMER_INTERRUPT_TASK
Output parameters
Name Data type Initial value Description
FALSE: No error
error BOOL FALSE
TRUE: An error has occurred, refer to error identification
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
y REAL 0.0 [ - ] Output quantity
Functionality
Output quantity y changes as a function of the rate of change of input quantity x,
multiplied by the differential time constant diffTime. Discrete values are calculated
using the following algorithm:
Yn X n X n 1 *
diffTime
TA
Yn Value of Y in sampling interval Y
Xn Value of X in sampling interval n
Xn-1 Value of X in sampling interval n-1
Note The higher the diffTime / TA the lower the amplitude change at y from one
sampling instant to the next sampling instant. TA is the sampling time in which
the function block is processed. diffTime is internally limited diffTime >= 0.
diffTime
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0103_8001 The function block is called in an incorrect task.
Block name
FBLConDT1
Task
Function block with differentiating behavior and smoothing. The DT1 output can be
set.
FBLConDT1
REAL diffTime
eTaskNameType taskMode
Block parameters
Input parameters
Name Data type Initial value Description
FALSE: Setting value has no influence on the output
quantity of the DT1 element
set BOOL FALSE TRUE: Output value Y is set to the value of input SV and
the output of the DT1 element corresponds to the
equation below
x REAL 0.0 [ - ] Input quantity
setValue REAL 0.0 [ - ] Setting value
[ ms ] Smoothing time constant
SmoothingTime REAL 0.0
is internally limited :[SamplingTime – T1Max]
Output parameters
Name Data type Initial value Description
FALSE: No error
error BOOL FALSE
TRUE: An error has occurred, refer to error identification
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
y REAL 0.0 [ - ] Output quantity DT1
ypt REAL 0.0 [ - ] Output quantity smoothing element
Functionality
Siemens AG 2018 All rights reserved
The higher the smoothingTime /TA, the lower the amplitude change at Y and at
YPT from one sampling instant to the next sampling instant. TA is the sampling
time in which the function block is processed.
The higher the diffTime /TA, the higher the amplitude change at Y from one
sampling instant to the next sampling instant. DiffTime and smoothingTime are
internally limited:
0 <= diffTime <= MaxTD, TA <= smoothingTime <= MaxT1
In this case, the internal limits for smoothingTime1 and diffTime apply. For diffTime
= 0, the output quantities remain unchanged as long as set = TRUE.
Caution: Overcontrol (limits reached) can occur when the setting function is both
active as well as also inactive!
x Y
Siemens AG 2018 All rights reserved
set
YPT
Y1
Y1=f(X,t)
x*diffTime/
smoothingTime
Y1(t=T1)=0,37*x*diffTime/
smoothingTime
t
smoothing
Time
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0104_8001 The function block is called in an incorrect task.
Block name
FBLConLIM
Task
Function block for limiting with settable upper and lower limits. If a limit is reached,
this is displayed.
FBLConLIM
Siemens AG 2018 All rights reserved
REAL x y REAL
Block parameters
Input parameters
Name Data type Initial value Description
x REAL 0.0 [ - ] Input quantity to be limited
upperLimit REAL 0.0 [ - ] Upper limit value
lowerLimit REAL 0.0 [ - ] Lower limit value
Output parameters
Name Data type Initial value Description
y REAL 0.0 [ - ] Limited output quantity [lowerLimit – upperLimit]
FALSE: Upper limit not reached
upperLimitReached BOOL TRUE
TRUE: Upper limit reached
FALSE: Lower limit not reached
lowerLimitReached BOOL TRUE
TRUE: Lower limit reached
Functionality
The function block transfers input quantity x to its output y. The input quantity is
limited dependent on upperLimit and lowerLimit.
If the input quantity reaches upper limit upperLimit, output upperLimitReached is
set to TRUE.
If the input quantity reaches lower limit value lowerLimit, output lowerLimitReached
is set to TRUE.
If the lower limit value is greater or equal to the upper limit value, output y is set to
the upper limit value upperLimit.
Graphic representation
Figure 4-7
lower upper
Limit Limit
upperLimitReached
x y
lowerLimitReached
Siemens AG 2018 All rights reserved
Error messages
If upperLimitReached and lowerLimitReached are both at TRUE, the lower limit
lowerLimit is greater than upper limit upperLimit.
Task
This function block monitors an input value to identify whether it violates (exceeds,
falls below) the parameterized limit values. The monitoring is only activated as long
as the block is active.
FBLConLevelControl
Siemens AG 2018 All rights reserved
REAL alarmLow
REAL hyst
TIME delayTime
Block parameters
Input parameters
Name Data type Initial value Description
FALSE: Function is de-activated
run BOOL FALSE
TRUE: Function is activated
x REAL 0.0 [ - ] Input value to be monitored
alarmHigh REAL 100.0 [ - ] Upper limit value, alarm
warningHigh REAL 80.0 [ - ] Upper limit value, warning
warningLow REAL -80.0 [ - ] Lower limit value, warning
alarmLow REAL -100.0 [ - ] Lower limit value, alarm
[ - ] Hysteresis
hyst REAL 0.0
This value is always taken into account as absolute value.
delayTime TIME T#3s [s] Delay Time to set outputs
Output parameters
Name Data type Initial value Description
FALSE: Function is de-activated
busy BOOL FALSE
TRUE: Function is activated
Siemens AG 2018 All rights reserved
Functionality
This function block monitors an input value x to identify whether it violates
(exceeds, falls below) parameterized limit values as long as it is active with run =
TRUE. If the block is functioning, then this can be identified using the busy output.
When the warningHigh value is exceeded, output warningUpperLimit is set after
delayTime. The same applies when the alarmHigh value is exceeded with the
associated output alarmUpperLimit. If the input value drops below the limit value
warningHigh or alarmHigh minus the hysteresis value (hyst), the particular output is
again reset. The same applies for the lower limit monitoring with the limits
warningLow and alarmLow as well as the associated outputs warningLowerLimit
and alarmLowerLimit. However, in this case, the hysteresis (hyst) is added to the
limit value. Warnings are not reset as a result of alarms.
Block name
FCLConDeadBand
Task
The function generates a dead band whose values cannot be reached. All values
in this value range –symmetrical around the zero point – are set to zero.
FCLConDeadBand
REAL bandBorder
Block parameters
Input parameters
Name Data type Initial value Description
x REAL 0.0 [ - ] Input value that should be checked
bandBorder REAL 0.0 [ - ] Limit value for dead band
Output parameters
Name Data type Initial value Description
FCLConDead
REAL - [ - ] Checked output value
Band
Functionality
If the input value (x) is located in the dead band range (-bandBorder < x <
+bandBorder), the output value is set to zero. However, if it is at or below
(–bandBorder) at output input – bandBorder is output. If the input value is at or
above (+bandBorder), x + bandBorder is set to as output value. The dead band –
symmetrical around the zero point – can be set using response value B.
Algorithm:
X+B for X <= -B
Y=0 for -B < X < + B
X-B for X >= +B
with the secondary condition B >= 0. For B < 0, all IN: OUT=IN.
X Input quantity
B Response threshold for the dead band
Y Output quantity
Block name
FCLConDeadZone
Task
The function generates a dead zone whose values cannot be reached. All values in
the value range – symmetrical around the zero point – are set to zero.
FCLConDeadZone
REAL zoneBorder
Block parameters
Input parameters
Name Data type Initial value Description
x REAL 0.0 [ - ] Input value which should be checked
zoneBorder REAL 0.0 [ - ] Limit value for dead zone
Output parameters
Name Data type Initial value Description
FCLConDeadZone REAL - [ - ] Checked output value
Functionality
If the input value (x) lies in the range of the dead band (-zoneBorder < x < +
zoneBorder), the output value (FCLConDeadZone) is set to zero. If the input value
lies at / below (–zoneBorder) or at / above (+zoneBorder), input x is output as
output value. The dead zone – symmetrical around the zero point – can be set
using the response value zoneBorder.
Algorithm:
Block name
FBLConAverageValue
Task
The function calculates the floating average value for the values entered at the
input.
FBLConAverageValue
INT sizeOfArray
Block parameters
Input parameters
Name Data type Initial value Description
FALSE: Function block is not active
run BOOL FALSE TRUE: Function block is active and calculates an average
value
reset BOOL FALSE TRUE: Resets the calculation
x REAL 0.0 [ - ] Actual input value
sizeOfArray INT 0 [ - ] Size of the field to save the value [1 – 50]
Output parameters
Name Data type Initial value Description
FALSE: FB does not calculate any values
busy BOOL FALSE
TRUE: FB calculates values
averageValue REAL 0.0 [ - ] Calculated average value
TRUE: maximum Values in the array
maxValueReached BOOL FALSE
sizeOfArray – Values are in the array
Siemens AG 2018 All rights reserved
Functionality
The function block calculates the average value (averageValue) of several values
that are entered and saved. Each time the block is called, the value (x) currently
present is saved in a field (sizeOfArray). The larger the field, the more the average
value moves. If the field size is very small, changes and fluctuations can be
immediately identified in the average value, which is present at the output
(averageValue). The function block is activated via the input run and calculates
values from that instant. Similar to that for reset, the field size is accepted and the
associated field counter is reset. The Output maxValueReached is set if
sizeOfArray Values are in the array. With reset = TRUE the output averageValue is
set to the input value x.
4.10 FBLConPIDController
PID controller with actual value smoothing and optional D component in the actual
value branch.
Block name
FBLConPidController
Task
The function block has the following functionality:
PID controller
Actual value smoothing with PT1 element
Scaling of the actual value signal
Proportional, integral and derivative action component
Optional derivative action component in the actual value arm
“Anti-windup” integrator: If the controller output is limited, then the integrator is
frozen when the limit is reached
Pre-control signal
Siemens AG 2018 All rights reserved
FBLConPidController
REAL lowerLimit
REAL intSetValue
BOOL holdIntChannel
BOOL setIntChannel
sPidDataType sPidData
eTaskName taskMode
Type
Block parameters
Input parameter
Name Data type Initial value Description
TRUE: Controller, active, outputs are calculated
enable BOOL FALSE FALSE: Controller inactive, all outputs are set to the
initial values
TRUE: The outputs are set to the initial values and
reset BOOL FALSE
the integrator to the starting value.
setpointValue REAL 0.0 [ - ] Setpoint signal
actualValue REAL 0.0 [ - ] Actual value signal
preControl REAL 0.0 [ - ] Pre-control signal
propGain REAL 2.0 [ - ] Controller gain
[ ms ] Time constant of the I component – is internally
integTime REAL 999.0
limited to cycle time / 2 as the lower limit value.
[ ms ] Time constant of the D component – the value
derivTime REAL 4.0
is internally limited to cycle time as lower limit value.
[ ms ] Time constant of the actual value smoothing –
this is internally limited to the cycle time as lower limit
filterTime REAL 50.0
value. The smoothing is deactivated if values <= 0.0
are parameterized.
[ - ] Upper limit value of the control output. This must
Siemens AG 2018 All rights reserved
Output parameter
Name Data type Initial value Description
FALSE: No error
TRUE: An error has occurred, refer to error
identification
error BOOL FALSE
All outputs have the initial values, errors can be reset
using the reset function or rising edge at the enable
input.
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
busy BOOL FALSE TRUE: Block is active
BOOL TRUE: Controller output has reached the upper limit,
upperLimitReached FALSE
the integrator is limited
BOOL TRUE: Controller output has reached the lower limit,
lowerLimitReached FALSE
the integrator is held
deviationValue REAL 0.0 [ - ] System deviation after the deadband filter
pOutValue REAL 0.0 [ - ] P component output, unlimited
iOutValue REAL 0.0 [ - ] I component output, unlimited
sPidDataType
The following type declaration applies:
I/O Element Data type Description
TRUE: P component is activated
IN boEnPChannel BOOL
Pre-assignment: TRUE
TRUE: I component is activated
IN boEnIChannel BOOL
Pre-assignment: TRUE
Siemens AG 2018 All rights reserved
Functionality
The function block is used to implement a universal PID controller that can be
switched over to the P controller or I controller modes. The D component can either
be calculated in the actual value branch or in the system deviation.
The integrator can be set using the inputs intSetValue (setting value) and
setIntChannel. In addition, the instantaneous value of the integrator can be held
using holdIntChannel (P controller). Internally, the I component is limited, based on
the controller output limits (“anti-windup”). The integrator is set to zero at switch-on.
All of the block parameters can be changed in operation.
The scaled and smoothed actual value (actualValue) is subtracted from the
setpoint (setpointValue) corresponding to the following equation:
t
deviationValue (actualValue r 32 ActValueFactor) r 32 ActValueOffset 1 e T setpo intValue
The result is the system deviation deviationValue (after the deadband) and is then
multiplied with the proportional coefficient propGain that can be set. The result is
transferred to the integrator – and optionally to the D component. The settable
integral time integTime as well as the time constant of the D component derivTime
(optional) define the controller behavior.
Component Calculation
P component pOutValuen propGain deviationValuen
I component pOutValuen pOutValuen 1 T Zyklus
iOutValuen iOutValuen 1
2 int egTime
Tcycle: Sampling time
The integrator includes "anti-windup" functionality, i.e. if the controller
output is limited, the integrator cannot continue to integrate in the same
direction.
The inputs setIntChannel and holdIntchannel can be used to set the
integrator (intSetValue) – or manually hold it. The integrator is set to zero
using reset or with a rising edge for enable.
D component
dOutValuen pOutValuen pOutValuen 1
derivTime
(if activated) Tcycle
Tcycle: Sampling time
Warnings
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No warning
Invalid parameter, it is internally limited
16#0110_4002 derivTime < Tcycle,
integTime < Tcycle / 2
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0110_8001 The function block is called in an incorrect task.
Invalid parameter
16#0110_8005
upperlimit < lowerlimit
Siemens AG 2018 All rights reserved
Signal diagram
Fig. 4-10
enable 1
(IN) 0
1
reset
(IN) 0
busy 1
(OUT) 0
error 1
(OUT) 0
Siemens AG 2018 All rights reserved
outValue
(OUT)
Function diagram
Siemens AG 2018 All rights reserved
Block name
FBLConTechnologyController
Task
The function block includes the following functionality:
Setpoint ramp-function generator with setting function
PID controller
Ramp function as controller output limiting
Kp adaptation
D component can be optionally switched-in in the actual value branch
Siemens AG 2018 All rights reserved
FBLConTechnologyController
Block parameters
Input parameters
Name Data type Initial value Description
FALSE -> TRUE: Ramp-function generators are started,
PID controller is active (if not in the openLoop mode)
enable BOOL FALSE TRUE -> FALSE: Setpoint is integrated to the actual
value, the controller output is limited and then FB
deactivated.
FALSE: PID controller is active
openLoopCtrl BOOL FALSE TRUE: PID controller and RFG limiting are inactive. Only
the setpoint RFG is used.
setpointValue REAL 0.0 [ Z ] / [ LU ] / [ % ] Setpoint signal
actualValue REAL 0.0 [ Z ] / [ LU ] / [ % ] Actual value signal
preControl REAL 0.0 [ rpTU ] or [ °/TU ] pre-control signal
[ - ] Signal for Kp adaptation
adaptionValue REAL 0.0
The units depend on the interconnection.
holdIntChannel BOOL FALSE TRUE: I component is frozen
setIntChannel BOOL FALSE TRUE: set I component
Input/output parameters
Name Data type Initial value Description
sLConTechnol
sTechnology Configuration data of the technology controller. Details on
ogy
Controller - this structure are provided in the description of the type
Controller
Config definitions.
ConfigType
Output parameters
Name Data type Initial value Description
FALSE: The function block is deactivated
busy BOOL FALSE TRUE: The function block is activated. The controller
output or the ramped setpoint (in case of openLoopCtrl =
TRUE) is not zero.
FALSE: No error
error BOOL FALSE
TRUE: An error has occurred, refer to error identification
Error identification, refer to error messages
Siemens AG 2018 All rights reserved
Note The calculations in this function block are independent of the physical units.
[LU] Length unit, e.g. m
[Z] Tension, force, e.g. N
sLConPidDataType
The following type declaration applies:
I/O Element Data type Description
TRUE: P component is activated
IN boEnPChannel BOOL
Pre-assignment: TRUE
TRUE: I component is activated
IN boEnIChannel BOOL
Pre-assignment: TRUE
TRUE: D component is activated
IN boEnDChannel BOOL
Pre-assignment: FALSE
TRUE: D component is effective in the actual
value branch (after smoothing) and not in the
IN boControlMode BOOL system deviation
Siemens AG 2018 All rights reserved
sLConTechnologyControllerConfigType
The following type definition applies:
I/O Element Data type Description
IN r32X1 REAL [ - ] x coordinate for Kp adaptation for Kp1
[ - ] Kp value for r32X1.
IN r32Kp1 REAL If the Kp adaptation is deactivated, then this
parameter is used as Kp value.
[ - ] x coordinate for Kp2
IN r32X2 REAL If r32X1 = r32X2, then the Kp adaptation is
deactivated.
[ - ] second Kp value, assigned corresponding to
IN r32Kp2 REAL
r32X2.
OUT r32EffectiveKp REAL [ - ] effective controller gain after Kp adaptation
[ ms ] ramp-up time of the controller output
IN r32LimRampUpTime REAL limiting.
This is internally limited to the cycle time as
Functionality
The block is enabled using the enable input; as a consequence, the setpoint ramp-
function generator and the limiting ramp-function generator are started with their
respective ramp-up times and the PID controller is activated. In addition, for a rising
edge, the setpoint ramp-function generator is set to the actual value that is present
(actualValue). This guarantees a jerk-free and smooth transition into the tension
controlled mode.
When the edge at the enable input falls, the limiting ramp-function generator is
ramped back to zero and therefore the controller output is limited. This results in a
bumpless controller shutdown. As soon as the outValue output is zero and enable
= FALSE, the block is deactivated and the output busy is set to FALSE. The
setpoint is internally ramped to the actual value during the switch-off phase.
If the input openLoopCtrl = TRUE, then the block operates in the open control
circuit mode. As a consequence, the setpoint channel remains active and the
controller or the output limits remain inactive. The output busy stays TRUE as long
as the setpoint ramp output is not zero. The input actualValue is 0.0.
Setpoint ramp
The setpoint ramp-function generator is used to avoid setpoint steps in the setpoint
channel. The setpoint ramp-function generator is configured using parameter
r32SetRampDownTime , r32SetRampUpTime, and r32SetNominalValue, whereby
r32SetNominalValue defines the reference value for the ramp-up or ramp-down
time. The function is always active, if enable = TRUE.
If openLoopCtrl = FALSE, enable = FALSE and busy = TRUE (switch-off phase),
then the setpoint is internally set to the actual value.
The ramp times are internally limited to the cycle time.
Limit ramp
The limit ramp is only active, if the technology controller is used as closed control
loop. When switching on the controller with enable = TRUE, the limits are ramped
to 100% using the parameterized ramp-up time (r32LimRampUpTime). The output
limit (r32UpperLimit and r32LowerLimit) is therefore completely effective.
When switching off (enable = FALSE), the controller limits are ramped back to 0%
(r32LimRampDownTime), to permit bumpless transition into the non-controlled
mode. The controller is deactivated once zero has been reached.
The times are internally limited to the cycle time.
Controller function
Controller setpoint is provided via the setValue, the actual value via the actValue
input. The setpoint channel includes a settable setpoint ramp-function generator,
Siemens AG 2018 All rights reserved
via which the setpoint is routed; the effective setpoint can be monitored at output
RFGSetValue. The control algorithm used corresponds to that described in block
FBLConPidController.
Kp adaptation
A linear adaptation is carried out as Kp adaptation. The interpolation straight line is
defined by the value tuple (r32X1, r32Kp1) and (r32X2, r32Kp2).
1st case: (adaptionValue < r32X1) or (r32X1 = r32X2):
r32EffectiveKp = r32Kp1
r32EffectiveKp = r32Kp2
1
enable
0
1
busy 0
100%
RFGLim.y
0%
1
RFGLimReached 0
100%
p%
actualValue
0%
100%
setpointValue
0%
100%
RFGSetpointValue p%
0%
1
RFGSetpointReached 0
Siemens AG 2018 All rights reserved
Warnings
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No warning
Invalid parameter, internal limitation
16#0208_4002 derivTime < Tcycle,
integTime < Tcycle / 2
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0208_8001 The function block is called in an incorrect task.
Invalid parameter:
sTechnologyControllerConfig.r32Upperlimit <=
16#0208_8005
sTechnologyControllerConfig.r32Lowerlimit
sTechnologyControllerConfig.r32SetNominalValue <= 0.0
SetpointRFG
1 EN Y RFGSetPointValue
setpointValue
X QE RFGSetPointReached
0.0 0 NRM QU
A MaxReal LU QL
r32SetNominalValue
Function diagram
MinReal LL
SV
r32SetRampUpTime TU
r32SetRampDownTime TD
CU
CD
TRUE CF
S
r32lowerLimit
C
= ≥1 busy
KP-Adaption =0
1
r32Kp2 EN PID
0
W Y outValue
r32Kp1 INTEGRATOR
X
X W
P
LU
r32X1 LL
adaptionValue
r32X2 SV
Kp
preControl
D TN
r32IntSetValue
r32IntegTime TD
upperLimitReached
r32DerivTime T
r32FilterTime S QU
setIntChannel lowerLimitReached
HI QL
holdIntChannel
configdata
sPidData
94
5 Winding functions
5 Winding functions
The description of the function block FBLConWinder can be found in a separate
document:
https://support.industry.siemens.com/cs/de/en/view/35818687
Block name
FBLConDiameterCalculation
Task
This function block calculates the actual diameter of the roll based on the behavior
of the winding drive and line drive. One of 5 modes can be selected for the
calculation. The result of the diameter calculation is subject to a plausibility check.
Siemens AG 2018 All rights reserved
FBLConDiameterCalculation
Block parameters
Input parameters
Name Data type Initial value Description
FALSE: function block is deactivated
The block sets the output signals to “secure” values
and executes a limitation of the output value
run BOOL TRUE
diamActVal. The limitation is done between
sDiamConfid.diamMin and sDiamConfig.diamMax.
TRUE: function block is activated
FALSE: The diameter calculator is deactivated (acts
like holdDiam)
enable BOOL FALSE TRUE: The diameter calculator is activated. The
calculation mode is assumed and internal stored with a
rising edge.
reset BOOL FALSE TRUE: Resets all of the variables in the FB (also filter)
TRUE: Sets the diameter to a specified value
setDiam BOOL FALSE
The value is specified in sDiamConfig.diamSetVal
holdDiam BOOL FALSE TRUE: Holds the actual diameter
Winder type:
REWIND_FROM_ABOVE
eWinding REWIND_ REWIND_FROM_BELOW
typeOfWinder FROM_ UNWIND_FROM_ABOVE
ModeType ABOVE UNWIND_FROM_BELOW
Siemens AG 2018 All rights reserved
Output Parameters
Name Data type Initial value Description
FALSE: Function block is deactivated, values will not
busy FALSE be evaluated
BOOL
TRUE: Function block is activated
FALSE: No error
error BOOL FALSE TRUE: An error has occurred, refer to error
Siemens AG 2018 All rights reserved
identification
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
eDiam
diamModeInUse - Actual diameter calculation mode
ModeType
[ LU ] Calculated value of the web thickness
calculatedWebThickness REAL 0.0 only for DIAM_CALC_INTEGRAL and
DIAM_CALC_POSITION mode. Otherwise the output
is set to 0.0.
diamActVal REAL 0.0 [ LU ] Actual diameter value
FALSE: Diameter calculator is enabled
diamIsHold BOOL FALSE
TRUE: Diameter calculator is in the stop condition
diamActUpperLimit TRUE: Upper limit of the actual diameter value
BOOL FALSE
Reached reached
diamActLowerLimit TRUE: Lower limit of the actual diameter value
BOOL FALSE
Reached reached
diamRawUpperLimit TRUE: Upper limit of the actual raw diameter value is
BOOL FALSE
Reached reached
diamRawLowerLimit TRUE: Lower limit of the actual raw diameter value is
BOOL FALSE
Reached reached
diamSetUpperLimit
BOOL FALSE TRUE: Upper limit of the diameter setpoint is reached
Reached
diamSetLowerLimit
BOOL FALSE TRUE: Lower limit of the diameter setpoint is reached
Reached
diamChangeLimited BOOL FALSE TRUE: Diameter change rate is limited.
Note In principle, the calculations made in this function block are independent of any
physical units. The input parameter determines the units of the output
parameters. The internal calculations carry-out specific related conversions
[LU] Length unit, e.g. m
[TU] Time unit of the line-/winderAxis
[Inc] Position signal of the winding and the material web axis
[V] Web velocity, derived from LU/min
[n] Speed, e.g. rpm
As far as the physical units of smaller length units and conversion of velocities,
conversions are made into LU/s or rev/s.
Functionality
The diameter calculator determines the actual diameter value (diamActVal) of the
roll being wound (or unwound) using the input quantities:
Web velocity and position
Shaft speed of the mandrel or angle
Web thickness
Siemens AG 2018 All rights reserved
Calculation modes
The function block implements the following calculation modes:
Table 5-1: Diameter calculation types
Calculation mode Description
DIAM_THICKNESS_ADDITION Integrates the web thickness
Calculates the diameter based on the ratio
DIAM_CALC between the web velocity and winder velocity or
speed (speed)
DIAM_EXT Senses the diameter using a sensor
Calculates the diameter from the ratio between
DIAM_CALC_INTEGRAL the winder angle and web length by integrating
the winding speed and the web velocity.
Calculates the diameter using the ratio between
DIAM_CALC_POSITION the winder angle and web length by measuring
the winder position (angle) and the web length.
DIAM_THICKNESS_ADDITION
This mode calculates the diameter by continually adding the web thickness that is
added or removed from the roll at each sampling time.
The diameter change is 2 x web thickness (h) x speed of the mandrel (n). Starting
from an initial diameter, the actual diameter value is formed from this change
through numerical integration.
Depending on the winder type eTypeOfWinder the material thickness is either
added or subtracted.
Table 5-3: Parameter list, material thickness integration
Name Description
sDiamConfig Structure for the diameter calculator configuration data
Winder type
UNWIND_FROM_ABOVE
.eTypeOfWinder UNWIND_FROM_BELOW
REWIND_FROM_ABOVE
REWIND_FROM_BELOW
DIAM_CALC
The diameter is obtained by dividing the web quantity by the angular quantity
Siemens AG 2018 All rights reserved
DIAM_EXT
In this particular mode, the diameter is externally sensed using an analog sensor.
The numerical sensor value is assigned to parameter diamExtVal. In the diameter
calculator, this value forms the abscissa value of a characteristic block (refer to
FBLConPolygonA). The user should parameterize this characteristic block so that
its output value ordinateOutput is the actual diameter.
By setting the DiamConfig parameter u16DiamExtCurveEntryNum to zero, the
functionblock FBLConPolygonA won’t be calculated and the value assigned to
diamExtVal will be taken as diameter.
Table 5-5: Parameter list, external diameter
Name Description
[ - ] External diameter value, when required, can be scaled and
diamExtVal
linearized using the characteristic.
sDiamConfig Configuration data of the diameter calculator
.u16DiamExtCurve [ - ] Number of grid points for the polygon calculation [2 –
EntryNum LCONLIB_MAX_IDX_A+1]
[ - ] Abscissa values for the diameter characteristic to linearize the
.r32DiamExtCurveAbscissa external diameter signal (maximum LCONLIB_MAX_IDX_A+1 x-y
points).
[ LU ] Ordinate values for the diameter characteristic to linearize
.r32DiamExtCurveOrdinate the external diameter signal (maximum LCONLIB_MAX_IDX_A+1
x-y points).
Siemens AG 2018 All rights reserved
DIAM_CALC_INTEGRAL
These integral diameter calculation techniques are also based on the division of
the web quantity by the angular quantity. However, quantities v and ω are
integrated over a number of roll revolutions that can be specified
(sDiamConfig.r32MeasuringRevolutionCount). This is to minimize the disturbing
effect of processing just individual values. The following applies:
s
s R , with D 2
If the number of revolutions of the winding shaft - specified by parameter
sDiamConfig.r32MeasuringRevolutionCount – is reached, then the integrators are
reset. The calculated diameter value is then further processed.
In order that the associated quantities are divided at the same instant of detection it
is also possible to slightly delay the web velocity signal (v) using a PT1 element.
In addition in every measuring interval the actual material thickness
(r32CalculatedWebThickness) is calculated, e.g. for a rest length calculation.
DIAM_CALC_POSITION
This diameter calculation technique directly intervenes at the position of the web
and the roll being wound or unwound. In this case, the position is fed back into the
FB via the input parameter lineFeedback and windingShaftFeedback there (in the
Siemens AG 2018 All rights reserved
FB) the difference to the previous cycle is measured. Overflows are intercepted
using modulo limits that should be entered. Positions are evaluated and weighted
using the scaling factors sDiamConfig.r64LineFeedbackScal and sDiamConfig.-
r64WindingShaftFeedbackScal.
sDiamConfig.r64LineFeedbackScal corresponds to: 1 [LU]
sDiamConfig.r64WindingShaftFeedbackScal corresponds to: 1 [rev]
s
s R , with D 2
If the number revolutions of the winding shaft – specified by parameter
sDiamConfig.r32MeasuringRevolutionCount – is reached the differential value is
reset and the calculated diameter value is further processed. In order to be able to
identify overflows, the change of the feedback signal per cycle must be less than
half of the difference of the modulo limits.
ModLength
Feedback
2
In addition in every measuring interval the actual material thickness
(r32CalculatedWebThickness) is calculated, e.g. for a rest length calculation.
r32MeasuringRevolutionCount
r32FirstDiameterOutput
r32DiameterOutputRate
After rising edge of input “enable” resp. after a change of the diameter calculation
mode the first calculated diameter will be output after the number of revolutions
configured in “r32FirstDiameterOutput”.
After the first diameter output the calculated diameter will be refreshed cylic after
the number of revolutions configured in “r32DiameterOutputRate”.
The calculated diameter will be averaged over the number of revolutions
configured in “r32MeasuringRevolutionCount”, as long as the the parameterized
number of revolutions has been passed already.
The averaging of a specific number or revolutions is determinded by the depth
(array length) of an internal ring buffer. Inside the ring buffer the position deltas of
line and winder axis will be entered. The buffer depth is calculated based on the
following formula:
r32MeasuringRevoluti onCount
buffer depth
r32DiameterOutputRate
Is the result of the calculation a non natural number the value will be rounded to
next natural number (N = {1, 2,3, …}).Therby the the effective averaging over a
specific number of revolutions can differ to the configured value in
“r32MeasuringRevolutionCount” (compare example 3).
The following sketeches show the interacting of the configuration parameter. In the
function block a modulo cycle from 0° to 360° is recreated. The configuration of the
technology object is independend of that.
Example 1:
r32MeasuringRevolutionCount := 4
r32DiameterOutputRate := 1
r32FirstDiameterOutput := 2
r32MeasuringRevolutionCount
r32FirstDiameterOutput
r32DiameterOutputRate
effective averaging:
Example 2:
r32MeasuringRevolutionCount := 4
r32DiameterOutputRate := 1
r32FirstDiameterOutput := 0.5
r32MeasuringRevolutionCount
r32FirstDiameterOutput
r32DiameterOutputRate
effective averaging:
Example 3:
r32MeasuringRevolutionCount := 5
r32DiameterOutputRate := 2
r32FirstDiameterOutput := 1
r32MeasuringRevolutionCount
r32FirstDiameterOutput
r32DiameterOutputRate
effective averaging:
1
1st diameter output
3
2nd diameter output
5
3rd diameter output
6
4th diameter output
Siemens AG 2018 All rights reserved
DIAM_CALC_POSITION the raw diameter value is only saved at the end of the
integration or end of the calculation. This means when the specified number of
winding shaft revolutions has been reached.
Interpolation modes
The following interpolation modes are implemented in the function block:
Table 5-8: Interpolation modes
Interpolation mode Description
NO_INTERPOLATION No interpolation
Interpolation with ramp-function generator, available in every
INTERPOLATION_1 calculation mode. The material thickness is required for the plausibility
check.
Interpolation with ramp-function generator, only available in the modes
INTERPOLATION_2
DIAM_CALC_INTEGRAL and DIAM_CALC_POSITION.
Interpolation without ramp-function generator, only available in the
calculation modes DIAM_CALC_INTEGRAL and
INTERPOLATION_3
DIAM_CALC_POSITION. The material thickness is required for the
Siemens AG 2018 All rights reserved
plausibility check.
NRM
YA TA
when accelerating
TU
TA: = task cycle time
When considered from the physical perspective the acceleration values correspond
to the diameter changes per unit time. The following applies:
NRM D
T t as the diameter decreases
D
NRM D
T t as the diameter increases
U
The diameter calculator either sets the normalization value to 1.0 (ramp-function
generator is operational) or to 0.0 (ramp-function generator is inhibited).
The other two ramp-function generator input parameters TD and TU are calculated
by changing over the above specified formula:
1
D
TU TD
t
Table 5-9: Interpolation modes
Interpolation mode Description
INTERPOLATION_1 In this mode, the differential quotient ΔD/Δt is calculated over the increase in thickness
of the wound roll:
D r 32 AdjustWebThickness r 32WebThickness
t 2
D 2 r 32 AdjustWebThickness r 32WebThickness lineSpeed
t diamActVal
The ramp-function generator input parameters TD and TU are calculated as follows:
NRM diamActVal
TU TD
2 r 32 AdjustWebThickness r 32WebThickness lineSpeed
This interpolation mode is available for all diameter calculation types.
INTERPOLATION_2 TU or TD are calculated as in the first mode, however, under the following conditions:
TU (or TD) is the time interval TR between two reset pulses of the integrators. The
value of TR is obtained from the sum of the cycle times for the duration of the
integration.
NRM is the change in diameter ΔdiamActVal in this time interval. The value of
∆diamActVal is obtained from the difference between the actual and previous raw
diameter value.
Siemens AG 2018 All rights reserved
and therefore: TU TR
r 32 AdjustWebThickness diamActVal
TR is now obtained from the sum of the cycle times for the duration of the integration.
This corresponds to the value from ΔdiamActVal from the difference between the
actual and previous raw diameter value. This means that the values for TU and TD can
be precisely calculated.
This interpolation mode is not available for the diameter calculation mode
DIAM_THICKNESS_ADDITION, DIAM_CALC, DIAM_EXT.
diameter
Latch
interpolated
winder revolutions
1n 2n 3n
n: number of revolutions per calculated raw value
This interpolation mode is not available for the diameter calculation modes
DIAM_THICKNESS_ADDITION, DIAM_CALC, DIAM_EXT.
Siemens AG 2018 All rights reserved
Warnings
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No warning
16#0201_4002 The latchDiamCalc variable contains a value that lies outside the specified limits. It is
probable that either no diameter has been set or an incorrect diameter has been
entered.
16#0201_4015 The table of entered values is not monotonically (steadily) increasing -> a matching
value is not found. (if selectDiamMode = DIAM_EXT)
16#0201_4018 The table of entered values is not monotonically (steadily) increasing -> 2 values are
identical. (if selectDiamMode = DIAM_EXT)
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
Siemens AG 2018 All rights reserved
DIAM_THICKNESS_ADDITION
UNWIND FROM ABOVE or UNWIND FROM BELOW [3, A4]
typeOfWinder
L
5 Winding functions
A
Function diagrams
DIAM_CALC
B v / n = D
Web velocity [LU / s]
lineSpeed X D from v / n / Pi
T [LU]
[ms] SV [LU]
r32LineBalancing Balancing time for v and n phase adjustment
S D2 [3, B2]
Time
>0
Speed of winding shaft [U / s]
windingShaftSpeed X
T
Balancing time for v and n phase adjustment [ms] SV
r32WindingShaft S
BalancingTime
C
DIAM_EXT
arDiamExtCurve Ordinate values
Ordinate
Breakout
u16DiamExtCurve Entry number for the table
table
EntryNum
D from external source
External diameter value [LU]
diamExtVal
D3 [3, B2]
111
Siemens AG 2018 All rights reserved
Unlimited raw D-
DIAM_CALC_INTEGRAL Integrator, reference is 0 value [LU] s = r
v_nominal, speed is
integrated into path, [3, C8]
Web velocity [LU / s] setValue is 0 D from integrating
D = 2 s
5 Winding functions
lineSpeed X DR calculation
A T [LU]
0
SV D4 [3, B2]
[LU]
Balancing time for v and S 1
n phase adjustment [ms] Raw D value
r32BalancingTime
2 Signal save raw value
Integrator, reference is n_nominal, 0
shaft speed is integrated info angle in
radians, setValue is 0. [3, D1],
≥ B
5 Z [4, C1]
DIAM_CALC_POSITION
Number of revolutions for
[inc] Modulo evaluation calculation reached
windingShaft
Feedback Δinc x
C Σ [rad] <
[inc] y
r64ShaftModLength
≥
r64WindingShaft Weighting factor [inc/rad]
FeedbackScal Reset summing units
Modulo evaluation
[inc]
lineFeedback Δinc D from length based
Σ [LU] calculation
[inc]
r64LineModLength Raw D value [LU]
D5 [3, B2]
D r64Line Weighting factor [inc/LU]
FeedbackScal
π
112
Siemens AG 2018 All rights reserved
Hold diameter
Winding shaft speed [RPs]
windingShaftSpeed x
Signal "Diameter is hold”
Minimum winding shaft speed RP s]
y
<
5 Winding functions
r32MinWinderSpeed
A TRUE: v or n is smaller than specified minimum
≥ [4, B1],
Web velocity [LU / s] ≥ K
lineSpeed x [2, A6]
Minimum web velocity [LU / s]
y
<
r32MinLineSpeed
Hold diameter explicitly
holdDiam
D3 D2 D1
[1, D8] [1, B8] [1, A8] Diameter raw value reached maximum diamRawUpper
Unlimited D raw LU LUR
1 value [LU] LimitReached
Limited Diameter raw value [LU]
B X D [4, D1], [5, B1]
Diameter raw value reached minimum diamRawLower
LL LLR
5 LimitReached
[2, A8] [2, D8] DR
D4 D5
Set diameter
Diameter maximum [LU]
r32DiamMax diamMax [4, A2]
Diameter minimum [LU]
r32DiamMin diamMin [4, A2]
Diameter set value reached maximum
LU LUR diamSetUpperLimitReached
Diameter set value [LU]
Limited diameter set value [LU]
C diamSetVal X L [4, A1]
Diameter set value reached maximum
LL LLR diamSetLowerLimitReached
Signal „set diameter”
Set Diameter
setDiam
≥ S [4, C1]
VAR_IN_OUT :
Retain-Variable
1 Saved diameter
&
Signal "save raw value"
[2, A8] B 1 [4, A1],
≥ 1 Latch V
0 [5, B1],
0
[5, C1]
D =
DIAM_EXT
DIAM_CALC LU LUR
? ≥ error := FALSE
DIAM_THICKNESS
X
_ADDITION
?
LL LLR
113
Siemens AG 2018 All rights reserved
INTERPOLATION_1 / INTERPOLATION_2
[LU]
[3, C4] diamMax
[LU]
5 Winding functions
eSelectIntegration- Selection for integrating direction Internal Upper diameter limit reached
Direction evaluation 1
X LU LUR
3
diamActUpperLimitReached
SV D-Istwert [LU]
S X diamActVal
Selection for diameter change limitation
eInterpolationMode T
LL LLR diamActLowerLimitReached
r32Smoothing- Smoothing time for layer jump [ms]
Lower diameter limit reached
TimeLayerJump
[3, C8]
Signal set diameter S
C INTERPOLATION_3
2.0
+
[3, D8] [LU]
Saved diameter min Y2 1
value V
Y 0
r32TargetDiaLast Y1
X1 X X2
114
Siemens AG 2018 All rights reserved
intoLU
r32Measuring-
RevolutionCount
115
5 Winding functions
Task
This block calculates the variable and total moment of inertia, the mass of the roll
being wound and the torque compensation to compensate for the inertia.
FBLConTorquePrecontrol
Siemens AG 2018 All rights reserved
tensionTorque REAL
Block parameters
Input parameters
Name Data type Initial value Description
FALSE: Deactivates the block
TRUE: Activates the block
run BOOL FALSE
If the block has been de-activated, the calculated pre-
control and tension torques are set to 0.
FALSE: Only the moment of inertia calculation is active
TRUE: Moment of inertia and torque calculation are
torqueOn BOOL FALSE
active
Functions are only active, if run = TRUE!
Task in which the FB is called:
SERVO_SYNCHRONOUS_TASK:
IPO_ Servo Synchronous Task
eTask
taskMode SYNCHRONO IPO_SYNCHRONOUS_TASK: Ipo Synchronous Task
NameType
US_TASK IPO_SYNCHRONOUS_TASK_2:
Ipo Synchronous Task 2
TIMER_INTERRUPT_TASK: in a Timer Interrupt Task
Winder type:
REWIND_ UNWIND_FROM_ABOVE: Unwinder from the top
eWinding
typeOfWinder FROM_ UNWIND_FROM_BELOW: Unwinder from the bottom
ModeType
Siemens AG 2018 All rights reserved
Input-/Output Parameters
Name Data type Initial value Description
sLConMom Configuration data of the torque pre-control calculation
sMomentConfig ent - Details on this structure are provided in the description of
ConfigType the type definitions.
Output parameters
Name Data type Initial value Description
FALSE: Function block deactivated
busy BOOL FALSE
TRUE: Function block active
FALSE: No error
error BOOL FALSE
TRUE: An error has occurred, refer to error identification
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
[ mLUb² ] Total moment of inertia referred to the motor
totalInertia REAL 0.0
shaft
mass REAL 0.0 [ m ] Mass of the web
preCtrlMotor REAL 0.0 [ M ] Torque precontrol
[ M ] Total precontrol torque based on motor shaft /
totalTorquePreCtrl REAL 0.0
Torque limitation
Note In principle, the calculations made in this function block are independent of any
physical units. The input parameter determines the units of the output
parameters. The internal calculations do not carry-out any conversions.
[LU] Length units, e.g. m
[LUb] Basis length unit, m or ft
[TU] Time unit of the line-/winderAxis
[Z] Tension, force, e.g. N
[m] Mass, weight, e.g. kg, is defined by the units of density
(specific gravity), e.g. kg/m³
[J] = mLUb² Moment of inertia, e.g. kgm²
- -
[M] = mLUb²s ² Torque, e.g. Nm = kgm²s ²
Siemens AG 2018 All rights reserved
Functionality
The block determines the following:
The variable moment of inertia for Kp adaptation of the speed and tension
controller
The pre-controlled torque for Δv/Δt and ΔD/Δt
The torque pre-control outputs the following torque setpoints to pre-control the
winder drive:
A torque setpoint as a function of the acceleration setpoint of the
machine/system ramp-function generator and the instantaneous diameter
actual value
Note The precise setting of the compensation is especially important for indirect
tension control. This is so that the torque-generating current emulates, as far as
possible, the material tension.
Siemens AG 2018 All rights reserved
Calculations:
The function block FBLConTorquePrecontrol calculates the following physical
quantities:
Weight of the wound material:
r 32Mass
r 32Density r 32Width diamActVal 2 r 32DiamMin 2
4
The material density can either be pre-assigned by selecting the material (selected
using sMomentConfig.eMaterialType <> USER_DEFINED) or specified as value
(sMomentConfig.eMaterialType = USER_DEFINED and with
sMomentConfig.r32Density <> 0.0).
Moment of inertia of the wound material relating to the motor shaft:
diamActVal 2 r 32DiamMin 2
r32Variabl eInertia r 32Mass
8 r 32GearRatio 2
Total moment of inertia with variable moment of inertia for torque precontrol
relating to the motor shaft:
r32JMandre l
r32TotalInertia r 32VariableIn ertia r 32JMot r 32JFix
r32GearRat io2
massmax
r 32Density r 32Width diamMax 2 r 32DiamMin 2
4
r32DiamMax 2 r 32DiamMin 2
variableIn ertiamax mass max
8
variableIn ertiamax r 32JMandrel
r32MaxInertia r 32JMot r 32JFix
r32GearRat io2
Angular acceleration of the roll:
lineAccele ration r 32GearRatio
2
diamActVal
Pre-control torque 1
M pre1 r32TotalInertia
The winding mode is always defined assuming a positive line speed. If the leading
value becomes negative the winding mode will be inverted automatically (a
rewinder becomes an unwinder and vice versa). The same applies for winding from
above and from below. This inversion is automatic.
Rewinding from above
M preCtrlMotor M pre1 M pre2 M frict
M tensionTroque M tensionTroque
M totalTorque Pr eCtrl M preCtrlMotor M tensionTroque
Rewinding from below
M preCtrlMotor M pre1 M pre2 M frict
M tensionTroque M tensionTroque
M totalTorque Pr eCtrl M preCtrlMotor M tensionTroque
Unwinding from above
M preCtrlMotor M pre1 M pre2 M frict
M tensionTroque M tensionTroque
M totalTorque Pr eCtrl M preCtrlMotor M tensionTroque
Warnings
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No warning
16#0203_4015 The table of entered values is not monotonically (steadily) increasing -> no matching
value found. (friction characteristic)
16#0203_4018 The table of entered values is not monotonically (steadily) increasing -> 2 values are
identical. (friction characteristic)
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0203_8001 The function block is called in an incorrect task.
16#0203_8005 One or several configuration data are not plausible or lie outside the specified limits:
sMomentConfig.r32GearRatio <= 0.0
Siemens AG 2018 All rights reserved
UNWIND_FROM_ABOVE:
preCtrlMotor := Mpre2 + Mpre1 + Mfrict [M]
tensionTorque := – tensionTorque tensionTorque
Winder speed table totalTorquePreCrl := preCtrlMotor +
arFrictionCurveAbscissa
tensionTorque
Scaling factor
r32FrictionAdjustment
UNWIND_FROM_BELOW:
Tension setpoint after tension taper [Z] preCtrlMotor := Mpre2 – Mpre1 – Mfrict
tensionSetpoint
Scaling factor tension setpoint Tension torque [M] totalTorquePreCrl := preCtrlMotor +
D r32TensionAdjust r32gearRatio
tensionTorque
diamActVal
Actual diameter [LUb]
2
123
5 Winding functions
Task
This function block calculates a reduction factor for the tension setpoint as a
function of the diameter.
FBLConTaperCharacteristic
Siemens AG 2018 All rights reserved
tensionTaper REAL
Block parameters
Input parameters
Name Data type Initial value Description
FALSE: The block is not processed
TRUE: The block is processed
run BOOL FALSE
If the block is de-activated (run = FALSE) the output
tensionTaper is set to 1.0.
Tension taper characteristic mode:
TAP_ TAP_CHAR_NO_TAPER: No characteristic
tensionTaper eTaperChar CHAR_ TAP_CHAR_LINEAR: Linear characteristic
Mode ModeType NO_ TAP_CHAR_HYPERBOLIC_1: Hyperbolic char.1
TAPER TAP_CHAR_HYPERBOLIC_2: Hyperbolic char.2
TAP_CHAR_TABLE : Characteristic defined by a table
diamActVal REAL 0.0 [ % ] / [ LU ] Actual diameter value
Input-/Output Parameters
Name Data type Initial value Description
Output parameters
Name Data type Initial value Description
FALSE: function block inactive
The output tensionTaper is set to 1.0, actual errors are
busy FALSE
BOOL deleted.
TRUE: function block active
FALSE: No error
TRUE: An error has occurred, refer to error
error BOOL FALSE identification
In case of error (error = TRUE) the output
tensionTaper is set to 1.0.
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
tensionTaper REAL 1.0 [ - ] Taper adjustment factor
Siemens AG 2018 All rights reserved
sLConTensionTaperConfigType
Name Data type Description
Tension taper characteristic mode:
TAP_CHAR_NO_TAPER: No characteristic
eLConTaperChar TAP_CHAR_LINEAR: Linear characteristic
eTensionTaperMode
ModeType TAP_CHAR_HYPERBOLIC_1: Hyperbolic char.1
TAP_CHAR_HYPERBOLIC_2: Hyperbolic char.2
TAP_CHAR_TABLE : Characteristic defined by a table
r32UpperLimitTaper REAL [ % ] Upper limit for tension reduction
r32LowerLimitTaper REAL [ % ] Lower limit for tension reduction
[ % ] Max. Tension Reduction
r32TensionTaperRatio REAL
Not for tensionTaperMode = TAP_CHAR_TABLE.
[ % ] or [LU] Start diameter for the characteristic calculation
based on the max. diameter sWinderConfig.sDiamConfig.-
r32TensionTaperDiameterStart REAL diamMax
Not for tensionTaperMode = TAP_CHAR_TABLE.
[ % ] or [LU] Maximum diameter with full reduction based on
r32TensionTaperDiameterMax REAL the max. diameter sWinderConfig.sDiamConfig.diamMax
Not for tensionTaperMode = TAP_CHAR_TABLE.
[ - ] Number of grid points to calculate the polygon [2 –
u16TensionTaperEntryNum UINT LCONLIB_MAX_IDX+1]
Only for tensionTaperMode = TAP_CHAR_TABLE
ARRAY [ % ] or [LU] Abscissa values for the diameter
[0.. (maximum ‘ LCONLIB_MAX_IDX_A+1’ x-y points) based
ar32TensionTaperCurveAbscissa
LCONLIB_MAX_I on the max. diameter sWinderConfig.sDiamConfig.diamMax
DX_A] OF REAL Only for tensionTaperMode = TAP_CHAR_TABLE
ARRAY [ % ] Ordinate values for the percentage component
ar32TensionTaperCurveOrdinate [0.. (maximum ‘ LCONLIB_MAX_IDX_A+1’ x-y points)
LCONLIB_MAX_I
DX_A] OF REAL Only for tensionTaperMode = TAP_CHAR_TABLE
Note In principle, the calculations made in this function block are independent of any
physical units. The input parameter determines the units of the output
parameters. The internal calculations do not carry-out any conversions.
[LU] Length units, e.g. m
[%] Percentage, e.g. 100%
Functionality
The tension taper characteristic is used to define with which tension the material
should be wound onto the roll as a function of the roll diameter. It only makes
sense to use the tension taper characteristic while actually winding in order to wind
the inner layers tightly.
For dancer roll controls, the tension taper characteristic can be used to reduce the
pressure setpoint for the dancer roll support. In this case, the output of the
characteristic must be multiplied with the tension setpoint and made available at
the analog output.
The block is activated using the run input. Depending on the mode selected at
input tensionTaperMode, the tension reduction factor is calculated as a function of
Siemens AG 2018 All rights reserved
Taper
100%
NO_TAPER
LINEAR
HYPERBOLIC_1
HYPERBOLIC_2
TABLE
r32TensionTaper
Ratio
r32TensionTaper r32TensionTaper
DiameterStart DiameterMax
D
Warnings
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000.
ErrorID Description
Siemens AG 2018 All rights reserved
16#0000_0000 No warning
16#0205_4015 The table of entered values is not monotonically (steadily) increasing -> no matching
value found. (if tensionTaperMode = TAP_CHAR_TABLE)
16#0205_4018 The table of entered values is not monotonically (steadily) increasing -> 2 values are
identical. (if tensionTaperMode = TAP_CHAR_TABLE)
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0205_8005 Invalid input parameter.
diamActVal <= 0.0
sTensionTaperConfig.r32UpperLimitTaper <
sTensionTaperConfig.r32LowerLimitTaper
sTensionTaperConfig.r32LowerLimitTaper < 0.0
For TAP_CHAR_LINEAR, TAP_CHAR_HYPERBOLIC_1,
TAP_CHAR_HYPERBOLIC_2:
sTensionTaperConfig.r32TensionTaperDiameterStart < 0.0
sTensionTaperConfig.r32TensionTaperDiameterMax <=
sTensionTaperConfig.r32TensionTaperDiameterStart
sTensionTaperConfig.r32TensionTaperRatio < 0.0
sTensionTaperConfig.r32TensionTaperRatio > 100.0
16#0205_8013 The number of grid points that has been entered is too small. (if tensionTaperMode =
TAP_CHAR_TABLE)
16#0205_8014 The number of grid points that has been entered is too high. (if tensionTaperMode =
TAP_CHAR_TABLE)
run
Mode taper
tensionTaperMode characteristic
A TAP_CHAR_NO_TAPER
Function diagram
5 Winding functions
1.0
TAP_CHAR_LINEAR
100 %
TAP_CHAR_HYPERBOLIC_1
r 32TensionTaperRatio r 32TensionTaperDiameterStart
C 1 1
100 diamActVal
TAP_CHAR_TABLE
Tension reduction [%] Polygonzug
arTensionTaperCurveOrdinate Ordinate values
/ 100 %
D
Tension reduction abscissa [%] / [LU]
arTensionTaperCurveAbscissa values
Upper limit [%]
r32UpperLimitTaper / 100 %
Lower limit [%]
r32LowerLimitTaper / 100 %
129
5 Winding functions
Block name
FCLConRLC
Task
The length of residual material on a roll can be calculated by entering the
appropriate roll parameters.
FCLConRLC
REAL actualDiameter
REAL targetDiameter
REAL offset
Block parameters
Input parameters
Name Data type Initial value Description
webThickness REAL 0.0001 [ LU ] Thickness of the material on the roll [ 0.000001–1 ]
actualDiameter REAL - [ LU ] Actual diameter of the roll [ - ]
targetDiameter REAL - [ LU ] Target diameter to be reached [ - ]
offset REAL 0.0 [ LU ] Offset to the calculated residual length [ - ]
Output parameters
Name Data type Initial value Description
FCLConRLC REAL - [ LU ] Calculated residual length of the roll [ - ]
Note The calculations made in this function block are in principle independent of the
physical units. The output parameter units are defined by the input parameters.
The internal calculations do not perform any conversions.
[LU] Length units, e.g. m
Functionality
Depending on the roll parameters that have been entered, the function calculates
the residual length (FCLConRLC). To do this, the following data is required – the
thickness of the material on the roll (webThickness), the actual diameter
(actualDiameter) and the diameter to be reached (targetDiameter). In this case, the
target diameter represents the end of the roll or the diameter to be reached.
Depending on whether the target diameter is greater than or less than the actual
diameter, the length of the material on the roll or the length of the material still to be
wound is output. The thickness of the material web (webThickness) is limited using
the internal constants MIN_THICKNESS and MAX_THICKNESS.
FCLConRLC * actualDiam eter ² t arg etDiameter ² offset
4 * webThickness
Figure 5-2: Graphic representation of the function
d1 d2
Siemens AG 2018 All rights reserved
d1
X
p
Δlength d2
X
p
Table 5-11
Winder mode Actual diameter Target diameter
Winder d1 < d2 d2 (full roll)
Unwinder d2 > d1 d1 (empty roll)
5.5 FBLConCalcTargetDiamStopCondition
Block name
FBLConCalcTargetDiamStopCondition
Task
The function block calculates the rest length to a specified target diameter and the
necessary stopping time.
FBLConCalcTargetDiamStopCondition
Siemens AG 2018 All rights reserved
stop BOOL
REAL targetDiameter
stopDistance REAL
REAL offset
stopTime REAL
REAL minDiameter
restLengthToTarget REAL
REAL maxDiameter
REAL webThickness
REAL actLineVelocity
REAL actLineAcceleration
REAL negAccelLimitLine
REAL posAccelEndJerkLimitLine
REAL negAccelStartJerkLimitLine
REAL negAccelEndJerkLimitLine
Block parameters
Input parameters
Name Data Initial Description
type value
enable BOOL FALSE TRUE = enable Function Block, False = Disable
0: rewind, 1: unwind
windingMode INT 0
hint: distinguish dependent on line speed sign
actualDiameter REAL 0.0 [LU] actual diameter value
targetDiameter REAL 0.0 [LU] target diameter value
offset REAL 0.0 [LU] offset rest length to target diameter
minDiameter REAL 0.0 [LU] Minimum diameter allowed
maxDiameter REAL 0.0 [LU] Maximum diameter allowed
webThickness REAL 0.0 [LU] Web thickness for rest length calculation
[LU / min] actual velocity (of line)
actLineVelocity REAL 0.0 has to be positive
hint: (use ABS() )
actLineAcceleration REAL 0.0 [LU / min²] actual acceleration (of line)
[ LU / min² ] Deceleration limit (of line),
negAccelLimitLine REAL 0.0
has to be negative
Siemens AG 2018 All rights reserved
Output parameters
Name Data Initial Description
type value
TRUE = Function Block calculates values,
busy BOOL -
FALSE = Funciton Block idle
TRUE = error occured,
error BOOL -
FALSE = no error
errorID DWORD - Error identification
TRUE = target reached,
stop BOOL -
FALSE = target not reached
[LU] distance to stop line with actual velocity and
stopDistance REAL -
dynamics
stopTime REAL - [s] time to decelerate line to velocity 0
restLengthToTarget REAL - [LU] rest length to target diameter
Functionality
The function block combines internal the the LConLib functions FCLConRLC and
FCLConCalculateDistance.
With a rising edge at the input enable a plausibility check of the input parameter will
be started. Faults will be displayed at the outputs error and errorID.
NOTE The rest length calculation is continued even there is fault active (error= TRUE).
As soon the calculated stopping distance is smaller than the calculated rest length
the FB output stop comes TRUE.
NOTICE The line axis need to be stopped by the user in case stop = TRUE!
Block name
FCLConRDC
Task
With the input of the parameters the target diameter of a roll can be calculated.
FCLConRDC
REAL actualDiameter
REAL length
eWindingMode windingMode
Type
Block parameters
Input parameters
Name Data type Initial value Description
webThickness REAL 0.0001 [ LU ] Material thickness [ 0.000001–1 ]
actualDiameter REAL 0.0 [ LU ] Actual roll diameter
length REAL 0.0 [ LU ] target length to be wound/unwound
REWIND_
eWindingMode
windingMode FROM_ Winding mode (Winder or unwinder)
Type
ABOVE
Output parameters
Name Data type Initial value Description
FCLConRDC REAL - [ LU ] Calculated target diameter of the roll
Note The calculations made in this function block are in principle independent of the
physical units. The output parameter units are defined by the input parameters.
The internal calculations do not perform any conversions.
[LU] Length units, e.g. m
Functionality
The function uses the input parameters to calculate the target diameter
(FCLConRDC) of a roll. The calculation relies on the material thickness
(webThickness), the actual roll diameter (actualDiameter) and the material length
to be wound or unwound (length). The winding mode is defined using the
windingMode input. The material thickness (webThickness) is internally limited
(MIN_THICKNESS, MAX_THICKNESS).
In case of a too high material length input the function result is zero.
Winder
actualDiam eter² webThickness length
FCLConRDC 2
Siemens AG 2018 All rights reserved
4 Π
Unwinder
actualDiam eter² webThickness length
FCLConRDC 2
4 Π
d1
X
p
Δlength d2
X
p
Table 5-12
Winder mode Actual diameter Target diameter
Winder d1 < d2 d2 (full roll)
Unwinder d2 > d1 d1 (empty roll)
Block name
FBLConThicknessAverage
Task
The block is used as extension for the FBLConWinder winder block or the
FBLConDiameterCalculation diameter calculator.
Both of these blocks offer several calculation modes for calculating the diameter,
whereby the DIAM_CALC_INTEGRAL and DIAM_CALC_POSITION position
modes, not only calculate the diameter, but also the actual material thickness. The
FBLConThicknessAverage block improves the precision of the material thickness
calculation by generating a floating average value (extension of the measurement
interval), in order to make the value more suitable - for instance to calculate the
Siemens AG 2018 All rights reserved
remaining length.
FBLConThicknessAverage
REAL diameterMeasuring
RevCount
REAL thicknessMeasuring
RevCount
Block parameters
Input parameters
Name Data type Initial value Description
TRUE: Block is active.
A rising edge resets the block and fills the
elements of the ring buffer with
enable BOOL FALSE
materialThicknessInitial.
FALSE: Block inactive, output materialThickness
= materialThicknessInitial.
TRUE: Block does not accept any new values,
hold BOOL FALSE e.g. if the winder is stopped or the machine
velocity is changed.
Rising edge: The value in
newValue BOOL FALSE materialThicknessPartial is written into the ring
buffer.
materialThicknessPartial Actual material thickness calculated by the
REAL 0.0
diameter calculator
materialThicknessInitial REAL 0.0 Initial value of the material thickness calculation
Number of winder revolutions of the diameter
diameterMesuringRevCount REAL 1.0
calculation
Number of winder revolutions of the material
thicknessMeasuringRevCount REAL 1.0
thickness calculation
Siemens AG 2018 All rights reserved
Output parameters
Name Data type Initial value Description
busy BOOL FALSE TRUE: FB is active
FALSE: No error
error BOOL FALSE TRUE: An error has occurred, refer to error
identification
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
thicknessValid BOOL FALSE Ring buffer is filled with measured values
Calculated material thickness if FB is active,
materialThickness REAL 0.0
materialThicknessInitial if not.
Functionality
The following equation shows the block functionality:
d i #t
mt i k
2# d #d
D d i D D
2# d k 2# d k 2# t
mt i
MT
2# t k k k
D d
k
i
Δdi
ΔD3
Δdi
ΔD2
Δdi
ΔD1
Δdi
Δdi
Δdi
number of
#d #d #d #d #d #d #d #d #d #d #d winder revolutions
#t
#t
#t
#t
diameter actualDiameter
targetDiameter restLength
Warnings
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000.
Table 5-13 Warnings
ErrorID Description
16#0000_0000 No warning
Siemens AG 2018 All rights reserved
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
Table 5-14 Error messages
ErrorID Description
16#0000_0000 No error.
16#0209_8005 Invalid configuration data:
thicknessMeasuringRevCount < diameterMeasuringRevCount
or
diameterMeasuringRevCount <= 0.0
Task
Sets the internal conversion factors corresponding to the parameterized axis
configuration.
FBLConSetUnits
Siemens AG 2018 All rights reserved
Block parameters
Input parameters
The input parameters are used to specify the axis units according to the selected
TO parameterization.
Name Data type Initial value Description
Axis configuration of the velocity corresponding to TO
lineAxis
NOT_DEFINED
M_MIN: m/min
MM_MIN: mm/min
eUnitLine
unitLineAxis NOT_ M_S: m/s
Axis
Velocity DEFINED MM_S: mm/s
VelocityType
FT_MIN: ft/min
INCH_MIN: inch/min
FT_S: ft/s
INCH_S: inch/s
DEG_S_PRINT 360°/s = 1m/s
Input/Output parameter
The parameters included in this structure are used as output parameters and are
automatically assigned by the system.
Name Data type Initial value Description
sConversion Structure with conversion factors
Siemens AG 2018 All rights reserved
Output Parameter
Name Data type Initial value Description
FALSE: No error
TRUE: An error has occurred, refer to error identification
Error BOOL FALSE
In case of error (error = TRUE) the output tensionTaper is
set to 1.0.
Error identification, refer to error messages
errorID DWORD 16#0000_0000 errorID <= 16#000_8000: warning
errorID >= 16#0000_8000: error
Functionality
Using the input parameters, the velocity and the acceleration of the leading axis
(lineAxis) as well as the velocity of the winder axis (winderAxis) are specified
corresponding to the particular TO parameterization. This is realized using three
enumeration types; these are orientated to the units of the physical quantity –
metric and Anglo-American (imperial) units can be selected. The conversion factors
of structure sConvC to convert into the required units, are automatically assigned
by the system starting from the FB parameterization. This means that the user
does not have to change them. Parameterization for printing machines is available
with the DEG_Sx_PRINT option. This is orientated to the requirement that 360°/s =
corresponds to 1m/s.
If one of the input parameters is incorrect or is not available, an error (error) is
generated including an error number (errorID).
Errors
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
ErrorID Description
16#0000_0000 No error
16#0206_8005 The requested dimension unit has not been implemented. Instead, standard
conversion factors are used.
Input parameter Leading axis LU is in Leading axis LU is in
meters feet
unitLineAxisVelocity M_MIN FT_MIN
unitLineAxisAcceleration M_S2 FT_S2
unitWinderAxisVelocity RPM RPM
Siemens AG 2018 All rights reserved
6 Glossary
Table 6-1
Abbreviation Meaning
FB Function block
FUP Function diagram
IN Input parameter
IN/OUT Input/output parameter
RFG Ramp-function generator
LAD Ladder diagram
LU Length unit
NRM Normalization value
MCC Motion Control Chart (graphic programming language)
OUT Output parameter
SCOUT SIMOTION Controlling with optimized Usability Toolbox
(Engineering System for the family of SIMOTION products)
ST Structured Text (text-based programming language)
TO Technology object
TU Time unit
WHKL Tension taper characteristic
7 Appendix
7.1 Service and support
Industry Online Support
Do you have any questions or need assistance?
Siemens Industry Online Support offers round the clock access to our entire
service and support know-how and portfolio.
The Industry Online Support is the central address for information about our
products, solutions and services.
Product information, manuals, downloads, FAQs, application examples and videos
– all information is accessible with just a few mouse clicks:
https://support.industry.siemens.com/
Technical Support
The Technical Support of Siemens Industry provides you fast and competent
support regarding all technical queries with numerous tailor-made offers
– ranging from basic support to individual support contracts. Please send queries
to Technical Support via Web form:
https://www.siemens.com/industry/supportrequest
Siemens AG 2018 All rights reserved
Service offer
Our range of services includes the following:
Plant data services
Spare parts services
Repair services
On-site and maintenance services
Retrofitting and modernization services
Service programs and contracts
You can find detailed information on our range of services in the service catalog
web page:
https://support.industry.siemens.com/cs/sc
Phone:
https://support.industry.siemens.com/cs/ww/en/sc/2067
https://support.industry.siemens.com
\2\ Link to this entry page of this application example
https://support.industry.siemens.com/cs/ww/en/view/48805235
\3\ SIMOTION/SIMATIC/SINAMICS – Converting Toolbox
https://support.industry.siemens.com/cs/ww/en/view/109744606