LM Functions en-US
LM Functions en-US
Fundamental safety
instructions 1
Description 2
SIMOTION Parameter assignment /
addressing 3
SIMOTION SCOUT
Standard function for Programming 4
SINAMICS S120 line modules
Example of an application 5
Function Manual
Appendix A
04/2014
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be
used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property
damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified
personnel are those who, based on their training and experience, are capable of identifying risks and avoiding
potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended or
approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described.
Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in
this publication is reviewed regularly and any necessary corrections are included in subsequent editions.
Function block
The _LineModule_control function block is part of the command library of the
"SIMOTION SCOUT" engineering system.
SIMOTION Documentation
An overview of the SIMOTION documentation can be found in the SIMOTION Documentation
Overview document.
This documentation is included as electronic documentation in the scope of delivery of
SIMOTION SCOUT. It comprises ten documentation packages.
The following documentation packages are available for SIMOTION V4.4:
● SIMOTION Engineering System Handling
● SIMOTION System and Function Descriptions
● SIMOTION Service and Diagnostics
● SIMOTION IT
● SIMOTION Programming
● SIMOTION Programming - References
● SIMOTION C
● SIMOTION P
● SIMOTION D
● SIMOTION Supplementary Documentation
Additional information
Click the following link to find information on the the following topics:
● Ordering documentation / overview of documentation
● Additional links to download documents
● Using documentation online (find and search manuals/information)
http://www.siemens.com/motioncontrol/docu
Please send any questions about the technical documentation (e.g. suggestions for
improvement, corrections) to the following e-mail address:
[email protected]
My Documentation Manager
Click the following link for information on how to compile documentation individually on the
basis of Siemens content and how to adapt it for the purpose of your own machine
documentation:
http://www.siemens.com/mdm
Training
Click the following link for information on SITRAIN - Siemens training courses for automation
products, systems and solutions:
http://www.siemens.com/sitrain
FAQs
Frequently Asked Questions can be found in SIMOTION Utilities & Applications, which are
included in the scope of delivery of SIMOTION SCOUT, and in the Service&Support pages
in Product Support:
http://support.automation.siemens.com
Technical support
Country-specific telephone numbers for technical support are provided on the Internet under
Contact:
http://www.siemens.com/automation/service&support
Foreword......................................................................................................................................................3
1 Fundamental safety instructions...................................................................................................................7
1.1 General safety instructions............................................................................................................7
1.2 Industrial security..........................................................................................................................8
2 Description....................................................................................................................................................9
2.1 General..........................................................................................................................................9
2.2 Product description......................................................................................................................10
3 Parameter assignment / addressing...........................................................................................................11
3.1 Overview.....................................................................................................................................11
3.2 Addressing the Line Module for SINAMICS S120.......................................................................12
3.3 Parameter transfer at FB _LineModule_control...........................................................................15
4 Programming..............................................................................................................................................17
4.1 _LineModule_control function block............................................................................................17
4.1.1 Overview of _LineModule_control FB..........................................................................................17
4.1.2 Parameter description.................................................................................................................18
4.1.3 Function description....................................................................................................................19
4.1.4 Manual selection of the Line Module...........................................................................................20
4.1.5 Automatic detection of the Line Module (only in exceptional cases)...........................................20
4.1.6 Determining the module address................................................................................................22
4.1.7 Graphical overview of the functionality........................................................................................23
4.1.8 Task integration (call)..................................................................................................................23
4.2 Calling the function block............................................................................................................24
4.3 Error messages...........................................................................................................................26
5 Example of an application..........................................................................................................................31
5.1 General........................................................................................................................................31
5.2 Sequence of the application example.........................................................................................33
A Appendix.....................................................................................................................................................35
A.1 Flow diagrams for switching the Line Modules on and off...........................................................35
A.2 List of abbreviations / acronyms..................................................................................................39
Index...........................................................................................................................................................41
WARNING
Risk of death if the safety instructions and remaining risks are not carefully observed
If the safety instructions and residual risks are not observed in the associated hardware
documentation, accidents involving severe injuries or death can occur.
● Observe the safety instructions given in the hardware documentation.
● Consider the residual risks for the risk evaluation.
WARNING
Danger to life or malfunctions of the machine as a result of incorrect or changed
parameterization
As a result of incorrect or changed parameterization, machines can malfunction, which in
turn can lead to injuries or death.
● Protect the parameterization (parameter assignments) against unauthorized access.
● Respond to possible malfunctions by applying suitable measures (e.g. EMERGENCY
STOP or EMERGENCY OFF).
Note
Industrial security
Siemens provides products and solutions with industrial security functions that support the
secure operation of plants, solutions, machines, equipment and/or networks. They are
important components in a holistic industrial security concept. With this in mind, Siemens’
products and solutions undergo continuous development. Siemens recommends strongly
that you regularly check for product updates.
For the secure operation of Siemens products and solutions, it is necessary to take suitable
preventive action (e.g. cell protection concept) and integrate each component into a holistic,
state-of-the-art industrial security concept. Third-party products that may be in use should
also be considered. For more information about industrial security, visit http://
www.siemens.com/industrialsecurity.
To stay informed about product updates as they occur, sign up for a product-specific
newsletter. For more information, visit http://support.automation.siemens.com
WARNING
Danger as a result of unsafe operating states resulting from software manipulation
Software manipulation (e.g. by viruses, Trojan horses, malware, worms) can cause unsafe
operating states to develop in your installation which can lead to death, severe injuries and/
or material damage.
● Keep the software up to date.
Information and newsletters can be found at:
http://support.automation.siemens.com
● Incorporate the automation and drive components into a state-of-the-art, integrated
industrial security concept for the installation or machine.
For more detailed information, go to:
http://www.siemens.com/industrialsecurity
● Make sure that you include all installed products into the integrated industrial security
concept.
Note
For versions earlier than V4.2, a function block can be found in "SIMOTION Utilities &
Applications" for controlling SINAMICS S120 Line Modules (under Applications > Cross-
Sector Applications > Function Block for Controlling Line Modules).
"SIMOTION Utilities & Applications" is provided free of charge and as part of the
SIMOTION SCOUT scope of delivery.
Note
Line Modules (Active Line Modules, Basic Line Modules, Smart Line Modules) of different
types must not be operated simultaneously on the same DC link.
Note
For explanations relating to the status and control word of SINAMICS S120 Line Modules,
refer to the
● SINAMICS S120 Drive Functions Function Manual
● SIMOTION D4x5 Commissioning and Hardware Installation Manual
These documents are provided as part of the SIMOTION SCOUT scope of delivery in
electronic format.
3. Highlight the status word under infeed and confirm by pressing "OK".
Continue with the chapter entitled Parameter transfer at FB _LineModule_control (Page 15).
Example
Determining the addresses from the message frame configuration of the SINAMICS drive unit
(using an ALM as an example):
Note
Make sure that the addresses are accepted correctly from the message frame configuration.
In your user project, when the _LineModule_control FB is called you must assign these two
I/O variables to the periIn and periOut input/output parameters. Only once you have done
this will the Line Module status word that has been read be transferred to the FB, and the
output data prepared by the FB for the control word be transferred to the Line Module.
Task
You can use the _LineModule_control FB to switch on and off infeeds (Line Modules) for
SINAMICS S120 with a DRIVE-CLiQ connection via your user program. The
_LineModule_control FB transfers the commands to the selected Line Module, reads the
response data provided, and monitors the status signals from the Line Module.
Note
From SIMOTION V4.2 onward, the symbolic assignment is activated as standard for newly
created projects. For this purpose, no message frames must be configured for the infeed. If
the symbolic assignment is deactivated, SIEMENS message frame 370 must be configured.
B/LQH0RGXOHBFRQWURO
(1 (12
%22/ HQDEOH GRQH %22/
%22/ UHVHW HUURU %22/
:25' SHUL,Q HUURU,' ':25'
HQXPB/,1(02'8/( W\SH/0 VWDWH5G3DU ':25'
',17 PRGXOH$GGUHVV DFWLYDWHG %22/
SHUL2XW :25'
VHOHFWHG/0 HQXPB/,1(02'8/(
/$'VSHFLILFSDUDPHWHUV
General information
In exceptional cases, e.g. generic blocks for modular machines, automatic detection of the
Line Module type can be configured:
typeLM = AUTO_DETECT
Note
When using this function, you must take potential programming conflicts with other parallel
DPV1 jobs into account, e.g. from the library functions used. Manual selection is
recommended for familiar Line Module types.
If the user sets the typeLM input parameter to AUTO_DETECT, the _LineModule_control FB
automatically detects the type of Line Module once when there is a rising edge at the enable
input parameter. In this mode, the _readDriveParameter() system function is called internally
in the FB and the type of Line Module is determined by means of a parameter request. For
this function, the configured Line Module address must also be specified at the moduleAddress
input parameter (see Section "Determining the Logical Address of the Line Module").
Otherwise, the _readDriveParameter() system function called by the _LineModule_control FB
will signal an error. In the case of error "50001" at the errorID output parameter, the stateRdPar
output parameter will contain specific information on the error from the _readDriveParameter()
system function.
Note
You must ensure that only one parameter request is ever active for each drive unit
(e.g. SINAMICS Integrated, CU320, CX32). Otherwise, conflicts with other DPV1 jobs may
arise, e.g. from the library functions used. Any additional requests sent to the same drive unit
will be rejected with the error 16#FFFF81C7 (on output parameter functionResult of the
parameter job or on output parameter stateRdPar of the _LineModule_control FB).
In the case of automatic Line Module detection, no parameter requests from the user program
may be active at the drive unit of the Line Module when there is a rising edge at the enable
input parameter. If the Line Module type cannot be determined automatically, an error is
generated and the Line Module is not switched on.
You can recognize an active parameter request in the _LineModule_control FB from the values
0x00007001 or 0x00007002 in the stateRdPar output parameter.
The values 0x0000000 or FFFF8xxx (parameter request aborted with an error) in the
stateRdPar output parameter indicate that the _LineModule_control FB is not processing any
parameter requests internally.
For additional information on acyclic reading and writing of parameters (using DP-V1 services)
with the _readDriveParameter() system function, please refer to the SIMOTION
Communication System Manual, as well as the SIMOTION D4x5 Commissioning and
Hardware Installation Manual, Section "Acyclic communication with the drive".
If a parameter request from a user or from the SIMOTION device is already active at the Line
Module (functionResult = 0xFFFF81C7 error message), the parameter is read out repeatedly
within a timeout period of 1 s.
The stateRdPar output parameter of the _LineModule_control FB remains at
value 0x00007002 during the repeated readout process taking place within the timeout.
The parameter is only read again if there is a functionResult = 0xFFFF81C7 error. If the system
function signals any other errors, an error is output immediately at the _LineModule_control
FB and the parameter reading process is aborted with the _readDriveParameter system
function.
If the functionResult = 0xFFFF81C7 error is still present once the timeout period has elapsed,
the following error is output at the output parameters of the _LineModule_control FB:
error = TRUE
errorID = 50001
stateRdPar = 0xFFFF81C7
selectedLM = NOT_DEFINED
In the case of deactivated symbolic assignment, proceed in the same way as for determining
the addresses of I/O variables, but this time determine the module address for the status and
control word of the Line Module. Use the same address value (start address of input data) in
the same way as for I/O variables for the status and control word of the Line Module, see
Addressing the Line Module for SINAMICS S120 (Page 12).
HQDEOH
UHVHW
GRQH
DFWLYDWHG
HUURU
HUURU,'
7LPH
6ZLWFKRQGHOD\
6ZLWFKRIIGHOD\
7LPHLQZKLFKWKHHUURUZLOOEHUHVHW
Procedure
Proceed as follows to work with the _LineModule_control function block in your user project
(the numbers shown in the program segment below correspond to the steps listed):
1. Create an instance of the _LineModule_control function block.
2. Call the function block instance and transfer input parameters.
3. The output parameters of the function block are accessed with <instance name of
FB>.<name of output parameter>.
4. The data for the I/O outputs (control word of the Active Line Module) prepared by the FB
must be assigned by the user program to the I/O variables for the purpose of writing the
control word. It is recommended that you use the _setSafeValue system function for this
assignment task.
Note
The program segment is an extract from the application example supplied. The application
example is included on the "SIMOTION Utilities & Applications" DVD and is available for
various SIMOTION hardware platforms.
"SIMOTION Utilities & Applications" is provided free of charge and as part of the
SIMOTION SCOUT scope of delivery.
Note
For additional information, see the following sources:
● SIMOTION SCOUT online help
● Programming manual of the corresponding programming language, e.g.:
– SIMOTION ST, Structured Text programming manual
– SIMOTION MCC, Motion Control Chart programming manual
– SIMOTION LAD/FBD, Ladder Diagram and Function Block Diagram Programming
Manual
These documents are provided as part of the SIMOTION SCOUT scope of delivery in
electronic format.
UNIT E_AlmCtr;
INTERFACE
VAR_GLOBAL
myFbAlmCtrl : _LineModule_control; // Instance of FB _LineModule_control (1)
END_VAR
PROGRAM StartUpAlm;
PROGRAM BackGrndAlm;
PROGRAM PeripheralFaultAlm;
END_INTERFACE
IMPLEMENTATION
PROGRAM BackGrndAlm
// *********************************************************************
// call instance of FB _LineModule_control
// *********************************************************************
//****************************************************************************
// write the output parameters of FB _LineModule_control - control WORD ALM -
// to i/o-variable myperiOutAlm
//****************************************************************************
s_eRetVal := _setSafeValue ( (4)
variable := myperiOutAlm,
value := myAlmCtrl_Out.periOut,
accessmode := default_value,
setvalue := s_setValue
);
END_PROGRAM
END_IMPLEMENTATION
Error groups
The errors signaled in the errorID output parameter may be allocated to the following error
groups:
Error messages
Note
Statuses S1 to S4 are contained in the errorID output parameter while the Line Module is in
the process of being switched on or off.
You can find the meanings of the statuses (S1 to S4) described in the table below in the
Appendix Flow diagrams for switching the Line Modules on and off (Page 35).
For explanations relating to the status and control word of SINAMICS S120 Line Modules,
refer to the
● SINAMICS S120 Drive Functions Function Manual
● SIMOTION D4x5 Commissioning and Hardware Installation Manual
These documents are provided as part of the SIMOTION SCOUT scope of delivery in
electronic format.
The error groups and error messages listed below are to be viewed as being in decimal format.
Error correction
Use the methods outlined below to correct pending errors.
Check the diagnostics LEDs on the Line Module and all SINAMICS components.
● Check the RDY LED.
● Check the DC-LINK LED.
For descriptions of all the LEDs, please refer to the SINAMICS S120 Booksize Power Units Manual.
Check the communication between SIMOTION and the connected Line Module.
Has SIEMENS message frame 370 been configured for the connected Line Module?
See Section Parameter assignment / addressing (Page 11)
Check the programming for the _LineModule_control FB.
● Does the symbol browser in your project contain one I/O variable for reading the status word and one for writing the
control word?
● Is the I/O variable for reading the status word assigned to input parameter periInof the _LineModule_control FB?
● Is output parameter periOut assigned to the I/O variable for writing the control word after the _LineModule_control FB is
called?
● Is the _LineModule_control FB called in a cyclic task and run during each cycle?
See Section Parameter assignment / addressing (Page 11)
Check whether the connected Line Module has signaled any errors.
● Check the error messages in the "Alarms" window of SIMOTION SCOUT.
● In the Line Module expert list, check the error messages in the following parameters:
p945 (fault code)
p947 (fault number)
p2131 (current fault code)
● Check the error messages via the user program, using the _readDriveFaults() system function.
For information on the causes of the errors read and how to remedy them, please refer to the SINAMICS S List Manual and
the SIMOTION SCOUT online help.
On SIMOTION Utilities & Applications, you will also find a DPV1 library containing a function block for reading drive fault and
warning messages. SIMOTION Utilities & Applications is provided as part of the SIMOTION SCOUT scope of delivery.
Check the entries in the SINAMICS diagnostics buffer
(D4x5 SINAMICS Integrated/CX32: SIMOTION V4.1 SP2 and higher; CU320: SINAMICS Firmware V2.6 and higher)
1. Right-click the SINAMICS device in the SIMOTION SCOUT project navigator.
2. Select "Target device" > "Device Diagnostics" from the context menu and open the "Diagnostics buffer" tab.
See also
_LineModule_control function block (Page 17)
Task
The application example shows:
● How you can use the _LineModule_control FB to switch a Line Module on and off. This is
shown using the example of an ALM.
● How error statuses are signaled by the _LineModule_control FB, and how you can reset
the errors.
● Additional ALM diagnostic information.
The application example contains the following programs:
Hardware platform
The application example is available for various SIMOTION hardware platforms.
Note
If the application example is not available for your hardware platform, you must adapt the
hardware configuration.
StartUpALM program
In the StartUpAlm program, a flag for the initial run is set and then evaluated in the
BackgroundTask. This allows for the implementation of a standard start-up sequence for not
only the STOP – RUN transition, but also an appropriate user request.
BackGrndALM program
The BackGrndALM program contains 2 program sequences for switching the Active Line
Module on and off. In both sequences, the switch-on/switch-off procedure is monitored for
errors and tested to ensure it has completed successfully.
The switch-on procedure for the ALM is initiated using a positive edge on the mySwitchOn
variable. The steps that follow involve testing the switch-on procedure to ensure it has
completed successfully and checking it for errors. The mySwitchOn variable is set to FALSE
once the switch-on procedure has begun.
The switch-off procedure for the ALM is initiated using a positive edge on the mySwitchOff
variable. The value of the mySwitchOff variable is then set to FALSE. The step that follows
involves testing the procedure to ensure it has completed successfully and checking it for
errors.
Any errors that occurred during processing are displayed in the myError and myErrorId global
variables and can be reset using the myAlmCtrl_In.reset variable.
PeripheralFaultALM program
If the module triggering an error is the ALM, the start information for the PeripheralFaultTask
is written to the myPftTsi global variable. If the start information evaluation produces a
diagnostic or process alarm signaled by the ALM, this is displayed in the myDiagnosticAlarm
or myProcessAlarm global variable.
Overview
The flow diagrams below describe the statuses (S1 to S4) present while the Line Module is
ramping up.
The Line Modules are switched off using the same procedure used to switch them on, but in
the reverse order.
Note
For explanations relating to the status and control word of SINAMICS S120 Line Modules,
refer to the
● SINAMICS S120 Drive Functions Function Manual
● SIMOTION D4x5 Commissioning and Hardware Installation Manual
These documents are provided as part of the SIMOTION SCOUT scope of delivery in
electronic format.
32:(521
63RZHURQLQKLELW
=6:$( [
!
=6:$( !
&RPPLVVLRQLQJILQLVKHG
S DQGS
2)) 67:$(
!
2)) 67:$(
9DW(3WHUPLQDOV
3RZHUXQLW
65HDG\IRUSRZHURQ
=6:$(
!
=6:$( !
/LQHFRQWDFWRULVRII
:DLWIRUVZLWFKRQ
2))
! 67:$(
S 7
3RZHURQGHOD\
6D6ZLWFKRQ
OLQHFRQWDFWRU !
3UHFKDUJLQJ
65HDG\IRURSHUDWLRQ
=6:$(
! =6:$( !
/LQHFRQWDFWRULVRQ
(QDEOHRSHUDWLRQ
67:$( ! 32:(521 9HOHFWURQLFSRZHU
! VXSSO\2))!21RU5(6(7EXWWRQ
62SHUDWLRQ ! 67:$([[ &RQWUROZRUG
=6:$( 352),%86LQIHHGELW[[
! =6:$( ! =6:$([[ 6WDWXVZRUG
3XOVHVDQGFRQWUROOHUHQDEOHG 352),%86LQIHHGELW[[
9GFSRZHUHGXSYLDUDPS ! U 2SHUDWLQJGLVSOD\
32:(521
63RZHURQLQKLELW
=6:$( [
!
=6:$( !
&RPPLVVLRQLQJILQLVKHG
S DQGS
2)) 67:$(
!
2)) 67:$(
65HDG\IRUSRZHURQ
=6:$(
!
=6:$( !
/LQHFRQWDFWRULVRII
:DLWIRUVZLWFKRQ
2))
! 67:$(
S 7
3RZHURQGHOD\
6D6ZLWFKRQ
OLQHFRQWDFWRU
!
3UHFKDUJLQJ ! 32:(521 9HOHFWURQLFSRZHU
VXSSO\2))!21RU5(6(7EXWWRQ
62SHUDWLRQ ! 67:$([[ &RQWUROZRUG
=6:$( 352),%86LQIHHGELW[[
! =6:$( ! =6:$([[ 6WDWXVZRUG
3XOVHVDQGFRQWUROOHUHQDEOHG 352),%86LQIHHGELW[[
9GFSRZHUHGXSYLDUDPS ! U 2SHUDWLQJGLVSOD\
32:(521
63RZHURQLQKLELW
=6:$( [
!
=6:$( !
&RPPLVVLRQLQJILQLVKHG
S DQGS
2)) 67:$(
!
2)) 67:$(
9DW(3WHUPLQDOV
3RZHUXQLW
65HDG\IRUSRZHURQ
=6:$(
!
=6:$( !
/LQHFRQWDFWRULVRII
:DLWIRUVZLWFKRQ
2))
! 67:$(
S 7
3RZHURQGHOD\
6D6ZLWFKRQ
OLQHFRQWDFWRU !
3UHFKDUJLQJ
65HDG\IRURSHUDWLRQ
=6:$(
! =6:$( !
/LQHFRQWDFWRULVRQ
(QDEOHRSHUDWLRQ
! 32:(521 9HOHFWURQLFSRZHU
67:$( VXSSO\2))!21RU5(6(7EXWWRQ
!
! 67:$([[ &RQWUROZRUG
62SHUDWLRQ 352),%86LQIHHGELW[[
=6:$( =6:$([[ 6WDWXVZRUG
! =6:$( ! 352),%86LQIHHGELW[[
3XOVHVHQDEOHG
! U 2SHUDWLQJGLVSOD\
Abbreviation Meaning
ALM Active Line Module
BLM Basic Line Module
DRIVE-CLiQ DRIVE Component Link with IQ
FB Function block
IN Input parameters
I/O Input/output
LAD Ladder diagram
LED Light Emitting Diode
OUT Output parameter
PLC Programmable Logic Controller
PZD Process data
SLM Smart Line Module
STW Control word
ZSW Status word
_ R
_LineModule_control - Device, 9 References, 3
_LineModule_control function block, 17
_readDriveParameter(), 21
Timeout behavior, 22 S
System function
_readDriveFaults, 26
A _readDriveParameter(), 21
Addressing
Creating an I/O variable, 12
Example, 14
Parameter transfer, 15
ALM application example, 31
E
Error correction, 28
Error groups, 26
Error messages, 26
F
Flow diagram
Switching on the ALM, 36
Switching on the BLM, 37
Switching on the SLM, 38
I
I/O variable
Creating, 12
L
Line Module
Automatic detection, 20
Selecting manually, 20
P
Parameter transfer, 15
Product description, 10