LM Functions en-US
LM Functions en-US
Foreword
02/2012
Legal information
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
with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.
CAUTION
without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.
NOTICE
indicates that an unintended result or situation can occur if the relevant information is not taken into account.
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 a separate list of references.
This documentation is included as electronic documentation in the scope of delivery of
SIMOTION SCOUT. It comprises 10 documentation packages.
The following documentation packages are available for SIMOTION V4.3:
● SIMOTION Engineering System
● 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 in manuals/information)
[Link]
Please send any questions about the technical documentation (e.g. suggestions for
improvement, corrections) to the following e-mail address:
[Link]@[Link]
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 this for the purpose of your own machine
documentation:
[Link]
Training
Click the following link for information on SITRAIN - Siemens training courses for automation
products, systems and solutions:
[Link]
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:
[Link]
Technical support
Country-specific telephone numbers for technical support are provided on the Internet under
Contact:
[Link]
Foreword ................................................................................................................................................... 3
1 Description................................................................................................................................................. 7
1.1 General ..........................................................................................................................................7
1.2 Product description ........................................................................................................................8
2 Parameter assignment / addressing .......................................................................................................... 9
2.1 Overview ........................................................................................................................................9
2.2 Addressing the Line Module for SINAMICS S120 .........................................................................9
2.3 Parameter transfer at FB _LineModule_control ...........................................................................12
3 Programming ........................................................................................................................................... 13
3.1 _LineModule_control function block.............................................................................................13
3.1.1 Overview of _LineModule_control FB ..........................................................................................13
3.1.2 Parameter description..................................................................................................................14
3.1.3 Function description.....................................................................................................................16
3.1.4 Manual selection of the Line Module ...........................................................................................16
3.1.5 Automatic detection of the Line Module (only in exceptional cases) ...........................................17
3.1.6 Determining the module address .................................................................................................19
3.1.7 Graphical overview of the functionality ........................................................................................20
3.1.8 Task integration (call)...................................................................................................................20
3.2 Calling the function block .............................................................................................................21
3.3 Error messages............................................................................................................................23
4 Example of an application........................................................................................................................ 27
4.1 General ........................................................................................................................................27
4.2 Sequence of the application example..........................................................................................29
A Appendix.................................................................................................................................................. 31
A.1 Flow diagrams for switching the Line Modules on and off...........................................................31
A.2 List of abbreviations / acronyms ..................................................................................................35
Index........................................................................................................................................................ 37
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.
Continue with the chapter entitled Parameter transfer at FB _LineModule_control (Page 12).
2. The "PZD message frames" window opens. Check whether message frame 370 is
selected for the infeed. Click on "Set up address". The assigned addresses of the
message frames are then displayed. Select the start address for the input data (see
figure below).
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 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
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 31).
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 9)
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 9)
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:
See also
_LineModule_control function block (Page 13)
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\
Table A- 1 Abbreviations
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
_ References, 3
_LineModule_control function block, 13
_readDriveParameter(), 18
Timeout behavior, 18 S
System function
_readDriveFaults, 23
A _readDriveParameter(), 18
Addressing
Creating an I/O variable, 9
Example, 11
Parameter transfer, 12
ALM application example, 27
E
Error correction, 25
Error groups, 23
Error messages, 23
F
Flow diagram
Switching on the ALM, 32
Switching on the BLM, 33
Switching on the SLM, 34
I
I/O variable
Creating, 9
L
Line Module
Automatic detection, 17
Selecting manually, 16
P
Parameter transfer, 12
Product description, 8