Basis Functions Technologiques en-US PDF
Basis Functions Technologiques en-US PDF
Basis Functions Technologiques en-US PDF
System overview 1
Technology Packages and
Technology Objects 2
SIMOTION Programming with
Technology Objects 3
SIMOTION SCOUT Error Handling in Technology
Basic functions Objects 4
Execution System, Tasks,
and System Cycle Clocks 5
Function Manual
Programming Execution
System/Tasks/System Cycle 6
Clocks
Programming of general
standard functions 7
Programming of general
system function blocks 8
SIMOTION memory concept
(in the target device) 9
Downloading data to the
target device 10
Error sources and efficient
programming 11
Appendix A A
05/2009
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 corresponding 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 device/system may only be set up and used in conjunction with this documentation. Commissioning and
operation of a device/system may only be performed by qualified personnel. Within the context of the safety notes
in this documentation qualified persons are defined as persons who are authorized to commission, ground and
label devices, systems and circuits in accordance with established safety practices and standards.
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 adhered to. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of the 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.
Content
This document is part of the System and Function Descriptions documentation package.
Scope of validity
This manual is valid for SIMOTION SCOUT product version V4.1.4:
● SIMOTION SCOUT V4.1.4 (engineering system for the SIMOTION product range)
● SIMOTION Kernel V4.1, V4.0, V3.2, V3.1 or V3.0
● SIMOTION technology packages Cam, Cam_ext (Kernel V3.2 and higher) and TControl
in the version for the respective kernel (including technology packages Gear, Position
and Basic MC as of Kernel V3.0).
Basic functions
Function Manual, 05/2009 3
Preface
SIMOTION Documentation
An overview of the SIMOTION documentation can be found in a separate list of references.
This documentation is included as electronic documentation with the supplied SIMOTION
SCOUT.
The SIMOTION documentation consists of 9 documentation packages containing
approximately 80 SIMOTION documents and documents on related systems (e.g.
SINAMICS).
The following documentation packages are available for SIMOTION V4.1 SP4:
● SIMOTION Engineering System
● SIMOTION System and Function Descriptions
● SIMOTION Service and Diagnostics
● SIMOTION Programming
● SIMOTION Programming - References
● SIMOTION C
● SIMOTION P350
● SIMOTION D4xx
● SIMOTION Supplementary Documentation
Basic functions
4 Function Manual, 05/2009
Preface
Additional support
We also offer introductory courses to help you familiarize yourself with SIMOTION.
For more information, please contact your regional Training Center or the main Training
Center in 90027 Nuremberg, Germany.
Information about training courses on offer can be found at:
www.sitrain.com
Technical support
If you have any technical questions, please contact our hotline:
Europe / Africa
Phone +49 180 5050 222 (subject to charge)
Fax +49 180 5050 223
€0.14/min from German wire-line network, mobile phone prices may differ.
Internet http://www.siemens.com/automation/support-request
Americas
Phone +1 423 262 2522
Fax +1 423 262 2200
E-mail mailto:[email protected]
Asia / Pacific
Phone +86 1064 757575
Fax +86 1064 747474
E-mail mailto:[email protected]
Note
Country-specific telephone numbers for technical support are provided under the following
Internet address:
http://www.automation.siemens.com/partner
Basic functions
Function Manual, 05/2009 5
Preface
Basic functions
6 Function Manual, 05/2009
Table of contents
Preface ...................................................................................................................................................... 3
1 System overview...................................................................................................................................... 15
1.1 System architecture .....................................................................................................................15
1.1.1 SIMOTION system architecture ...................................................................................................15
1.1.2 SIMOTION SCOUT Engineering System ....................................................................................16
1.1.3 SIMOTION project .......................................................................................................................17
1.1.4 Offline/online mode ......................................................................................................................18
1.1.5 Programming................................................................................................................................18
1.2 SIMOTION motion control............................................................................................................19
1.3 Fields of application .....................................................................................................................20
1.4 Fusion of PLC and motion control ...............................................................................................21
1.5 Totally Integrated Automation ......................................................................................................21
1.6 Hardware platforms......................................................................................................................22
2 Technology Packages and Technology Objects ...................................................................................... 25
2.1 Introduction ..................................................................................................................................25
2.2 Technology packages ..................................................................................................................27
2.3 Technology objects (TO)..............................................................................................................28
2.3.1 Instantiation and configuration .....................................................................................................29
2.3.2 Programming................................................................................................................................30
2.3.3 Programming................................................................................................................................30
2.3.4 Interconnections...........................................................................................................................34
2.3.5 Technology objects and DCC ......................................................................................................35
2.3.6 Available technology objects........................................................................................................37
2.4 Expert list .....................................................................................................................................38
2.4.1 Expert list for configuration data and system variables ...............................................................39
2.4.2 Using the expert list .....................................................................................................................41
2.4.3 Comparing expert lists .................................................................................................................47
2.4.4 Save expert list comparison.........................................................................................................50
2.5 Interconnection of technology objects .........................................................................................51
2.5.1 Interconnection overview for technology objects .........................................................................52
2.5.2 Implicit interconnection when creating.........................................................................................53
2.5.3 Interconnection using general interconnection screen form in SCOUT (for experts) ..................53
2.5.4 General properties of interconnection interfaces .........................................................................54
2.5.5 Interconnection interfaces on the TOs.........................................................................................55
2.5.6 'Motion' interconnection interface type.........................................................................................59
2.5.7 'LREAL' interconnection interface type ........................................................................................60
3 Programming with Technology Objects ................................................................................................... 63
3.1 Definitions ....................................................................................................................................63
3.2 Programming technology objects (TOs) ......................................................................................63
3.2.1 Using technology functions in a program.....................................................................................63
3.2.2 Sample program with namespace option ....................................................................................67
Basic functions
Function Manual, 05/2009 7
Table of contents
Basic functions
8 Function Manual, 05/2009
Table of contents
Basic functions
Function Manual, 05/2009 9
Table of contents
Basic functions
10 Function Manual, 05/2009
Table of contents
Basic functions
Function Manual, 05/2009 11
Table of contents
Basic functions
12 Function Manual, 05/2009
Table of contents
Basic functions
Function Manual, 05/2009 13
Table of contents
Basic functions
14 Function Manual, 05/2009
System overview 1
1.1 System architecture
The SIMOTION system architecture enables trends towards decentralization, heterogeneous
target systems, and distributed intelligence to be implemented.
6,027,21XVHU &XVWRPL]HG6,027,21
SURJUDP )XQFWLRQ DSSOLFDWLRQ
OLEUDULHV
8VHUSURJUDP
0RWLRQFRQWURO 2WKHUWHFKQRORJ\
%DVLFIXQFWLRQDOLW\LQ WHFKQRORJ\ SDFNDJHV '&&FKDUWV
DFFRUGDQFHZLWK,(&
SDFNDJH )XQFWLRQOLEUDULHV
6\VWHPIXQFWLRQV 7HFKQRORJ\SDFNDJHV
RSHUDWLQJV\VWHP,2KDQGOLQJFRPPXQLFDWLRQ
%DVLFIXQFWLRQDOLW\
'ULYHV ,2 $GGLWLRQDOFRPSRQHQWV
VHQVRUVDFWXDWRUV
The basic functionality of the device (SIMOTION Kernel) includes functions for open-loop
and closed-loop control as well as logic and arithmetic. Program execution can be cyclical,
time-triggered or interrupt-triggered. As a result, the SIMOTION Kernel contains the
functions needed for virtually all applications and corresponds in essence to a PLC with the
IEC 61131-3 command set plus system functions for controlling various components, such
as inputs and outputs.
You can expand the SIMOTION Kernel of the device by downloading technology packages.
You access the technology packages from the user program using special language
commands, in the same way that you access the SIMOTION Kernel.
For particular tasks, you can either use existing applications or you can program and link the
required applications yourself. The applications are programmed in compliance with IEC
61131-3 and can be adapted to your specific task.
In addition, SIMOTION provides function libraries that include the system functions and
motion functions. The function libraries contain functions and access to system variables of a
technology object and are linked to the associated device and technology package in
SIMOTION SCOUT.
For special tasks, such as closed-loop control functions, you can use wiring diagrams and
execute them in the corresponding DCC execution tasks using blocks connected with a
graphical tool.
Basic functions
Function Manual, 05/2009 15
System overview
1.1 System architecture
&RQILJXUDWLRQ 7HVWDQGGLDJQRVWLFV
3URMHFWQDYLJDWRU
&DPHGLWRU 'ULYHFRPPLVVLRQLQJ
The SIMOTION SCOUT engineering system is a powerful tool that acts as the PC
development environment to provide optimal support for the required engineering steps in a
user-friendly way. It is integrated in the SIMATIC landscape, where it operates as an option
package for STEP7. Special attention has been given to optimum usability and a
comprehensive, function-oriented view of the automation task.
Basic functions
16 Function Manual, 05/2009
System overview
1.1 System architecture
The project is the highest level in the data management hierarchy. SIMOTION SCOUT
saves all data which belongs, for example, to a production machine, in the project directory.
Basic functions
Function Manual, 05/2009 17
System overview
1.1 System architecture
6,027,21 2IIOLQHSURMHFW
6&287
5XQWLPHSURMHFW
7DUJHWV\VWHP
Figure 1-4 Connection between offline and runtime project with SIMOTION SCOUT
1.1.5 Programming
The open-loop control and motion control tasks are predefined in the user program.
The following programming languages are available to create your user programs:
● MCC - Motion Control Chart
is a graphical programming language for programming logic and motion control functions.
MCC charts are created.
● ST - Structured Text
is a text-based programming language compliant with IEC 61131-3 that enables you to
create an ST source that can comprise several programs.
You can also edit an ST source file using an external ST editor.
Basic functions
18 Function Manual, 05/2009
System overview
1.2 SIMOTION motion control
Programs created using MCC can be converted to ST, but not vice versa.
● LAD/FBD - Ladder Logic / Function Block Diagram
are graphics-based programming languages in compliance with IEC 61131-3 for
programming logic as well as motion control via PLCopen blocks.
● DCC - Drive Control Chart
Is a graphic programming language for programming drive functionality.
It is possible to edit a Drive Control Chart with an external DCC editor.
Detailed information on the programming languages is provided in the SIMOTION MCC,
SIMOTION ST and SIMOTION LAD/FBD Programming Manuals.
Programming in SIMOTION provides the following advantages:
● Programs of different programming languages can be used in one project (MCC, ST and
LAD/FBD)
● Programming is independent of the hardware platform
● PLC, motion control and technology can be implemented in one program
● There are functions for direct access to drive parameters available via PROFIDRIVE
Modular machines are supported by the following:
● Modular software development with libraries
● Division into individual machine modules
● Activation/deactivation of DP slaves and technology objects
● Commands for the synchronization
Basic functions
Function Manual, 05/2009 19
System overview
1.3 Fields of application
● Standards
Industrial automation is increasingly governed by standards in the PC world such as
Microsoft Windows and Ethernet. Standardized global programming languages have
greatly facilitated system handling for the customer.
● Modular machine concepts
The trend towards standardization is also encompassing machine designs. As a
consequence, attempts are being made to break down machine design into various
subcomponents. By virtue of this modularity, it is possible to standardize individual
subcomponents and install them as standard components in different types of machines.
Basic functions
20 Function Manual, 05/2009
System overview
1.4 Fusion of PLC and motion control
3/&
IXQFWLRQDOLW\
,(&
7KHV\VWHPDSSURDFKRI
0RWLRQ&RQWURO
HJSRVLWLRQLQJV\QFKURQRXV
RSHUDWLRQHWF
0HUJLQJ
0RWLRQ&RQWURO
3/&DQGWHFKQRORJ\
7HFKQRORJ\IXQFWLRQV IXQFWLRQV
HJK\GUDXOLFFRQWURO
WHPSHUDWXUHFRQWURO
HWF
On the hardware side, this means that the programmable controller is able to process motion
functions. The hardware platform can be selected individually.
On the software side, the fusion of automation functions and motion functions makes for
simpler engineering. This starts with the configuration and continues through parameter
assignment and programming.
Consistency with SIMATIC is another essential feature, since both systems can be used
together in one plant.
Basic functions
Function Manual, 05/2009 21
System overview
1.6 Hardware platforms
available in SIMATIC (motion control, output cam controller, etc.) or that are required by
SIMOTION to meet the demands of a distributed system are selected based on optimal
usability. Moreover, SIMOTION is integrated into PROFINET and includes all of the requisite
system features for this purpose.
Basic functions
22 Function Manual, 05/2009
System overview
1.6 Hardware platforms
Basic functions
Function Manual, 05/2009 23
Technology Packages and Technology Objects 2
2.1 Introduction
6,027,21 8VHUSURJUDP
([HFXWLRQV\VWHPEDVLFIXQFWLRQDOLW\LQDFFRUGDQFHZLWK,(&
,2GLDJQRVWLFVFRPPXQLFDWLRQ
Basic functions
Function Manual, 05/2009 25
Technology Packages and Technology Objects
2.1 Introduction
8VHUSURJUDPV83
6,027,21 6\QFKUR
,QWHUUXSW
7DVN
QRXV7DVN 83Z
0RWLRQ7DVN
%DFN 83]
83\
JURXQG7DVN
83[
([HFXWLRQV\VWHPEDVLFIXQFWLRQDOLW\LQDFFRUGDQFHZLWK,(&
,2GLDJQRVWLFVFRPPXQLFDWLRQ
Technology Objects
SIMOTION provides technology objects for the technology and motion control.
The technology objects offer the user a technological view of actuators and sensors and
provide technological functions for these, for example:
● the TO axis for drive and encoder
● the TO external encoder for one encoder only
● the TO outputCam/camTrack for an output to be switched in a defined way
● the TO measuringInput for a measuring input
Moreover, technology objects for the preparation of technological data on the system level
are available, for example:
● the TO FollowingObject for synchronous operation between two axes or one axis on an
encoder value
● the TO path for traversing path axes along a path and a positioning axis synchronous to
the path
● the TO cam for representing complex programmable functions
● the TO additionObject, TO formulaObject for the processing of motion data and
technological data on the system side
The technology objects are implemented by the system in system tasks, e.g. IPO task,
IPO_2 task or servo task.
Basic functions
26 Function Manual, 05/2009
Technology Packages and Technology Objects
2.2 Technology packages
Instantiation
Technology objects are provided by the system as technology object types adapted to the
specific application using instantiation.
6,027,21 8VHUSURJUDP
7HFKQRORJLFDOYLHZ
7HFKQRORJ\SDFNDJH
73
7HFKQRORJ\
V\VWHP
72W\SH
HJD[LV ,QVWDQWLDWLRQ $[LVB
([HFXWLRQV\VWHPEDVLFIXQFWLRQDOLW\LQDFFRUGDQFHZLWK,(&
,2GLDJQRVWLFVFRPPXQLFDWLRQ
'ULYHDVVLJQHGLQWKH
FRQILJXUDWLRQ
'ULYH
Technology object types are combined in one technology package and loaded to the runtime
system.
Basic functions
Function Manual, 05/2009 27
Technology Packages and Technology Objects
2.3 Technology objects (TO)
&$0
3$7+
&$0B(;7
3DUDPHWHU
$FWXDOYDOXHV
&RPPDQGV
6WDWXV
&RQILJXUDWLRQ $ODUPV
7HFKQRORJ\REMHFW
$FWXDWRU 6HQVRU
For the cross-TO processing of technological data on the system level, the technology
objects provide defined input and output interfaces.
Basic functions
28 Function Manual, 05/2009
Technology Packages and Technology Objects
2.3 Technology objects (TO)
See also
Available technology objects (Page 37)
Interconnections (Page 34)
See also
Programming of general standard functions - overview (Page 289)
System variables (Page 85)
Configuration data (Page 88)
Basic functions
Function Manual, 05/2009 29
Technology Packages and Technology Objects
2.3 Technology objects (TO)
2.3.2 Programming
System variables comprise technological parameters and display values of technology
objects.
SIMOTION SCOUT usually provides screen forms for the setting of technological
parameters and standard values/defaults.
System variables are individual values or structures that are read out consistently.
Note
The object will be reinitialized after restarting a technology object.
Among other things, this brings about that, for example, system variables cannot be read
until the end of the restart, i.e. are not available.
Additional information on the system variables can be found in System variables (Page 85).
2.3.3 Programming
The technological functions are activated/deactivated using specific commands.
Return value
The return value supplies the result of the function call, e.g. function was/is carried out as
planned or there is an error.
CommandId
CommandId can be used to uniquely identify and trace a TO command.
For information on parameters, step enabling conditions, diagnostics, etc., please refer to the
following:
● Functions for CommandID (Page 359) and various examples in this manual.
● SIMOTION MCC Motion Control Chart, Programming MCC Charts
For a detailed description of the TO commands, please refer to the SIMOTION Reference
Lists.
Basic functions
30 Function Manual, 05/2009
Technology Packages and Technology Objects
2.3 Technology objects (TO)
Programming model
The commands are assigned to tasks which are in turn assigned to the execution levels of
the task system.
Commands can be issued from all user program tasks of the system.
8VHUSURJUDP
7DVN 7DVN 7DVN
6,027,21
BHQDEOH$ BVWRS$ BJHW6WDWH$
BPRYH$
7HFKQRORJLFDOYLHZ
7HFKQRORJ\SDFNDJH
73
72W\SH 7HFKQRORJ\
HJD[LV ,QVWDQWLDWLRQ $[LVB V\VWHP
([HFXWLRQV\VWHPEDVLFIXQFWLRQDOLW\LQDFFRUGDQFHZLWK,(&
,2GLDJQRVWLFVFRPPXQLFDWLRQ
'ULYH
The execution time of a command on the technology object is the only factor that determines
the effectiveness of the command.
If commands are issued from multiple tasks, programming consistency must be ensured by
the user program.
Basic functions
Function Manual, 05/2009 31
Technology Packages and Technology Objects
2.3 Technology objects (TO)
Execution properties
The execution properties of technology objects are object-specific.
The following synchronous execution levels are provided for the execution of the technology
objects: DP cycle clock, servo cycle clock and IPO or IPO_2 cycle clock (except for
temperature controllers).
0RWLRQFRQWURO
6HWSRLQWJHQHUDWLRQ
'ULYH
3URJUDP 3RVLWLRQFRQWURO
,QWHUSRODWLRQ ILQDOFRQWUROOLQJ
LQWHUIDFH VHUYR
HOHPHQW
The instances of the technology objects are processed in different execution levels.
● The command evaluation and motion control are processed in the IPO/IPO_2 cycle clock.
● The position and setpoint control are processed in the servo cycle clock.
● Communication with the drive is processed via PROFIBUS DP in the DP cycle clock or
PROFINET IO with IRT in the PN cycle clock.
Basic functions
32 Function Manual, 05/2009
Technology Packages and Technology Objects
2.3 Technology objects (TO)
The processing can be influenced by means of the system and object configurations.
● System cycle clock setting
Setting the system cycle clocks also sets the sampling time for the motion control of axes
(IPO, IPO_2), the position control (servo) and the communication via PROFIBUS DP or
PROFINET IO with IRT.
● When configuring objects, you can specify whether motion control is to be executed in the
IPO or IPO_2 cycle clock. This allows you to distinguish between operations that are time
critical and those that are not.
● Technology objects are controlled from the user program through system function calls.
Alarms
A technology object monitors the execution and executability of technological functions as
well as the I/O required for the TO, and creates a technological alarm, if necessary.
A technological alarm has a TO-local alarm response, e.g. stop motion, and a global
response, e.g. stop system or call alarm task in which further responses can be specified.
The local and global responses can be set for specific alarms.
For a detailed description of the TO alarms, please refer to the SIMOTION Reference Lists.
See also
Execution system (Page 133)
Differences between cyclical and sequential programming (Page 68)
Process Alarms (Page 115)
Basic functions
Function Manual, 05/2009 33
Technology Packages and Technology Objects
2.3 Technology objects (TO)
2.3.4 Interconnections
There are interconnection interfaces defined on the technology objects for the exchange of
data/information between the technology objects on the system level. These interfaces
generally allow for the bidirectional exchange of data between individual technology objects.
The type of the external interfaces can be different on each TO type. There are no
interconnections or actuators/sensors required.
8VHUSURJUDP
670&&/$')%'
6,027,21
BHQDEOH$[LV$
BPRYH$
BHQDEOH$[LV&
BHQDEOH*HDULQJ%
7HFKQRORJLFDOYLHZ
7HFKQRORJ\SDFNDJH
7HFKQRORJ\V\VWHP
,QVWDQWLDWLRQ
73 &RQILJXUDWLRQ
72W\SHV $[LV )2 $[LV
$ % &
)2 IROORZLQJREMHFW
5XQWLPHV\VWHPIXQFWLRQV
F\FOHFORFNH[HFXWLRQV\VWHPFRPPXQLFDWLRQGLDJQRVWLFV
'ULYH$ 'ULYH%
Depending on the interface type, interconnection interfaces can exchange different data in
cyclic mode (cyclic motion data, e.g. s,v,a for the motion vector of type motion) and during
initialization (e.g. modulo information, units).
Implicit interconnection
If an interconnection is mandatory and unambiguous, it is implicitly created by the
SIMOTION SCOUT engineering system, e.g. measuring input with axis, cam with axis,
synchronous operation with axis. The corresponding TO types are offered under the axis.
Basic functions
34 Function Manual, 05/2009
Technology Packages and Technology Objects
2.3 Technology objects (TO)
See also
'Motion' interconnection interface type (Page 59)
'LREAL' interconnection interface type (Page 60)
Interconnection of technology objects (Page 51)
Description
The data exchange between DCC and TO is performed by DCC charts
● using the direct interconnection of block inputs and block outputs with system variables of
the TO;
for TO axes, it is possible to transfer cyclically the data specified in system variables,
such as override and setpoints, without commands needing to be issued each time in the
user program.
● or by forwarding values calculated in DCC via commands and variables in the user
programs to the TO. The TOs have specific function-related interconnection interfaces.
The TOs themselves are not available as blocks in the DCC charts.
Basic functions
Function Manual, 05/2009 35
Technology Packages and Technology Objects
2.3 Technology objects (TO)
6,027,21
8VHUSURJUDP
670&&/$')%'
BHQDEOH$[LV$
BPRYH$
BHQDEOH$[LV&
BHQDEOH*HDULQJ%
7HFKQRORJLFDOYLHZ
'&&FKDUWV
7HFKQRORJ\V\VWHP
72
D[LVB$ 72)2 72D[LV
% &
,2
)2 IROORZLQJREMHFW
5XQWLPHV\VWHPIXQFWLRQV
F\FOHFORFNH[HFXWLRQV\VWHPFRPPXQLFDWLRQGLDJQRVWLFV
'ULYH$ 'ULYH%
See also
Sequence model for DCC blocks (DCB) (Page 216)
Basic functions
36 Function Manual, 05/2009
Technology Packages and Technology Objects
2.3 Technology objects (TO)
Basic functions
Function Manual, 05/2009 37
Technology Packages and Technology Objects
2.4 Expert list
Note
Special knowledge of the system is required to modify parameters in the expert list.
• You can overwrite entries made using the expert list by calling wizards and
parameterization screen forms.
• No check is made on dependencies with other parameters.
Basic functions
38 Function Manual, 05/2009
Technology Packages and Technology Objects
2.4 Expert list
System variables
The System Variables tab lists the configuration data of the TO in
alphabetical order. There are system variables which can be written
(displayed in green) and which cannot be written (displayed in yellow).
Selected parameters
On the Selected Parameters tab, the most important system variables
and configuration data of a TO are displayed in alphabetical order,
separated according to system variables and configuration data. The tab
can be closed, but it will be displayed again at the next call.
The selection is a factory setting and cannot be changed. To enable a
different selection nevertheless, the selection can be saved as a user-
defined list.
User-defined parameter lists
Configuration data or system variables from user-defined lists are
displayed on additional tabs. Configuration data and system variables are
divided into blocks.
Create new tab Click this button if you want to create a new or open an existing user-
defined list or default parameter list.
Basic functions
Function Manual, 05/2009 39
Technology Packages and Technology Objects
2.4 Expert list
Collect changes As long as the button is activated, all the configuration data changed by
you (in RUN mode) is collected and the new values do not take effect in
the target system. Only when Activate changes is clicked, do all the
changes to the configuration data take effect in the target system.
Activate changes Click this button if all the collected changes to the configuration data are
to take effect in the target system.
Configuration selection list Select whether the parameters for a linear axis or rotary axis are to be
displayed or changed for standard, force or pressure in the table in the
expert list.
New user-defined list By clicking this button a new user-defined list is created.
Open user-defined list By clicking this button an existing user-defined list is opened.
Save user-defined list By clicking this button the currently opened user-defined list is stored.
Edit user-defined list By clicking this button you access the editing mode of the currently
opened user-defined list.
Cancel editing mode By clicking this button the editing mode is canceled. Changes are
discarded.
Enter comment lines (editing mode) By clicking this button you change the format of newly created lines in
"Comment".
Enter headlines (editing mode) By clicking this button you change the format of newly created lines in
"Headline".
Enter parameter lines (editing mode) By clicking this button you change the format of newly created lines in
"Parameter".
Restart For configuration data that only take effect after a restart of the TO, the
restart can be performed by either activating the system variable
"restartActivation" or by clicking the Restart button. The button restarts
the axis.
The button becomes active when you have changed an effective data
item after a restart, but not yet accepted it.
Parameter The name of the configuration data item or the system variable is
displayed here. Click the plus sign to open the entire structure.
Parameter text A brief description of the system variable or the configuration data is
displayed.
Offline value The value of the configuration data item or the system variable is
displayed here. Depending on the type of parameter, you can enter the
value directly as a numerical value or select a symbolic identifier from the
selection list.
Basic functions
40 Function Manual, 05/2009
Technology Packages and Technology Objects
2.4 Expert list
Displaying the help for the system variables and the configuration data
1. Select Help > Context-sensitive help or press the Shift+F1 keys.
The cursor changes to a question mark.
2. Click the configuration data item or the system variable in the expert list for which help is
required.
The help for this is displayed.
Basic functions
Function Manual, 05/2009 41
Technology Packages and Technology Objects
2.4 Expert list
Basic functions
42 Function Manual, 05/2009
Technology Packages and Technology Objects
2.4 Expert list
Basic functions
Function Manual, 05/2009 43
Technology Packages and Technology Objects
2.4 Expert list
Basic functions
44 Function Manual, 05/2009
Technology Packages and Technology Objects
2.4 Expert list
3. Transfer the desired parameters from the other tabs via copy & paste (context menu or
Ctrl + C and Ctrl + V).
Example:
4. To save the list, click the Save button or select Save list in the context menu of the
tab and confirm with OK.
The name of the saved list is taken as label for the tab.
5. To print the list, select Print list in the context menu of the tab.
Basic functions
Function Manual, 05/2009 45
Technology Packages and Technology Objects
2.4 Expert list
Delete entry
1. Place the cursor in the line that you want to delete.
2. Press the Del key on the keyboard.
The line will be deleted.
2. In the displayed selection window, activate the Save as executable script ... option and
click OK to confirm.
3. In the Add script window, you can enter a name for the script. Then click OK to confirm.
The script will be saved in the SCRIPTS folder below the object. If the script folder does
not exist, it will be created.
Optionally, you can also export the script as ASCII text:
1. In the Save as window, you can select a storage location and the name for the text file.
Then click OK to confirm or click Cancel if the script is not to be exported.
Note
You can also save the results of an expert list comparison as a user-defined list or as
executable script, see Comparing expert lists (Page 47).
Basic functions
46 Function Manual, 05/2009
Technology Packages and Technology Objects
2.4 Expert list
Description
In this window, you can compare the differences in parameter settings of a maximum of 5
objects (TOs) and the differences in ONLINE and OFFLINE mode of an object.
The displayed data are always the current data in effect. For TOs in ONLINE mode, these
data are the actual values. System variables are not permanently updated, only if you update
the representation with New comparison.
You can change the values of the comparison objects as well as the values of the reference
objects. Objects that cannot be changed are indicated with "???".
Basic functions
Function Manual, 05/2009 47
Technology Packages and Technology Objects
2.4 Expert list
Parameters with different settings or parameters not available for an object are presented in
a list.
Note
A comparison can only be made within groups of compatible objects (TOs). Only the eligible
objects for the comparison will be made available.
Basic functions
48 Function Manual, 05/2009
Technology Packages and Technology Objects
2.4 Expert list
Basic functions
Function Manual, 05/2009 49
Technology Packages and Technology Objects
2.4 Expert list
See also
Save expert list comparison (Page 50)
Description
In this window, you can save the results of the expert list comparison.
The button is active only if the parameters of a device are displayed under Results.
● Click User-defined parameter list to save the results of the comparison as a *.cdl file.
● Click Executable script on source object and select the object to which you want to assign
the script. The SCRIPTS folder will then be created under this object.
See also Comparing expert lists (Page 47).
You can save only the comparison results of one object. Prior to storing, you must specify
which object is to be saved.
Basic functions
50 Function Manual, 05/2009
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
3DUDPHWHU
$FWXDOYDOXHV
&RPPDQGV
6WDWXV
&RQILJXUDWLRQ $ODUPV
,QSXWVLGH 2XWSXWVLGH
LQWHUFRQQHFWLRQ LQWHUFRQQHFWLRQ
LQWHUIDFHV 7HFKQRORJ\REMHFW LQWHUIDFHV
$FWXDWRU 6HQVRU
Basic functions
Function Manual, 05/2009 51
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
Introduction
With the interconnection overview you can display all motion input and output
interconnections of technology objects in the project via an interconnection tree. The tree
display enables the interconnections to be displayed in cascades.
An interconnection table shows the TOs interconnected on the input or output side with
interface designation for the TO selected in the interconnection tree.
Basic functions
52 Function Manual, 05/2009
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
Description
Interconnections are generated automatically when the following TOs are created:
● Synchronous axis; master object is interconnected to the following axis
● Output cam; this is interconnected to the master value
● Measuring input; this is interconnected to the master value
These interconnections are also displayed in the interconnection overview.
2.5.3 Interconnection using general interconnection screen form in SCOUT (for experts)
SCOUT offers the Interconnection view for interconnection of various technology objects.
Basic functions
Function Manual, 05/2009 53
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
On the left-hand side, all input-side interconnection interfaces of the selected object are
listed, on the right-hand side, the output-side interconnection interfaces of the same type.
Only the output-side interfaces displayed bold can be selected.
● When one of these lines is highlighted (clicked), you can open a tree that displays all
interconnection possibilities.
Only those elements displayed bold can be selected.
The display of the devices and technology objects is used only for orientation purposes.
● Direct input can be made in the input line.
Only complete and correct inputs are accepted. The input field cannot be exited if incorrect
inputs are made.
If the input-side interconnection interface has the characteristic of multiple interconnectability
and can therefore be interconnected with several output-side interconnection interfaces,
another line is added for the interconnection of the input-side interconnection interface after
the interconnection with an output-side interconnection interface.
● An interconnection can be removed by deleting a line.
The value will be accepted when the input line is exited.
Enabling/disabling
The input-side interconnection interfaces are activated with a command on the associated
TO or they are active by default.
In the case of multiple interconnectability of an input-side interconnection interface,
enabling/disabling is carried out with a command for the technological function, e.g.:
● Selection of the cam in _enableCamming() via the cam parameter
● Selection of the technology object for the master value in the _setMaster() command via
the master parameter
● Selection of the technology object for the reference value of the MotionIn interface in the
_run...basedMotionIn...() command via the mastertype.reference parameter
● Selection of a profile or the cam in the _run…Profile() commands via the profile
parameter
For information on this topic, please refer to the function manuals of the respective
technology objects.
Basic functions
54 Function Manual, 05/2009
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
Validity
Interconnection interfaces have valid values when the interconnection is established and the
interconnection values have the 'valid' status; invalid interconnections / interconnection
values have the value 0.
If a (virtual) axis is set to simulation, the output-side setpoints will continue to be updated, the
actual values will be frozen.
The status available in the system variables can be read out to determine whether the
interconnection value or the substitute value is valid after ramp-up.
Alarm Response
In the case of a faulty interconnection, a technological alarm is only issued when a function
on the interconnection interface is activated.
In the case of multiple interconnectability of an input-side interconnection interface, a
reference TO must be selected.
Programmed functions will be cancelled at the transition from STOPU to STOP,
interconnection functions remain active at the transition from STOPU to STOP.
TO Interface Type
Drive axis (driveAxis)
Input-side interconnection interfaces:
Motion input Motion
Torque limit, positive LREAL
Torque limit, negative LREAL
Additive torque LREAL
Motion profile MotionProfile
Force/pressure profile ForceProfile
Valve characteristic (hydraulic axis) ValveCharacteristics
Output-side interconnection interfaces:
Motion setpoint Motion
Motion actual value with extrapolation Motion
Actual torque LREAL
Basic functions
Function Manual, 05/2009 55
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
Position axis
Input-side interconnection interfaces:
As for drive axis
Output-side interconnection interfaces:
As for drive axis plus additionally:
Interface for output cam, cam track Specific
(implicitly interconnected with the axis by the system when
creating an output cam, cam track)
Interface for measuring input Specific
(implicitly interconnected with the axis by the system when
creating a measuring input)
Following axis
input-side interconnection interfaces:
As for position axis plus additionally:
Interface for synchronous object Specific
(implicitly interconnected by the system when creating a
following axis/following object)
output-side interconnection interfaces:
As for position axis, plus additionally:
Path axis
Input-side interconnection interfaces
Interface as for the following axis, in addition:
Path motion specific
Output-side interconnection interface
As for position axis
Following object
Input-side interconnection interfaces:
Motion input Motion
Cam CAM
Output-side interconnection interfaces:
Interface for slave axis specific
(implicitly interconnected by the system when creating a
following axis/following object)
Path object
Input-side interconnection interfaces:
Velocity profile MotionProfile
Output-side interconnection interfaces:
Path motion (path axis 1) specific
Path motion (path axis 2) specific
Path motion (path axis 3) specific
Path synchronous motion specific
Motion output (path object.x) Motion
Motion output (path object.y) Motion
Motion output (path object.z) Motion
Basic functions
56 Function Manual, 05/2009
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
External encoder:
Input-side interconnection interfaces:
None
Output-side interconnection interfaces:
Interface for output cam, cam track specific
(implicitly interconnected by the system when creating an
output cam, cam track)
Interface for measuring input specific
(implicitly interconnected by the system when creating a
measuring input)
Motion setpoint Motion
Motion actual value with extrapolation Motion
Measuring input
Input-side interconnection interfaces:
Measuring input interface specific
(implicitly interconnected with the axis, external encoder by
the system when creating a measuring input)
Input interface 'Listening measuring input' (V4.0 and higher) specific
(via general interconnection screen form)
Output-side interconnection interfaces:
Output interface for 'Listening measuring input' (V4.0 and specific
higher)
Output cam, cam track
Input-side interconnection interfaces:
Output cam interface specific
(implicitly interconnected with the axis, external encoder by
the system when creating an output cam, cam track)
Cam
Input-side interconnection interfaces:
None
Output-side interconnection interfaces:
Cam Cam
Motion profile MotionProfile
Force/pressure profile ForceProfile
Valve characteristic (hydraulic axis) ValveCharacteristics
Temperature controller
No interconnection interfaces
Addition object
Input-side interconnection interfaces:
Motion output 1 Motion
Motion input 2 Motion
Motion input 3 Motion
Motion input 4 Motion
Output-side interconnection interfaces:
Motion output Motion
Basic functions
Function Manual, 05/2009 57
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
Formula object
Input-side interconnection interfaces:
Motion input 1 Motion
Motion input 2 Motion
Motion input 3 Motion
LREAL input 1 LREAL
LREAL input 2 LREAL
LREAL input 3 LREAL
LREAL input 4 LREAL
DINT input 1 DINT
DINT input 2 DINT
DINT input 3 DINT
DINT input 4 DINT
Output-side interconnection interfaces:
Motion output 1 Motion
Motion output 2 Motion
Motion output 3 Motion
LREAL output 1 LREAL
LREAL output 2 LREAL
LREAL output 3 LREAL
LREAL output 4 LREAL
DINT output 1 DINT
DINT output 2 DINT
DINT output 3 DINT
DINT output 4 DINT
Fixed gear
Input-side interconnection interfaces:
Motion input Motion
Output-side interconnection interfaces:
Motion output Motion
Sensor
Input-side interconnection interfaces:
None
Output-side interconnection interfaces:
Sensor value LREAL
Sensor value derivation LREAL
Motion output Motion
Controller object
Input-side interconnection interfaces:
Setpoint LREAL
Actual value LREAL
Feedforward control LREAL
Motion input setpoint Motion
Basic functions
58 Function Manual, 05/2009
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
Motion basis
The motion vector can have a different motion basis: position or velocity.
The position component is zero for the "velocity" motion basis.
A drive axis provides only the motion vector with the velocity motion basis on the output side.
Commands / command parameters (TO axis) or the configuration (TO additionObject, TO
fixedGear) are used to consider/set the motion basis.
The components of the motion vector are maintained consistent at the output side of the TO
axis, TO fixedGear (the derivation of the position value is the velocity value, the derivation of
the velocity value is the acceleration).
The components of the motion vector are not maintained consistent at the output side of the
TO additionObject and TO formulaObject.
The velocity and the acceleration can be specifically defined in this item for the position.
Basic functions
Function Manual, 05/2009 59
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
'Torque' output-side interconnection interface on the axis for providing the actual torque
There is a 'Torque' output-side interconnection interface available on the axis for issuing the
actual torque to other TOs.
Prerequisite is the activation of the process-related field on the TO axis.
The actual torque supplied by the drive in the additive process-related field is issued.
It is issued in the unit set on the axis.
The output-side interconnection interface can be interconnected several times.
The output-side interconnection interface 'ActualTorque' cannot be distributed.
Basic functions
60 Function Manual, 05/2009
Technology Packages and Technology Objects
2.5 Interconnection of technology objects
'AdditiveTorque' Input-side interconnection interface on the axis for specifying an additive torque
There is a 'AdditiveTorque' input-side interconnection interface of the LREAL type available
on the axis for specifying an additive torque to the drive using the additive process-related
field.
To specify an additive torque depending on other TOs, the input-side interconnection
interface'AdditiveTorque' can be interconnected with output-side interconnection interfaces
of the LREAL type of other TOs on the axis.
The input-side interface 'AdditiveTorque' cannot be interconnected several times and it
cannot be distributed.
Output-side interconnection interfaces of the LREAL type have, for example:
● TO axis with the output-side interconnection interface 'Torque'
● TO formulaObjectType with the output-side interconnection interface 'LRealOut'
● Sensor TO
● Controller Object TO
Basic functions
Function Manual, 05/2009 61
Programming with Technology Objects 3
3.1 Definitions
The following section provides an introduction to the motion components primarily from the
perspective of the ST programming language. This mainly involves system functions, system
variables and configuration data. Some definitions are provided below:
● System functions are functions used for the system management. They provide access to
technology-neutral functionality of the device. System functions are always available.
● A technology object (TO) represents a technological functionality (for example,
positioning an axis, assigning parameters for an output cam) in the SIMOTION user
program.
● TO functions or technology commands are language commands available to the
individual TOs, i.e. functions for a technology object.
● A technology package contains one or more technology object types, from which the
respective TO instance is generated with <Insert technology object>.
● System variables and configuration data are attributes of the technology objects and the
basic system. You can use system variables to assign parameters for technology objects
and the basic system or to read their status.
Note
You will find additional information about the basics, configuration and programming of
motion control technology and, in particular, technology objects, in the SIMOTION Motion
Control <Technology Objects> Function Manuals.
The specified topics are only briefly described in this documentation.
Basic functions
Function Manual, 05/2009 63
Programming with Technology Objects
3.2 Programming technology objects (TOs)
INTERFACE
USEPACKAGE Cam AS Cam1;
USES ST_2;
FUNCTION function1;
END_INTERFACE
IMPLEMENTATION
FUNCTION function1 : VOID
VAR_INPUT
Axis : posAxis;
END_VAR
VAR
retVal: DINT;
END_VAR
retVal:= Cam1._enableAxis (
axis := axis,
nextCommand := Cam1.WHEN_COMMAND_DONE,
commandId := _getCommandId() );
END_FUNCTION
END_IMPLEMENTATION
Basic functions
64 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Code Description
Name All TO function names (_enableAxis in the example) are defined identifiers
in the SIMOTION system that always begin with _ (underscore). To
maintain a distinction between these TO functions and user-defined FBs
and FCs, you should not create source file sections beginning with the _
character.
Input parameter When called, TO functions can contain one or more input parameters and
always supply a return value to the call location. Output parameters are not
supported.
For more information, see Subsection 8.1.2.
Return value All commands normally return a double-precision integer (DINT data type).
This indicates whether the command was successfully transferred to the
system and processed normally (return value of zero) or whether an error
occurred (return value other than zero).
Example
If the application requires you to enable a virtual axis, you could program a source file like
the one shown in the following figure.
The following conditions must be fulfilled:
● An instance of a positioning axis or speed axis has been created in SIMOTION SCOUT
as a virtual axis called Axis_1.
● The myPos program has been assigned to MotionTask_1, for example. The Activation
after StartupTask option has been selected in the task configuration of MotionTask_1.
● The source file has been downloaded to the target system.
After the CPU has changed to RUN mode, virtual axis Axis_1 will issue an enable. You can
verify the status of the axis enable in system variable Axis_1.control.
Basic functions
Function Manual, 05/2009 65
Programming with Technology Objects
3.2 Programming technology objects (TOs)
INTERFACE
USEPACKAGE cam;
PROGRAM myPos;
END_INTERFACE
IMPLEMENTATION
// The following program must be assigned to a
// MotionTask.
// In the task configuration, the "Activation
// after StartupTask" option must be selected.
PROGRAM myPos
VAR
retVal : DINT;
END_VAR
// Axis is enabled for positioning.
retVal := _enableAxis (
axis := Axis_1,
// TO instance identifier
nextCommand := WHEN_COMMAND_DONE,
// Condition for program advancement.
commandId := _getCommandId() );
// Unique command ID
END_PROGRAM
END_IMPLEMENTATION
Note
Use the long form for passing parameters (with value assignment) described in Input
parameters of the technology functions. This form is clearer and more flexible.
You will find tips on efficient use of parameters in system functions in Error sources and
efficient programming.
Basic functions
66 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
INTERFACE
USEPACKAGE Cam AS Cam1;
USES ST_2;
FUNCTION function1;
END_INTERFACE
IMPLEMENTATION
FUNCTION function1 : VOID
VAR_INPUT
p_Axis : posAxis;
END_VAR
VAR
retVal : DINT;
END_VAR
retVal:= Cam1._enableAxis (
axis := p_Axis,
nextCommand := Cam1.WHEN_COMMAND_DONE,
commandId := _getCommandId() );
END_FUNCTION
END_IMPLEMENTATION
NOTICE
If a namespace is defined for an imported library or technology package, this must always
be specified if a function, function block or data type from this library or technology package
is being used. See above example: Cam1._enableAxis, Cam1.WHEN_COMMAND_DONE.
See also
Function parameters of the technology functions (Page 69)
Efficient programming - overview (Page 460)
Basic functions
Function Manual, 05/2009 67
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Cyclic tasks
Cyclic tasks (such as the BackgroundTask) will be started by the system after their
completion or automatically after a defined time frame. The values of the static variables of
the assigned programs are retained. Cyclic tasks have a time monitoring and a defined error
response should the time monitoring be exceeded. This means the code contained in cyclic
tasks must perform its tasks quickly and efficiently. Tasks with a waiting character (for
example, wait for the positioning of an axis) can only be performed in several call cycles of
the cyclic task. This means TO system commands must normally be called with the
IMMEDIATELY step enabling condition for the nextCommand parameter. The subsequent
call cycles must then check the result of the system command for successful processing or
error. This procedure is also called asynchronous execution.
Sequential tasks
After start, sequential tasks (e.g. MotionTasks) are executed once and then terminated. At
each start, all local variables of the assigned programs are initialized; see Influence of the
compiler on variable initialization (Page 241) for variable initialization. Because sequential
tasks do not have any time monitoring, they can attain a run time of any length. Sequential
tasks are subject only to the control of the application. This means the application can start,
stop, pause and resume tasks. The code contained in sequential tasks processes tasks
successively, where the following task is normally performed only when the previous task
has been completed. For example, an axis is first released and then homed. This means TO
system command calls should be performed using the WHEN_COMMAND_DONE step
enabling condition for the nextCommand parameter. The system function returns to the
calling sequential task only when the command has been processed. This is also called
synchronous execution.
General Procedure
In general, it is better to program sequential sequences in MotionTasks. The differences
between a sequential programming in a MotionTask and the cyclical programming in the
BackgroundTask are:
● As part of the sequential processing of a the MotionTask, one and only one (but
nevertheless linked) step enabling condition can be awaited at any point in time. The step
enabling condition is checked with high priority in the interpolator cycle clock. To reduce
the response time for continuing the MotionTask, its priority can be increased temporarily
(-> WAITFORCONDITION).
● A normally cyclical program checks in each cycle a number of signal states and step
enabling conditions. This heavily loads and extends the cycle time. The advantage
compared with the sequential type of programming lies in the parallel processing of
requests and sequences.
Basic functions
68 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Rule Example
Assignments
All function parameters are always transferred, either with In the Example of variables to be specified the actual values
the programmed values or with the default settings. myAxis (variable) and IMMEDIATELY (value) are assigned
to the function parameters axis and nextCommand.
Several function parameters
Several function parameters are separated by commas. In the Example of variables to be specified:
_enableAxis (axis:=myAxis, nextCommand :=
IMMEDIATELY)
Sequence of the function parameters
The function parameters can be in any order as long as the In the Example of variables to be specified, _enableAxis
first two rules are followed. (nextCommand:=IMMEDIATELY, axis:=myAxis) is also
possible.
Function parameters with preset values
Basic functions
Function Manual, 05/2009 69
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Rule Example
If the parameter names are also specified, the sequence is In the Example of variables to be specified, you can omit
arbitrary (e.g. "velocity:=..."). If not all parameter names are function parameter nextCommand := IMMEDIATELY as this
specified, they must all be entered in the correct sequence. is the default value.
Actual values as variables
The advantage is that you can reuse the source file sections In the Example of variables to be specified, the user-defined
that use these variables. function block posFB defines the TO instance myAxis
For example, a user-defined function block (FB) is to call a (myAxis:PosAxis).
TO function with variable axis identifiers as function When you call a TO function from this FB, the TO instance
parameters. It would be awkward to have to call the function is used as actual values (Axis := myAxis).
several times using constant axis names and would also The values for the TO instance are derived not from the
mean that you could not reuse the FB. user-defined FB, but from the program called by this FB with
You can also use other actual values as variables. myFB (myAxis := Axis).
For the reasons named, you can also call the FB and, thus,
the TO function with myAxis := Axis2 or myAxis := Axis3,
etc.
This means you can use the FB in all programs of the ST
source file and in programs of other source files with the aid
of the export function.
Actual values as values (enumerators)
If you enter actual values as values (next Command: = In the Example of variables to be specified, enumerators
IMMEDIATELY in the example), you must usually choose a IMMEDIATELY and WHEN_COMMAND_DONE are
value from various specific states (only for enumerators). available for function parameter nextCommand in TO
Enumerators are a derived data type. You will find basic function _enableAxis. The compiler rejects other values
information about enumerators in the "User-defined data during compilation of the program.
types" section in the ST programming manual. You can also
specify direct values for other data types.
Parameters for the transition and step enabling condition
With many motion commands, you can specify when the TO function is executed on the technology object and when the
next statement is processed (see Transition and step enabling condition)
Parameters for command identification
All motion commands must contain a parameter for the command identification. This allows you to track the status of the
command execution (see Diagnosis of the command execution).
Basic functions
70 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Note
All system data types for enumerations (in system functions and system variables) begin
with the word Enum. For example, function parameter nextCommand has enumeration data
type EnumNextCommandEnable (with values IMMEDIATELY or
WHEN_COMMAND_DONE).
All system data types for structures (in system functions and system variables) begin with
the word Struct.
If you do not begin user-defined data types with character string Enum or Struct, names
cannot overlap. For a detailed description of of the name spaces, see ST programming
manual.
Appendix D of this manual contains all reserved identifiers of the ST (Structured Text)
programming language, the system functions, the system blocks, and the SIMOTION
devices.
The reserved identifiers of the SIMOTION technology packages can be found in the
Parameter Manuals for the SIMOTION technology packages.
Table 3- 7 Frequent reference parameters and effect of the associated value parameters
Basic functions
Function Manual, 05/2009 71
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Specification of the function parameters without specifying the function parameter identifiers
Two variants are supported for the specification of function parameters in the function call
(see IEC1131/3 2nd Edition, 11/98):
● "call by value" as call with fixed assignment and number of input variables corresponding
to the function declaration, whereby assignment operators are not permitted.
● "call by name" as call with variable assignment and number of input variables, whereby
an assignment of the transfer parameter to the formal operand is required. In this call
variant, transfer parameters with default values can remain unused.
In the short form of parameter transfer, the function parameters (parameter identifiers) are
omitted and only the actual values (parameter values) are used.
NOTICE
In the short form of parameter transfer, you must specify all parameter values (even
optional ones) separated by commas in the correct order!
Only a few system functions (see Functions for the runtime measurement of tasks, Task
control commands and Functions for the message configuration) require the short form of
parameter transfer when called. This is specified explicitly for the relevant functions.
Note
Use the long form (with value assignment) described above. This form is clearer and more
flexible.
Basic functions
72 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Note
New TO data types (V4.0 and higher) begin with a "_" to prevent confusion with user
variables.
You must first declare the variables, however, and you must choose from a predefined
selection of data types (see table for Data types for technology objects). In our Use of TO
functions in the program examples in this section (Example of variables to be specified), the
data type is PosAxis, because you want to create TO instance variables for positioning axes.
The Cam (discontinuous synchronous operation) technology package you have selected
contains the PosAxis data type for the Position Axis technology object.
Basic functions
Function Manual, 05/2009 73
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Variables of the technology object (TO) data type are initialized by default with the value
TO#NIL. You can use this to check whether a valid TO was assigned to a variable; see
Example of variables to be specified.
// ...
FUNCTION_BLOCK posFB
VAR_INPUT
myAxis: posAxis;
END_VAR
VAR_OUTPUT
// Return value of the TO function,
// also output parameter of the FB
return_value: DINT:= -1;
END_VAR
// Check for valid TO
IF myAxis = TO#NIL THEN RETURN; END_IF;
// Example of call with variable of data type of TO
return_value := _enableAxis (
axis:= myAxis, // TO function
nextCommand:= IMMEDIATELY, //optional
commandId := _getCommandId() );
END_FUNCTION_BLOCK
PROGRAM Example
VAR
myFB: posFB;
END_VAR
myFB (myaxis := Axis1);
// Name is created on start-up // in the SIMOTION SCOUT.
myFB (myaxis := Axis2);
// Name is created on start-up // in the SIMOTION SCOUT.
END PROGRAM
//...
Basic functions
74 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
72LQVWDQFH
0RWLRQ%XIIHU
3URJUDP
6(48(17,$/
FRPPDQG,G
0RWLRQFRPPDQG
3DUDPHWHU
FRPPDQG,G
&RPPDQG
SDUDPHWHU
&RPPDQGJURXSV
1(;7&200$1'
683(5,0326('B027,21B0(5*(
,00(',$7(/<
The MotionBuffer stores motion commands that are executed sequentially by the
interpolator. The number of motion commands that can be stored in the motion buffer is
defined via the configuration data
TypeOfAxis.DecodingConfig.numberOfMaxbufferedCommandId. Multiple motion commands
can therefore be issued on the technology object, irrespective of the execution status of the
active command.
A commandId is assigned to each command when it is issued. This is stored in the
command and provides a reference to the issued command.
Basic functions
Function Manual, 05/2009 75
Programming with Technology Objects
3.2 Programming technology objects (TOs)
The commands are assigned to command groups. The pending commands in the existing
command groups are processed in parallel by the interpolator. Certain commands become
active on the technology object immediately and form a queue in the motion buffer; other
commands, i.e. superimposing commands, take effect immediately.
Note
The behavior of the command groups and command buffers, e.g. MotionBuffer, is TO-
specific. Thus, for example, you cannot call the _enableaxistorquelimitpositive and
_enableaxistorquelimitnegative commands simultaneously within one IPO2 cycle clock. Only
one of the commands will be executed.
An exact description of command groups and command buffers can be found in the TO
manuals, e.g. in the "TO Axis Electric / Hydraulic, External Encoder" function manual.
Basic functions
76 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
INTERFACE
USEPACKAGE CAM;
PROGRAM ProgramCycle;
END_INTERFACE
IMPLEMENTATION
PROGRAM ProgramCycle
VAR
boStartCommand : BOOL; // Command - issue command
boCommandStarted : BOOL; //Auxiliary variable - command issued
boCommandDone : BOOL; // Auxiliary variable - command executed
i32Ret : DINT; // Return value of system functions
sCommandId : CommandIdType; // CommandId
Basic functions
Function Manual, 05/2009 77
Programming with Technology Objects
3.2 Programming technology objects (TOs)
IF r_trig_1.q THEN
// Request for a system-wide unique commandId
sCommandId := _getCommandId ();
// Register commandId at the TO
// --> Diagnostics of end or abort of command possible
i32Ret := _bufferAxisCommandId (
axis := Axis_1,
commandId := sCommandId );
// Evaluation of return value of system function
// ...
// Issuing of a command - motion with USER_DEFAULT values
i32Ret := _move(
axis := Axis_1,
nextCommand := IMMEDIATELY,
commandId := sCommandId );
// Evaluation of return value of system function
// ...
// Auxiliary variables for coordination of command execution
boCommandStarted := TRUE;
boCommandDone := FALSE;
//---------------------------------------------------------------------
// Continuation follows
// Continuation
//---------------------------------------------------------------------
ELSIF boCommandStarted AND NOT boCommandDone THEN
// Query command execution status
sRetCommandState := _getStateOfAxisCommand(
axis := Axis_1,
commandId := sCommandId );
IF sRetCommandState.functionResult = 0 THEN
IF sRetCommandState.commandIdState = EXECUTED THEN
// Command has been executed (completed)
boCommandStarted := FALSE;
boCommandDone := TRUE;
// Remove registered commandId on TO
i32Ret := _removeBufferedAxisCommandId(
axis := Axis_1,
Basic functions
78 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
commandId := sCommandId );
END_IF;
ELSE
// Error handling for _getStateOfAxisCommand function call
// ...
;
END_IF;
END_PROGRAM
END_IMPLEMENTATION
INTERFACE
USEPACKAGE CAM;
VAR_GLOBAL
g_boCommandStarted : BOOL; //Auxiliary variable - command issued
g_boCommandDone : BOOL; // Auxiliary variable - command executed
END_VAR
PROGRAM ProgramSequential;
END_INTERFACE
IMPLEMENTATION
PROGRAM ProgramSequential
VAR
i32Ret : DINT: // Return value of system function
END_VAR;
g_boCommandStarted := TRUE;
g_boCommandDone := FALSE;
// Statements executed before the motion.
// ...
i32Ret := _move(
axis := Axis_1,
nextCommand:= WHEN_MOTION_DONE,
commandId:= _getCommandId () );
Basic functions
Function Manual, 05/2009 79
Programming with Technology Objects
3.2 Programming technology objects (TOs)
// ...
g_boCommandStarted := FALSE;
g_boCommandDone := TRUE;
END_PROGRAM
//...
VAR
myCommandId : CommandIdType;
END_VAR
//...
// Save unique ID
myCommandId := _getCommandId ();
// Execute function with ID
myFC := _pos (axis := myAxis,
position := position_1,
nextCommand :=IMMEDIATELY,
commandId :=myCommandId);
//...
The description how you can track the execution status of a command with the aid of the
commandId follows.
Basic functions
80 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Example 1 The _buffer... command is not issued, and the _pos command for which the query is to
be made is already finished.
Result Because a matching command for the CommandId specified in the
_getStateOf...CommandId was not found (_pos is already finished), NOT_EXISTENT
('commandId' is not known or command is already finished) is returned.
Example 2 The _buffer... command is issued, and the _pos command for which the query is to be
made is already finished.
Result The _pos command is no longer found, but the result was stored in the CommandId
buffer. The result is now either EXECUTED (command processing finished) or
ABORTED (command processing aborted).
The size of the CommandID buffer is limited and can be set, for example, for the axis with
configuration data item TypeOfAxis.DecodingConfig.NumberOfMaxBufferedCommandId.
Thus, you can notify the TO regarding the maximum number of commands it has to manage
simultaneously.
On the STOP-RUN transition, the buffered Command IDs will be deleted. The CommandID
buffer is then empty.
Example: see Asynchronous program execution (cyclic programming), Part 1 and Part 2.
The behavior of the "buffer and removeBuffer" commands is the same in all TOs that support
this functionality (exceptions: names of commands and name of the configuration data item
for the buffer size).
Note
The description applies analogously to the external encoder, as well.
Basic functions
Function Manual, 05/2009 81
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Note
With a project-wide unique identifier for the technology object instance, you can use the
predefined name space _project also for identifying the instance. This ensures compatibility
with projects created with an older SIMOTION SCOUT version (up to V3.2).
Basic functions
82 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Note
Other type conversions are not possible (for example, between a measuring input and
following object).
VAR
drv_axis1 : driveAxis;
pos_axis1 : posAxis;
any_obj1 : ANYOBJECT;
END_VAR
drv_axis1 := pos_axis1;
any_obj1 := fol_axis_real;...
Basic functions
Function Manual, 05/2009 83
Programming with Technology Objects
3.2 Programming technology objects (TOs)
VAR
drv_axis1 : driveAxis;
pos_axis1 : posAxis;
any_obj1 : ANYOBJECT;
END_VAR
//...
In the event of a failed type conversion, the value TO#NIL is assigned to the target variable:
VAR
pos_axis1 : posAxis;
any_obj1 : ANYOBJECT;
END_VAR
Basic functions
84 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Basic functions
Function Manual, 05/2009 85
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Note
For performance reasons, you should only access system variables when absolutely
necessary. Instead, save their contents in a local variable of the same data type. Local
variable accesses need much fewer resources because less processor time is used. For
more information, see Efficient programming.
Also note that a source of error can be comparing REAL variables, LREAL variables, and
system variables (for example, axis position) with each other, see Compare REAL or LREAL
variables.
Basic functions
86 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Replacement value or the last value of system variables at TO restart or where TO is deactivated
(V4.1 and higher)
The access to system variables is also possible at RESTART of the TO or at activated TO,
without the system going to STOP. Instead of reading out the system variables using the
_getSaveValue function, you can configure the following by means of an entry in the config
data (restart.behaviorInvalidSysvarAccess) to enable direct access:
● read last value (LAST_VALUE = default)
● Read default value (=value when loading the project; DEFAULT_VALUE)
● Go to STOP (STOP_DEVICE)
Basic functions
Function Manual, 05/2009 87
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Exceptions
Variables that deliver the current TO status, also return the correct status at RESTART. This
affects the system variable restartActivation, which you can access via _getSafeValue.
Note
TO system variables can be written to during a TO restart or where a TO is deactivated
(apart from STOP_DEVICE). The values will be applied or are effective after the RESTART.
If writing system variables exceeds the applicable limits, the CPU will go to STOP.
Note
System variables saved ONLINE cannot be saved with "Save to memory card (Ram2Rom)"
or "Save in the engineering project (load configuration data to PG)" is not possible.
So that values of system variables can also be saved in the engineering project and on
memory card the value of system variables must be changed OFFLINE and then loaded into
the target system per download and saved. See Storage concept in the target system.
Basic functions
88 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Depending on the configuration data item, the following options are available:
● Cannot be modified online:
These configuration data can only be modified during configuration of the technology
object with SIMOTION SCOUT.
● Can be modified online, effective after restart:
These configuration data can be changed by variable access from the user program. The
change does not take effect until the technology object is restarted (see Resetting a
technology object).
● Can be modified online, immediately effective:
These configuration data can be changed by variable access from the user program.
Change is immediately effective.
Note
If you make a change to configuration data which only takes effect after a TO restart,
subsequent changes to "effective immediately" configuration data will also only take effect
after the TO restart.
Note
Configuration data changed ONLINE can be saved on a memory card with "Copy current
data to RAM" and subsequent "Copy from RAM to ROM" or saved with "Load to PG" in
the engineering project. See Storage concept in the target system.
VAR
lreal_var : LREAL;
drive_var : driveaxis;
END_VAR
lreal_var :=
drive_var.setconfigdata.TypeOfAxis.MaxJerk.maximum;
// Read access to saved value
lreal_var :=
drive_var.activeconfigdata.TypeOfAxis.MaxJerk.maximum;
// Read access to value currently in effect
Basic functions
Function Manual, 05/2009 89
Programming with Technology Objects
3.2 Programming technology objects (TOs)
VAR
lreal_var : LREAL;
drive_var : driveaxis;
END_VAR
drive_var.setconfigdata.TypeOfAxis.MaxJerk.maximum :=
200000.0;
// Write access to saved value
Basic functions
90 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
NOTICE
When activationModeChangedConfigData:= ACTIVATE_CHANGED_CONFIG_DATA, it
takes a certain amount of time for a modified configuration data item to take effect after
it has been written.
In particular, when several configuration data are changed simultaneously, timeouts can
occur in the tasks. It is not possible to change configuration data in SynchronousTasks.
Note
If you want to change several configuration data at the same time, it is advisable to
collect them first with activationModeChangedConfigData =
COLLECT_CHANGED_CONFIG_DATA and then activate them as a body in a sequential
task using the ACTIVATE_CHANGED_CONFIG_DATA setting.
Config data changed at runtime can be saved on card and in the ES project, see Memory
access (Page 426).
Note
For access to configuration data from the user program, (e.g. in a general FB) that the
respective configuration data is also available depending on TO type.
Example
Vartemp
myPosAxis :posaxis;
End_Var
myPosAxis :=Pos[2]
Basic functions
Function Manual, 05/2009 91
Programming with Technology Objects
3.2 Programming technology objects (TOs)
myPosAxis.setconfigdata.TypeOfAxis.MaxJerk.maximum :=
200000.0;
Because you are accessing the axis directly via a reference, no further assignment is
necessary to access the value. You do not have to reassign pos[2] to myPosAxis.
Note
Config data can be written to during a TO restart or where a TO is deactivated (apart from
STOP_DEVICE). The values will be applied or are effective after the RESTART.
Replacement value or the last value of config data at TO restart or where TO is deactivated (V4.1 and
higher)
Config data can also be accessed when a RESTART of the TO is performed or where the
TO is deactivated without the system going to STOP. Instead of reading out the config data
using the _getSaveValue function, you can configure the following by means of an entry in
the config data (restart.behaviorInvalidSysvarAccess):
● Read out last value (LAST_VALUE = default)
● Read out default value (=value when loading the project; DEFAULT_VALUE)
● Go to STOP (STOP_DEVICE)
If writing config data exceeds the applicable limits, the CPU will go to STOP.
Basic functions
92 Function Manual, 05/2009
Programming with Technology Objects
3.2 Programming technology objects (TOs)
CAUTION
Resetting a technology object aborts the current motion without an error message.
To integrate configuration data that require a restart of the technology object, you must reset
the technology object. The procedure depends on the restart.restartActivationSetting
configuration data item of the technology object:
● For the setting restart.restartActivationSetting = RESTART_BY_COMMAND:
The technology object can only be restarted by means of the corresponding system
function (e.g. _restartAxis). To do so, set the parameter activateRestart =
ACTIVATE_RESTART.
● For the setting restart.restartActivationSetting=
RESTART_BY_SYSVAR_AND_COMMAND:
The restart can be performed in two ways:
– By calling the corresponding system function (e.g. _restartAxis). By setting parameter
activateRestart = ACTIVATE_RESTART.
– By assigning a value to the technology object system variable: restartActivation=
ACTIVATE_RESTART. The system variables are initialized, the technology object
loses all of its status information, such as axis homed.
The restart is always performed asynchronously. After a successful restart of the
technology object, this system variable has the value NO_RESTART_ACTIVATION.
NOTICE
To compile a project without errors, observe the rules governing the selection of
SIMOTION devices and technology packages in the following table!
You can also specify the technology package in the library's ST source files if you want (with
the USEPACKAGE command), however, this is not necessary.
Basic functions
Function Manual, 05/2009 93
Programming with Technology Objects
3.2 Programming technology objects (TOs)
Selection Description
Device-independent You must also select:
• The technology packages
• The version number of the selected technology packages
Note:
1. The library is compiled without reference to a SIMOTION device or a
version of the SIMOTION Kernel.
For this reason, the following must not be used:
– System functions of SIMOTION devices
– System variables of SIMOTION devices
– Version-dependent system functions
– Configuration data of technology objects
2. The library is compiled precisely to the version selected. The use of
system functions or variables which are not available in the selected
version will result in a compilation error.
3. If a device-independent library is to be made available for another version
it must be copied and inserted under a different name. This copy must be
recompiled with a different version reference.
SIMOTION device Only those technology packages are displayed that are available for all of the
including version selected devices.
(multiple selection Note:
possible)
1. The library is compiled for all of the selected devices and technology
packages (of the selected device versions).
2. The use of system functions or variables which are not available for one of
the selected devices, or the technology package of the respective device
version, will result in a compilation error.
3. The library can only be used for the selected devices and technology
packages. When you use the library in an ST source file, the following is
therefore checked:
– Whether the library is compiled for the SIMOTION device (including
version) that contains the importing ST source file.
– Whether the technology package set on the SIMOTION device and
specified in the ST source file with the USEPACKAGE command
corresponds to the one in the library.
Any inconsistencies will result in compilation errors.
Basic functions
94 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
Note
Message generation is another system feedback option. User-assigned messages can be
used in programs, e.g. if certain events occur (tank empty, etc.). For more information, see
Programming messages (Page 368).
Alarm configuration
You can define the system behavior for technological alarms in SIMOTION SCOUT (alarm
configuration). You can choose between:
● STOP: Transition to STOP mode (all system and user tasks are stopped.)
● STOP U: Transition to STOP U mode (only user program tasks are stopped.)
● START TechnologicalFaultTask: Starts the associated SystemInterruptTask
● NONE: No response
Each alarm has a default response. Details for the alarm configuration can be found at Error
handling for technology objects.
Basic functions
Function Manual, 05/2009 95
Programming with Technology Objects
3.3 Response to faults and events
When you select START TechnologicalFaultTask, you must assign a program to the
TechnologicalFaultTask that responds to the associated alarm.
Besides a configurable response to program execution, alarms also have a reaction in the
technology object (see SIMOTION Motion Control Technology Objects function manuals).
See also
Specifications for the configuring (Page 237)
Basic functions
96 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
Note
You can create an NaN or infinity from the corresponding bit pattern, e.g. with system
function DWORD_TO_REAL, BigByteArray_to_AnyType or LittleByteArray_to_AnyType.
NOTICE
When a floating-point number is displayed in the engineering system (e.g. in the symbol
browser of SIMOTION SCOUT), no distinction is made between a signaling and a quiet
NaN.
FPU exceptions
The operations with floating-point numbers are also implemented according to IEEE 754. If
any of the indicated errors for the operations below occur, an FPU exception will be
triggered:
● Any operation with a signaling NAN (NaNs).
● Addition: Both addends are infinity but have different signs.
● Subtraction: Minuend and subtrahend are infinity and have the same sign.
● Multiplication: One factor is 0 and the other is infinity.
● Division:
– Both operands are 0 or infinity.
– Divisor is 0.
● Modulo division (x MOD y): x = infinity or y = 0.
Basic functions
Function Manual, 05/2009 97
Programming with Technology Objects
3.3 Response to faults and events
Note
No error (no FPU exception) is triggered:
• For operations with quiet NaN (NaNq), if not mentioned explicitly above.
For example, the addition of a valid floating-point number to a quiet NaN (NaNs)
produces the same quiet NaN (NaNs).
• For operations with + infinity or - infinity, if not mentioned explicitly above.
For example, the addition of a valid floating-point number to + infinity produces +infinity
again.
Basic functions
98 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
3.3.4 Access errors to system variables and configuration data, as well as I/O variables
for direct access
This section describes the behavior when errors occur while accessing system variables,
configuration data or I/O variables with the usual methods (using the variable identifier in an
expression or variable assignment), see also Using Taskstartinfo (Page 102).
Basic functions
Function Manual, 05/2009 99
Programming with Technology Objects
3.3 Response to faults and events
See also
Configuration data (Page 88)
Basic functions
100 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
Function Manual, 05/2009 101
Programming with Technology Objects
3.3 Response to faults and events
Table 3- 25 Error response during process image update for CPU STOP response
Event Description
Error occurs 1. An incoming message is generated once.
2. If no program is linked to the PeripheralFaultTask, the SIMOTION
device goes to STOP mode, and the ShutdownTask is started.
3. Otherwise:
– The PeripheralFaultTask is started once immediately (rather than in
the next IPO cycle clock):
TSI#interruptId = _SC_IMAGE_UPDATE_FAILED.
TSI#logBaseAdrIn or TSI#logBaseAdrOut contains the address at
which the error occurred.
See Taskstartinfo (Page 102).
– Process input image: The value of the process image at the address
is not changed.
Process output image: Value will not take effect at the output with
the address until the output becomes available again.
– The cyclic task in which the error occurred is continued.
Error persists • No additional messages are generated.
• The PeripheralFaultTask is not restarted.
• Process input image: The value of the process image at the address is
not changed.
Process output image: Value will not take effect at the output with the
address until the output becomes available again.
Error disappears 1. An outgoing message is generated once.
2. The PeripheralFaultTask is started once immediately (rather than in the
next IPO cycle clock):
TSI#interruptId = _SC_IMAGE_UPDATE_OK, see Taskstartinfo
(Page 102).
3. The cyclic task is continued.
Basic functions
102 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
Function Manual, 05/2009 103
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
104 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
Function Manual, 05/2009 105
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
106 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
Function Manual, 05/2009 107
Programming with Technology Objects
3.3 Response to faults and events
• _SC_IMAGE_UPDATE_FAILED ( = 204)
Error during process image update (for DP slave: in connection
with station failure)
Additional information in the following TSI:
– TSI#logBaseAdrIn
– TSI#logBaseAdrOut
See Errors when generating the process image (Page 101).
• _SC_PC_INTERNAL_FAILURE ( = 205)
Error in local controller module
Additional information in the following TSI:
– TSI#details
Basic functions
108 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
Function Manual, 05/2009 109
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
110 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
Function Manual, 05/2009 111
Programming with Technology Objects
3.3 Response to faults and events
Basic functions
112 Function Manual, 05/2009
Programming with Technology Objects
3.3 Response to faults and events
PROGRAM TO_AlarmProg
VAR
dintVar : DINT;
dtVar : DT;
END_VAR;
dtVar:=TSI#startTime;
dintVar:=TSI#alarmNumber;
IF TSI#toInst = axis_1 THEN // from TO you have created
; // commands
END_IF;
IF TSIalarmNumber = 30002 THEN // Triggering alarm
; // commands
END_IF;
END_PROGRAM
For an additional example, refer to Evaluating in the user program (Page 127) .
Basic functions
Function Manual, 05/2009 113
Programming with Technology Objects
3.3 Response to faults and events
Process interrupts
Process interrupts are indicated using the TSI "_SC_PROCESS_INTERRUPT".
Once a module triggers a process interrupt, the interrupt is read out, the PeripheralFaultTask
is called and the interrupt is acknowledged. If a process interrupt of the same module occurs
again during this time, note the following:
● If the process interrupt occurs in the same channel that previously triggered a process
interrupt, then the relevant interrupt is lost.
● If the process interrupt occurs in a different channel of the same module, then no process
interrupt can be triggered at that moment. However, this interrupt is not lost, but rather is
triggered after the first active process interrupt has been acknowledged. The behavior is
analogous if a process interrupt is triggered:
– On another module of the same station
– On another module of another station
Basic functions
114 Function Manual, 05/2009
Error Handling in Technology Objects 4
4.1 Possible errors in technology objects
The following basic errors are possible in the programming of technology objects:
● The technology object itself cannot execute the function required by the application or
reports certain events or states:
→ A technological alarm is output.
You can find information on the individual alarms in the SIMOTION Reference Lists.
● The command issued to a technology object cannot be executed:
→ The return value of the command provides information about the cause.
You can find information on the return values of the commands in the SIMOTION
Reference Lists.
● Error while accessing configuration data, system variables or I/O variables
The ExecutionFaultTask is called in the event of errors when configuration data or
variables are being read or written
See also
Process Alarms (Page 115)
Return values of commands (Page 128)
Errors when accessing system data with _get/_setSafeValue (Page 130)
Effects of alarms
Technological alarms cause subsequent responses in the system. A distinction is made
between:
● Effects on the affected technology object itself: Local response
● Effects on other technology objects or the execution system: Global response
Basic functions
Function Manual, 05/2009 115
Error Handling in Technology Objects
4.2 Process Alarms
For each alarm, certain effects have a default setting. However, you can adapt these settings
to suit your requirements.
● By specifying the error activation, you can define whether the alarm is to be activated
immediately, after repeated occurrences of an error, or after a certain period of time.
● You can hide some alarms. This allows you, for example, to suppress unimportant
information.
Basic functions
116 Function Manual, 05/2009
Error Handling in Technology Objects
4.2 Process Alarms
See also
Local response (Page 117)
Global response (Page 117)
Error activation (Page 118)
Configure technological alarms (Page 120)
Displaying and acknowledging technological alarms (Page 122)
Acknowledging via the user program (Page 123)
Evaluating in the user program (Page 127)
Basic functions
Function Manual, 05/2009 117
Error Handling in Technology Objects
4.2 Process Alarms
The TechnologicalFaultTask is started. Programs assigned to this task are started. This
provides the user with the option of programming an application-specific response to the
TO alarm. If there is no program assigned to this task, the system switches to STOP
mode.
● STOP
The system switches to STOP mode. In this mode, all technology objects are inactive, the
user program is not executed, and all outputs are at zero. However, all system services
are still active, and user programs can be downloaded.
● STOPU
The system switches to STOPU mode. The program execution is terminated, the axis
enable and thus the position control is deactivated. The technology objects also remain
active and can still process requests for testing and commissioning functions. Otherwise,
identical to STOP mode.
Basic functions
118 Function Manual, 05/2009
Error Handling in Technology Objects
4.2 Process Alarms
Type
You can set the Type parameter to specify whether certain TO alarms are to be displayed. If
you select the Hidden setting, an alarm message is not displayed when this alarm occurs
and no entry is written to the diagnostics buffer. You can thereby prevent an overflow of the
alarm buffer when a particular technology alarm is issued frequently, or suppress a note
message that is not important to you.
Basic functions
Function Manual, 05/2009 119
Error Handling in Technology Objects
4.2 Process Alarms
2. In the combo box, select the technology object for which you want to configure alarms.
The alarms for the technology object are displayed.
Basic functions
120 Function Manual, 05/2009
Error Handling in Technology Objects
4.2 Process Alarms
3. Select the alarm for which you want to change the response.
4. Select the required response from the list for the corresponding technology object alarm.
The options available depend on the type of alarm.
Note
The technology object whose alarms you want to configure must already be configured.
The alarm configuration can be transferred to other technology objects via the corresponding
buttons in the Alarm configuration dialog (via export/import).
Note
So that all changes that you execute in the dialog Configuration:Technological alarms are
exported, the button Export remains inactive until you accept all changes with Accept.
Basic functions
Function Manual, 05/2009 121
Error Handling in Technology Objects
4.2 Process Alarms
Note
Because drive alarms usually generate technology object alarms as well, the drive alarms
are also deleted with the Acknowledge (TO) switch. If however the cause of a drive alarm
still exists then a new TO alarm will be triggered immediately. In this case first correct the
cause of the drive alarm.
Basic functions
122 Function Manual, 05/2009
Error Handling in Technology Objects
4.2 Process Alarms
UNIT ST_1;
INTERFACE
USEPACKAGE CAM;
PROGRAM EXAMPLE;
END_INTERFACE
IMPLEMENTATION
PROGRAM EXAMPLE
VAR
s_i_RetVal : DINT;
END_VAR;
(* Acknowledge all TO alarms *)
s_i_RetVal:= _resetTechnologicalErrors();
END_PROGRAM
END_IMPLEMENTATION
Basic functions
Function Manual, 05/2009 123
Error Handling in Technology Objects
4.2 Process Alarms
UNIT ST_1;
INTERFACE
USEPACKAGE CAM;
PROGRAM EXAMPLE;
END_INTERFACE
IMPLEMENTATION
PROGRAM EXAMPLE
VAR
s_i_RetVal : DINT;
END_VAR;
(* Acknowledge TO alarms ('ResetTOAlarms') *)
s_i_RetVal:= _resetAxisError(axis:=Axis_1);
s_i_RetVal:= _resetMeasuringInputError(
measuringInput:=MeasuringInput_1);
s_i_RetVal:= _resetOutputCamError(outputCam:=OutputCam_1);
END_PROGRAM
END_IMPLEMENTATION
Basic functions
124 Function Manual, 05/2009
Error Handling in Technology Objects
4.2 Process Alarms
Figure 4-4 MCC call: Acknowledge all alarms on a TO axis, TO measuringInput and TO outputCam
UNIT ST_1;
INTERFACE
USEPACKAGE CAM;
PROGRAM EXAMPLE;
END_INTERFACE
IMPLEMENTATION
PROGRAM EXAMPLE
VAR
s_i_RetVal : DINT;
END_VAR;
(* Acknowledge specific TO alarm ('ResetSingleTOAlarm') *)
s_i_RetVal := _resetAxisError(axis:=Axis_1,
errorResetMode:=SPECIFIC_ERROR,
errorNumber:=30002);
END_PROGRAM
END_IMPLEMENTATION
Basic functions
Function Manual, 05/2009 125
Error Handling in Technology Objects
4.2 Process Alarms
Note
In addition to troubleshooting the commands for reset have other effects on the TO as well.
Therefore, as a general rule, errors should be acknowledged with the _reset...Error
commands.
In contrast to the _reset...Error command, the _reset... commands also bring the respective
TO to a safe state. In addition to acknowledging the alarms, the following actions are
performed for each TO type:
● Stop the active commands
● Clear the command buffer
● Reset system variables (parameter userDefaultData)
● Execute a TO restart (parameter activateRestart)
In addition, actions dependent on the TO type are executed:
● Axes: Generate a braking ramp
● Output cam and cam track: Switch off the hardware output
● Cam: Delete the curve geometry
● Path object: Stop the path group
Call example: Resetting TO axis, TO measuringInput and TO outputCam
Basic functions
126 Function Manual, 05/2009
Error Handling in Technology Objects
4.2 Process Alarms
UNIT ST_1;
INTERFACE
USEPACKAGE CAM;
PROGRAM EXAMPLE;
END_INTERFACE
IMPLEMENTATION
PROGRAM EXAMPLE
VAR
s_i_RetVal : DINT;
END_VAR;
(* Reset object ('ResetObject') *)
s_i_RetVal := _resetAxis(axis:=Axis_1,
userDefaultData:=DO_NOT_CHANGE);
s_i_RetVal := _resetMeasuringInput(
measuringInput:=MeasuringInput_1,
userDefaultData:=DO_NOT_CHANGE);
s_i_RetVal:= _resetOutputCam(outputCam:=OutputCam_1,
userDefaultData:=DO_NOT_CHANGE);
END_PROGRAM
END_IMPLEMENTATION
Note
If you have not added any program to the TechnologicalFaultTask, the CPU will switch to
STOP mode if the task is called by an alarm.
Basic functions
Function Manual, 05/2009 127
Error Handling in Technology Objects
4.3 Return values of commands
Note: This sample program must be added to the TechnologicalFaultTask in the execution
system!
UNIT ST_1;
INTERFACE
USEPACKAGE CAM;
PROGRAM TO_AlarmProg;
END_INTERFACE
IMPLEMENTATION
PROGRAM TO_AlarmProg
VAR
s_i_Count : INT;
s_i_RetVal: DINT;
END_VAR;
Basic functions
128 Function Manual, 05/2009
Error Handling in Technology Objects
4.3 Return values of commands
Call example
If an error occurs when the _pos command is being executed, the g_bo_error variable is to
be set to true, the return value entered in the g_i_errornumber parameter and the block
aborted.
Note: This sample program must be added to a MotionTask in the execution system!
UNIT ST_1;
INTERFACE
USEPACKAGE CAM;
VAR_GLOBAL
g_bo_error: BOOL;
g_i_errornumber: DINT;
g_i_RetVal: DINT;
END_VAR
PROGRAM RETURN_VALUE;
END_INTERFACE
IMPLEMENTATION
PROGRAM RETURN_VALUE
Basic functions
Function Manual, 05/2009 129
Error Handling in Technology Objects
4.4 Errors when accessing system data with _get/_setSafeValue
Replacement value strategy and errors when accessing system variables, config data, and IO
variables
There are various situations in which the reading or writing of a system variable, a
configuration data item or an I/O variable can fail.
Basic functions
130 Function Manual, 05/2009
Error Handling in Technology Objects
4.4 Errors when accessing system data with _get/_setSafeValue
Table 4- 6 System response in the event of an error when using _setSafeValue - when writing a temporarily inaccessible
value
Table 4- 7 System response in the event of an error when using _setSafeValue - error when writing an invalid value
Basic functions
Function Manual, 05/2009 131
Error Handling in Technology Objects
4.4 Errors when accessing system data with _get/_setSafeValue
See also
System variables (Page 85)
_getSafeValue function (Page 329)
_setSafeValue function (Page 332)
_getInOutByte function (Page 335)
Configuration data (Page 88)
Basic functions
132 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks 5
5.1 Execution system
The SIMOTION execution system provides various execution levels.
● The execution levels are assigned user program tasks.
– The user tasks are assigned programs.
All programs - and thus also tasks - can contain PLC and motion control tasks.
The following execution levels are available:
● Synchronous execution levels: synchronous with control and interpolator cycle clocks
● Time-driven execution levels
● Event-driven execution levels
● Interrupt-controlled execution levels
● Sequential execution levels
● Free-running execution levels
Various tasks with different execution properties are available for specific tasks:
System tasks
System tasks are regularly executed by the system.
The system cycle clock can be specified.
The following tasks are executed by system tasks:
● Communication
System tasks for the connection to the isochronous PROFIBUS, to PROFINET IO with
IRT or the system cycle clock and for I/O processing.
● Motion control
– Base cycle clock/bus cycle clock
The bus cycle clock (DP cycle clock or PN cycle clock) is based on the cycle of the
isochronous bus and determines the time intervals for data exchange with the DP/PN
I/O. The base/bus cycle clock is used as the basis for setting further cycle clocks.
– Servo cycle clock
Among other things, position control and monitoring of axes, drive communication,
and I/O processing take place during the time slice of the servo cycle clock. The cycle
for the servo cycle clock determines the interval between two position control cycle
clocks. The servo cycle clock can be set as a multiple of the base/bus cycle clock. A
cycle clock ratio of 1:1 is recommended.
Basic functions
Function Manual, 05/2009 133
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
,32
,32
6(592
$F\FOLFGDWD )LHOGEXV
&\FOLFGDWD';
User programming
Execution levels for the task-related programming are available for the user programming
(user program tasks): Motion control, logic and technological functions.
See also
Specifications for the configuring (Page 237)
Basic functions
134 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
Execution levels
The following figure shows the execution levels with their tasks.
'FF$X['&&
GFFDX[
(YHQWFRQWUROOHG 6\VWHP,QWHUUXSW7DVNV
H[HFXWLRQOHYHOVWDVNV [[[)DXOW7DVN 6\VWHPDODUPV
)UHHO\UXQQLQJ
H[HFXWLRQOHYHOVWDVNV 6\VWHPWDVNV
5RXQG
%DFNJURXQG7DVN 0RWLRQ7DVNBQ
F\FOLFDQGVHTXHQWLDO URELQ
6\VWHPVWDUWXSVWRS 6WDUW
6WDUWXS7DVN 6KXWGRZQ7DVN (QG
$SSOLFDWLRQ
/HJHQG 6\VWHPWDVNV '&&WDVN 7HFKQRORJ\REMHFWV
8VHUSURJUDP
Figure 5-1 Execution levels and tasks in the SIMOTION runtime system
Basic functions
Function Manual, 05/2009 135
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
When you use technology packages, the execution levels provided by the system are
automatically assigned. The user program cannot influence the processing of technology
functions in these execution levels. System tasks are acyclic communication (Ethernet,
PROFIBUS DP. PROFINET IO), debug services or trace preprocessing, for example.
The DCC levels and tasks are not visible in the execution system in the SCOUT user
interface. The DCC plans are arranged in the DCC editor via execution groups, see
Description of the DCC editor.
The following example for the Axis technology object demonstrates how the system and user
program tasks interact with each other. At the end of cyclic data transmission, the
ServoSynchronousTask and ServoTask are started, followed by the IPOSynchronousTask
and IPOTask.
&RQWURO
,SR6\QFKURQRXV7DVN ,SR7DVN
,32
6HUYR6\QFKURQRXV7DVN 6HUYR7DVN
6(592
'DWDLQ 'DWDRXW
$F\FOLFGDWD )LHOGEXV
&\FOLFGDWD';
*OREDO&RQWURO
/HJHQG
$SSOLFDWLRQ
6\VWHPIXQFWLRQV 7HFKQRORJ\REMHFWV 8VHUSURJUDP
&\FOHFORFNVHWWLQJ'36HUYR,32
Tasks
One or more tasks are available in each execution level for user programming.
The main features of the tasks are:
● Start behavior: When and under what conditions a task is started. (refer to Table )
● Priority: Which task is interrupted by which other task. (refer to the table for the task
priorities in the next section)
The following table shows the tasks available for user programs.
Basic functions
136 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
Task Description
StartupTask The StartupTask is executed once at the transition from STOP or STOPU mode to
RUN mode. It is intended for initialization and resetting of technology objects.
Free-running tasks: In the round robin execution level, the MotionTasks and BackgroundTask are
executed by the system in the background in the time-slice procedure.
MotionTasks MotionTasks are intended for the programming of sequences, for programmed
motion control or other sequential executions.
MotionTasks are started by user programs and executed once.
BackgroundTask The BackgroundTask is provided for the programming of cyclic sequences without
a fixed time scale.
The BackgroundTask is started after system start-up and then executed cyclically
and free-running.
Time-driven tasks and synchronous Cyclic tasks. They are called cyclically in a certain time frame and are
tasks: automatically restarted after the execution of the assigned programs.
TimerInterruptTasks TimerInterruptTasks are intended for the periodical starting of programs.
SynchronousTasks SynchronousTasks are started periodically, synchronous with a specified system
cycle clock.
Event-driven tasks: Sequential tasks. They are started and executed once when an event occurs and
then terminated.
SystemInterruptTasks SystemInterruptTasks are started and executed once when a system event
occurs.
UserInterruptTasks UserInterruptTasks are started and executed once when a user-defined event
occurs.
ShutdownTask The ShutdownTask is executed once at the transition from RUN mode to STOP or
STOPU mode.
Note
In addition to the user program tasks, there are various system-internal tasks that the user
cannot influence.
The ControlPanelTask is such a system-internal task, for example. It is visible during the
task run times of the device diagnosis, but not in the execution system.
As of V4.1.2, the TaskTrace is also available. The SIMOTION Task Trace records the
sequence of the individual tasks, labels "user events" which you can generate using a
program command, and represents this graphically; see .
Basic functions
Function Manual, 05/2009 137
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
See also
StartupTask (Page 145)
MotionTasks (Page 147)
BackgroundTask (Page 151)
TimerInterruptTasks (Page 154)
SynchronousTasks (Page 158)
SystemInterruptTasks (Page 164)
UserInterruptTasks (Page 169)
ShutdownTask (Page 174)
Isochronous I/O processing on fieldbus systems (Page 203)
Basic functions
138 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
Execution system
The execution system with the execution levels and the assigned tasks are displayed here.
Function Meaning/Note
Open Use this to open the execution level configuration.
Expert
Set system cycle clocks Use this to set the ratio between the system cycle clocks (e.g.
between the interpolator cycle clock and the servo cycle clock)
depending on a parameterized isochronous operation at the
PROFIBUS or PROFINET interface.
Print Use this to print the contents of the execution system. All tasks with
the associated configuration are printed.
Print preview Use this to open the print preview for the execution system.
Basic functions
Function Manual, 05/2009 139
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
Basic functions
140 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
Priorities
The priority of a task cannot be changed by the user.
Note
Tasks run according to their priorities. Thus, higher priority tasks supersede lower priority
tasks.
Therefore, fluctuations of the cycle time can occur for lower priority tasks.
● TimerInterruptTasks:
The shorter a time slice, the higher its priority.
● UserInterruptTasks:
All tasks have the same priority and are executed in the order of their activation events.
● Wait for condition / WAITFORCONDITION temporarily increases the priority of a
MotionTask:
– The condition is checked with the same priority as for UserInterruptTasks.
– If the condition is satisfied, the MotionTask (that was previously pending) is
reactivated.
– The commands enclosed between WAITFORCONDITION and
ENDWAITFORCONDITION are executed with increased priority (between
SystemInterruptTasks and TimerInterruptTasks).
Further information on Wait for condition / WAITFORCONDITION can be found in the
SIMOTION MCC or SIMOTION ST programming manuals.
Basic functions
Function Manual, 05/2009 141
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
Note
The priorities of the execution levels or their tasks do not indicate the order in which the
MotionTasks, BackgroundTask and time-triggered tasks are started after RUN mode is
reached.
Basic functions
142 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
1 '331V\VWHP
,VRFKURQRXV
'331$6,&!EXV 1:n
FORFNLQJ
2 3 4 6HUYR
'331$6,&! 3$ 6HUYR6\QFKUR 3$ /RJDGGU!
VHUYRGFF 6\VWHPVHUYR 1:n
ORJDGGU LQ QRXV7DVN RXW '331$6,&
5 6 7 ,32
8VHU,QWHUUXSW ,SRGFF
3$ ,SR6\QFKURQRXV7DVN 3$ :DLWIRUFRQGLWLRQ 6\VWHP,32
FKHFN LQ RXW FKHFN
7LPHFDQEHVHWDVRI,32F\FOHFORFN
WULJJHUHGLQWKH,32F\FOHFORFN
,QDOOH[HFXWLRQOHYHOVHYHQWVFDQRFFXU
,32B
7KH7LPHU,QWHUUXSW7DVNVDUH
3$
LSRGFFB ,SR6\QFKURQRXV7DVNB 3$ 6\VWHP,32B
WKDWFDOOD6\VWHP,QWHUUXSW7DVN
LQ RXW
'FF$X[
GFFDX[
'HFUHDVLQJSULRULW\
'FF$X[B
GFFDX[B
6\VWHPDODUP
6\VWHP,QWHUUXSW7DVN 6\VWHP,QWHUUXSW7DVNQ ,QWKHRUGHURIHYHQWV
8
0RWLRQ7DVNQ
5RXQGURELQ
9
3$ 3$
10 ([HFXWLRQLQWKHUHPDLQLQJWLPHLQDFFRUGDQFH
LQ
%DFNJURXQG7DVN RXW 0RWLRQ7DVN 0RWLRQ7DVNQ &RPPXQLFDWLRQHWF ZLWKWKHURXQGURELQPHFKDQLVP
Basic functions
Function Manual, 05/2009 143
Execution System, Tasks, and System Cycle Clocks
5.1 Execution system
3. System servo:
System calculations in the servo cycle clock (position controller, etc.).
If all tasks of the servo level cannot be calculated in a single cycle (bus cycle clock), a
level overflow occurs and the system enters STOP mode, the start-up lock is set and a
corresponding entry is made in the diagnostic buffer. Only after a ramp-up (power on/off)
or download can the system return to RUN mode.
4. Log. addr. -> DP/PN-ASIC:
The I/O outputs are written to the communications chip.
5. UserInterrupt - Check:
The conditions of the two user interrupts are checked.
6. Wait for condition - Check:
The conditions for WAITFORCONDITION (wait for axis, wait for signal, etc.) are checked.
7. System IPO/IPO_2:
The system-side components of the IPO cycle clock are calculated (motion control:
Positioning profiles, synchronous operation, etc.).
8. MotionTask n:
A MotionTask that is waiting with a WAITFORCONDITION will be switched in preference
when the condition occurs (with higher priority).
9. BackgroundTask:
The BackgroundTask runs here.
The updating of the background process image (PI) is performed at the start and after
completion of the complete BackgroundTask.
The runtime model normally runs several times between the reading of the input image
and the writing of the output image. I.e. depending on the size of the user program, the
BackgroundTask is interrupted several times by higher priority tasks (starting with the
ServoTask).
10.Communication:
Communication functions (HMI, PG/PC, etc.).
See also
SynchronousTasks (Page 158)
BackgroundTask (Page 151)
Basic functions
144 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Description
You can monitor and, if required, change program instance data of programs that are used in
the execution system. This data includes the values of local variables that are normally not
monitored on the unit.
For example, you have used a function block several times in the execution system on
MotionTasks. You can then view the program instance data under every MotionTask in the
symbol browser of the execution system.
Note
If you have selected "Only create program instance data once" as the compiler setting,
the program instance data is no longer displayed. It is displayed locally on the unit.
5.2.1 StartupTask
The StartupTask is provided for the one-time initialization and the resetting of the technology
objects.
It is activated when the operating mode switches from STOP or STOPU to RUN.
It must not be used for process start-up or homing or for setting up axes (motion commands
must not be used).
While the StartupTask is being executed, no other user program tasks except for the
SystemInterruptTask and the UserInterruptTask are active.
Access to process image and symbolic I/O variables is restricted. The process image of the
inputs is updated before the startup task and remains constant for the duration of the startup
task. The process image of the outputs is set to zero before the startup task, and output after
the startup task. Direct accesses to inputs provide the current values. Write I/O variables can
be set to initial values. These values, however, act only after the startup task with the enable
of all outputs on the terminals.
Basic functions
Function Manual, 05/2009 145
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
When the StartupTask is completed, RUN mode has been reached. The following tasks are
now started:
● SynchronousTasks
● TimerInterruptTasks
● MotionTasks, in which the automatic start attribute is set
● BackgroundTask
Select the Program assignment tab to assign the created and compiled programs to the
StartupTask and define their execution sequence.
2. In the Program assignment tab, assign the required programs to this task and define the
execution sequence.
Basic functions
146 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
See also
Assigning programs to the execution levels/tasks (Page 176)
SystemInterruptTasks (Page 164)
5.2.2 MotionTasks
MotionTasks are intended for the programming of sequences, for programmed motion
control or other sequential executions.
Example for the sequential execution: An axis traverses to a target position, waits for an
enable signal, and then traverses to the next target position.
Several MotionTasks are available:
● Up to V3.2: 20 MotionTasks MotionTask_1 to MotionTask_20
● As of V4.0 only for D4xx and P350: 32 MotionTasks MotionTask_1 to MotionTask_32
The names of the MotionTasks can be changed, see below.
Basic functions
Function Manual, 05/2009 147
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Note
C230 and C240 devices only have 20 MotionTasks; all other CPUs (see above) have 32.
With the C230 and C240, the excess MotionTasks may be deleted. Once deleted, these
MotionTasks cannot be reinstalled.
MotionTasks and BackgroundTask share the free time apart from the higher-priority system
and user program tasks. The relationship of the time slices between both levels can be
parameterized, see Setting the time allocation (Page 196).
There is no fixed sequence of execution for MotionTasks and BackgroundTask.
Instructions for influencing the task execution are provided in Overview of the task control
commands (Page 254).
Starting a MotionTask
MotionTasks are usually controlled from the user program via task control commands such
as _startTaskID, _stopTaskID,, ... . With the corresponding configuration (set attribute), a
MotionTask starts automatically when the RUN mode has been reached. You can scan the
current task status using the _getStateOfTaskID system command.
A MotionTask does not have any time monitoring, i.e. once a MotionTask is started, it can
remain active for an indefinite period.
A MotionTask that waits for a synchronous command remains active with regard to its status.
Completing a MotionTask
A MotionTask is completed when the task has been completed or at the transition to the
STOP or STOPU mode (start of the ShutdownTask).
One way to automatically suspend the task is to use wait commands Wait for condition /
WAITFORCONDITION.
The task is suspended when the wait command is issued. The condition specified in the
command is checked in the IPO cycle clock. When the condition is fulfilled, the MotionTask
is automatically resumed. Depending on where you position the wait command, you can
influence the task priority when execution continues.
The commands (with MCC in the gray area behind the command) enclosed between
WAITFORCONDITION and ENDWAITFORCONDITION are executed with increased priority
(between SystemInterruptTasks and TimerInterruptTasks).
Select the Program assignment tab to assign the created and compiled programs to the
MotionTasks and define the execution sequence.
Basic functions
148 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
MotionTask Under MotionTask, select the MotionTasks you want to assign the
programs to. You can assign several programs to one MotionTask.
MotionTask_1 to Predefined names of the possible MotionTasks.
MotionTask_n
Use task in execution Activate the checkbox to display and use the task in the execution
system system. If the checkbox is deactivated, you cannot assign any programs
to this task.
Configuring MotionTasks
You can define which tasks are to be started automatically when the RUN mode is reached.
Otherwise MotionTasks must be explicitly started via programmed task control commands.
1. Click MotionTasks in the execution level tree.
2. Select the required task in the MotionTask list. The task names can be changed.
3. To do so click in the field MotionTask and enter a new name. Umlauts and special
characters are not permitted. The name is updated in the task list.
Basic functions
Function Manual, 05/2009 149
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
4. In the Program assignment tab, assign the required programs to this task and define the
execution sequence.
Field/Button Meaning/Note
Limits for dynamic data Enter the stack size for this task in bytes. When the programs assigned to
this task are executed, this size is made available for data in the stack.
The guide value is 16 KB for a task.
Activation after Select this if you want the MotionTask to start once when RUN mode is
StartupTask reached (StartupTask is completed).
Time allocation Clicking this button opens the screen form for time allocation in the round
robin execution level.
This is where you can parameterize the time allocated to MotionTasks
and BackgroundTasks in the round robin execution level.
Basic functions
150 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
Error reaction with Select the error reaction for errors that occur while processing programs.
program error Program errors are, for example, faulty operations with floating-point
numbers, division by zero, and overshooting array limits.
CPU to STOP The CPU switches to STOP mode and the ShutdownTask is started.
ExecutionFaultTask The ExecutionFaultTask is started. All programs assigned to this task are
started.
If no programs are assigned, the CPU switches to STOP mode. The task
in which the error occurred is terminated.
See also
BackgroundTask (Page 151)
Assigning programs to the execution levels/tasks (Page 176)
SystemInterruptTasks (Page 164)
Time allocation in the round robin execution level (Page 194)
Assigning programs to the tasks (Page 238)
5.2.3 BackgroundTask
The BackgroundTask is provided for the programming of cyclic sequences without a fixed
time frame.
It is executed cyclically in the round robin execution level, which means it will be
automatically restarted on completion.
The BackgroundTask is used in programs that have to be executed cyclically, e.g.
interlocking tasks, PLC tasks.
The cycle time of the BackgroundTask is monitored. When the cycle time monitoring
responds, the TimeFaultBackgroundTask is started. The CPU will switch to STOP mode if
the task is not configured or there is no program assigned to it.
The process image of the inputs and outputs is generated for the BackgroundTask in
address space 0.0 to 63.7. The process image remains consistent during the time the
BackgroundTask is being processed.
You can use the BackgroundTask to implement lower-priority, cyclical logic functions,
interlocks, calculations, monitoring functions.
The BackgroundTask shares available CPU time with the MotionTasks.
Note
The BackgroundTask shares computation time with MotionTasks and SystemTasks (e.g.
communication tasks). Relative to time allocation you must consider that the runtime, i.e. the
performance, is influenced by the settings (time allocation of the round robin execution level).
Basic functions
Function Manual, 05/2009 151
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
2. In the Program assignment tab, assign the required programs to this task and define the
execution sequence.
Basic functions
152 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
Limits for dynamic data Enter the stack size for this task in bytes. When the programs
assigned to this task are executed, this size is made available for
data in the stack. The guide value is 16 KB for a task.
Watchdog Specify the cycle time in ms for executing the BackgroundTask.
Enter a value for time monitoring. The time monitoring is inactive if
you enter 0 or no value.
Error reaction with program You can select the error reaction, if the cycle for the
error BackgroundTask is not terminated within the time frame specified
under Time monitoring. You can select and configure a
SystemInterrupt as error reaction.
TimeFaultBackgroundTask Timeout system interrupt in the BackgroundTask
Basic functions
Function Manual, 05/2009 153
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
CPU to Stop The CPU switches to STOP mode.
Time allocation Clicking this button opens the screen form for time allocation in the
round robin execution level.
This is where you can parameterize the time allocated to
MotionTasks and BackgroundTasks in the round robin execution
level.
Error reaction with program Select the error reaction for errors that occur while processing
error programs. Program errors are, for example, faulty operations with
floating-point numbers, division by zero, and overshooting array
limits.
CPU to Stop The CPU switches to STOP mode and the ShutdownTask is
started.
ExecutionFaultTask The ExecutionFaultTask is started. All programs assigned to this
task are started.
The CPU subsequently changes to STOP.
See also
MotionTasks (Page 147)
Assigning programs to the execution levels/tasks (Page 176)
Watchdog (Page 193)
Setting of the time allocation (Page 196)
SystemInterruptTasks (Page 164)
Time allocation in the round robin execution level (Page 194)
5.2.4 TimerInterruptTasks
TimerInterruptTasks are intended for the periodical starting of programs.
Five TimerInterruptTasks, i.e. TimerInterruptTask_1 to TimerInterruptTask_5, are available
for different time levels.
TimerInterruptTasks are periodically started and executed in the configured fixed time frame
(e.g. 100 ms).
This time frame must be a multiple of the interpolator cycle clock.
In this task, you can implement closed-loop control or monitoring functions that require a
reproducible time reference without a direct link to I/O or motion control of the axes.
Additional system and user tasks are provided for the TControl technology package. The
TControl technology package is processed in the system tasks, whereas the application-
specific adaptations are processed in the user program tasks.
You can find additional information in the functional description of the temperature controller,
refer to the Motion Control Additional Technology Objects Function Manual.
Basic functions
154 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Starting a TimerInterruptTask
TimerInterruptTasks are started periodically. A start delay can be set.
Completing a TimerInterruptTask
TimerInterruptTasks are completed automatically after completion of the programs assigned
to the TimerInterruptTask.
You can assign the created and compiled programs to the selected TimerInterruptTask and
define their execution sequence in the Program assignment tab.
You can set the following parameters:
Configuring TimerInterruptTasks
1. Click TimerInterruptTasks in the Execution Levels tree.
2. Select the required task in the For task selection box. The names (TimerInterruptTask_1
to TimerInterruptTask_5) are preset.
Basic functions
Function Manual, 05/2009 155
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
3. Select a Defined time level or enter an arbitrary integer value. This value must be an
integral multiple of the interpolator cycle clocks (IPO cycle clocks). Different settings are
rounded up to the next integral multiple of the IPO cycle clock.
4. In the Program assignment tab, assign the required programs to this task and define the
execution sequence.
Basic functions
156 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
See also
Assigning programs to the execution levels/tasks (Page 176)
Watchdog (Page 193)
SystemInterruptTasks (Page 164)
Basic functions
Function Manual, 05/2009 157
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
5.2.5 SynchronousTasks
SynchronousTasks are started synchronously to the specified system cycle clock on a
periodic basis. They run with high priority in the time-triggered execution level.
The following SynchronousTasks are available:
● ServoSynchronousTask (V4.0 and higher): Synchronous with the servo cycle clock
In the servo-synchronous task you can implement time-critical terminal - terminal
responses for I/O or fast influencing of setpoints on the servo level.
Isochronous I/O processing on PROFIBUS DP
Application, such as for fast terminal - terminal response. If a TO is configured for
execution in the servo cycle clock then TO and motion commands can also be issued.
● IPOSynchronousTask/IPOSynchronousTask_2: Synchronous with interpolator cycle clock
IPO/IPO_2
In IPO-synchronous tasks, you can implement time-critical functions that have a direct
effect on the functions of the technology object. The user program is executed prior to the
interpolator, i.e. the programmed functions can be effective in the same IPO cycle clock.
Application, e.g. for a fast start depending on the event, fast response to events terminal -
axis
Additionally, there are further SynchronousTasks for TControl:
● PWMsynchronousTask: Synchronous with the PWM cycle clock
● InputSynchronousTask_1/InputSynchronousTask_2: Synchronous with the Input1/2 cycle
clock before temperature control
● PostControlTask_1/PostControlTask_2: Synchronous with the Control1/2 cycle clock after
temperature control
You can assign the created and compiled programs to the selected SynchronousTask and
define their execution sequence in the Program assignment tab.
You can set the following parameters:
Field/Button Meaning/Note
For cycle clock level Use this to select the SynchronousTask to which you want to
assign the programs. You can assign several programs to one
SynchronousTask.
ServoSynchronousTask SynchronousTask which is started in the servo cycle clock
IPOSynchronousTask SynchronousTask which is started in the interpolator cycle clock
(IPO cycle clock).
IPOSynchronousTask_2 SynchronousTask which is started in the second interpolator cycle
clock (IPO2 cycle clock).
Basic functions
158 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
Use task in execution system Activate the checkbox to display and use the task in the execution
system. If the checkbox is deactivated, you cannot assign any
programs to this task.
ServoSynchronousTask
ServoSynchronousTasks are provided for applications in which fast processes are to be
implemented with the help of isochronous mode (V4.0 and higher).
ServoSynchronousTasks run within a servo cycle clock and behave similar to
IPOsynchronousTasks.
The ServoSynchronousTask is reasonable for:
● Fast responses (e.g for short terminal - terminal times for I/O processing)
● Influencing servo-effective system variables
Information on servo efficacy of the system variables is provided in the SIMOTION
reference list technology package CAM system variables.
● for motion commands if a TO (in exceptional cases) is configured for execution in the
servo cycle clock.
It is not reasonable for:
● Communication
● For motion commands if a TO is configured for execution in the IPO cycle clock (since
this is evaluated in the IPO cycle clock)
If a TO is configured for execution in the servo cycle clock then TO and motion commands
can also be issued.
The same characteristics apply as for the IPOSynchronousTask.
The ServoSynchronousTask can be configured in the execution system. (The cycle time of
the servo execution level is set with the servo). The default setting is active.
There is a process image available for the ServoSynchronousTask as for the other cyclic
tasks. This only results in an improved performance if the same I/O addresses are accessed
several times.
As of V4.1 the monitoring of the ServoSynchronousTask can also be set. In this way,
MOTION commands are also permitted in the ServoSynchronousTask, where the IPO share
is executed in the servo (all commands with the step enabling condition IMMEDIATELY).
You can set the following parameters:
Field/Button Meaning/Note
Limits for dynamic data Enter the stack size for this task in bytes. When the programs assigned
to this task are executed, this size is made available for data in the
stack. The guide value is 16 KB for a task.
Monitoring when executing You can select the error reaction if the ServoSynchronousTask is not
synchronous functions completed within the system cycle clock.
Basic functions
Function Manual, 05/2009 159
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
Suspend time Compatible with the functionality up to V4.0
monitoring and interrupt With synchronous functions, time monitoring is suspended and one
task servo cycle clock is lost - all old projects have this setting, too, if they
have been updated to V4.1 (CPU replacement).
Leave time monitoring Time monitoring is not suspended, i.e. the CPU goes to STOP with
active timeout when synchronous functions are called which really interrupt
the ServoSynchronousTask.
If overflows are tolerated, it might be possible to avoid STOP - this is
the default setting for newly created V3.2 CPUs.
Diagnostics buffer entry: "STOP by execution system, cause: Timeout".
CPU goes to STOP There is no synchronous function permitted. In the case of a
synchronous function, the CPU goes to STOP - even if the
ServoSynchronousTask is not interrupted in the specific case.
Diagnostics buffer entry: "Impermissible calling of a system/package
function".
Error reaction with program Select the error reaction for errors that occur while processing
error programs. Program errors are, for example, faulty operations with
floating-point numbers, division by zero, and overshooting array limits.
CPU to STOP The CPU switches to STOP mode and the ShutdownTask is started.
ExecutionFaultTask The ExecutionFaultTask is started. All programs assigned to this task
are started.
If no programs are assigned, the CPU switches to STOP mode. The
task in which the error occurred is terminated.
IPOSynchronousTask/IPOSynchronousTask_2
IPOSynchronousTasks are intended for applications that require, for example, fast and
deterministic responses or correction movements. Optimum time transfer of motion
commands to the motion control system is thus possible.
IPOsynchronousTasks run immediately before the interpolator within an IPO cycle clock.
Thus, commands in these tasks can directly affect the motion control.
The IPOSynchronousTask is started synchronously to the IPO cycle clock, whereas the
IPOSynchronousTask_2 is started synchronously to the IPO cycle clock 2, i.e. a reduced
IPO cycle clock.
The IPOSynchronousTask is executed prior to the internal IPOTask and
IPOsynchronousTask_2 is executed before IPOTask_2.
Basic functions
160 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Note
If a synchronous system function is called that suspends the IPOSynchronousTask, the
CPU will go into STOP mode with a diagnostic buffer entry (as of V3.2).
It is possible to configure whether time monitoring is to be performed.
Basic functions
Function Manual, 05/2009 161
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Configuring SynchronousTasks
1. Click the appropriate task in the Execution Level tree.
2. Select the required SynchronousTask in the For cycle clock level selection box.
3. In the Program assignment tab, assign the required programs to this task and define the
execution sequence.
Basic functions
162 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
Limits for dynamic data Enter the stack size for this task in bytes. When the programs assigned
to this task are executed, this size is made available for data in the
stack. The guide value is 16 KB for a task.
Number of IPO/IPO2 cycle Enter the number of tolerable level overflows in the IPO/IPO_2 cycle
clock overflows clock for the SynchronousTask. If the number of overflows is less than
the entered overflows, there will be no error reaction.
When arithmetic operations are processed, level overflows in the
IPO/IPO_2 cycle clock can occur that can be tolerated by the user for
the SynchronousTask and SynchronousTask_2 execution levels.
Execution level overflows may occur if:
• IPOSynchronousTask + IPO task > IPO cycle clock or
• IPOSynchronousTask_2 + IPO_2 task > IPO_2 cycle clock
This set tolerance level causes the next IPO cycle clock to be used for
terminating the arithmetic operation of the previous cycle clock without
triggering the set error reaction. When the set number of overflows is
exceeded, or if no tolerance has been set, an entry is made in the
diagnostic buffer and the error response (CPU to STOP with starting
lockout) results. A maximum of 5 execution level overflows can be set.
Monitoring when executing You can select the error reaction if the SynchronousTask is not
synchronous functions completed within the system cycle clock.
Suspend time Compatible with the functionality up to V3.1.1
monitoring and interrupt With synchronous functions, time monitoring is suspended and one
task IPO cycle clock is lost - all old projects have this setting, too, if they
have been updated to V3.2 (CPU replacement).
Leave time monitoring Time monitoring is not suspended, i.e. the CPU goes to STOP with
active timeout when synchronous functions are called which really interrupt
the IPOSynchronousTask.
If IPO overflows are tolerated, it might be possible to avoid STOP - this
is the default setting for newly created V3.2 CPUs.
Diagnostics buffer entry: "STOP by execution system, cause: Timeout".
Basic functions
Function Manual, 05/2009 163
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
CPU goes to STOP There is no synchronous function permitted. In the case of a
synchronous function, the CPU goes to STOP - even if the
IPOSynchronousTask is not interrupted in the concrete case.
Diagnostics buffer entry: "Impermissible calling of a system/package
function".
The behavior applies to the IPOsynchronousTask,
IPOsynchronousTask_2 and PWMTask.
Task / cycle clock Here you select the duration for the specified task as a percentage of
the cycle clock (e.g. IPOsynchronousTask / IPO cycle clock). If the task
requires more time than set here, the system will respond according to
the settings in error reaction.
To configure the system cycle clocks, select the CPU in the project
navigator and select Target system > Expert > Set system cycle clocks
in the menu.
25%: The maximum duration of the task is 25% of the cycle clock.
50%: The maximum duration of the task is 50% of the cycle clock.
75%: The maximum duration of the task is 75% of the cycle clock.
Error reaction with program Select the error reaction for errors that occur while processing
error programs. Program errors are, for example, faulty operations with
floating-point numbers, division by zero, and overshooting array limits.
CPU to STOP The CPU switches to STOP mode and the ShutdownTask is started.
ExecutionFaultTask The ExecutionFaultTask is started. All programs assigned to this task
are started.
If no programs are assigned, the CPU switches to STOP mode. The
task in which the error occurred is terminated.
See also
Isochronous I/O processing on fieldbus systems (Page 203)
Timeouts and level overflows (Page 190)
Assigning programs to the execution levels/tasks (Page 176)
Sequence model for DCC blocks (DCB) (Page 216)
5.2.6 SystemInterruptTasks
SystemInterruptTasks are started and executed once when a system event occurs.
The following SystemInterruptTasks are available:
● TimeFaultTask: starts in the event of a TimerInterruptTask timeout
● TimeFaultBackgroundTask: starts in the event of a BackgroundTask timeout
● TechnologicalFaultTask: starts in the event of an error on a technology object
● PeripheralFaultTask: starts in the event of an error on the I/O
● ExecutionFaultTask: starts in the event of an error when executing a program
Basic functions
164 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Starting a SystemInterruptTask
A SystemInterruptTask is started automatically after the set event has occurred.
If an event that triggers a SystemInterruptTask occurs, the SystemInterruptTask must be
used in the execution system, and a program must be assigned to this task; otherwise, the
CPU switches to STOP mode.
Up to 8 different interrupts can be stored in the buffer. If another interrupt occurs, the buffer
overflows and the CPU goes into STOP mode, too.
The events that caused a SystemInterruptTask to be called can be queried using the
associated TaskStartInfo for this task and are described under Using Taskstartinfo
(Page 102).
Completing a SystemInterruptTask
A SysteminterruptTask is completed automatically after completion of the programs assigned
to the SystemInterruptTasks.
You can assign the created and compiled programs to the selected SystemInterruptTask and
define their execution sequence in the Program assignment tab.
You can set the following parameters:
Field/Button Meaning/Note
For task Use this to select one of the SystemInterruptTasks to which you
want to assign the programs. You can assign several programs
to one SystemInterruptTask.
ExecutionFaultTask Program processing error, for example, division by zero.
PeripheralFaultTask I/O alarms such as process alarms, diagnostic alarms, removing
and inserting modules.
TechnologicalFaultTask Technological alarms such as alarms, warnings and notes.
TimeFaultBackgroundTask Timeout in the BackgroundTask.
TimeFaultTask Timeouts, for example in the SynchronousTasks,
TimerInterruptTasks, system runtime and cycle time.
Alarm configuration This displays the window for the configuration of the
technological alarms. You can configure the alarm response to
a technological alarm for the SystemInterruptTasks.
Use task in execution system Activate the checkbox to display and use the task in the
execution system. If the checkbox is deactivated, you cannot
assign any programs to this task.
TimeFaultTask
The TimeFaultTask is started when the time monitoring of a TimerInterruptTask responds.
The CPU will switch to STOP mode if the TimeFaultTask is not configured or there is no
program assigned to it.
In the TimeFaultTask, you can program the response to timeouts of TimerInterruptTasks.
For additional information, see Using Taskstartinfo (Page 102)).
Basic functions
Function Manual, 05/2009 165
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
TimeFaultBackgroundTask
The TimeFaultBackgroundTask is started when the time monitoring of the BackgroundTask
responds. The CPU will switch to STOP mode if the TimeFaultBackgroundTask is not
configured or there is no program assigned to it.
In the TimeFaultBackgroundTask, you can program how timeouts of BackgroundTasks are
handled.
TechnologicalFaultTask
The TechnologicalFaultTask is started when the technology package generates an alarm or
information message. The CPU will switch to STOP mode if the TechnologicalFaultTask is
not configured or there is no program assigned to it.
Generally, alarm messages have a direct effect on the behavior of the technology package
and must be acknowledged before technology functions can be activated again.
In the TechnologicalFaultTask you can, for example, acknowledge errors directly and/or
initiate further responses with respect to the sequence of operations on the machine.
For additional information, see Using Taskstartinfo (Page 102)).
PeripheralFaultTask
The PeripheralFaultTask is started immediately in accordance with its priority for I/O access
errors.
I/O access errors can occur, for example, when the load voltage supply for the I/O module
fails or other errors occur on the I/O module.
For further information, refer to the descriptions of the I/O modules.
The task for which an error occurred during its I/O access, will not be terminated.
The CPU will switch to STOP mode if the PeripheralFaultTask is not configured or there is
no program assigned to it.
For additional information, see Using Taskstartinfo (Page 102))."
ExecutionFaultTask
The ExecutionFaultTask is started immediately in accordance with its priority for program run
errors.
Examples of program run errors:
● Faulty operations with floating point numbers, such as logarithms of negative numbers,
invalid numbers, etc.
● Division by zero
● Violation of array limits
● Error while accessing system variables
The task in which the error occurred is terminated.
The CPU will switch to STOP mode if the ExecutionFaultTask is not configured or there is no
program assigned to it.
Basic functions
166 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
The CPU to STOP error response is possible for all tasks and starts the ShutdownTask. The
SIMOTION device switches to STOP mode.
An error reaction for the ExecutionFaultTask restarts the ExecutionFaultTask.
The following tasks can be restarted by commands in the program of the
ExecutionFaultTask:
● StartupTask
● ShutdownTask
● MotionTasks
For the following tasks, the SIMOTION device switches to STOP mode once the
ExecutionFaultTask is completed and the ShutdownTask is started:
● BackgroundTask
● TimerInterruptTasks
● SynchronousTasks
For additional information, see Using Taskstartinfo (Page 102)).
Note
Program errors in the ExecutionFaultTask and in the ShutdownTask switch the system to
STOP mode immediately.
Configuring SystemInterruptTasks
1. Click SystemInterruptTasks in the Execution Levels tree.
2. Select one of the specified tasks in the For task selection box.
Basic functions
Function Manual, 05/2009 167
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
3. In the Program assignment tab, assign the required programs to this task and define the
execution sequence.
Field/Button Meaning/Note
Limits for dynamic data Enter the stack size for this task in bytes. When the programs
assigned to this task are executed, this size is made available for
data in the stack. The guide value is 16 KB for a task.
Error reaction with program Select the error reaction if errors occur while processing programs.
error Program errors are, for example, faulty operations with floating-point
numbers, division by zero and overshooting array limits.
CPU to STOP The CPU switches to STOP mode and the ShutdownTask is started.
ExecutionFaultTask The ExecutionFaultTask is started. All programs assigned to this
task are started.
If there are no programs assigned, the CPU switches to STOP
mode. The task in which the error occurred is terminated.
See also
Information on starting a task: TaskStartInfo (TSI) (Page 192)
Basic functions
168 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
5.2.7 UserInterruptTasks
UserInterruptTasks are intended for user-defined actions.
Two UserInterruptTasks are available: UserInterruptTask_1 and UserInterruptTask_2.
A defined condition must be specified for the UserInterruptTask. Each time the condition is
fulfilled, the UserInterruptTask is started.
If you want to use a UserInterruptTask, the IPOsynchronousTask must be used in the
execution system.
UserInterruptTasks are not active during a StartupTask and a ShutDownTask.
Starting a UserInterruptTask
UserInterruptTasks are started automatically as soon as the user-defined interrupt condition
is fulfilled. The interrupt condition is checked in the interpolator cycle clock.
If both UserInterruptTasks are started at the same time, UserInterruptTask_1 is processed
before UserInterruptTask_2.
Note
If a user-defined interrupt occurs during shutdown, the UserInterruptTask is not started
anymore.
During shutdown (ShutdownTask), starting the UserInterruptTask is only possible using the
_startTask() command.
Completing a UserInterruptTask
UserInterruptTasks are completed automatically after completion of the programs assigned
to the UserInterruptTask.
You can assign the created and compiled programs to the selected UserInterruptTask and
define their execution sequence in the Program assignment tab.
You can set the following parameters:
Field/Button Meaning/Note
For task Use this to select one of the two UserInterruptTasks to which you want to
assign the programs. You can assign several programs to one
UserInterruptTask.
UserInterruptTask_1 Predefined names of the UserInterruptTask.
and
UserInterruptTask_2
Basic functions
Function Manual, 05/2009 169
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
Field/Button Meaning/Note
Defined condition Here you define the condition for the selected UserInterruptTask
according to IEC 61131. During operation, the specified condition is
checked in the interpolator cycle clock. If the condition is fulfilled, the
UserInterruptTask is started with the assigned programs. You enter the
condition in the input field by using the symbol browser (variables via
drag and drop) and the Command library tab in the project navigator
(operators via drag and drop).
Only simple conditions (logic operations of inputs and local CPU
variables) and Boolean variables are permissible.
Use task in execution Activate the checkbox to display and use the task in the execution
system system. If the checkbox is deactivated, you cannot assign any programs
to this task.
Configuring UserInterruptTasks
1. Click UserInterruptTasks in the Execution Levels tree.
2. Select a UserInterruptTask in the For task selection box.
3. Specify the condition for starting this task.
Basic functions
170 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
4. In the Program assignment tab, assign the required programs to this task and define the
execution sequence.
Basic functions
Function Manual, 05/2009 171
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
You enter the condition for starting a UserInterruptTask as a formula according to IEC 61131
(Structured Text). You can use the following variables:
● Global device variables
● Unit variables in an ST/MCC or LAD/FBD source file
SIMOTION SCOUT helps you create the formula.
To formulate a condition for starting the UserInterruptTask:
1. Under For task select the UserInterrupt for which you want to define the start condition.
2. Take the required operators from the Command library tab and insert them in the Defined
condition text field using drag and drop.
Alternatively, you can enter the operators directly in the text field.
3. Take the operands from the symbol browser and insert them in the Defined condition text
field using drag and drop or copy and paste. Alternatively, you can enter the operands
directly in the text field.
Creating conditions with the command library
Basic functions
172 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
The Command library tab contains a list of mathematical operations and functions. You can
use these to create conditions.
To open the individual operations, click the plus sign in front of the folders. You can drag the
operators to the required text field via drag and drop. You can use these commands, for
example, to define conditions.
Field/Button Meaning/Note
Limits for dynamic data Enter the stack size for this task in bytes. When the programs assigned
to this task are executed, this size is made available for data in the
stack. The guide value is 16 KB for a task.
Error reaction with program Select the error reaction for errors that occur while processing
error programs. Program errors are, for example, faulty operations with
floating-point numbers, division by zero, and overshooting array limits.
CPU to STOP The CPU switches to STOP mode and the ShutdownTask is started.
ExecutionFaultTask The ExecutionFaultTask is started. All programs assigned to this task
are started.
If no programs are assigned, the CPU switches to STOP mode. The
task in which the error occurred is terminated.
Basic functions
Function Manual, 05/2009 173
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
See also
Assigning programs to the execution levels/tasks (Page 176)
5.2.8 ShutdownTask
The ShutdownTask is intended for selective intervention in the transition from RUN to
STOPU/STOP mode or for programming stop sequences with a preassigned braking ramp,
e.g. selected setting of outputs, defined shutdown of axes.
The ShutdownTask is not called in the case of a power failure.
The time monitoring must be specified in the Task configuration for the ShutdownTask: You
can configure the maximum duration for the execution of the ShutdownTask; 0 ms = no
monitoring. After this time, the CPU switches to STOP mode.
The I/O can be accessed directly in the ShutdownTask. Access to process image and
symbolic I/O variables is restricted. It is not practical to access the I/O by means of the
process image, as the process image is no longer being updated.
For additional information, see SIMOTION ST Structured Text, "Access to inputs and outputs
(process image, I/O variables)"
Select the Program assignment tab to assign the created and compiled programs to the
ShutdownTask and define their execution sequence.
Note
Program errors in the ExecutionFaultTask and in the ShutdownTask switch the system to
STOP mode immediately.
Basic functions
174 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.2 Description of the user program tasks
2. In the Program assignment tab, assign the required programs to this task and define the
execution sequence.
Basic functions
Function Manual, 05/2009 175
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Field/Button Meaning/Note
Limits for dynamic data Enter the stack size for this task in bytes. When the programs assigned
to this task are executed, this size is made available for data in the
stack. The guide value is 16 KB for a task.
Watchdog Specify the cycle time in ms for executing the ShutdownTask. Enter a
value for time monitoring. The time monitoring is inactive if you enter 0
or no value.
Error reaction to program Select the error reaction for errors that occur while processing
error programs. Program errors are, for example, faulty operations with
floating-point numbers, division by zero, and overshooting array limits.
CPU to STOP The CPU switches to STOP mode.
See also
Assigning programs to the execution levels/tasks (Page 176)
Watchdog (Page 193)
Basic functions
176 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Note
DCC tasks are assigned via the DCC editor, see the description of the DCC editor
andSequence model for DCC blocks (DCB) (Page 216).
Field/Button Meaning/Note
Programs A list of all compiled programs that are available in the project is displayed
here. Non-compiled programs are not displayed. The number after the
program name indicates how often the program has been assigned to the
different tasks of the execution levels. MCC charts and LAD/FBD programs
are displayed immediately after entering as long as they have been entered
as "exportable".
Assign Use this to assign selected programs to the task. Mark the program in the
Programs list and click on the Arrow button. The program is assigned to the
task and is displayed in the task list.
Removing Use this to remove programs assigned to a task. Mark the program in the
Task list and click on the corresponding Arrow button. The program is
removed from the task.
Task A list of all programs assigned to this task is displayed here. The sequence
of the programs in the list corresponds to the execution sequence when the
program is executed. The program at the top of the list is executed first.
Basic functions
Function Manual, 05/2009 177
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Field/Button Meaning/Note
Arrow up Use the arrow up to move the selected program up one position within the
task. In this way you can determine the order of program execution within
the task.
Arrow down Use the arrow up to move the selected program down one position within
the task. In this way you can determine the order of program execution
within the task.
In the left-hand pane of the window, you can see the execution levels tree. It displays as
entries the execution levels / tasks for which Use task in execution level has been clicked.
The OperationLevels folder contains the tasks that are available in the RUN mode.
Basic functions
178 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
The list below each execution level or task name shows the configured tasks and the
programs assigned to them.
1. Select the task to be configured.
2. Select the Program assignment tab.
The left-hand list box lists all available programs (ST programs, MCC charts and
LAD/FBD with Task creation type).
3. Select the programs in the list box on the left that you want to assign to the task.
4. Click .
The assigned programs are listed in the right-hand list box.
They are still listed in the left-hand list box. You can assign programs to several tasks.
The number of assignments made appears in brackets.
5. Select the Task configuration tab and make any additional settings, such as:
– Error reaction with program error
– Time watchdogs for cyclic tasks
– Start behavior of MotionTasks
After you have assigned a program to one or more tasks, you can establish the connection
to the target system, download the project to the target system, and start it.
Basic functions
Function Manual, 05/2009 179
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Task names
The names of the MotionTasks can be changed.
Task control
The MCC, ST and LAD/FBD programming languages provide several commands for the task
control (e.g. start, stop, etc.).
See SIMOTION MCC, SIMOTION ST and SIMOTION LAD/FBD Programming Manual
These programming guides also provide information about how to use these task control
commands and several examples.
Stack size
In SIMOTION SCOUT as of V3.0, the stack size (limit for dynamic data) of the associated
task can be set in the Task configuration tab of the Task Configuration window. A default
value is specified for each task.
For more information, refer to the SIMOTION ST Programming Manual, "Setting the size of
the local data stack"
See also
Task priorities (Page 140)
Basic functions
180 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Basic functions
Function Manual, 05/2009 181
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Note
The reduction ratio between the bus and servo cycle clocks must also be set on the
drive as master application cycle. This setting is necessary to enable reciprocal sign-
of-life monitoring. For further information, refer to the drive descriptions.
Basic functions
182 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Note
The settings of the system cycle clocks affect the system operating sequence
considerably. You must therefore exercise caution when making these settings.
Basic functions
Function Manual, 05/2009 183
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
2. Specify the basic/bus cycle clock (only if the isochronous mode is not configured). The
bus cycle clock is specified in HW Config for the equidistant bus.
Possible values: 1.0 ... 8.0 ms for PROFIBUS
Possible values for PROFINET:
– As of V4.0 of SIMOTION P with PROFINET and SIMOTION D445: 0.5 ... 4.0 ms
– As of V4.1 for SIMOTION P with PROFINET: 0.25 ms to 4 ms.
The bus cycle time for PROFIBUS must be an integer multiple of 0.125 ms, or of 0.25 ms
for the C2xx.
The bus cycle time for PROFINET must be an integer multiple of 0.125 ms. Change the
value in HW Config if this is not the case.
3. Specify the ratio between the cycle clocks.
Note
If the basic/bus cycle clock has been set too small for a large hardware configuration, this
can result in the CPU not switching to the RUN mode. In this case, note the entries in the
diagnostics buffer for timeouts.
DCC
The entries for DCC are displayed as soon as a chart has been added under programs. DCC
charts are started automatically when the appropriate task is started.
Basic functions
184 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Figure 5-26 Setting of the system cycle clocks for TControl in SCOUT
Basic functions
Function Manual, 05/2009 185
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Field/Button Meaning/Note
Cycle clock ratios
Basic cycle clock or The base cycle clock is the basic cycle clock if no isochronous
bus cycle clock DP/PN interfaces have been parameterized in HW Config. The
"bus cycle clock" cannot be set in this dialog box if the "Equidistant
bus cycle" setting is activated. The "bus cycle clock" is set in HW
Config. This means the equidistant bus cycle forms the basic cycle
clock for the system cycle clocks. The basic/bus cycle clock (DP
cycle clock or PN cycle clock) is used as a basis for setting further
tasks.
Servo / T1(DCC) You can set an integral ratio between the servo cycle clock and
bus cycle clock here.
Among others, the position control of the axes is calculated in this
cycle clock.
Normally the factor 1 should be used. If you set the factor 2,
although the dynamic performance of the controller will
deteriorate, more computing time will be available for processing
other tasks.
The reduction ratio between the bus cycle clock and the servo
cycle clock must also be set as "master application cycle" for the
drive. This setting is necessary to enable reciprocal sign-of-life
monitoring. For further information, refer to the drive descriptions.
If isochronous mode is not configured, the default setting for the
basic time to servo cycle clock ratio is 1:1. It cannot be changed
then!
PROFIBUS DP: The servo cycle clock can be operated at a ratio
of 1:1, 1:2, 1:3, and 1:4.
PROFINET IO: The servo cycle clock can be operated at a ratio of
1:1, 1:2, 1:3, 1:4, 1:6, 1:8, 1:10, 1:12, 1:14 and 1:16.
Ipo / T2(DCC) You can set an integral ratio between the IPO cycle clock and
servo cycle clock here.
As standard, the motion control of the axes will be calculated in
the interpolator cycle clock. The interpolator cycle clock factor is
used to determine how fast the drive setpoints are calculated.
Ipo2 / T3(DCC) You can set an integral ratio between the IPO_2 cycle clock and
IPO cycle clock here.
The interpolator cycle clock 2 is used for the motion control of low-
priority axes. The factor is used to determine how fast the
setpoints of the low-priority drives are calculated.
DCCAux (DCC) You can set an integer ratio between the DCCAux DCC cycle
clock and T3(DCC) DCC cycle clock here.
DCCAux_2(DCC) You can set an integral ratio between the DCCAux_2 DCC cycle
clock and DCCAux DCC bus cycle clock here.
TControl Click the arrow to open the configuration of the system tasks for
the TP TControl. There, you can set the ratio of the cycle clocks
for the task of the temperature channels to the servo cycle clock.
Basic functions
186 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Field/Button Meaning/Note
Use system tasks for Activate the checkbox if the special tasks for the temperature
TControl channels in the execution system should be displayed. If you have
not configured a temperature channel, you should deactivate the
system tasks for TControl as they require unnecessary
computation time.
Servo cycle clock The servo cycle clock is displayed here for information purposes.
(master application cycle) To change this, you must select the value further up in the dialog
box. All other cycle clocks of the temperature channel are a
multiple of the servo cycle clock.
PWM (Pulse Width Cycle clock which is used for the actuating signal output of the
Modulation) temperature channel. Specifies the basic cycle clock for further
cycle clocks. Select the cycle clock in ms or in Hz. If you select
Hz, the ratios to the input cycle clock and the control cycle clock
are specified automatically.
Input1/2 Cycle clock which is used for the actual value measurement of the
temperature channel. Select the ratio of this cycle clock to the
PWM cycle clock. The duration is displayed in the grayed-out field.
Control1/2 Cycle clock which is used for the closed-loop control of the
temperature channel. Select the ratio of this cycle clock to the
input cycle clock. The duration is displayed in the grayed-out field.
Network settings
Network settings at the DP Indicates whether isochronous mode was configured on the
master submodule X9 PROFIBUS interface. This display is for information purposes
only.
Isochronous bus cycle Isochronous operation parameterized on the PROFIBUS interface.
activated
Isochronous bus cycle not Isochronous operation not parameterized on the PROFIBUS
activated interface.
Isochronous bus cycle Displays the fieldbus cycle in ms if isochronous mode was
configured for the fieldbus interface. This display is for information
purposes only and corresponds to the isochronous mode
calculated in HW Config.
Basic functions
Function Manual, 05/2009 187
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Assign the interpolator cycle clock 2 to the axis and external encoder technology objects with
lower-priority tasks, and assign the IPO cycle clock or the interpolator cycle clock 2 to the
output cam and the measuring input technology objects.
Assign the interpolator cycle clock or the servo cycle clock to the technology objects with
high-priority tasks.
You can assign the following cycle clocks to the technology objects:
Basic functions
188 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
W W 7DVNUXQWLPHV,32
,32 WW
(IIHFWLYHWDVNUXQWLPH,32
Figure 5-27 Representation of the Taskruntime and effectiveTaskruntime (cycle clock ratio IPO1 :
IPO2 = 2)
Legend:
Servo: Servo cycle clock
IS1: IPOSynchronousTask
IS2: IPOSynchronousTask_2
IPO1: IPOTask
IPO2: IPOTask2
The following table shows the tasks and the levels for which a Taskruntime (tasks) and an
effective Taskruntime (levels) can be determined.
Basic functions
Function Manual, 05/2009 189
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
Note
To determine the task runtimes, the system variable taskRuntimeMonitoring must be set to
enable.
The task runtimes are also shown in the SCOUT device diagnostics.
See also
Functions for runtime measurement of tasks - overview (Page 269)
Optimizing the execution system (Page 462)
Efficient programming - overview (Page 460)
Timeout
You can configure maximum execution cycles for the execution levels BackgroundTask,
TimerInterruptTask, SynchronousTasks and ShutdownTask.
If the set maximum duration is exceeded, the associated SystemInterruptTask
(TimeFaultTask or BackgroundFaultTask) or a standard function (e.g. CPU to STOP) can be
called up.
Level overflow
A toleration of level overflows can be set for the execution levels IPOSynchronousTask and
IPOSynchronousTask_2.
A level overflow occurs when a level (IPOTask/IPOSynchronousTask or
IPOTask2/IPOSynchronousTask_2) has not been executed within the set system cycle
clock, IPO or IPO_2.
Note
A cyclic user task (IpoSync, Ipo2Sync) must be finished within its cycle.
A task overflow caused by a failed start attempt of a lower priority task produces an entry in
the diagnostic buffer.
Basic functions
190 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
With a set tolerance, the next IPO cycle clock is used in order to:
● Complete the computing process of the previous cycle clock without triggering the set
error reaction.
● Start the computing process of the current cycle clock.
If another level overflow occurs in the next level cycle (if no tolerance is set or the number
has been exceeded), the CPU is set to STOP in order to prevent a blockade of the entire
system. This results in an entry in the diagnostic buffer and the error reaction (CPU to
STOP) with starting lockout.
You can set a maximum of 5 level overflows to be tolerated in the task configuration in the
execution system.
Examples
The following are examples of the execution relationships for level overflows:
6HUYR 6HUYR
6HUYR 6HUYR
High-performance programming
If level overflows occur, but it is not possible to increase the DP/servo cycle clock, the
following measures can be taken:
● In task configuration for IPOSynchronousTask
Ratio of IPOSynchronousTask : IPO cycle clock = 75%
Tolerate two IPO overflows
● Use optimized PROFIBUS
User-defined profile: HSA=2 (highest PROFIBUS address)
with, for example, two nodes on the PROFIBUS, RetryLimit = 1, switch off cyclic
distribution of the bus parameters (then, however, a PG can no longer be connected to
the isochronous PROFIBUS)
Basic functions
Function Manual, 05/2009 191
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
See also
SynchronousTasks (Page 158)
Task runtimes (Page 188)
Basic functions
192 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.3 Configure execution system
See also
Using Taskstartinfo (Page 102)
5.3.8 Watchdog
The maximum duration for the execution of a task (cycle time) can be configured. If this time
is exceeded, the associated SystemInterruptTask (TimeFaultTask or
TimeFaultBackgroundTask) or the response CPU to STOP mode can be called.
The cycle time monitoring can be activated for the following tasks:
● BackgroundTask
● TimerInterruptTasks
● SynchronousTasks
● ShutdownTask
Note
For time-triggered tasks: If the task is restarted before it has been executed, there is a
timeout error. The SystemInterruptTask is started or the CPU goes to STOP mode.
See also
SystemInterruptTasks (Page 164)
Basic functions
Function Manual, 05/2009 193
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
%DFNJURXQG7DVN
0RWLRQ7DVNB
6\VWHP7DVNV
0RWLRQ7DVNBQ
Figure 5-30 Overview of the time allocation in the round robin execution level
Additional tasks
In addition to the user program tasks (BackgroundTask, MotionTask), other system tasks
(e.g. for communication) that require computing time in the round robin cycle also run in the
round robin execution level.
Sequence
In general, the tasks run successively in the round robin cycle. (The sequence is non-
deterministic and can, for example, change each time via a download, PowerON.)
Basic functions
194 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
Time allocation
A task can successively run a specified number of servo cycle clocks (remaining runtime)
before it must transfer the computation time to the next task. However, it can also be
transferred beforehand to the next task if it "does not have anything to do".
For the constructed case that all tasks in the round robin execution level have already been
handled once, the first task is restarted. In this way, there is no IDLE time.
There are times in which no user program is being executed. This, for example, is the case
when the BackgroundTask and the MotionTask are very brief (shorter than the remaining
runtime in a servo cycle clock); the system tasks will then use the remaining runtime.
Performance
A continuous loop in a MotionTask, without wait commands or synchronous motion
commands, causes the MotionTask to use its maximum computation time. Consequently,
the cycle of a BackgroundTask is additionally utilized (a larger part of the computation time
goes into the MotionTask). Consequently, the system tasks in the round robin level are
called at longer time intervals, which, for example, may influence the communication.
Note
MotionTasks with (continuous) loops without _waitTime (0 s) burden the round robin
execution level as the MotionTask uses two complete servo cycle clocks.
During the allocation of the round robin execution level for the BackgroundTask and
MotionTasks, the BackgroundTask in a complete round robin cycle receives at least one
time slice, a MotionTask receives two time slices (if, for example, they are required because
of a continuous loop).
Cyclic MotionTasks
Note when Motion Tasks should run cyclically:
If you want to use continuous loops in MotionTasks, then issue, for example, a
_waitTime(0s) in each cycle. This MotionTask then passes to the following MotionTask.
Note
MotionTasks with (continuous) loops without _waitTime (0 s) burden the round robin
execution level as the MotionTask needs two complete servo cycle clocks.
If you want a MotionTask to be executed cyclically, it is better to end the task in the normal
way and restart the MotionTask again from a different task (e.g. BackgroundTask) rather
than use a continuous loop or a step command at the start of the program. This also has
advantages for a download during RUN.
Basic functions
Function Manual, 05/2009 195
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
See also
Optimizing the execution system (Page 462)
Basic functions
196 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
Figure 5-33 Time allocation in the round robin: Setting of the computation time for MotionTasks
In this setting, the BackgroundTask runs for one servo cycle clock, then all MotionTasks run
(each MotionTask runs for maximum two servo cycle clocks, unless it enters the suspend
mode beforehand), then the BackgroundTask runs again for one servo cycle clock, etc.
Basic functions
Function Manual, 05/2009 197
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
Table 5- 6 Example:
Servo cycle clock Servo cycle clock Servo cycle clock Servo cycle clock Servo cycle clock
1 2-3 4-5 6 7-8
Background MotionTask 1 MotionTask 2 Background MotionTask 1
Task Task
Sample program:
MotionTask 1 and 2 run concurrently with the BackgroundTask;
servo cycle clock = 3 ms
● A counter in a While loop is incremented in the BackgroundTask (green line).
● A counter in a While loop is incremented in MotionTask 1 (red line).
● A counter in a While loop is incremented in MotionTask 2 (blue line).
Figure 5-34 Execution example for the time allocation in the round robin: Setting of the computation time for MotionTasks
Figure 5-35 Time allocation in the round robin: Setting the computation time for BackgroundTask
Basic functions
198 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
In this setting, the BackgroundTask runs for 20 servo cycle clocks, then all MotionTasks run
(each MotionTask runs for maximum two servo cycle clocks, unless it enters the suspend
mode beforehand), then the BackgroundTask runs again for another 20 servo cycle clocks,
etc.
Table 5- 7 Example:
Servo cycle clock Servo cycle clock Servo cycle clock Servo cycle clock Servo cycle clock
1-20 21-22 23-24 25-40 41-42
Background MotionTask 1 MotionTask 2 Background MotionTask 1
Task Task
Sample program:
MotionTask 1 and 2 run concurrently with the BackgroundTask;
servo cycle clock = 3 ms
● A counter in a While loop is incremented in the BackgroundTask (green line).
● A counter in a While loop is incremented in MotionTask 1 (red line).
● A counter in a While loop is incremented in MotionTask 2 (blue line).
Figure 5-36 Execution example for the time allocation in the round robin: Setting the computation time for BackgroundTask
Basic functions
Function Manual, 05/2009 199
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
'3F\FOH
6HUYRF\FOHFORFN
,32F\FOHFORFN
'3FRPPXQLFDWLRQ
6HUYRWDVN
,32WDVN
6\VWHP,QWHUUXSW7DVN
7LPHU,QWHUUXSW7DVNB
7LPHU,QWHUUXSW7DVNB
8VHU,QWHUUXSW7DVN
5RXQGURELQ
H[HFXWLRQOHYHO
1 In the execution system, the cycle clocks have been selected as follows for this example:
DP cycle: Servo cycle clock: IPO cycle clock: 1:1:2
This means that the servo task is executed in each DP cycle and the IPO task is only executed
in every second DP cycle.
2 DP communication has the highest priority followed by the servo task.
3 IPO tasks are executed after servo tasks.
4 The round robin execution level is executed in the remaining time.
Basic functions
200 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
Example 2: Chronological execution when an InterruptTask is active and IPOTask lasts longer than
one servo cycle clock
'HIDXOW'36HUYR,32
'3F\FOH
6HUYRF\FOHFORFN
,32F\FOHFORFN
'3FRPPXQLFDWLRQ
6HUYRWDVN
,32WDVN
6\VWHP,QWHUUXSW7DVN
7LPHU,QWHUUXSW7DVNB
7LPHU,QWHUUXSW7DVNB
8VHU,QWHUUXSW7DVN
5RXQGURELQ
H[HFXWLRQOHYHO
7KHFRQGLWLRQIRUVWDUWLQJWKHWDVNLVVDWLVILHGDWWKLVWLPH
1 The program executed in the IPO task lasts longer than the servo cycle clock. As a result, the
IPO task is interrupted and the DP communication and the servo task are executed. Then,
execution of the IPO task resumes.
2 After the IPO task is completed, the SystemInterruptTask is executed. Then the lower-priority
TimerInterruptTask is started.
3 The UserInterruptTask is also not executed until the higher-priority tasks are completed, even if
the condition for the UserInterruptTask was previously satisfied.
4 The round robin execution level is executed in the remaining time.
Figure 5-38 Chronological task execution, example: with InterruptTask active and IPOTask lasts
longer than one servo cycle clock
Basic functions
Function Manual, 05/2009 201
Execution System, Tasks, and System Cycle Clocks
5.4 Time allocation in the round robin execution level
Table 5- 8 Example:
Basic functions
202 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.5 Task Trace overview
Description
The Task Trace is a tool for troubleshooting in the SIMOTION multitasking environment. The
Task Trace offers the following options:
● Graphic display of the sequence of individual tasks and user events (generated using a
program command).
● Trace of individual user tasks.
● Ability to configure the Task Trace using IT Diag or via the user program (system
functions).
● Storage of the trace file on a memory card.
● Start of the SIMOTION Task Profiler as a separate application using IT Diag or the
SCOUT device diagnostics.
For detailed information regarding the Task Trace, see the Task Trace function manual.
&RQWURO
'DWD
HGLWLQJ
%XVV\VWHP
'DWD 'DWD
WUDQVIHU WUDQVIHU
UHDG ZULWH
'LVWULEXWHG
,2 'DWD 'DWD
UHDGLQ RXWSXW
In an isochronous system, the individual actions are chronologically synchronized with each
other. Thus, short and reproducible response times (i.e. with the same length) are achieved.
Cycle clock and time reference are preset by an isochronous, i.e. clocked bus system.
Basic functions
Function Manual, 05/2009 203
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
7';
'DWD
WUDQVPLVVLRQ
RQWKHEXV
W
*OREDO $F\FOLF'DWD
FRQWURO &\FOLFGDWD 5HVHUYH
GDWDH[FKDQJH
Basic functions
204 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
Description
7LPH,2
2XWSXW 7B'&
9DOLG
'DWDWUDQV
PLVVLRQRQ
WKHEXV
W
57VWDQGDUG 6WDQGDUG
,57FRPPXQLFDWLRQ FRPPXQLFDWLRQF\FOLF FRPPXQLFD
F\FOLFGDWDGDWD DQGDF\FOLFGDWD WLRQ
H[FKDQJH
Basic functions
Function Manual, 05/2009 205
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
Isochronous application
For an isochronous application the processing cycle clock of the controller and drives, or
decentral I/O, if connected, is synchronized to the bus cycle.
'DWDWUDQV
PLVVLRQRQ
WKHEXV
W
*OREDO $F\FOLFGDWD
FRQWURO &\FOLFGDWDGDWD 5HVHUYH
H[FKDQJH
7LPH,22XWSXW
9DOLG
'DWDLQ 'DWDRXW
&RQWURO
'DWDSURFHVVLQJ
'DWDWUDQV
PLVVLRQRQ
WKHEXV
W
,57FRPPXQLFDWLRQ 57VWDQGDUGFRPPXQLFD 6WDQGDUG
F\FOLFGDWDGDWD WLRQF\FOLFDQGDF\FOLF FRPPXQLFD
H[FKDQJH GDWD WLRQ
The data transmitted via cyclic data communication can thus be processed isochronously.
Basic functions
206 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
'DWD
WUDQVPLVVLRQ
RQWKHEXV
W
*OREDO $F\FOLFGDWD
FRQWURO &\FOLFGDWDGDWD
H[FKDQJH
7, 7, 72
7LPHRI 7LPHRIRXWSXW
DFTXLVLWLRQ UHIHUULQJWRJOREDO
UHIHUULQJWRJOREDO FRQWURO
FRQWURO
&KDQJHRIWKHLQSXWVLJQDO 7,7'372
0LQLPXPUHVSRQVHWLPH
0D[LPXPUHVSRQVHWLPH
7,[7'372
Basic functions
Function Manual, 05/2009 207
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
'DWD
WUDQVPLVVLRQ
RQWKHEXV
W
57157DF\FOLF
157
,57F\FOLFGDWD GDWD
GDWDH[FKDQJH
7, 7, 72
7LPHRI 7LPHRIRXWSXW
DFTXLVLWLRQ UHIHUULQJWRWKH
UHIHUULQJWRWKH ,57F\FOH
,57F\FOH
&KDQJHRIWKHLQSXWVLJQDO 7,7B'&72
0LQLPXPUHVSRQVHWLPH
0D[LPXPUHVSRQVHWLPH
7,[7B'&72
Basic functions
208 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
PROFIBUS
This results in a real process reaction time of:
● TI +TDP +TO minimum
● TI + 2·TDP + TO maximum
PROFINET
This results in a real process reaction time of:
● minimum TI +T_DC+TO
● maximum TI + 2·T_DC+ TO
Basic functions
Function Manual, 05/2009 209
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
Figure 5-46 Data processing in the control - setting the output data
● When influencing axis data/axis motions, the processing time depends on the fact if the
data is already active in the servo (e.g. superimposed setpoint or output value).
'DWDLQ 'DWDRXW
● If the data or commands become effective not until the IPO (e.g. issuing of motion
commands), the output data on the outputs only become effective with the next servo.
Note: To keep the runtime of the ServoSynchronousTask low (and thus the time until
Data Out), it is preferable to implement the programming of such tasks in the
IPOSynchronousTask.
Figure 5-48 Data processing in the control - output data effective in the IPO
Basic functions
210 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
Figure 5-49 Data processing in the control - output data effective in the next servo
Figure 5-50 Data processing in the control - output data effective in the IPO - influencing motion
data
In those cases where the output data of the I/O are only transmitted in the next servo, the
reaction time is increased by one bus cycle clock each (for bus cycle
clock: servo : IPO = 1 : 1 : 1).
5.6.5 Dynamic response with respect to data transmission from the acquisition to the
processing
When using a PROFIBUS or PROFINET bus system, the specified times for data
transmission (TDX) must be taken into account in the calculation of the system cycle clock.
Small TDX allow for shorter cycle clocks or more processing time for the application with the
same cycle clock length.
● For PROFIBUS DP TDX is shown by the HW config.
● On the SIMOTION D on PROFIBUS-integrated depending on the degree of extension of
the SINAMICS project (I/O extension on SIMOTION D4xx and SIMOTION CX32) a
transmission time in the range of 125 µs ≦ TDX ≦ 375 µs is set automatically.
● For PROFINET IO TDX = 0.5 • TDP is set automatically
Basic functions
Function Manual, 05/2009 211
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
See also
Determination of Tdp, Ti and To using HW Config for ET 200 I/O devices on the PROFIBUS
(Page 212)
5.6.7 Determination of Tdp, Ti and To using HW Config for ET 200 I/O devices on the
PROFIBUS
In HW Config in the Isochronous mode screen form (called from the Edit > Isochronous
mode menu), the times for TDP, TI and TO can be determined.
The dialog box gives an overview of the parameters and times set for the isochronous mode
of the involved objects PROFIBUS, slaves and modules in the respective slaves.
All times in the dialog are specified in milliseconds.
● TI/TO setting
– in the network means that the times TI and TO are centrally set "same for all slaves"
– in the slave means that the times TI and TO are set individually on each slave
● TI, TO, TDP
Shows the currently set or calculated values TI, TO and TDP for the selected DP master
system.
For a detailed description of the screen form and all other parameters, please refer to the
online help for HW Config.
Basic functions
212 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
Note
Full "terminal-to-terminal" support of isochronous mode is only possible if all components
within the sequence support the "isochronous mode" system property. When selecting from
the PM10 catalog or the hardware catalog of HW Config, pay attention to the entry
Isochronous mode in the information field of the module.
A current list of isochronous I/O modules can be found on the Internet under
http://support.automation.siemens.com/WW/view/de/14747353.
Basic functions
Function Manual, 05/2009 213
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
Thus with a different runtime of the servo execution level in the individual cycle clocks, the
terminal-terminal time may vary.
If an always constant reaction time is to be achieved instead of a reaction time optimized
behavior, the following must be set:
● For PROFIBUS:
– A reduction ratio servo: IPO = 1 : 1 so that the I/O accesses from the
IPOSynchronousTask are always implemented in isochronous mode.
Comment: I/O accesses from the ServoSynchronousTask are always isochronous for
PROFIBUS
● For PROFINET:
– A reduction ratio bus cycle clock : Servo: IPO = 1 : 1 : 1 so that the I/O accesses from
the IPOSynchronousTask are always implemented in isochronous mode
– A reduction ratio bus cycle clock : servo = 1 : 1 so that the I/O accesses from the
ServoSynchronousTask are always implemented in isochronous mode
Introduction
Optimized configuration in HW Config can greatly improve the runtime behavior of the
SIMOTION firmware.
Basic functions
214 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.6 Isochronous I/O processing on fieldbus systems
Basic functions
Function Manual, 05/2009 215
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
See also
Timeouts and level overflows (Page 190)
5.7.1 Introduction
Introduction
Drive Control Chart (DCC) allows you to implement your regulating and control tasks in a
drive-related manner. For this there is a set of blocks (DCB) available to you that you can
interconnect graphically via a configuration tool (DCC editor) in so-called charts. The DCBs
are available to you in the form of a library (DCBLIB).
Thus the charts created can be executed on the SIMOTION platforms as well as on
SINAMICS drives.
Only DCC for Simotion is described below.
Additional references
DCB lib DCC editor description
Description
The individual DCC blocks (DCB – Drive Control Block) are organized as runtime groups in
the DCC editor. You can freely assign these runtime groups to the DCC tasks in the DCC
editor (task T1 to T5). The DCC tasks in the DCC editor correspond to the DCC tasks in the
SIMOTION execution system.
Basic functions
216 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
&\FOLFH[HFXWLRQOHYHO
F\FOH
5XQWLPHJURXS 5XQWLPHJURXS
&DQEHVZLWFKHGRQRII
In the user model, the DCC task assigns itself in the execution level next to the user program
tasks (execution environment for user programs in ST, MCC, LAD/FBD) and the system
tasks. If required, the DCC task is created by the Engineeringsystem (ES); this means it is
not present in the system as standard.
Mode Action
STARTUP->RUN ON runtime groups
SHUTDOWN->STOPU OFF runtime groups
SHUTDOWN->STOP OFF runtime groups
All other changes in the mode cause no changes to the runtime groups.
See also
servoDccTask in the servo level (Page 218)
ipoDcc Task in the IPO level (Page 219)
ipoDcc_2 Task in the IPO2 level (Page 220)
Execution levels for DccAux and DccAux_2 (Page 221)
Basic functions
Function Manual, 05/2009 217
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
Description
The T1(DCC) task runs in the servo level of the SIMOTION execution system. The servo
level is called synchronous to the data exchange with the isochronous I/O and used primarily
for fast control tasks.
● At start, the cyclical I/O data for the technology objects and servo-synchronous I/O
variables is copied from the interface to the isochronous I/O in the execution system.
● At conclusion, the cyclical I/O data is copied again from the execution system and, for
example, transferred with PROFIBUS to a PROFIBUS node.
The following graphic shows the chronological sequence of a task in the servo level.
'DWD3URFHVVLQJ
'; ';
W
'3F\FOHQ Q
'DWD,Q,2GDWDDUHFRSLHGWRWKHH[HFXWLRQV\VWHP
'DWD2XW,2GDWDDUHFRSLHGIURPWKHH[HFXWLRQV\VWHP
The T1(DCC) task is automatically started and executed at the begin of the servo level.
The following graphic shows the sequence of the tasks in the servo level.
6HUYROHYHO
Basic functions
218 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
See also
Defining system cycle clocks (Page 182)
Description
The IPO level runs with the same cycle time as the servo level or in an integer reduction
ratio. Tasks in the servo level have a higher priority and so can interrupt tasks in the IPO
level. In addition, in the IPO level all I/O data not copied in the servo level are copied into the
execution system. The data can come both from the isochronous and the non-isochronous
I/O.
The command processing and the setpoint generation of the technology objects run in the
system task of the IPO level.
The following graphic shows the chronological sequence in the IPO level.
,32OHYHO
6HUYR 6HUYR
W
'3F\FOHQ Q Q
&RS\,Q,2GDWDDUHFRSLHGWRWKHH[HFXWLRQV\VWHP
&RS\2XW,2GDWDDUHFRSLHGIURPWKHH[HFXWLRQV\VWHP
The T2(DCC) task is automatically started and executed at the begin of the IPO level.
Basic functions
Function Manual, 05/2009 219
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
The following graphic shows the execution sequence in the IPO level.
,32OHYHO
,32V\QFKURQRXVXVHU
LSRGFF 6\VWHPWDVNV
SURJUDP
See also
Defining system cycle clocks (Page 182)
Timeouts and level overflows (Page 190)
SynchronousTasks (Page 158)
Isochronous data processing (Page 206)
Description
The cycle time of the IPO2 level is an integer multiple of the cycle time of the IPO level.
However, it is not possible to set the IPO2 cycle clock equal to the IPO cycle clock.
The cycle time of the IPO2 level is shorter than that of the IPO level. Consequently, both the
IPO level and the servo level can interrupt the processing.
The T3(DCC) task is assigned in the IPO2 level as follows:
,32OHYHO
Basic functions
220 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
See also
ipoDcc Task in the IPO level (Page 219)
Defining system cycle clocks (Page 182)
Description
The two DCC execution levels, DccAux and DCCAux_2, are called synchronous to the
system.
The DCCAux and DCCAux_2 levels have the following properties:
● DccAux has a multiple of the Ipo_ cycle clock.
● DccAux_2 has a multiple of the DccAux cycle clock.
● DccAux has a higher priority than DccAux_2
● Synchronous trace recordings are possible.
● Up to five level overflows are tolerated (the default is 1). The current number of level
overflows can be fetched.
● In the case of a level overflow, the DCCTask is calculated to completion in the next task.
See also
Defining system cycle clocks (Page 182)
Basic functions
Function Manual, 05/2009 221
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
Overview
In the DCC editor, you can interconnect the connections of various blocks. Three basic
scenarios must be differentiated for the data exchange between the blocks:
● You have connected connections of blocks with each other that lie in the same execution
level.
● You have interconnected the output of one block with the input of a block in a higher
execution level.
● You have interconnected the output of one block with the input of a block in a lower
execution level.
See also
Data exchange between blocks in the same level (Page 222)
Data for blocks from a lower-priority level (Page 225)
Data for blocks from a higher-priority level (Page 228)
Description
If you have interconnect the blocks in the same execution level, the data will be transferred
in accordance with the execution sequence of the blocks. The guarantees that the value is
current at the input of the execution sequences.
If you have defined the execution sequence in accordance with the data flow, no additional
dead time results in the level.
Basic functions
222 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
,QWHUFRQQHFWLRQ
([HFXWLRQVHTXHQFHDQGGDWDIORZ
Q Q
&\FOHFORFN
If the execution sequence of the blocks in the level does not correspond to the data flow,
additional dead times result, because at the input access has been made to values from the
previous cycle clock.
Basic functions
Function Manual, 05/2009 223
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
,QWHUFRQQHFWLRQ
([HFXWLRQVHTXHQFHDQGGDWDIORZ
$GGLWLRQDOGHDGWLPH
To optimize the dead times, always orient the execution sequence on the data flow.
Basic functions
224 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
Description
All blocks in an execution level must be calculated before their output values are made
available to blocks at the input in a different execution level. Output values from a higher-
priority level are accessed in a dedicated cycle clock (acceptance cycle clock) in order to
ensure isochronism of input values. The following graphic illustrates the isochronous value
transfer in a higher-priority level.
,QWHUFRQQHFWLRQ
'&% '&%
'FF$X[B 'FF$X[
$FFHSWDQFHRIRXWSXWYDOXHV
Figure 5-60 Example for the data exchange from a lower priority level
The cycle clock ratio between the levels is 1:2. The task in the higher-priority level always
accepts the value in a second cycle clock, independent of whether the lower-priority task
was already calculated to the end in the previous cycle clock.
Basic functions
Function Manual, 05/2009 225
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
,QWHUFRQQHFWLRQ
'&% '&%
'FF$X[B 'FF$X[
'FF$X[BRYHUIORZ
$FFHSWDQFHRIRXWSXWYDOXHV
'FF$X[
'FF$X[B
The described overflow scenario is true only for an ideal system. In a real application, user
tasks and system tasks also run in a level together with the DCC task.
Basic functions
226 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
&RUUHFWYDOXHDFFHSWDQFH 1RQHZYDOXH
1RQHZYDOXHLQWKLVF\FOH
6HUYROHYHO
LSR'FFWDVN
,32V\QFKURQRXVXVHUSURJUDP
,32V\VWHPWDVN
Note
To ensure an isochronal data transfer between the ipoDCC task in the IPO level and the
servoDCC in the servo level, the ipoDcc task in the IPO level considered by itself should not
already cause a level overflow. If this is the case, the higher-priority task does not have
available any updated values for the transfer of the values from the lower-priority level. The
updated values are then transferred only after the next cycle of the lower-priority levels.
Basic functions
Function Manual, 05/2009 227
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
Description
If an access is made to the output values from a lower-priority level, the values must be
transferred from a dedicated cycle clock of the higher-priority level in order to guarantee the
isochronism of input values.
,QWHUFRQQHFWLRQ
'&% '&%
7'&& 7'&&
$FFHSWDQFHRIRXWSXWYDOXHV
([HFXWLRQOHYHO7'&&VHUYROHYHO
Basic functions
228 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
Basic functions
Function Manual, 05/2009 229
Execution System, Tasks, and System Cycle Clocks
5.7 Integrating DCC into the SIMOTION execution system
Note
There are no restrictions as to how often an output can be interconnected to a variable. The
output value of the most recently calculated block is always effective.
Description
DCC Tasks exhibit the following behavior for FPU (Floating-Point Unit) exceptions:
Basic functions
230 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.8 Include drive I/O
Description
The TM15 and TM17 High Feature terminal modules must be evaluated isochronously by
the SIMOTION motion control system. Details for the timing can be obtained from the TM15 /
TM17 High Feature Terminal Modules Commissioning Manual.
5.8.2 TM31, TM41, TM15 DI/DO terminal modules, TB30 terminal board and onboard
I/Os on SIMOTION D or CU310/CU320 and CX32.
Description
TM31, TM41, TM15 DI/DO, TB30 and the onboard I/Os operate free-running (not
isochronous) for SINAMICS.
The updating cycle is specified by the following drive parameters with 4 ms as default
setting:
● p4099 for TM31, TM41 and TM15 DI/O or
● p0799 for TB30 and the onboard I/O
The accesses are performed in a SINAMICS background task (for example, every 4 ms).
Access time to the inputs and outputs within the set updating cycle can vary from cycle to
cycle; this means that the system merely ensures that within each cycle an update is made
with a possible fluctuation range in accordance with the updating cycle. This can be
influenced using the setting for p4099 or p0799.
Note
The following figure only provides a schematic presentation of the times and does not
provide information on the absolute amount.
Basic functions
Function Manual, 05/2009 231
Execution System, Tasks, and System Cycle Clocks
5.8 Include drive I/O
V\QF
287
6HUYR6HUYR
287
6HUYR6HUYR
,1
,1
6HUYR
V\QF V\QF
7L 7R
7F\F 7F\F
7'2 7'2
76HUYRRU 7,2 7,2
7,SR
7&8LQ 7&8RXW 7&8RXW
0LQWHUPLQDOWHUPLQDOUHVSRQVHWLPH
83LQVHUYRV\QF
0LQWHUPLQDOWHUPLQDOUHVSRQVHWLPH
83LQ,SRV\QF
Legend
● TDP: Clock cycle PROFIBUS (see setting in HW Config)
● Ti : Latch time of the inputs for isochronous PROFIBUS (see setting in HW Config for the
drive)
● To: Delay of the outputs for isosynchronous PROFIBUS (see setting in HW Config for the
drive)
● TIO: Module-specific signal delay (corresponds to a DRIVE-CLiQ cycle + the input delay
time for digital input or the load-dependent output delay time for digital outputs)
● Tcyc: Updating cycle in the SINAMICS (p4099 or p0799 parameter)
● Servo: SIMOTION servo-cycle clock; multiple of TDP (see cycle clock settings for
SIMOTION)
● IPO: SIMOTION IPO-cycle clock; multiple of the servo cycle clock (see cycle clock
settings for SIMOTION)
● TDQ: DRIVE-CLiQ clock cycle (for V4.1, always corresponds to the current controller cycle
clock)
● UP: User program
● Output time on the CU: TCU_out = TO + Tcyc + TDQ + TIO
● Read in time on the CU: TCU_in = Ti + Tcyc + TDQ + TIO
The figure shows all times that affect the terminal-terminal response time. Worst case values
should be used for the dashed times, thus:
● The set updating cycle Tcyc (= maximum time for the access time)
● The time Tservo or TIPO in the gray area. Depending on the time the input event occurs the
maximum terminal-terminal reaction time can be up to one servo or IPO cycle clock
longer than the minimum terminal-terminal reaction time.
Basic functions
232 Function Manual, 05/2009
Execution System, Tasks, and System Cycle Clocks
5.8 Include drive I/O
The gray area shows the range in which the input event is acquired and processed with the
next call of the user program (UP). The size of this range depends on whether the user
program runs in the servo-synchronous task or IPO-synchronous task.
Note
Note that a reduction of the updating cycle leads to higher loading of the SINAMICS closed
loop control or the SIMOTION D4xx, this means that the quantity frame for drives, terminal
modules, etc., can be reduced under some certain circumstances!
The SIMOTION user program can access I/O components in the SINAMICS drive device
when they are added as I/O PZD (process data) to the PROFIdrive message frame using
BICO interconnection (refer to the SIMOTION D4xx commissioning and hardware installation
manual, "Message frame configuring for onboard I/O and drive objects" section): As of V4.1
special message frames (39x) can also be used.
The timing depends on which I/O component is accessed. The following table specifies the
maximum delay times. To determine the terminal-terminal times, the values for the "terminal
->UP" and "UP -> terminal" must be added.
Note
The dashed line areas in the IO Timing graphic for the IPO synchronous task only apply for
PROFINET IO. Analogously the times for PROFINET IO are presented in the following table
in the UP in iposynchronous task column. For PROFIBUS DP in the line OUT TIPO must be
replaced by TServo. The dotted line area is irrelevant for PROFIBUS as the servo cannot run
there over multiple bus cycles.
1) Access to integrated drives SIMOTION D4xx in conjunction with standard message frame
39x for the DO1. Without standard message frame the timing behavior applies the same as
for CX32.
2.) Access to CX32 as well as via external PROFIBUS or PROFINET IO on CU310 / CU320
3) For isochronal operation, Tcyc = max (TDP, p0799)
Basic functions
Function Manual, 05/2009 233
Execution System, Tasks, and System Cycle Clocks
5.8 Include drive I/O
Further information
You can also find more information on this topic:
● In the SIMOTION D410 and D4x5 Commissioning Manuals
● In an FAQ on the Utilities & Applications CD under FAQs
● On the Internet at http://support.automation.siemens.com/WW/view/de/27585482.
Basic functions
234 Function Manual, 05/2009
6
Programming Execution System/Tasks/System Cycle
Clocks
Note
Before programs can be assigned to the execution levels the ST/MCC/LAD/FBD sources
must be translated.
Basic functions
Function Manual, 05/2009 235
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Basic functions
236 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Note
The sequence in which these tasks are first started after RUN mode has been reached does
not conform to the task priorities.
Basic functions
Function Manual, 05/2009 237
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
See also
Configure execution system (Page 176)
Assigning programs to the execution levels/tasks (Page 176)
See also
Assigning programs to the execution levels/tasks (Page 176)
Basic functions
238 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Basic functions
Function Manual, 05/2009 239
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
NOTICE
The task start sequence is not defined after the transition to RUN mode (refer to the Task
start sequence section).
Correct initial value assignment is not ensured if a task other than the StartupTask is used.
Description
You can create multiple VAR_GLOBAL, VAR_GLOBAL RETAIN blocks in the interface and
implementation area of a UNIT (as of V4.1).
In the interface area and in the implementation area you can specify multiple declaration
blocks in any sequence. Each of these blocks will be versioned separately. Changes within a
block (whether direct or indirect via data type change) thus result in reinitialization of these
blocks when reloading. Thus the (RETAIN) data retain works block-by-block.
New blocks can be added on the end and the changed sources can be reloaded in the RUN,
without influencing the existing data blocks. If in one source section (statement applies
separately for interface and implementation) a block is added in front of an existing block of
the same type (RETAIN or not RETAIN) then all the subsequent blocks change and will be
reinitialized at download. Thus download in the RUN after such a change is not possible.
Via the functions _saveUnitDataSet /_loadUnitDataSet and _exportUnitDataSet
/_importUnitDataSet, the unit data block information can be saved. If when reading a data
set one or multiple blocks are missing this can be detected on the return code, the remaining
blocks however will be read. See also General information on saving data sets from the user
program (Page 337) and Data backup and data initialization from user program - functions
and instructions (Page 376).
Basic functions
240 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Basic functions
Function Manual, 05/2009 241
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
● Instance data of programs translated in this manner will only be created once. The
instance data are in the source, where the PROGRAM is declared.
● Each time a PROGRAM created in this manner is used, the same data is involved. This
affects the assignment to (possibly multiple) tasks and the call in other PROGRAMS or
function blocks.
● With the setting 'one-time program data instantiation' the data initialization is executed
according to the rules of global initialization (see Download settings on the project) with
the download of the source/ of the code, in which the program is declared. See also
Download of changed sources in RUN (Page 436).
CAUTION
Changed behavior for the data initialization when "Only create program instance data
once" has been selected.
For sequential tasks, the data initialization is no longer performed with a task start or for
cyclic tasks with the STOP-RUN transition, but generally only during a download. If
required, the data initialization must now be performed applicatively in the StartUpTask
or at the start of the programs in sequential tasks. Initialization during the STOP-RUN
transition is possible with a pragma, see Initialization of data during a STOP - RUN
transition (Page 441). For information on the influence of the compiler switch in
conjuction with the download in RUN, see Download of changed sources in RUN
(Page 436).
If several tasks are assigned to one program, the same data is used as the basis for all
of them.
Basic functions
242 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Global availability of the instance data is a prerequisite for "program in program". This can be
satisfied either in that the PROGRAM does not have any instance data, or however through
using the compiler switch "One-time program data instantiation" when compiling the
PROGRAM that will be called (see One-time program data instantiation).
Note
If you do not set the compiler switch, then the behavior remains unchanged relative to V4.0
(corresponds to DEFAULT).
Table 6- 3 Example
VAR_GLOBAL
{HMI_Export := false; }
x : INT;
y : INT;
END_VAR
Basic functions
Function Manual, 05/2009 243
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Table 6- 4 Example
VAR_GLOBAL
{HMI_Export := true; }
x : INT;
y : INT;
END_VAR
This means that all HMI-relevant variables must be below the 64kbyte address limit for HMI
access. For device variants less than V4.1 this corresponds to the position of the block within
the source, and RETAIN blocks are ordered independently of association with the source
section in front of the dynamic blocks (no change possible).
For device variants as of V4.1 only HMI-relevant blocks still occupy areas in the HMI address
space.
If the 64kbyte address limit is exceeded then there is a warning, citing the variable from
which an HMI access is no longer possible. If data blocks are explicitly exported by
specifying the compiler pragmas for HMI, and it is not possible to reach variables of the block
via HMI, then then an error message is executed when translating.
Note
Access from HMI without consistency check setting is possible if variables at the end of the
entire VAR_GLOBAL area are added, this means they are added in the last VAR-GLOBAL
block variables, or that an entire VAR-GLOBAL definition block is supplemented at the end.
See also HMI (Human Machine Interface) connection (Page 397) and HMI variables in one
unit (Page 463).
For detailed information on the behavior of HMI-relevant data, see ST programming manual,
Section Variables and HMI devices.
Basic functions
244 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Basic functions
Function Manual, 05/2009 245
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Basic functions
246 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Note
The statement section of the expression cannot contain any function calls or loops.
Basic functions
Function Manual, 05/2009 247
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
:$,7)25&21',7,21VWDWHPHQWXQIRUPDWWHG
:$,7)25&21',7,21 ([SUHVVLRQLGHQWLILHU
&RQGLWLRQ
1DPHRIDFRQVWUXFWGHFODUHGZLWK
(;35(66,21
(GJHHYDOXDWLRQ
%22/GDWDW\SH
758(5LVLQJHGJHRIWKHFRQGLWLRQLVHYDOXDWHG
)$/6(&RQGLWLRQLVHYDOXDWHGVWDWLFDOO\GHIDXOWVHWWLQJ
6WDWHPHQWVHFWLRQ (1'B:$,7)25&21',7,21
'RQRWIRUJHWWRWHUPLQDWHWKH
(1'B:$,7)25&21',7,21
NH\ZRUGZLWKDVHPLFRORQ
Expression identifier is a construct declared with EXPRESSION; its value defines (together
with WITH edge evaluation, if necessary) whether the condition is considered as satisfied.
The WITH edge evaluation sequence is optional. Edge evaluation is an expression of data
type BOOL; it determines how the value of expression identifier is interpreted:
● Edge evaluation = TRUE: The rising edge of expression identifier is interpreted; i.e. the
condition is satisfied when the value of expression identifierchanges from FALSE to
TRUE.
● Edge evaluation = FALSE: The static value of expression identifier is interpreted; i.e. the
condition is satisfied when the value of expression identifier is TRUE.
If is not specified, the default setting is FALSE, i.e. the static value of expression identifier is
evaluated.
You can use the NOT expression identifier to check for a trailing edge.
Basic functions
248 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
The increased task priority applies to all statements between the WAITFORCONDITION
command and the END_WAITFORCONDITION command. The
END_WAITFORCONDITION command ends the increased task priority.
The statement section must contain at least one empty statement.
Please note the following when using the WAITFORCONDITION command:
● The command is used to wait for an event in a MotionTask. If it is programmed within
another task, it is ignored.
● There is no time watchdog in a MotionTask.
Therefore, make sure that the condition does actually become true. Otherwise, the
MotionTask would always be in the wait state and this would produce a timeout error.
● As of V4.1 time monitoring for WAITFORCONDITION can be programmed in a Motion
Task.
● The WAITFORCONDITION ... END_WAITFORCONDITION structure may not be nested.
● Within the round-robin level, the waiting task is the next to be executed when the event
occurs, as long as it is not hindered by higher-priority tasks (such as alarms).
● The time slice of the active task in the round robin level is interrupted.
● For the behavior in the event of task interruption, see _suspendTaskid).
● The expression is checked in the IPO cycle clock with high priority.
See also
Task priorities (Page 140)
MotionTasks (Page 147)
INTERFACE
USEPACKAGE cam;
PROGRAM feeder;
END_INTERFACE
IMPLEMENTATION
// Condition for WAITFORCONDITION in MotionTask_1
EXPRESSION automaticExpr
automaticExpr := IOfeedCam; // Digital input
END_EXPRESSION
// feeder (MotionTask_1)
PROGRAM feeder
Basic functions
Function Manual, 05/2009 249
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
VAR
retVal : DINT;
END_VAR ;
retVal := _enableAxis(axis := realAxis,
enableMode := ALL,
servoCommandToActualMode := INACTIVE,
nextCommand := WHEN_COMMAND_DONE,
commandId := _getCommandId() );
// Wait for automatic start
WAITFORCONDITION automaticExpr WITH TRUE DO
retVal := _pos(axis := realAxis,
positioningMode := RELATIVE,
position := 500,
velocityType := DIRECT,
velocity:=300,
positiveAccelType := DIRECT,
positiveAccel:= 400,
negativeAccelType := DIRECT,
negativeAccel := 400,
velocityProfile:= TRAPEZOIDAL,
mergeMode:=IMMEDIATELY,
nextCommand:=WHEN_MOTION_DONE,
commandId:= _getCommandId() );
// Reduce priority after WAITFORCONDITION
END_WAITFORCONDITION;
retVal := _disableAxis(axis := realAxis,
disableMode := ALL,
servoCommandToActualMode := INACTIVE,
nextCommand := WHEN_COMMAND_DONE,
commandId := _getCommandId() );
END_PROGRAM
END_IMPLEMENTATION
Example of using WAITFORCONDITION with time verification via FB (V4.1 and higher)
The following example shows time monitoring of the expressions (WAITFORCONDITION).
The bonding of the expression at the call point to instance data of a calling function block
inclusive time monitoring is presented alongside. This is a TON type reference variable. The
call is executed within the expression with query of the output.
VAR_GLOBAL
v1, v2 : INT;
t1, t2 : TIME;
END_VAR
EXPRESSION exp
Basic functions
250 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
VAR_IN_OUT
v : INT;
t : TON;
END_VAR
t();
exp := v > 100 and not t.q ;
END_EXPRESSION
FUNCTION_Block waitfb
VAR_IN_OUT
refpar1 : INT;
refpar2 : TIME;
END_VAR
VAR_TEMP
expr_timeout : TON;
END_VAR
expr_timeout(pt := refpar2, IN := true);
// Set monitoring time and
//activate timer
WAITFORCONDITION exp(v := refpar1, t := expr_timeout ) DO
… ; //Statement
IF (expr_timeout.q) THEN
// Error handling feasible, if Time-Out
… ;
END_IF;
END_WAITFORCONDITION
END_FUNCTION_BLOCK
The call of the waitfb type instance can then be executed at any point with different variables
in each case. These global variables are then updated by cyclic tasks:
my_waitfb_1(refpar1 := v1, refpar2:=t1); //Wait until V1>100 and
time t1 not elapsed
my_waitfb_2(refpar1 := v2, refpar2:=t1);
6.1.7.6 Example for using WAITFORCONDITION with time monitoring directly in non-cyclic task /
Motion Task
Description
Example of time monitoring of the expression (WAITFORCONDITION).
The call is executed directly in a MotionTask.
The time monitoring is type TON, with call within the expression and query of the output.
INTERFACE
TYPE
eDiagType : (TIMEOUT, COUNTER_REACHED, NOTHING);
END_TYPE
Basic functions
Function Manual, 05/2009 251
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
VAR_GLOBAL
eDiag : eDiagType := NOTHING;
v1 : INT := 0;
t1 : TIME := T#0d_0h_0m_3s_0ms;
END_VAR
PROGRAM testExpression;
PROGRAM increaseV1;
END_INTERFACE
IMPLEMENTATION
EXPRESSION expr
VAR_IN_OUT
v : INT;
t : TON;
END_VAR
t();
expr := v > 500 OR t.q;
END_EXPRESSION
//MotionTask
PROGRAM testExpression
VAR_TEMP
expr_timeout : TON;
END_VAR
// Set monitoring time, and activate timer
expr_timeout(pt := t1, IN := TRUE);
//Wait until v1 > 500 or time t1 has elapsed
WAITFORCONDITION expr(v := v1, t := expr_timeout) DO
IF (expr_timeout.q) THEN
// Error handling
// Time t1 has elapsed without v1 > 500 becoming true
eDiag := TIMEOUT;
… ;
ELSE
// Good case, v1 > 500
eDiag := COUNTER_REACHED;
… ;
END_IF;
END_WAITFORCONDITION;
END_PROGRAM
//BackgroundTask
PROGRAM increaseV1
v1 := v1 + 1;
END_PROGRAM
END_IMPLEMENTATION
.....
You can update v1 in any cyclical tasks.
Basic functions
252 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.1 Execution system
Note
A task that is in the wait state does not (or hardly) requires any CPU time. The only load on
the target system is the periodic check to establish whether the wait time has expired. This
check takes place in the IPO cycle clock.
The call of _waitTime (timeValue := T#0ms) in a MotionTask temporarily inactivates these
and returns the program control to the scheduler. This is recommended, for example for
longer loops if the program control will knowingly be transferred to the next round robin task
(also possible in BackgroundTask).
NOTICE
The function should be used in MotionTasks only; using it in cyclic tasks may lead to time
monitoring errors!
• With SynchronousTasks: As of SIMOTION Kernel V3.2 you may configure if time
monitoring is suspended. Time monitoring is active by default1.
With IPOsynchronousTask, additionally take the following into account:
UserInterruptTasks will no longer be started by their triggering event!
• With other cyclic tasks (BackgroundTask, TimerInterruptTasks): Time monitoring is
always active.
In cyclic tasks, use the timer system function blocks (see Timers section) to implement
waiting times.
1Up to Version V3.1 of the SIMOTION Kernel, time monitoring is suspended for the
SynchronousTasks.
Use an expression of data type TIME as an input parameter, the return value of data type
DINT is always 0.
For more information on the function (syntax), refer to the description of the _waitTime
function.
The following sample program puts the MotionTask to which it is assigned in the wait state
for ten seconds:
Basic functions
Function Manual, 05/2009 253
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
INTERFACE
PROGRAM waitTime;
END_INTERFACE
IMPLEMENTATION
PROGRAM waitTime
VAR
retVal :DINT;
END_VAR;
retVal := _waitTime(timeValue := T#10s);
END_PROGRAM
END_IMPLEMENTATION
Basic functions
254 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
TaskId
The task is specified for these functions via a unique TaskId. You can obtain the TaskId for a
task as follows:
● As _task.name variable (e.g. _task.motionTask_1). Explanation of terms:
– _task identifies the predefined namespace for the TaskId (see Namespaces section).
The identifier for the namespace is separated by a period from the following identifier.
– name is the identifier of the task as assigned in the execution system (e.g.
motionTask_1).
● With the _getTaskId(name) function
The task is specified by its name (as in the execution system).
● You can use the _checkEqualTask function to check whether a TaskId belongs to a
particular task (see _checkEqualTask function).
Note
Similar functions are available for SIMOTION Kernel versions up to V3.0. For these
functions, the task is specified via its name (as in the execution system). These functions
must not be used in libraries.
These functions should no longer be used as of Version V3.1 of the SIMOTION Kernel;
their availability is not guaranteed with future versions of the SIMOTION Kernel.
In addition, SIMOTION devices provide system functions for controlling the scheduler. These
are listed in the table (for a description, see the Parameter Manuals for SIMOTION devices):
Basic functions
Function Manual, 05/2009 255
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
NOTICE
The _checkEqualTask and _getTaskId functions and variables of the form _task.name must
not be used in libraries.
See also
Example for using a task control command (Page 256)
Querying and meaning of the task states (Page 245)
INTERFACE
PROGRAM myStart;
PROGRAM myMotion;
END_INTERFACE
IMPLEMENTATION
VAR
RetDWord : DWORD;
END_VAR
PROGRAM myStart
RetDWord := _startTaskid (_task.motionTask_1);
Basic functions
256 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
// Start MotionTask_1
END_PROGRAM
// Here, commands in the program, e.g. axis commands
PROGRAM myMotion
END_PROGRAM
END_IMPLEMENTATION
Declaration
_getStateOfTaskId (
{ id : StructTaskId // Task ID
}
) : DWORD
Input parameter
id (optional)
Data type: StructTaskId
Default: The TaskId of the current task in which the function is called.
Task ID of the task to be controlled (see Overview of the task control commands
(Page 254)).
Basic functions
Function Manual, 05/2009 257
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Return value
This function corresponds to the _getStateOfTaskId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
See also
Querying and meaning of the task states (Page 245)
Basic functions
258 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Declaration
_resetTaskId (
id : StructTaskId // MotionTasks only
) : DWORD
Input parameter
id
Data type: StructTaskId
TaskId of the task to be controlled.
Return value
Basic functions
Function Manual, 05/2009 259
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
This function corresponds to the _resetTaskId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● The function has no return value.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
See also
_restartTaskId function (Page 260)
_startTaskId function (Page 264)
Declaration
_restartTaskId (
id : StructTaskId // MotionTasks only
) : DWORD
Input parameter
id
Data type: StructTaskId
Task ID of the task to be controlled (see Overview of the task control commands
(Page 254)).
Basic functions
260 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Return value
This function corresponds to the _restartTaskId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● The function has no return value.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
Declaration
_resumeTaskId (
id : StructTaskId
) : DWORD
Basic functions
Function Manual, 05/2009 261
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Input parameter
id
Data type: StructTaskId
Task ID of the task to be controlled (see Overview of the task control commands).
Return value
This function corresponds to the _resumeTaskId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● The function has no return value.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
See also
_suspendTaskId function (Page 265)
Basic functions
262 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Declaration
_retriggerTaskIdControlTime (
{ id : StructTaskId
}
) : DWORD
Input parameter
id (optional)
Data type: StructTaskId
Default: The TaskId of the current task in which the function is called.
Task ID of the task to be controlled (see Overview of the task control commands
(Page 254)).
Return value
Basic functions
Function Manual, 05/2009 263
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Declaration
_startTaskId (
id : StructTaskId // MotionTasks only
) : DWORD
Input parameter
id
Data type: StructTaskId
Task ID of the task to be controlled (see Overview of the task control commands
(Page 254) – only MotionTasks).
Basic functions
264 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Return value
This function corresponds to the _startTaskId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● The function has no return value.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
See also
_getStateOfTaskId function (Page 257)
_resetTaskId function (Page 259)
_restartTaskId function (Page 260)
Basic functions
Function Manual, 05/2009 265
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Declaration
_suspendTaskId (
id : StructTaskId
) : DWORD
Input parameters
id
Data type: StructTaskId
Task ID of the task to be controlled (see Overview of the task control commands
(Page 254)).
Return value
Basic functions
266 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
This function corresponds to the _suspendTaskId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● The function has no return value.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
See also
_resumeTaskId function (Page 261)
NOTICE
This function must not be used in libraries.
This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
Declaration
Input parameters
Basic functions
Function Manual, 05/2009 267
Programming Execution System/Tasks/System Cycle Clocks
6.2 Task control commands
Return value
NOTICE
This function must not be used in libraries.
This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
Declaration
Input parameters
id
(only short form
permitted)
Data type: StructTaskId
TaskId to be checked, e.g. TSI#taskId.
Name
(only short form permitted)
Data type: TaskName
Name of a task, as defined in the execution system.
Return value
Basic functions
268 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.3 Functions for runtime measurement of tasks
Note
You can also use the Track Trace to determine the runtime of tasks. For detailed information
regarding the Task Trace, see the Task Trace function manual.
Note
In many cases, there is a similar function available for SIMOTION Kernel versions up to
V3.0. For these functions, the task is specified by its name (as in the execution system).
These functions must not be used in libraries.
These functions should no longer be used as of Version V3.1 of the SIMOTION Kernel; their
availability is not guaranteed with future versions of the SIMOTION Kernel.
See also
Task runtimes (Page 188)
Basic functions
Function Manual, 05/2009 269
Programming Execution System/Tasks/System Cycle Clocks
6.3 Functions for runtime measurement of tasks
Declaration
_getMaximalTaskIdRunTime (
{ id : StructTaskId
}
) : TIME
Input parameters
id (optional)
Data type: StructTaskId
Default: The TaskId of the current task in which the function is called.
Task ID of the task for which the runtime is to be measured (see page 6-330).
Return value
Basic functions
270 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.3 Functions for runtime measurement of tasks
See also
_startTaskId function (Page 264)
_suspendTaskId function (Page 265)
Basic functions
Function Manual, 05/2009 271
Programming Execution System/Tasks/System Cycle Clocks
6.3 Functions for runtime measurement of tasks
Declaration
_getMinimalTaskIdRunTime (
{ id : StructTaskId
}
) : TIME
Input parameters
id (optional)
Data type: StructTaskId
Default: TaskId of the current task in which the function is called.
TaskID of the task for which the runtime is to be measured (see _startTaskId function).
Return value
Basic functions
272 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.3 Functions for runtime measurement of tasks
See also
_startTaskId function (Page 264)
_suspendTaskId function (Page 265)
Declaration
_getCurrentTaskIdRunTime (
{ id : StructTaskId
}
) : TIME
Input parameters
id (optional)
Data type: StructTaskId
Default: TaskId of the current task in which the function is called.
TaskID of the task for which the runtime is to be measured (see _startTaskId function)
Basic functions
Function Manual, 05/2009 273
Programming Execution System/Tasks/System Cycle Clocks
6.3 Functions for runtime measurement of tasks
Return value
See also
_startTaskId function (Page 264)
_suspendTaskId function (Page 265)
Basic functions
274 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.3 Functions for runtime measurement of tasks
The determined runtime is a multiple of the servo cycle clock; for runtimes less than the
position control cycle clock, T#MIN (= T#0ms) is returned as measured value.
The function is permitted for all tasks. However, the measurement is not supported by the
IPOsynchronousTask and the ShutdownTask. Measured value T#MIN (= T#0ms) is returned
when called with these tasks.
Declaration
Input parameters
id (optional)
Data type StructTaskId
Default: TaskID of the task for which runtime is to be measured, as
defined in the execution system.
TaskID of the task for which the runtime is to be measured (see _startTaskId function).
Return value
Basic functions
Function Manual, 05/2009 275
Programming Execution System/Tasks/System Cycle Clocks
6.3 Functions for runtime measurement of tasks
See also
_startTaskId function (Page 264)
_suspendTaskId function (Page 265)
Description
With the following system functions you can measure the time since system start with µs
precision. Thus for sections within the application you can measure the time precisely, in
order to optimize the application.
You can use the following functions:
● Function _getInternalTimeStamp (Page 276)
● Function _getTimeDifferenceOfInternalTimeStamp (Page 277)
Description
The _getInternalTimeStamp function supplies a specific internal time stamp as UDINT. You
can set a time stamp, at the beginning and end of a task for example, and then use this in
the Function _getTimeDifferenceOfInternalTimeStamp (Page 277) as UDINT t1 and UDINT
t2.
_getInternalTimeStamp :UDINT;
Basic functions
276 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Description
The function _getTimeDifferenceOfInternalTimeStop supplies a time value from two internal
time stamps. You must generate the two time stamps via the Function
_getInternalTimeStamp (Page 276) (return value UDINT).
_getTimeOfDifferenceOfInternalTimeStamps
(
UDINT t1,
UDINT t2
):UDINT;
The start time point of the time that will be measured is t1, the end time point t2. The function
returns the difference (t2 - t1) as UDINT (in µs).
Application
With the function you can measure the runtimes of code sections, for example
communication times in an IPO-synchronous task
Basic functions
Function Manual, 05/2009 277
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Note
In many cases, there is a similar function available for SIMOTION Kernel versions up to
V3.0. For these functions, the message is specified via its name (as configured in
SIMOTION SCOUT). These functions must not be used in libraries.
These functions should no longer be used as of Version V3.1 of the SIMOTION Kernel; their
availability is not guaranteed with future versions of the SIMOTION Kernel.
AlarmId
You can obtain the AlarmId for a configured message name in the following way:
● As variable _alarm.name. Where
– _alarm designates the predefined namespace for the AlarmId (see Namespaces in the
ST Programming Manual). The identifier for the name space is separated by a period
from the following identifier.
– name is the identifier of the message as configured in SIMOTION SCOUT.
● With the _getAlarmId(name) function (see _getAlarmId function). The message is
specified by means of the configured message name:
NOTICE
The _getAlarmId function and variables of the form _alarm.name must not be used in
libraries.
See also
_getAlarmId function (Page 286)
_alarmScId function (Page 285)
_alarmSqId function (Page 282)
_alarmSId function (Page 279)
Basic functions
278 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Declaration
_alarmSId (
Sig : BOOL
Ev_Id : StructAlarmId
{ sd : ANY_NUM, ANY_BIT
}
) : DWORD
Input parameters
Sig
Data type: BOOL
The signal triggering the message is interpreted as follows:
If the signal represents a rising edge – relative to the last call with this AlarmId – an
incoming message is generated. An incoming message is also generated if the signal
state is TRUE on the first call with this message name.
If the signal represents a trailing edge – relative to the last call with this AlarmId – an
outgoing message is generated.
Ev_Id
Data type: StructAlarmId
AlarmId of the message to be generated (see AlarmID (Page 370))
sd (optional)
Data type: ANY_NUM, ANY_BIT
Basic functions
Function Manual, 05/2009 279
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Default: 0
Auxiliary value: All elementary data types are permissible auxiliary values. Values
cannot be entered; only variables or previously defined identifiers for constants
belonging to one of the allowed data types are permitted.
The auxiliary value must be specified if an auxiliary value has been defined during
message configuration in SIMOTION SCOUT.
During compilation, a check cannot be performed with the data type of the auxiliary
value configured in the message.
Return value
Basic functions
280 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Example
See Example of message generation (Page 372).
This function corresponds to the _alarmSId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
Basic functions
Function Manual, 05/2009 281
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Declaration
_alarmSqId (
Sig : BOOL
Ev_Id : StructAlarmId
{ sd : ANY_NUM, ANY_BIT
}
) : DWORD
Input parameters
Sig
Data type: BOOL
The signal triggering the message is interpreted as follows:
If the signal represents a rising edge – relative to the last call with this message name –
an incoming message is generated. An incoming message is also generated if the
signal state is TRUE on the first call with this message name.
If the signal represents a negative edge – relative to the last call with this message
name – an outgoing message is generated.
Ev_Id
Data type: StructAlarmId
AlarmId of the message to be generated (see AlarmID (Page 370))
sd (optional)
Data type: ANY_NUM, ANY_BIT
Basic functions
282 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Default: 0
Auxiliary value: All elementary data types are permissible auxiliary values. Values
cannot be entered; only variables or previously defined identifiers for constants
belonging to one of the allowed data types are permitted.
The auxiliary value must be specified if an auxiliary value has been defined during
message configuration in SIMOTION SCOUT.
During compilation, a check cannot be performed with the data type of the auxiliary
value configured in the message.
Return value
Basic functions
Function Manual, 05/2009 283
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Example
See Example of message generation (Page 372)Programming messages.
This function corresponds to the _alarmSqId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
Basic functions
284 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Declaration
_alarmScId (
Ev_Id : StructAlarmId
) : DWORD
Input parameters
Ev_Id
Data type: StructAlarmId
AlarmId of the message to be generated (see AlarmID (Page 370))
Return value
Basic functions
Function Manual, 05/2009 285
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Example
See Checking the error number and status of a message (filtering return values) on page 5-
261 in Subsection 5.7.1.
This function corresponds to the _alarmScId function with the following exceptions:
● The task is specified by means of its name (as it appears in the execution system).
● This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
● This function must not be used in libraries.
This function should no longer be used as of Version V3.1 of the SIMOTION Kernel; it will no
longer be supported in future versions.
NOTICE
This function must not be used in libraries.
This function may only be called in the short form, i.e. with a complete listing of all
parameter values, but without specification of the formal parameters.
Basic functions
286 Function Manual, 05/2009
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
Declaration
Input parameters
Al_Name
This is a message name configured specifically for the application that is created when
the message is configured in SIMOTION SCOUT.
Return value
See also
_alarmSId function (Page 279)
_alarmScId function (Page 285)
AlarmId (Page 370)
_alarmSqId function (Page 282)
Description
The function returns a max. of 40 pending alarms according to the maximum number of
entries in the alarm list. (pending alarms). The number of pending alarms is displayed in
numberOfPendingAlarms.
The type of each alarm is displayed in _type.
The type of each alarm is displayed in state.
Syntax
_getPendingAlarms :StructRetGetPendingAlarms
StructRetGetPendingAlarms :STRUCT
Basic functions
Function Manual, 05/2009 287
Programming Execution System/Tasks/System Cycle Clocks
6.4 Functions for message programming (AlarmS)
numberOfPendingAlarms :UINT;
alarm :Array[1..40] of StructPendingAlarmState;
END_STRUCT
StructPendingAlarmState :STRUCT
Id :StructAlarmId;
_type :EnumAlarmIdType [ALARM_S |ALARM_SQ]
State :EnumAlarmIdState [INCOMING|OUTGOING]
END_STRUCT
Description
Use the functions _resetAlarmId and _resetAllAlarmId to set one or all alarms to "outgoing".
As before SQ alarms must be acknowledged via an HMI or the SCOUT.
Note
Set "outgoing" and concurrent "Acknowledge" of the AlarmSQ in a 2nd step if necessary;
Resetting the alarms deletes the AlarmS,
You must acknowledge the AlarmSQ yourself.
Basic functions
288 Function Manual, 05/2009
Programming of general standard functions 7
7.1 Programming of general standard functions - overview
SIMOTION provides a series of standard functions you can call in your sources to solve
common tasks.
Note
Some of the following standard functions can only be called in short form, i.e. with a
complete list of all parameter values, but without specifying the formal parameters:
• Result := function name (1st parameter value, 2nd parameter value)
instead of
• Result := function name (formal parameter1 := 1st parameter value, etc.)
This is noted in the description of each function.
For information about the general data types (e.g. ANY_INT, ANY_BIT), see Elementary
data types, General data types table in the ST programming manual.
Basic functions
Function Manual, 05/2009 289
Programming of general standard functions
7.2 Numeric standard functions
Call Result
Result:=ABS (-5); 5
Result:=ABS (in := -5);
Result:=SQRT (81.0); 9.0
Result:=SQRT (in := 81.0);
Result:=TRUNC (-3.141_59); -3
Result:=TRUNC (in := -3.141_59);
Basic functions
290 Function Manual, 05/2009
Programming of general standard functions
7.2 Numeric standard functions
Call Result
Result := EXP (4.1); 60.3403 ...
Result := EXP (in := 4.1);
Result := EXPD (3.0); 1_000.0
Result := EXPD (in := 3.0);
Result := EXPT (2.0,4.0); 16.0
Result := EXPT (in1 := 2.0, in2 := 4.0);
Result := 2.0 ** 4.0;
Result := LN (2.718_281); 1.0
Result := LN (in := 2.718_281);
Result := LOG (245); 2.389_166
Result := LOG (in := 245);
Basic functions
Function Manual, 05/2009 291
Programming of general standard functions
7.2 Numeric standard functions
Call Result
PI:= 3.141592; //PI is a variable! 0.5
Result := SIN (PI / 6);
Result := SIN (in := PI / 6);
Result := ACOS (0.5); 1.047_197 //equals PI/3
Result := ACOS (in := 0.5);
Basic functions
292 Function Manual, 05/2009
Programming of general standard functions
7.2 Numeric standard functions
Note
If numeric values are used as input parameter in, the smallest possible data type is assumed
(for example, BOOL if 1, BYTE if 2).
The following table shows possible bit string standard function calls and their results.
Call Result
Result := ROL (2#1101_0011, 5); 2#0111_1010
// 1st parameter corresponds to 211 decimal (= 122 decimal)
Result := ROR (2#1101_0011, 2); 2#1111_0100
// 1st parameter corresponds to 211 decimal (= 244 decimal)
Result := SHL (2#1101_0011, 3); 2#1001_1000
// 1st parameter corresponds to 211 decimal (= 152 decimal)
Result := SHR (2#1101_0011, 2); 2#0011_0100
// 1st parameter corresponds to 211 decimal (= 52 decimal)
Result := SHL (1, 3); 2#0000_0000
// 1st parameter data type BOOL (= 0 decimal)
Result := SHL (2, 3); 2#0001_0000
// 1st parameter data type BYTE (= 16 decimal)
Basic functions
Function Manual, 05/2009 293
Programming of general standard functions
7.3 Access to bits in bit strings
Declaration
Input parameters
in
Data type ANY_BIT
Bit string variable
n
Data type USINT
Number of the bit for which the value is to be output
Permissible values: [0..7] for BYTE
[0..15] for WORD
[0..31] for DWORD
When specifying impermissible values the function supplies the return value FALSE.
Return value
Example
Basic functions
294 Function Manual, 05/2009
Programming of general standard functions
7.3 Access to bits in bit strings
FUNCTION f : VOID
VAR CONSTANT
BIT_7 : INT := 7;
END_VAR
VAR
dw : DWORD;
b: BOOL;
END_VAR
b := dw.BIT_7; // Access to bit number 7
b := dw.3; // Access to bit number 3
b := dw.33; // Translation error; insufficient bit width!
END_FUNCTION
Note
When using bit string addressing on I/O and system variables as a consequence of the
separate read, operation and re-write process that is interruptible by another task, there is no
way to ensure consistent access. The error will not be detected by the system; read access
however is possible.
Declaration
FUNCTION _setBit (
in : ANY_BIT, // Bit string variable
n : USINT, // Bit number
{ value : BOOL // Bit value
}
) : ANY_BIT
Basic functions
Function Manual, 05/2009 295
Programming of general standard functions
7.3 Access to bits in bit strings
Input parameters
in
Data type: ANY_BIT
Bit string variable
n
Data type: USINT
Number of the bit for which the value is to be set.
Permissible values: [0..7] for BYTE
[0..15] for WORD
[0..31] for DWORD
If illegal values are specified (without an additional message), the unchanged value of
the bit string variable is returned.
value
(optional)
Default: TRUE
Value assigned to the bit to be set
Return value
Example
Basic functions
296 Function Manual, 05/2009
Programming of general standard functions
7.3 Access to bits in bit strings
FUNCTION f : VOID
VAR CONSTANT
BIT_7 : INT := 7;
END_VAR
VAR
dw : DWORD;
b : BOOL;
b = 1;
END_VAR
dw.BIT_7 := b; // Write to bit number 7
dw.BIT_3 := b; // Write to bit number 3
END_FUNCTION
Note
When using bit string addressing on I/O and system variables as a consequence of the
separate read, operation and re-write process that is interruptible by another task, there is no
way to ensure consistent access. The error will not be detected by the system; read access
however is possible.
Declaration
FUNCTION _toggleBit (
in : ANY_BIT, // Bit string variable
n : USINT, // Bit number
) : ANY_BIT
Input parameters
in
Data type: ANY_BIT
Bit string variable
n
Data type: USINT
Number of the bit whose value is to be inverted (set from TRUE to FALSE or from
FALSE to TRUE).
Basic functions
Function Manual, 05/2009 297
Programming of general standard functions
7.4 Bit operations on numeric data types
Return value
Example
Basic functions
298 Function Manual, 05/2009
Programming of general standard functions
7.5 String processing (from V4.0 and greater)
Basic functions
Function Manual, 05/2009 299
Programming of general standard functions
7.5 String processing (from V4.0 and greater)
Table 7- 11 Examples for calls of the functions for the string processing
Call Result
A := CONCAT (in1 := ’ASTRING’, in2 := ’123’); ’ASTRING123’.
A := DELETE (in1 := ’ASTRING’, l := 2, p := 4); ’ASTNG’.
A := DELETE (in1 := ’ASTRING’, l := 2, p := 0); ’ASTRING’.
A := DELETE (in1 := ’ASTRING’, l := 2, p := 8); ’ASTRING’.
A := DELETE (in1 := ’ASTRING’, l := 0, p := 4); ’ASTRING’.
A := DELETE (in1 := ’ASTRING’, l := 10, p := 4); ’AST’.
A := DELETE (in1 := ’ASTRING’, l := -1, p := 4); ’’.
A := DELETE (in1 := ’ASTRING’, l := 2, p := -1); ’’.
B := FIND (in1 := ’ASTRING’, in2 := ’RI’); 4.
B := FIND (in1 := ’ASTRING’, in2 := ’RB’); 0.
A := INSERT (in1 := ’ASTRING’, in2 := ’123’, p := 1); ’A123STRING’.
A := INSERT (in1 := ’ASTRING’, in2 := ’123’, p := 0); ’123ASTRING’.
A := INSERT (in1 := ’ASTRING’, in2 := ’123’, p := 10); ’ASTRING123’.
A := INSERT (in1 := ’ASTRING’, in2 := ’123’, p :=-1); ’’.
Basic functions
300 Function Manual, 05/2009
Programming of general standard functions
7.5 String processing (from V4.0 and greater)
Call Result
A := LEFT (in := ’ASTRING’, l := 3); ’AST’.
A := LEFT (in := ’ASTRING’, l := 10); ’ASTRING’.
A := LEFT (in := ’ASTRING’, l := -1); ’’.
B := LEN (in := ’ASTRING’); 7.
A := MID (in := ’ASTRING’, l :=3, p :=2 ); ’STR’.
A := MID (in := ’ASTRING’, l :=3, p :=6 ); ’NG’.
A := MID (in := ’ASTRING’, l :=3, p :=8 ); ’’.
A := MID (in := ’ASTRING’, l :=3, p :=0 ); ’’.
A := REPLACE (in1 := ’ASTRING’, in2 := ’123’, l := 4, p := 2); ’A123NG’.
A := REPLACE (in1 := ’ASTRING’, in2 := ’123’, l := 4, p := 1); ’123ING’.
A := REPLACE (in1 := ’ASTRING’, in2 := ’123’, l := 0, p := 2); ’ASTRING’.
A := REPLACE (in1 := ’ASTRING’, in2 := ’123’, l := 4, p := 0); ’ASTRING’.
A := REPLACE (in1 := ’ASTRING’, in2 := ’123’, l := 2, p := 10); ’ASTRING123’.
A := REPLACE (in1 := ’ASTRING’, in2 := ’123’, l := 4, p := 5); ’ASTRI123’.
A := REPLACE (in1 := ’ASTRING’, in2 := ’123’, l := 4, p := -1); ’’.
A := REPLACE (in1 := ’ASTRING’, in2 := ’123’, l := -1, p : =2); ’’.
A := RIGHT (in := ’ASTRING’, l := 3); ’ING’.
A := RIGHT (in := ’ASTRING’, l := 10); ’ASTRING’.
A := RIGHT (in := ’ASTRING’, l := -1); ’’.
For information about conversion functions for STRINGs, see Functions for the conversion of
INT/REAL/LREAL and STRING data types (Page 309)
Description
Errors which occur during string functions are stored separately for each task in the
Taskstartinfo. It is therefore implemented in the task context and can then be subsequently
queried accordingly in the same task, e.g. BackgroundTask.
Variable:TSI#ERRNO : DINT
Value 0 indicates free of errors. For the string functions, the errors in P (position in the string)
and L (number of characters) are stored separately from the violation of the maximum string
length with different values
● Value 0 for free of errors
● Value1 for violation of the maximum string length
● Value 2 for P or L outside of the value range
Note
TSI#ERRNO cannot be used to examine the string length (applies to DINT_TO_STRING,
UDINT_TO_STRING, REAL_TO_STRING, and LREAL_TO_STRING).
In this case, the 0 error code will be set in TSI#ERRNO (string length exceeded).
You must, therefore, ensure that the string you enter is long enough or should check the
length in the user program prior to conversion.
Basic functions
Function Manual, 05/2009 301
Programming of general standard functions
7.5 String processing (from V4.0 and greater)
Table 7- 12 Example
VAR
A: STRING[254];
END_VAR
Basic functions
302 Function Manual, 05/2009
Programming of general standard functions
7.6 Standard functions for data type conversion
7.6.1 Functions for the conversion of numeric data types and bit data types
Explicit conversion is always required if information could be lost, for example, if the value
range is decreased or the accuracy is reduced, as is the case for conversion from LREAL to
REAL.
The compiler outputs warnings when it detects conversions associated with loss of precision.
NOTICE
The type conversion result may cause errors when the program is running, the error
response set in the task configuration will then be triggered, see Execution errors in
programs (Page 96).
Special attention is required when converting DWORD to REAL. The bit string from
DWORD is taken unchecked as the REAL value. You must make sure that the bit string in
DWORD corresponds to the bit pattern of a normalized floating-point number in accordance
with IEEE. To do this, you can use the _finite (Page 319) and _isNaN (Page 320) functions.
Otherwise, an error can be triggered (FPU exception (Page 97)) as soon as the REAL
value is first used for an arithmetic operation (for example, in the program or when
monitoring in the symbol browser).
Explicit data type conversion is performed using standard functions which are listed in the
following table.
● Input parameter
Each function for the conversion of a data type has exactly one input parameter named
in.
● Return value
The result is always the return value of the function. The respective conversion rule is
specified in the following table.
● Names
As the data types of the input parameter and the return value come from the respective
function name, they are not listed separately in the following table: For example, with the
BOOL_TO_BYTE function, the data type of the input parameter is BOOL and the data
type of the return value is BYTE.
Table 7- 13 Functions for converting numeric data types and bit data types
Basic functions
Function Manual, 05/2009 303
Programming of general standard functions
7.6 Standard functions for data type conversion
Basic functions
304 Function Manual, 05/2009
Programming of general standard functions
7.6 Standard functions for data type conversion
Basic functions
Function Manual, 05/2009 305
Programming of general standard functions
7.6 Standard functions for data type conversion
Basic functions
306 Function Manual, 05/2009
Programming of general standard functions
7.6 Standard functions for data type conversion
Basic functions
Function Manual, 05/2009 307
Programming of general standard functions
7.6 Standard functions for data type conversion
Description
The implicit conversion from BYTE to STRING and from STRING to BYTE enables a byte to
be written to a string or a byte to be read from a string (ASCII format, 1 byte per character).
Note
Strings are interpreted as ARRAY[1...stringsize].
Basic functions
308 Function Manual, 05/2009
Programming of general standard functions
7.6 Standard functions for data type conversion
Rules:
1. If n > len(myString) and n < maxlen(myString), the length of the string is adjusted.
All characters between myString[len(myString)] ... myString[n] are assigned the value "0".
2. If n > maxlen(myString), TSI#ERRNO is set to value 1 (maximum string length exceeded)
and myString remains the same.
Rule
1. If k > len(myString), TSI#ERRNO is set to value 2 (value outside of the valid range) and
myByte assigned the value 0.
Applications
● Read out of internal variable and, if required, conversion from INT to STRING or DINT to
STRING.
● Direct output of STRING on HMI, e.g. WIN CC Op.
● Conversion of STRING to ARRAY of bytes and thus output on HMI.
7.6.5 Functions for the conversion of INT/REAL/LREAL and STRING data types
Description
The following functions are used for the conversion of numbers to strings for the purpose of
displaying numbers of the INT/REAL(LREAL) data types.
Explicit data type conversion is performed using standard functions which are listed in the
following table.
● Input parameter
Each function for the conversion of a data type has exactly one input parameter named IN.
● Return value
The result is always the return value of the function.
Basic functions
Function Manual, 05/2009 309
Programming of general standard functions
7.6 Standard functions for data type conversion
Application
● An HMI fetches texts from the file system (recipe memory) and loads text for text via a
sequence into the run-time system of SIMOTION (unit variable).
● The data is saved with _saveUnitDataSet or _exportUnitDataSet in the run-time system.
Extension of the STRINGs with current SIMOTION data (e.g. actual position).
● The text is output via the serial interface (e.g. ET200)
Basic functions
310 Function Manual, 05/2009
Programming of general standard functions
7.7 Converting between any data types and byte arrays
7.7.1 General
Variables of any data type (elementary data types, standard data types of technology
packages and devices, and user-defined data types) can be converted to byte fields, and
vice versa, using the following functions:
For further information (e.g. on the arrangement of the byte arrays, application example) see
Converting between any data types and byte arrays (marshalling) (Page 381)).
These functions are commonly used to create defined transmission formats for data
exchange between various devices (see also Communication functions (Page 385)).
Note
The functions either have to be called and processed in one task only or, if several tasks are
used, suitable methods have to be implemented to synchronize these tasks from the point of
view of calling and processing functions (e.g., _testAndSetSemaphore, _releaseSemaphore).
If different tasks are used for the purpose of calling and processing the result, then undefined
values may be produced. If the destination memory for the BigByteArray_to_AnyType
function is a global variable that is evaluated in a higher priority task, the conversion should
be performed initially using a temporary destination variable. This is then copied over to the
global variable following the conversion. This also applies to elementary data types.
NOTICE
Each variable of data type BOOL (including variables that are components within a
structured data type) occupies one byte in the byte array.
Basic functions
Function Manual, 05/2009 311
Programming of general standard functions
7.7 Converting between any data types and byte arrays
Declaration
FUNCTION AnyType_to_BigByteArray (
anydata : ANY, // Any data type
{ offset : DINT // Only constant permitted
}
) : ARRAY [..] OF BYTE // Big Endian
FUNCTION AnyType_to_LittleByteArray (
anydata : ANY, // Any data type
{ offset : DINT // Only constant permitted
}
) : ARRAY [..] OF BYTE // Little Endian
Input parameters
anydata
Data type: ANY
Variable of any data type
The following data types are permitted:
• Technology objects
offset
(optional)
Data type: DINT
Default 0
Constant, specifies the first element to be assigned in the array.
Return value
See also
Converting between any data types and byte arrays (marshalling) (Page 381)
Basic functions
312 Function Manual, 05/2009
Programming of general standard functions
7.7 Converting between any data types and byte arrays
Note
The functions either have to be called and processed in one task only or, if several tasks are
used, suitable methods have to be implemented to synchronize these tasks from the point of
view of calling and processing functions (e.g., _testAndSetSemaphore, _releaseSemaphore).
If different tasks are used for the purpose of calling and processing the result, then undefined
values may be produced.
NOTICE
One byte from the byte array is assigned to each variable of data type BOOL (including
variables that are components within a structured data type).
Declaration
FUNCTION BigByteArray_to_AnyType (
byteArray : ARRAY [..] OF BYTE, // Big Endian
{ offset : DINT // Only constants permitted
}
) : ANY
FUNCTION LittleByteArray_to_AnyType (
byteArray : ARRAY [..] OF BYTE, // Little Endian
{ offset : DINT // Only constants permitted
}
) : ANY
Basic functions
Function Manual, 05/2009 313
Programming of general standard functions
7.7 Converting between any data types and byte arrays
Input parameters
byteArray
Data type: ARRAY [..] OF BYTE
• For BigByteArray_to_AnyType
In Big Endian arrangement (most significant byte at low memory address)
• For LittleByteArray_to_AnyType
In Little Endian arrangement (least significant byte at low memory address)
offset
(optional)
Data type: DINT
Default 0
Constant, specifies the first element to be assigned in the array.
Return value
NOTICE
The marshalling function result may cause errors when the program is running, the error
response set in the task configuration will then be triggered, see Execution errors in
programs (Page 96).
Proceed with caution when converting byte arrays to the general ANY_REAL data type or
to structures that contain this data type. The bit string from the byte array is taken
unchecked as the ANY_REAL value. You must make sure that the bit string of the byte
array corresponds to the bit pattern of a normalized floating-point number according to
IEEE 754. To do this, you can use the _finite (Page 319) and _isNaN (Page 320) functions.
Otherwise, an error can be triggered (FPU exception (Page 97)) as soon as the ANY_REAL
value is first used for an arithmetic operation (for example, in the program or when
monitoring in the symbol browser).
See also
Converting between any data types and byte arrays (marshalling) (Page 381)
Basic functions
314 Function Manual, 05/2009
Programming of general standard functions
7.8 Combining bit-string data types
Declaration
FUNCTION _BYTE_FROM_8BOOL (
{ bit0, // Least significant bit
bit1, bit2, bit3, bit4, bit5, bit6,
bit7: BOOL // Most significant bit
}
) : BYTE
Input parameters
bit0 (optional)
...
bit7 (optional)
Data type: BOOL
Default FALSE
Up to eight variables of data type BOOL, which are to be combined into a variable of
data type BYTE
bit0: least significant bit
...
bit7: most significant bit
Return value
Basic functions
Function Manual, 05/2009 315
Programming of general standard functions
7.8 Combining bit-string data types
Declaration
FUNCTION _WORD_FROM_2BYTE (
{ byte0, // Less significant byte
byte1: BYTE // More significant byte
}
) : WORD
Input parameters
byte0 (optional)
byte1 (optional)
Data type: BYTE
Default BYTE#0
Up to two variables of data type BYTE, which are to be combined into a variable of data
type WORD
byte0: less significant byte
byte1: more significant byte
Return value
Declaration
FUNCTION _DWORD_FROM_2WORD (
{ word0, // Less significant word
word1: WORD // More significant word
}
) : DWORD
Basic functions
316 Function Manual, 05/2009
Programming of general standard functions
7.8 Combining bit-string data types
Input parameters
word0 (optional)
word1 (optional)
Data type: WORD
Default WORD#0
Up to two variables of data type WORD, which are to be combined into a variable of
data type DWORD
word0: less significant word
word1: more significant word
Return value
Declaration
FUNCTION _DWORD_FROM_4BYTE (
{ byte0 // Least significant byte
byte1, byte2,
byte3: BYTE // Most significant byte
}
) : DWORD
Input parameters
byte0 (optional)
byte1 (optional)
byte2 (optional)
byte3 (optional)
Data type: BYTE
Basic functions
Function Manual, 05/2009 317
Programming of general standard functions
7.9 Conversion of technology object data types
Default BYTE#0
Up to four variables of data type BYTE, which are to be combined into a variable of
data type DWORD
byte0: least significant byte
...
byte3: most significant byte
Return value
Declaration
FUNCTION AnyObject_to_Object (
in : ANYOBJECT
) : ANYOBJECT
Input parameters
in
Data type: ANYOBJECT
Variable of a TO data type (or ANYOBJECT) or a TO instance
Return value
Basic functions
318 Function Manual, 05/2009
Programming of general standard functions
7.10 Functions for verification of floating-point numbers
Declaration
_finite (
in : ANY_REAL
) : BOOL
Input parameters
in
Data type: ANY_REAL
Variable to be checked
Return value
Example
Basic functions
Function Manual, 05/2009 319
Programming of general standard functions
7.10 Functions for verification of floating-point numbers
See also
_isNaN function (Page 320)
Execution errors in programs (Page 96)
Declaration
_isNaN (
in : ANY_REAL
) : BOOL
Input parameters
in
Data type: ANY_REAL
Variable to be checked
Return value
Basic functions
320 Function Manual, 05/2009
Programming of general standard functions
7.11 Functions for selection
Example
See also
_finite function (Page 319)
Execution errors in programs (Page 96)
Declaration
FUNCTION SEL (
g: BOOL,
in0 : ANY,
in1 : ANY
) : ANY
Input parameters
g
Data type: BOOL
Selection of the input parameter in0 or in1
in0, in1
Data type: ANY
The input parameters in0 and in1 must either be of the same data type or must be
convertible to a common data type by implicit conversion (see Elementary data type
conversion in the ST Programming Manual).
Basic functions
Function Manual, 05/2009 321
Programming of general standard functions
7.11 Functions for selection
Return value
Note
This description is not relevant to LadFdb. The corresponding function is described in the
LadFdb Programming Manual.
Declaration
FUNCTION MUX (
k : ANY_INT,
in0 : ANY,
...
inn-1 : ANY
) : ANY
Input parameters
k
Data type: ANY_INT
Selection of the input parameter in0 to inn–1.
The value range depends on the number n of the input parameters
in0...inn–1: 0 ≤ k ≤ n-1.
If illegal values are specified, input parameter in0 will be selected.
in0
...
inn–1
Basic functions
322 Function Manual, 05/2009
Programming of general standard functions
7.11 Functions for selection
Return value
Note
This description is not relevant to LadFdb. The corresponding function is described in the
LadFdb Programming Manual.
Declaration
FUNCTION MAX (
in0 : ANY_ELEMENTARY,
...
inn-1 : ANY_ELEMENTARY
) : ANY_ELEMENTARY
Basic functions
Function Manual, 05/2009 323
Programming of general standard functions
7.11 Functions for selection
Input parameters
in0
...
inn–1
Data type: ANY_ELEMENTARY
The number n of the input parameters in0 and inn–1 may vary.
All input parameters in0 and inn–1 must either be of the same data type or must be
convertible to the most powerful data type by implicit conversion (see Elementary data
type conversion in the ST Programming Manual).
If n formal parameters in0 to inn–1 are specified when calling the function, this must be
done in ascending, uninterrupted order; for four input parameters, for example, the
identifiers of the formal parameters are: in0, in1, in2, in3.
Return value
Note
This description is not relevant to LadFdb. The corresponding function is described in the
LadFdb Programming Manual.
Declaration
FUNCTION MIN (
in0 : ANY_ELEMENTARY,
...
inn-1 : ANY_ELEMENTARY
) : ANY_ELEMENTARY
Basic functions
324 Function Manual, 05/2009
Programming of general standard functions
7.11 Functions for selection
Input parameters
in0
...
inn–1
Data type: ANY_ELEMENTARY
The number n of the input parameters in0 and inn–1 may vary.
All input parameters in0 and inn–1 must either be of the same data type or must be
convertible to the most powerful data type by implicit conversion (see Elementary data
type conversion in the ST Programming Manual).
If n formal parameters in0 to inn–1 are specified when calling the function, this must be
done in ascending, uninterrupted order; for four input parameters, for example, the
identifiers of the formal parameters are: in0, in1, in2, in3.
Return value
Declaration
FUNCTION LIMIT (
mn : ANY_ELEMENTARY,
in : ANY_ELEMENTARY,
mx : ANY_ELEMENTARY
) : ANY_ELEMENTARY
Input parameters
mn
Data type: ANY_ELEMENTARY
Basic functions
Function Manual, 05/2009 325
Programming of general standard functions
7.12 Consistent access to global variables of derived data types (UDT)
Return value
7.12.1 General
When accessing global variables of derived data types (see User-defined data types (UDT)
in the ST programming manual), the user is responsible for ensuring data consistency when
multiple tasks access the same user variables (I/O variables, system variables, system
variables of technology objects, global device variables, and global unit variables, see
Variable model in the programming manuals).
Note
Consistent data access is always ensured within a task.
You can work with semaphores to ensure that global variables of derived data types (UDT)
are written and read consistently.
Basic functions
326 Function Manual, 05/2009
Programming of general standard functions
7.12 Consistent access to global variables of derived data types (UDT)
A global variable of data type DINT serves as a semaphore. Use the following functions to
change and test the status of the semaphore:
● _testAndSetSemaphore
● _releaseSemaphore
Consistent data access to global variables is ensured under the following conditions:
1. All tasks signal access to global variables by setting a semaphore.
2. All tasks access global variables only when the semaphore is enabled.
For more information on consistent data access and semaphores, refer to Consistent
reading and writing of variables (semaphores).
See also
Consistent data access (Page 374)
Declaration
_testAndSetSemaphore (
sema : DINT
) : BOOL
Input parameters
sema
Data type DINT
Sema is a global variable of data type DINT; it is used as a semaphore. It should not
be indexed. If the variable is an element of an array, the index must be specified when
compiling (e.g. a[2]).
Basic functions
Function Manual, 05/2009 327
Programming of general standard functions
7.12 Consistent access to global variables of derived data types (UDT)
Return value
Example
See Consistent reading and writing of variables (semaphores).
See also
Example: Consistent data access with semaphores (Page 375)
Declaration
_releaseSemaphore (
sema : DINT
) : VOID
Input parameters
sema
Data type: DINT
Sema is a global variable of data type DINT; it is used as a semaphore. It should not be
indexed. If the variable is an element of an array, the index must be specified when
compiling (e.g. a[2]).
Return value
None
Example
See Consistent reading and writing of variables (semaphores).
Basic functions
328 Function Manual, 05/2009
Programming of general standard functions
7.13 Access to system variables and inputs/outputs
See also
Example: Consistent data access with semaphores (Page 375)
See also
Access errors to system variables and configuration data, as well as I/O variables for direct
access (Page 99)
System variables (Page 85)
Configuration data (Page 88)
NOTICE
The runtime of this function can be very long. Therefore, this function is not suitable for use
in fast cyclic tasks.
Basic functions
Function Manual, 05/2009 329
Programming of general standard functions
7.13 Access to system variables and inputs/outputs
Declaration
_getSafeValue (
variable : ANY, //System variable,
// Configuration data or
// I/O variable
accessMode : EnumAccessMode,
getValue : ANY
) : EnumSetAndGetSafeValue
Input parameters
variable
Data type: ANY
System variable, configuration data item or I/O variable to be read.
accesssMode
Data type: EnumAccessMode
Response when an error occurs during read access.
TYPE EnumAccessMode : (
// Response as configured:
CONFIGURED // System variables and config data:
// Behavior depends on config data item
// restartInfo.behaviorInvalidSysvarAccess
Basic functions
330 Function Manual, 05/2009
Programming of general standard functions
7.13 Access to system variables and inputs/outputs
getvalue
Data type: ANY
Name of the variable to which the current value of the system variable (or configuration
data item) or I/O variable is written.
The following applies for the data type:
• It must be the same as the data type of the variable to be read, or
• the data type of the variable to be read must be convertible to this data type by
means of implicit type conversion (see Evaluating faults and events).
Return value
TYPE EnumSetAndGetSafeValue : (
// Access successful:
OK // Access was successful.
// Access error:
, NO_CHANGE // For system variables and configuration data: Variable was
// not read, last value
// For I/O variables: Last
// available (valid) value was
// accepted.
, DEFAULT_VALUE // Only for I/O variables:
// Replacement value was accepted.
, INVALID_VALUE // Only for configuration data:
// Configuration data item was
// not read, default value is returned,
// impermissible parameter
//(accessMode = DEFAULT_VALUE).
Basic functions
Function Manual, 05/2009 331
Programming of general standard functions
7.13 Access to system variables and inputs/outputs
See also
Evaluating faults and events (Page 95)
Errors when accessing system data with _get/_setSafeValue (Page 130)
NOTICE
The runtime of this function can be very long. Therefore, this function is not suitable for use
in fast cyclic tasks.
Basic functions
332 Function Manual, 05/2009
Programming of general standard functions
7.13 Access to system variables and inputs/outputs
The value is restricted to the value range and is not affected by the accessMode parameter.
You can use the return value to determine whether the access was successful.
Declaration
_setSafeValue (
variable : ANY, //System variable,
// Configuration data or
// I/O variable
value : ANY,
accessMode : EnumAccessMode,
setValue : ANY
) : EnumSetAndGetSafeValue
Input parameter
variable
Data type: ANY
System variable, configuration data item or I/O variable to be written.
value
Data type: ANY
Value to be written to the system variable (or configuration data item) or I/O variable.
The value data type must be the same as the data type of the variable to be written to,
or it must be convertible to this data type by means of implicit type conversion (see
Evaluating faults and events).
accessMode
Data type: EnumAccessMode
Response when an error occurs during write access:
TYPE EnumAccessMode : (
// Response as configured:
CONFIGURED // System variables and config data:
// Behavior depends on config data item
// restartInfo.behaviorInvalidSysvarAccess
// For I/O variables:
// Strategy specified during creation
// of the I/O variables
// Different response than configured:
, NO_CHANGE // For system variables and
// configuration data: Current value
// Is not written.
//For I/O variables
// The value transferred in the
Basic functions
Function Manual, 05/2009 333
Programming of general standard functions
7.13 Access to system variables and inputs/outputs
setvalue
Data type: ANY
Name of a variable to which the current value of the system variable, configuration data
item, or I/O variable is written.
The following applies for the data type:
• It must be of the same data type as the variable to be written, or
• The data type of the variable to be written must be convertible to this data type by
means of implicit type conversion (see Evaluating faults and events).
If, for example, 100 is to be written, but only 90 was entered, setValue is given a value
of 90.
Return value
TYPE EnumSetAndGetSafeValue : (
// Access successful:
OK // Access was successful.
// Access error:
, NO_CHANGE // For system variables and config data:
// Value is not written.
// For I/O variables: The value transferred
// in the parameter was
// written. It is not active at the output
// until the output is
// again available.
, DEFAULT_VALUE // For system variables: Limitation
// active, limit value was
Basic functions
334 Function Manual, 05/2009
Programming of general standard functions
7.13 Access to system variables and inputs/outputs
// written.
// For I/O variables: Substitute value was
// written. It is not active at the output
// until the output is
// again available.
, NO_ACCESS ) // Only for configuration data and system variables:
// Value of the configuration data item was
// not changed,
// Configuration data item
// not available).
END_TYPE
See also
Evaluating faults and events (Page 95)
Errors when accessing system data with _get/_setSafeValue (Page 130)
System variables (Page 85)
NOTICE
The runtime of this function can be very long. Therefore, this function is not suitable for use
in fast cyclic tasks.
Declaration
_getInOutByte (
mode : EnumInOutDirection,
logAddress : DINT
) : StructRetGetInOutByte
Basic functions
Function Manual, 05/2009 335
Programming of general standard functions
7.13 Access to system variables and inputs/outputs
Input parameters
mode
Data type: EnumInOutDirection
Specifies whether logAddress is used to access the input or output.
TYPE EnumInOutDirection : (
IN // Access to input
, OUT ) // Access to output
END_TYPE
logAddress
Data type: DINT
Logic address of input or output
Return value
Basic functions
336 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
7.14.1 General information on saving data sets from the user program
The functions below are for:
● Saving, loading, or initializing the following values:
– Non-retentive or retentive global unit variables of the interface or implementation
section of a unit (e.g. ST source file, MCC unit)
– Non-retentive or retentive global device variables (declared via project navigator)
Data backup is performed by selecting the relevant function
– Binary: The backed-up data set can no longer be read after the version ID of the data
segment has been changed.
– In XML format: The backed-up data set can be read after the version ID of the data
segment has been changed.
● Managing the data set in which the values are backed up
The values are backed up in a data set that is identified uniquely by specifying the storage
location, the name of the unit, and a data set number.
The application of these functions - in particular, the step enabling condition - is described in
detail in Data backup and initialization from user program (Page 376).
As well as saving retentive variables as individual data sets, it is also possible to back up all
the retentive data to the memory card using the _savePersistentMemoryData function. For
more information, see the System Functions/Variables Parameter Manual.
Basic functions
Function Manual, 05/2009 337
Programming of general standard functions
7.14 Backing up data from the user program
The "Save variables" and "Restore variables" SCOUT functions can be used to retain data
sets saved with _saveUnitDataSet, even if there is a change of version or data segments
have been changed. For additional information, refer to the SIMOTION SCOUT
Configuration Manual or the online help.
Declaration
_saveUnitDataSet (
unitName : STRING,
id : UDINT,
storageType : EnumDeviceStorageType,
{ path : STRING,
overwrite : BOOL,
nextCommand : EnumNextCommandMode,
dataScope : EnumDeviceDataScope,
kindOfData : EnumDeviceKindOfData,
}
): StructRetUnitDataSetCommand
Input parameters
unitName
Data type: STRING
Name of the unit (e.g. ST source file, MCC unit, LAD/FBD unit) whose unit variables
will be saved.
The name must be indicated in lower case and inside single quotation marks (e.g.
'st_unit1').
If ’_device’ is specified, the global device variables are saved (possible as of Version
V3.2 of the SIMOTION Kernel).
id
Data type: UDINT
Number of the data set under which the variable values are saved (maximum of
1_000_000 data sets per unit).
storageType
Data type: EnumDeviceStorageType
Location at which the data is saved.
TYPE EnumDeviceStorageType : (
TEMPORARY_STORAGE // temporary storage
// (RAM Disk),
// is deleted if there is a power failure
, PERMANENT_STORAGE // permanent data storage
// (MemoryCard), retained
// with power failure
Basic functions
338 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
path (optional)
Data type: STRING
Default: ' ' (empty string)
Destination path, if storageType = USER_DEFINED.
Only default value may be specified.
overwrite (optional)
Data type: BOOL
Default: FALSE
If TRUE, existing data set is overwritten.
nextCommand (optional)
Data type: EnumNextCommandMode
Default: IMMEDIATELY
Advance to next command
TYPE EnumNextCommandMode : (
IMMEDIATELY // immediately
, WHEN_COMMAND_DONE ) // After completion or abort
// of the command
END_TYPE
dataScope (optional)
Data type: EnumDeviceDataScope
Default _INTERFACE
The parameter is available as of Version V3.2 of the SIMOTION Kernel.
Specification of the section whose unit variables are to be saved.
Type EnumDeviceDataScope : (
_INTERFACE // Interface section
, _IMPLEMENTATION // Implementation section
, _INTERFACE_AND_IMPLEMENTATION ) // interface and
// Implementation section
END_TYPE
Basic functions
Function Manual, 05/2009 339
Programming of general standard functions
7.14 Backing up data from the user program
KindOfData (optional)
Default NO_RETAIN_GLOBAL
The parameter is available as of Version V3.2 of the SIMOTION Kernel.
Specification of whether non-retentive or retentive global variables will be saved.
TYPE EnumDeviceKindOfData : (
NO_RETAIN_GLOBAL // non-retentive variables
, _RETAIN // retentive variables
, ALL_GLOBAL ) // retentive and non-retentive
// variables
END_TYPE
Up to and including Version V3.1 of the SIMOTION Kernel, only non-retentive variables of
the interface section of a unit can be saved.
Return value
TYPE
EnumDeviceUnitDataSetCommand: (
DONE // Execution or start successful
, ACTIVE // Being executed
, INTERNAL_ERROR // internal error
// (please call the hotline)
,COMMAND_FAILED // Command cannot be executed
Basic functions
340 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
, NO_COMMAND_BUFFER_AVAILABLE
// Command buffer full
, COMMAND_NOT_FOUND // Command (handle) not found
, DATASET_ID_NOT_VALID // Data set number invalid
, READ_ERROR // Data read error
// (Defective storage medium)
, NO_STORAGE_AVAILABLE // No storage available
, ACCESS_DENIED // Access denied
// (missing write/read rights)
,DATASET_ALREADY_EXISTS // Data set already exists
,DATASET_NOT_FOUND // Data set not found
,VERSION_MISMATCH // Wrong version code
// of the data area to be imported (e.g. section of the unit
,UNIT_NOT_FOUND// Unit (e.g. ST source,
// MCC source) not found
,DATA_INCOMPLETE // Incomplete import of the data
,DATA_MISMATCH // Data range to be imported
// is not contained in the data set
,SYMBOL_INFORMATION_NOT_AVAILABLE ) //Symbol information
// Not available (activate the OPC-XML
export
// on the program source
StructRetUnitDataSetCommand
: STRUCT
functionResult : EnumDeviceUnitDataSetCommand;
handle : UDINT;
END_STRUCT;
END_TYPE
For information about data backup see Using data backup and data initialization from user
program (Page 376)
See also
General information on saving data sets from the user program (Page 337)
Communication via Ethernet with UDP protocol (Page 392)
Basic functions
Function Manual, 05/2009 341
Programming of general standard functions
7.14 Backing up data from the user program
The data set can only be loaded if the version codes of all the data segments to be loaded
(e.g. non-retentive and retentive variables of the interface section of the unit) have remained
unchanged since the data set was saved. For data segments and their version codes, see
Time of variable initialization in the ST, MCC, or LAD/FBD Programming Manuals.
A subset of the data segments backed up in the data set can be loaded (e.g. if the version
IDs of some data segments have changed).
When calling this function in short form, all parameters (including all optional parameters)
must be specified.
The "Save variables" and "Restore variables" SCOUT functions can be used to retain data
sets saved with _saveUnitDataSet, even if there is a change of version or data segments
have been changed.
For additional information, refer to the SIMOTION SCOUT Configuration Manual or the
online help.
Declaration
_loadUnitDataSet (
unitName : STRING,
id : UDINT,
storageType : EnumDeviceStorageType,
{ path : STRING,
nextCommand : EnumNextCommandMode,
dataScope : EnumDeviceDataScope,
kindOfData : EnumDeviceKindOfData,
}
): StructRetUnitDataSetCommand
Input parameters
unitName
Data type: STRING
Name of the unit (e.g. ST source file, MCC unit), whose unit variables will be loaded.
The name must be indicated in lower case and inside single quotation marks (e.g.
'st_unit1').
If ’_device’ is specified, the global device variables are loaded (possible with Version
V3.2 and higher of the SIMOTION Kernel).
id
Data type: UDINT
Number of the data set from which the variable values are loaded (maximum of
1_000_000 data sets per unit).
storageType
Data type: EnumDeviceStorageType
Location at which the data is saved.
Basic functions
342 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
TYPE EnumDeviceStorageType : (
TEMPORARY_STORAGE // temporary data storage
// (RAM disk),
// is deleted if there is a power failure
, PERMANENT_STORAGE // permanent data storage
// (MemoryCard), retained
// with power failure
, USER_DEFINED ) // with path specification, only the
// default is valid
END_TYPE
path (optional)
Data type: STRING
Default: ' ' (empty string)
Destination path, if storageType = USER_DEFINED
Only default value may be specified.
nextCommand (optional)
Data type: EnumNextCommandMode
Default: IMMEDIATELY
Advance to next command
TYPE EnumNextCommandMode : (
IMMEDIATELY // immediately
, WHEN_COMMAND_DONE ) // After completion or abort
// of the command
END_TYPE
dataScope (optional)
Data type: EnumDeviceDataScope
Default _INTERFACE
The parameter is available as of Version V3.2 of the SIMOTION Kernel.
Specification of the section whose unit variables are to be saved.
Type EnumDeviceDataScope : (
_INTERFACE // Interface section
, _IMPLEMENTATION // Implementation section
, _INTERFACE_AND_IMPLEMENTATION ) // interface and
// Implementation section
END_TYPE
Basic functions
Function Manual, 05/2009 343
Programming of general standard functions
7.14 Backing up data from the user program
KindOfData (optional)
Default NO_RETAIN_GLOBAL
The parameter is available as of Version V3.2 of the SIMOTION Kernel.
Specification of whether non-retentive or retentive global variables will be saved.
TYPE EnumDeviceKindOfData : (
NO_RETAIN_GLOBAL // non-retentive variables
, _RETAIN // retentive variables
, ALL_GLOBAL ) // retentive and non retentive
// variables
END_TYPE
Up to and including Version V3.1 of the SIMOTION Kernel, only non-retentive variables of
the interface section of a unit can be saved and loaded.
Return value
Basic functions
344 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
See also
_getStateOfUnitDataSetCommand function (Page 354)
_saveUnitDataSet function (Page 337)
General information on saving data sets from the user program (Page 337)
Data backup and data initialization from user program - functions and instructions
(Page 376)
Declaration
_exportUnitDataSet (
unitName : STRING,
id : UDINT,
storageType : EnumDeviceStorageType,
{ path : STRING,
overwrite : BOOL
nextCommand : EnumNextCommandMode,
dataScope : EnumDeviceDataScope,
kindOfData : EnumDeviceKindOfData,
}
): StructRetUnitDataSetCommand
Basic functions
Function Manual, 05/2009 345
Programming of general standard functions
7.14 Backing up data from the user program
Input parameters
unitName
Data type: STRING
Name of the unit (e.g. ST source file, MCC unit), whose unit variables will be exported.
The name must be indicated in lower case and inside single quotation marks (e.g.
'st_unit1').
Specifying ’_device’ (for exporting global device variables) is not permissible here (only
possible with _saveUnitDataSet).
id
Data type: UDINT
Number of the data set under which the variable values are saved (maximum of
1_000_000 data sets per unit).
storageType
Data type: EnumDeviceStorageType
Location at which the data is saved.
Note
Only the default can be used for the USER_DEFINED setting.
TYPE EnumDeviceStorageType : (
TEMPORARY_STORAGE // temporary storage
// (RAM disk),
// is deleted if there is a power failure
, PERMANENT_STORAGE // permanent data storage
// (MemoryCard), retained
// with power failure
, USER_DEFINED ) // with path specification
// (only default permissible)
END_TYPE
path (optional)
Data type: STRING
Default: ' ' ' (empty string)
Destination path, if storageType = USER_DEFINED.
Note
Only the default value may be specified. Otherwise, an error message is output.
overwrite (optional)
Data type: BOOL
Default: FALSE
If TRUE, existing data set is overwritten.
nextCommand (optional)
Data type: EnumNextCommandMode
Basic functions
346 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
Default: IMMEDIATELY
Advance to next command
TYPE EnumNextCommandMode : (
IMMEDIATELY // immediately
, WHEN_COMMAND_DONE ) // After completion or abort
// of the command
END_TYPE
dataScope (optional)
Data type: EnumDeviceDataScope
Default _INTERFACE
Specification of the section whose unit variables will be exported.
Type EnumDeviceDataScope : (
_INTERFACE // Interface section
, _IMPLEMENTATION // Implementation section
, _INTERFACE_AND_IMPLEMENTATION ) // interface and
// Implementation section
END_TYPE
KindOfData (optional)
Default NO_RETAIN_GLOBAL
Specification of whether non-retentive or retentive global variables will be exported.
TYPE EnumDeviceKindOfData : (
NO_RETAIN_GLOBAL // non-retentive variables
, _RETAIN // retentive variables
, ALL_GLOBAL ) // retentive and non retentive
// variables
END_TYPE
Basic functions
Function Manual, 05/2009 347
Programming of general standard functions
7.14 Backing up data from the user program
Return value
See also
Consistent data access (Page 374)
_getStateOfUnitDataSetCommand function (Page 354)
General information on saving data sets from the user program (Page 337)
Basic functions
348 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
To avoid unwanted values in variables, you can initialize the relevant data segments before
importing the data set with the _resetUnitData function (see parameter manual for the
system functions of the SIMOTION devices).
For data segments and their version ID see Time of variable initialization in the ST
programming manual.
A subset of the data segments exported in the data set can be imported.
When calling this function in short form, all parameters (including all optional parameters)
must be specified.
Declaration
_importUnitDataSet (
unitName : STRING,
id : UDINT,
storageType : EnumDeviceStorageType,
{ path : STRING,
nextCommand : EnumNextCommandMode,
dataScope : EnumDeviceDataScope,
kindOfData : EnumDeviceKindOfData,
}
): StructRetUnitDataSetCommand
Input parameters
unitName
Data type: STRING
Name of the unit (e.g. ST source file, MCC unit), whose unit variables will be imported.
The name must be indicated in lower case and inside single quotation marks (e.g.
'st_unit1').
Specifying ’_device’ (for importing global device variables) is not permissible here (only
possible with _loadUnitDataSet).
id
Data type: UDINT
Number of the data set under which the variable values are saved (maximum of
1_000_000 data sets per unit).
storageType
Data type: EnumDeviceStorageType
USERDEFINED (only default permissible)
Location at which the data is saved.
Basic functions
Function Manual, 05/2009 349
Programming of general standard functions
7.14 Backing up data from the user program
TYPE EnumDeviceStorageType : (
TEMPORARY_STORAGE // temporary data storage
// (RAM disk), erased in the event of a power
failure
, PERMANENT_STORAGE // permanent data storage
// (MemoryCard), retained in the event of a power
failure
END_TYPE
path (optional)
Data type: STRING
Default: ' ' ' (empty string)
Destination path, if storageType = USER_DEFINED.
Note
Only the default value may be specified. Otherwise, an error message is output.
overwrite (optional)
Data type: BOOL
Default: FALSE
If TRUE, existing data set is overwritten.
nextCommand (optional)
Data type: EnumNextCommandMode
Default: IMMEDIATELY
Advance to next command
TYPE EnumNextCommandMode : (
IMMEDIATELY // immediately
, WHEN_COMMAND_DONE ) // After completion or abort
// of the command
END_TYPE
dataScope (optional)
Data type: EnumDeviceDataScope
Default _INTERFACE
Specification of the section whose unit variables will be imported.
Basic functions
350 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
Type EnumDeviceDataScope : (
_INTERFACE // Interface section
, _IMPLEMENTATION // Implementation section
, _INTERFACE_AND_IMPLEMENTATION ) // interface and
// Implementation section
END_TYPE
KindOfData (optional)
Default NO_RETAIN_GLOBAL
Specification of whether non-retentive or retentive global variables will be imported.
TYPE EnumDeviceKindOfData : (
NO_RETAIN_GLOBAL // non-retentive variables
, _RETAIN // retentive variables
, ALL_GLOBAL ) // retentive and non retentive
// variables
END_TYPE
If retentive and non-retentive variables are stored in the exported data set, it is possible
to import retentive or non-retentive variables selectively.
Return value
Basic functions
Function Manual, 05/2009 351
Programming of general standard functions
7.14 Backing up data from the user program
See also
_getStateOfUnitDataSetCommand function (Page 354)
General information on saving data sets from the user program (Page 337)
_loadUnitDataSet function (Page 341)
Declaration
_deleteUnitDataSet (
unitName : STRING,
id : UDINT,
storageType : EnumDeviceStorageType,
{ path : STRING,
nextCommand : EnumNextCommandMode,
}
): StructRetUnitDataSetCommand
Input parameters
unitName
Data type: STRING
Name of the unit (e.g. ST source file, MCC unit); the name must be written in lower
case and placed inside single quotation marks (e.g. 'st_unit1').
If ’_device’ is specified, a data set for global device variables will be deleted (possible
as of Version 3.2 of the SIMOTION Kernel).
id
Data type: UDINT
Number of the data set to be deleted (maximum of 1_000_000 data sets per unit).
storageType
Basic functions
352 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
TYPE EnumDeviceStorageType : (
TEMPORARY_STORAGE // temporary data storage
// (RAM disk),
// is deleted if there is a power failure
, PERMANENT_STORAGE // permanent storage
// (MemoryCard), retained
// with power failure
, USER_DEFINED ) // with path specification
// (in preparation)
END_TYPE
path (optional)
Data type: STRING
Default: ' ' (empty string)
Destination path, if storageType = USER_DEFINED
Note
Only the default can be used for the USER_DEFINED setting.
nextCommand (optional)
Data type: EnumNextCommandMode
Default: IMMEDIATELY
Advance to next command
TYPE EnumNextCommandMode : (
IMMEDIATELY // immediately
, WHEN_COMMAND_DONE ) // After completion or abort
// of the command
END_TYPE
Basic functions
Function Manual, 05/2009 353
Programming of general standard functions
7.14 Backing up data from the user program
Return value
See also
_deleteAllUnitDataSets function (Page 357)
General information on saving data sets from the user program (Page 337)
_exportUnitDataSet function (as of Kernel V3.2) (Page 345)
Declaration
_getStateOfUnitDataSetCommand (
handle : UDINT
) : EnumDeviceUnitDataSetCommand
Input parameters
handle
Data type: DINT
Handle of the data backup function for which the status is to be checked. You received
this handle as a component of the return value of the data backup function.
Basic functions
354 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
Return value
See also
_exportUnitDataSet function (as of Kernel V3.2) (Page 345)
General information on saving data sets from the user program (Page 337)
Declaration
_checkExistingUnitDataSet (
unitName : STRING,
id : UDINT,
storageType : EnumDeviceStorageType,
{ path : STRING,
nextCommand : EnumNextCommandMode,
}
) : StructRetUnitDataSetCommand
Input parameters
unitName
Data type: STRING
Basic functions
Function Manual, 05/2009 355
Programming of general standard functions
7.14 Backing up data from the user program
Name of the unit (e.g. ST source file, MCC unit); the name must be written in lower
case and placed inside single quotation marks (e.g. 'st_unit1').
If ’_device’ is specified, a data set for global device variables will be checked (possible
as of Version 3.2 of the SIMOTION Kernel).
id
Data type: UDINT
Number of the data set (max. 1_000_000 data sets per unit).
storageType
Data type: EnumDeviceStorageType
Location at which the data are stored.
TYPE EnumDeviceStorageType : (
TEMPORARY_STORAGE // temporary data storage
// (RAM Disk),
// is deleted if there is a power failure
, PERMANENT_STORAGE // permanent storage
// (MemoryCard), retained
// with power failure
, USER_DEFINED ) // with path specification
// (only default is permissible)
END_TYPE
path (optional)
Data type: STRING
Default: ' ' (empty string)
Destination path, if storageType = USER_DEFINED
Only default value may be specified.
nextCommand (optional)
Data type: EnumNextCommandMode
Default: IMMEDIATELY
Advance to next command
TYPE EnumNextCommandMode : (
IMMEDIATELY // immediately
, WHEN_COMMAND_DONE ) // After completion or abort
// of the command
END_TYPE
Basic functions
356 Function Manual, 05/2009
Programming of general standard functions
7.14 Backing up data from the user program
Return value
See also
_exportUnitDataSet function (as of Kernel V3.2) (Page 345)
Declaration
_deleteAllUnitDataSets (
unitName : STRING,
storageType : EnumDeviceStorageType,
{ path : STRING,
nextCommand : EnumNextCommandMode,
}
) : StructRetUnitDataSetCommand
Basic functions
Function Manual, 05/2009 357
Programming of general standard functions
7.14 Backing up data from the user program
Input parameters
unitName
Data type: STRING
Name of the unit (e.g. ST source file, MCC unit); the name must be written in lower
case and placed inside single quotation marks (e.g. 'st_unit1').
If ’_device’ is specified, all data sets for global device variables will be deleted (possible
as of Version 3.2 of the SIMOTION Kernel).
storageType
Data type: EnumDeviceStorageType
Location from which the data set is to be deleted.
TYPE EnumDeviceStorageType : (
TEMPORARY_STORAGE // temporary storage
// (RAM disk),
// is deleted if there is a power failure
, PERMANENT_STORAGE // permanent data storage
// (MemoryCard), retained
// with power failure
, USER_DEFINED ) // with path specification
// (only default permissible)
END_TYPE
path (optional)
Data type: STRING
Default: ' ' ' (empty string)
Destination path, if storageType = USER_DEFINED.
Only default value may be specified.
nextCommand (optional)
Data type: EnumNextCommandMode
Default: IMMEDIATELY
Advance to next command
TYPE EnumNextCommandMode : (
IMMEDIATELY // immediately
, WHEN_COMMAND_DONE ) // After completion or abort
// of the command
END_TYPE
Basic functions
358 Function Manual, 05/2009
Programming of general standard functions
7.15 Functions for commandId
Return value
See also
_exportUnitDataSet function (as of Kernel V3.2) (Page 345)
Declaration
_getCommandId ( ) : CommandIdType
Input parameters
None
Basic functions
Function Manual, 05/2009 359
Programming of general standard functions
7.15 Functions for commandId
Return value
TYPE
CommandIdType : STRUCT
SystemId_low : UDINT; // Lower-order part
SystemId_high : UDINT; // Higher-order part
END_STRUCT
END_TYPE
See also
Using the commandId parameter correctly (Page 454)
Declaration
_getSyncCommandId ( ) : CommandIdType
Input parameters
None
Return value
TYPE
CommandIdType : STRUCT
SystemId_low : UDINT; // Lower-order part
Basic functions
360 Function Manual, 05/2009
Programming of general standard functions
7.16 Defining the waiting time
See also
Using the commandId parameter correctly (Page 454)
NOTICE
The function should be used in MotionTasks only; using it in cyclic tasks may lead to time
monitoring errors!
• With SynchronousTasks: As of SIMOTION Kernel V3.2 you may configure if time
monitoring is suspended. Time monitoring is active by default.
With IPOsynchronousTask, additionally take the following into account:
UserInterruptTasks will no longer be started by their triggering event!
• With other cyclic tasks (BackgroundTask, TimerInterruptTasks): Time monitoring is
always active.
In cyclic tasks, use the timer system function blocks (see Timers) to implement waiting
times.
1Up to Version V3.1 of the SIMOTION Kernel, time monitoring is suspended for the
SynchronousTasks.
Declaration
_waitTime (
timeValue : TIME // Wait time
) : DINT // always = 0
Basic functions
Function Manual, 05/2009 361
Programming of general standard functions
7.17 Device-specific functions
Input parameter
timeValue
Data type: TIME
Indicates the time interval during which task processing is interrupted.
Return value
See also
Timers (Page 413)
Time allocation in the round robin execution level (Page 194)
Wait times in cyclic tasks (Page 454)
Declaration
_getDeviceId (
idType : EnumDeviceIdType
) : StructRetGetDeviceId0
Input parameters
idType
Data type: EnumDeviceIdType
Specification of the ID to be read
Basic functions
362 Function Manual, 05/2009
Programming of general standard functions
7.17 Device-specific functions
TYPE EnumDeviceIdType : (
SERIAL_NUMBER ) // Serial number
, HW_TYPE // Hardware type
, SPECIFIC_NUMBER ) //
END_TYPE
Return value
Declaration
_getMemoryCardId (
idType : EnumMemoryCardIdType
) : StructRetGetMemoryCardId0
Basic functions
Function Manual, 05/2009 363
Programming of general standard functions
7.17 Device-specific functions
Input parameters
idType
Data type: EnumMemoryCardIdType
Specification of the ID to be read
TYPE EnumMemoryCardIdType : (
SERIAL_NUMBER ) //Serial number
END_TYPE
Return value
Declaration
_setDeviceErrorLED ( ) : DINT
Basic functions
364 Function Manual, 05/2009
Programming of general standard functions
7.17 Device-specific functions
Input parameters
None
Return value
Description
As of V4.1.2, you can set freely usable bits or bits not supported by SIMOTION RT in the
STW1_Device of message frame 39x to DO1 with the system function _setDriveObjectSTW.
Declaration
_setDriveObjectSTW
(DINT logAddress,
UINT STW1BitMask,
UINT STW1BitSet)
Input parameters
LogAddr Logical base address of the output message frame for the drive
object.
STW1BitMask Bit mask for selecting the affected bits in the control word of the
output message frame. Bits that are operated autonomously in
the connection to the drive object of SIMOTION (e.g. for the
synchronization, fault handling, etc.) cannot be accessed by this
function.
STW1BitSet Bit-coded value for writing in the control word of the output
message frame. Only those bits selected via STW1BitMask are
written
Basic functions
Function Manual, 05/2009 365
Programming of general standard functions
7.17 Device-specific functions
Return value
Bit assignment and reservation of the STW bits in the 39x-message frames:
Basic functions
366 Function Manual, 05/2009
Programming of general standard functions
7.18 Determine the memory size of a variable or of a data type
Declaration
_sizeOf (
in : ANY // Identifier of the data type or
// of the variables
) : DINT
Input parameters
in
Data type: ANY
Identifier of the variable or data type, whose size is to be determined.
Return value
TYPE
a_type : STRUCT
a : LREAL; // 8 bytes
b : BOOL; // 1 byte
END_STRUCT;
END_TYPE
//..
x := _sizeOf (a_type); // supplies value 16
Basic functions
Function Manual, 05/2009 367
Programming of general standard functions
7.19 Additional available system functions
Table 7- 16 Overview of additional system functions and system function blocks in SIMOTION ST
7.20.1.1 General
You can use the following functions to program messages, e.g. error messages, or check
their status:
● _alarmSId (generation of a message without acknowledgment)
● _alarmSqId (generation of a message with acknowledgment)
● _alarmScId (query about message status)
However the prerequisite is an application-specific configured message name
Note
You can use the _writeAndSendMessage function to make user-defined entries in the
diagnostic buffer. For a description of this function, refer to the Parameter Manuals for
SIMOTION devices.
Basic functions
368 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
Note
You should only generate an outgoing message after an incoming one, otherwise an error
message is output.
Commands in which the configured message name is transferred can only be called in the
short form, i.e. with a complete listing of all parameter values, but without specifying the
formal parameters.
The auxiliary value (optional) must be a variable of an elementary data type. Avoid the use of
constant values in the function call!
Basic functions
Function Manual, 05/2009 369
Programming of general standard functions
7.20 Application of certain system functions
7.20.1.3 AlarmId
The message to be generated is specified by means of the AlarmId for the _alarmSId,
_alarmSqId, and _alarmScId functions. You can obtain the AlarmId for a configured message
name in the following way:
● As variable _alarm.name, whereby name is the message identifier, as configured in
SIMOTION SCOUT.
● With the _getAlarmId(name) function.
See also
_alarmSId function (Page 279)
_getAlarmId function (Page 286)
Description
A message list with 40 buffer areas is available for the AlarmS messages. The AlarmS
messages are entered in this message list with their ID. For each outgoing AlarmS an
incoming AlarmS with the same ID must exist in the message list. For each of the in total 40
list entries there is also a send buffer. This send buffer is used to organize the notification of
the registered client (HMI or SIMOTION SCOUT).
Basic functions
370 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
Basic functions
Function Manual, 05/2009 371
Programming of general standard functions
7.20 Application of certain system functions
INTERFACE
PROGRAM handleAlarm;
END_INTERFACE
IMPLEMENTATION
PROGRAM handleAlarm
VAR
retVal : DWORD; // Return value
temperature : INT; // Status to be checked
maxTemperature: INT := 60; // Comparison value for status
mySignal : BOOL := FALSE; // Signal status yes/no
END_VAR
//...
IF temperature > maxTemperature THEN
IF mySignal = FALSE THEN
// Incoming message, does not require
acknowledgement
retVal := _alarmSId (
Sig := TRUE,
Ev_id := _alarm.SCOUT_alarm_name,
Sd := temperature);
mySignal := TRUE;
END_IF;
ELSE
IF mySignal = TRUE THEN
// Outgoing message, does not require
acknowledgement
retVal := _alarmSId (
Sig := FALSE,
Ev_id := _alarm.SCOUT_alarm_name,
Sd := temperature);
mySignal := FALSE;
END_IF;
END_IF;
//...
END_PROGRAM
Basic functions
372 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
7.20.1.6 Checking the error number and status of a message (filtering return values)
The return value of the _alarmSId and _alarmSqId functions contains the error number and
thus indicates whether an error occurred during execution. As with most system functions,
return value = 0 indicates error-free execution.
However, the return value of the _alarmScId function indicates both the error number and the
status of a message. For this reason, you must first filter the return value with the
ALARMS_ERROR constant (= 16#8000) when checking the status with these functions. This
enables you to determine whether an error occurred while the function was being executed.
The filter and the error numbers are selected such that they are true when combined in an
AND operation. If no error has occurred, you can evaluate the status of the message.
You can find a complete listing of error numbers and message states under Functions for the
message programming.
Consequently, you can check for errors when the _alarmScId command is dispatched (the
retVal variable of data type DWORD contains the return value of the function) as follows:
Note
You can use constant values and symbolic constants on an equal footing to check for errors;
see Functions for the message programming.
Basic functions
Function Manual, 05/2009 373
Programming of general standard functions
7.20 Application of certain system functions
Note
Consistent data access is always ensured within a task.
7.20.2.2 Semaphores
To ensure consistent reading and writing of global variables, you work with semaphores.
A global variable (e.g. semaA) of data type DINT is used as a semaphore. If the variable is
an element of an array, the index must be specified when compiling (e.g. a[2]).
Use the following functions to change and test the status of the semaphore:
● _testAndSetSemaphore (sema : DINT) : BOOL
This function is used to check whether the semaphore is set:
– Return value TRUE: The semaphore is enabled.
– Return value FALSE: The semaphore is set.
When the function is ended, the semaphore is always set. Additional calls of this function
(even from other programs) return a value of FALSE, until the _releaseSemaphore
(semaA) function is called.
● _releaseSemaphore (sema: DINT) : VOID
For information on the formal structure of functions, see Section Working with variables.
The semaphore is released.
Consistent data access to global variables is ensured under the following conditions:
1. All tasks signal access to global variables by setting a semaphore.
2. All tasks access global variables only when the semaphore is enabled.
Basic functions
374 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
Table 7- 19 Example for ensuring consistent access to global variables using semaphores
IMPLEMENTATION
VAR_GLOBAL
myArray : ARRAY [0..1] OF DINT;
semaA : DINT;
END_VAR
PROGRAM Writer
// Consistent writing of variables
IF _testAndSetSemaphore(sema := semaA) THEN
myArray[0] := 18;
myArray[1] := 19;
_releaseSemaphore(sema := semaA);
// The semaphore must be released in the TRUE
// branch of the query; this ensures that
// it is only released when it has been
// reset.
ELSE
; // Error handling
END_IF;
// _releaseSemaphore(sema := semaA);
// The release would be incorrect at this point;
// the semaphore would always be released.
END_PROGRAM
PROGRAM Reader
VAR
var0 : DINT;
var1 : DINT;
END_VAR
// Consistent reading of variables
IF _testAndSetSemaphore(sema := semaA) THEN
var0 := myArray[0];
var1 := myArray[1];
_releaseSemaphore(sema := semaA);
// The semaphore must be released in the TRUE
// branch of the query; this ensures that
// it is only released when it has been
// reset.
ELSE
; // Error handling
END_IF;
// _releaseSemaphore(sema := semaA);
// The release would be incorrect at this point;
// the semaphore would always be released.
END_PROGRAM
END_IMPLEMENTATION
Basic functions
Function Manual, 05/2009 375
Programming of general standard functions
7.20 Application of certain system functions
7.20.3.1 Data backup and data initialization from user program - functions and instructions
From a user program, it is possible to save, load, or initialize the values of the following
variables in data sets:
● Non-retentive or retentive unit variables of the interface or implementation section of a
unit (e.g. ST source file, MCC unit).
● Non-retentive or retentive global device variables.
Various functions are available for this, see Backing up data from the user program
(Page 337).
● _saveUnitDataSet: The values are stored as a binary data set (_saveUnitDataSet function
(Page 337)).
● _loadUnitDataSet: The values are loaded from a binary data set saved with
_saveUnitDataSet (_loadUnitDataSet function (Page 341)).
Loading the data set is only possible if since saving the data set the version IDs of all
data segments to be loaded have remained unchanged.
Please also pay attention to the note below.
● _exportUnitDataSet (as of Version V3.2 of the SIMOTION Kernel): The values are
exported in XML format as ZIP archive (file name *.dat) (_exportUnitDataSet function (as
of Kernel V3.2) (Page 345)).
● _importUnitDataSet (as of Version V3.2 of the SIMOTION Kernel): The values are
imported from a data set that was exported in XML format as ZIP archive (file name *.dat)
with _exportUnitDataSet (_importUnitDataSet function (as of Kernel V3.2) (Page 348)).
Importing the data set is also possible if, since the data set was saved, the version ID of a
data segment to be loaded has changed:
– Variables that no longer exist are ignored.
– The value of added variables remains unchanged.
You can, for example, initialize the relevant data segments with _importUnitDataSet
before importing a data set to avoid unwanted values in variables.
– In the case of a variable with a changed data type, the value is transferred if it can be
converted to the new data type; otherwise the value of the variable is retained.
● _deleteUnitDataSet: A single data set is deleted (_deleteUnitDataSet function
(Page 352)).
● _checkExistingUnitDataSet: A check determines whether the specified data set exists on
the storage medium (_checkExistingUnitDataSet function (Page 355)).
● _deleteAllUnitDataSets: All data sets are deleted (_deleteAllUnitDataSets function
(Page 357)).
● _resetUnitData (as of Version V3.2 of the SIMOTION Kernel): The values of the variables
are initialized, see System Functions of Devices parameter manual.
For data segments and their version ID, see Section Time of variable initialization, Table
Version ID of global variables and their initialization during download, which can be found in
the various programming manuals.
Basic functions
376 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
The description for _resetUnitData can be found in the parameter manual (reference list) for
the system functions of the SIMOTION devices.
Here is a more detailed explanation of the parameters.
NOTICE
If the data structure of a data segment is changed in a unit or in the global device variables,
the following applies to loading the project into the SIMOTION device:
• All temporarily backed-up data sets are deleted.
• None of the binary data sets that have been permanently saved (with
_saveUnitDataSet) can be read for this data segment any longer.
Note
You can upload data sets saved with _saveUnitDataSet or _exportUnitDataSet from the
SIMOTION device. Use the Save variables function in SIMOTION SCOUT. The data sets
saved with _saveUnitDataSet are automatically converted to XML format.
You can use the Restore variables function to download these data sets and variables back
to the SIMOTION device. For this purpose select the relevant SIMOTION device in the
project navigator and select the function from the context menu. For more information, refer
to the SIMOTION SCOUT configuration manual.
This makes it possible, for example, to obtain the data saved with _saveUnitDataSet, even if
it is initialized by a project download or if it becomes unusable (e.g. due to a SIMOTION
version change).
Basic functions
Function Manual, 05/2009 377
Programming of general standard functions
7.20 Application of certain system functions
● storageType: Specifying the storage location allows you to select the following:
– TEMPORARY_STORAGE: Data is saved to the RAM disk (deleted after a power
failure).
– PERMANENT_STORAGE: Data is saved to a memory card (and retained after a
power failure).
● nextCommand: Step enabling condition
Specifying the step enabling conditions enables you to select from the following options:
– Execute next command in the ST source file immediately (IMMEDIATELY).
– Wait until command is done (WHEN_COMMAND_DONE).
For information on step enabling conditions, refer to the relevant description in this
chapter.
● dataScope
The parameter is available with SIMOTION Kernel Version V3.2 and higher.
It enables the section of the unit to which the data backup function is applied to be
selected.
– _INTERFACE: Function is applied to the interface section of a unit.
– _IMPLEMENTATION: Function is applied to the implementation section of a unit.
– _INTERFACE_AND_IMPLEMENTATION: Function is applied to the interface and
implementation section of a unit.
If unitName = ’_device’ is specified, only the values _INTERFACE or
_INTERFACE_AND_IMPLEMENTATION are permissible for dataScope.
Up to and including Version V3.1 of the SIMOTION Kernel, it is only possible to apply
the data backup function to non-retentive variables in the interface section of a unit.
● KindOfData:
The parameter is available with SIMOTION Kernel Version V3.2 and higher.
It permits selection of whether the data backup function will be applied to retentive or
retentive global variables.
– NO_RETAIN_GLOBAL: Function is applied to non-retentive global variables.
– _RETAIN: Function is applied to retentive global variables.
– ALL_GLOBAL: Function is applied to retentive and non-retentive global variables.
If retentive and non-retentive variables are stored in a data set, it is possible to load or
import retentive or non-retentive variables selectively.
Up to and including Version 3.1 of the SIMOTION Kernel, it is only possible to apply the
data backup function to non-retentive variables in the interface section of a unit.
Basic functions
378 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
NOTICE
Do not fill the entire available memory space with data sets! Otherwise, it will no longer be
possible to download a project to the target system or copy RAM to ROM if project data are
increased!
You can estimate the required memory space for binary data sets (saved with
_saveUnitDataSet) with the following information:
● Elementary data types occupy their natural data width on the memory (see Table Bit
widths and value ranges of the elementary data types in Section Elementary data types;
data type BOOL occupies 1 byte).
● Additional memory space is required due to:
– Adaptation of the memory addresses to word or double-word boundaries
– Consistency information (approx. 100 bytes per data set)
– Usual supplementary data of a file system (e.g. sector headers, directory, occupy
whole sectors only)
For data sets exported in XML format (with _exportUnitDataSet), the memory requirement is
much higher and cannot be ascertained in this way.
Basic functions
Function Manual, 05/2009 379
Programming of general standard functions
7.20 Application of certain system functions
Table 7- 20 Call of a data backup function with step enabling condition WHEN_COMMAND_DONE
VAR_GLOBAL
ds_ret : StructRetUnitDataSetCommand;
error : BOOL := FALSE;
END_VAR
PROGRAM save_data_seq
// Program is assigned to a sequential task.
// Function is executed synchronously:
ds_ret := _loadUnitDataSet (
unitName := 'ds3',
id := 1,
storageType:= TEMPORARY_STORAGE,
nextCommand := WHEN_COMMAND_DONE);
// Function completed, evaluate result
IF (ds_ret.functionResult <> DONE) THEN
error := TRUE; // error
END_IF;
END_PROGRAM
This procedure is primarily used in sequential tasks.
The execution of this function may take quite a long time. Therefore, the time watchdog
might respond in connection with cyclic tasks (e.g. BackgroundTask). For this reason, the
function can also be executed asynchronously by setting the nextCommand parameter to
IMMEDIATELY. In this case, the function is started, and then the next command in the
source is immediately processed.
From the return value you can see:
● If the start was successful (component functionResult = DONE)
● A handle for further status query (handle component)
If the command start was successful, you must check the current status of the data backup
function using the _getStateOfUnitDataSetCommand function and the handle until the result
is something other than ACTIVE (see example).
Table 7- 21 Function call of a data backup function with step enabling condition IMMEDIATELY
VAR_GLOBAL
error : BOOL := FALSE;
ds_rslt : EnumDeviceUnitDataSetCommand;
ds_ret : StructRetUnitDataSetCommand;
cmd_busy : BOOL := FALSE;
Basic functions
380 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
PROGRAM save_data_cycl
// Program is assigned to a cyclic task.
IF NOT cmd_busy THEN
cmd_busy := TRUE;
// Function is executed asynchronously:
ds_ret := _saveUnitDataSet (
unitName := 'ds1',
id := 1,
storageType:= TEMPORARY_STORAGE,
overwrite := TRUE,
nextCommand:= IMMEDIATELY);
IF (ds_ret.functionResult <> DONE) THEN
cmd_busy := FALSE;
error := TRUE; // Start of the function has failed
// (e.g. too many services)
END_IF;
ELSE
// Function is running, wait for result:
ds_rslt := _getStateOfUnitDataSetCommand (
ds_ret.handle);
IF (ds_rslt <> ACTIVE) THEN
cmd_busy := FALSE;
IF (ds_rslt = DONE) THEN
cmd_done := TRUE;// Function successfully
// completed
ELSE
error := TRUE;// Function failed
END_IF;
END_IF;
END_IF;
END_PROGRAM
7.20.4 Converting between any data types and byte arrays (marshalling)
Conversion of variables of any data type to byte arrays, and vice versa, is frequently used in
order to create defined transmission formats for data exchange between different devices
(see also Section Communication functions).
Variables of any data type (elementary data types, standard data types of technology
packages and devices, and user-defined data types) can be converted to byte arrays, and
vice versa, using the following functions:
● AnyType_to_BigByteArray (Page 311)
● AnyType_to_LittleByteArray (Page 311)
Basic functions
Function Manual, 05/2009 381
Programming of general standard functions
7.20 Application of certain system functions
NOTICE
TO data types cannot be converted (for information about TO data type conversion, see
Section Conversion of technology object data types).
If structures and arrays are to be converted, consistency is guaranteed only at the
elementary variable level. Any higher level of consistency must be ensured by the user (see
Sections Consistent reading and writing of variables (semaphores) and Working with
variables).
Note
The following data types are not portable convertible, i.e their transmission formats are not
defined across systems. Conversions between SIMOTION devices are possible without any
restrictions:
• Time types: For conversion format, see Table
• Enumerators (enumeration data types)
When converting these data types, the compiler outputs a warning (16013).
Basic functions
382 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
NOTICE
The marshalling function result may cause errors when the program is running, the error
response set in the task configuration will then be triggered, see Execution errors in
programs (Page 96).
Proceed with caution when converting byte arrays to the general ANY_REAL data type or
to structures that contain this data type. The bit string from the byte array is taken
unchecked as the ANY_REAL value. You must make sure that the bit string of the byte
array corresponds to the bit pattern of a normalized floating-point number according to
IEEE 754. To do this, you can use the _finite (Page 319) and _isNaN (Page 320) functions.
Otherwise, an error can be triggered (FPU exception (Page 97)) as soon as the ANY_REAL
value is first used for an arithmetic operation (for example, in the program or when
monitoring in the symbol browser).
TYPE
Struct_1 : STRUCT
m_word : WORD;
m_byte : BYTE;
END_STRUCT;
Struct_2 : STRUCT
m_struct : ARRAY [0..2] OF Struct_1;
m_lreal : LREAL;
END_STRUCT;
END_TYPE
VAR
gsbVar : Struct_2;
big_b_Array : ARRAY [0..16] OF BYTE;
lit_b_Array : ARRAY [0..16] OF BYTE;
END_VAR
Basic functions
Function Manual, 05/2009 383
Programming of general standard functions
7.20 Application of certain system functions
gsbVar.m_struct[2].m_word := WORD#16#A881;
gsbVar.m_struct[2].m_byte := BYTE#16#BC;
gsbVar.m_lreal := LREAL#-12345.6789e123;
// Conversion to Big Endian
big_b_Array := AnyType_to_BigByteArray (
anyData := gsbVar,
offset := 0);
// Content of the elements of big_b_array (Big Endian):
// See 2nd column in following table
Table 7- 25 Content of the array elements of big_b_array and lit_b_array from example
Basic functions
384 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
Further information
Additional information is also available in the Communication system/configuration manual.
The program on the receiving device recognizes whether it is the data packet to be received
on the basis of a user-definable integer appended to the data packet. The data exchange is
only successful if the user program accepts and does not reject the data packet.
The sent data is in the form of byte sequences in an array, i.e. the data has no logical
structure. SIMOTION devices can send or receive up to 200 bytes at once; the actual user
data length depends on the communication peer.
You can check the status of an XSend or XReceive request with the _GetStateOfXCommand
command.
Basic functions
Function Manual, 05/2009 385
Programming of general standard functions
7.20 Application of certain system functions
Basic functions
386 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
● The mandatory commandId parameter is used for internal command detection in ST. The
parameter value should be saved to a local variable (CommandIdType data type) with the
_getCommandId function. This variable can be used as a parameter value.
● The data packet (data parameter) involves a list containing 200 entries of 1 byte each.
The list does not have to be this long if the amount of data you are sending is less than
the maximum.
● The data length (dataLength parameter) is used to specify the actual length of the data
packet to be transmitted.
● You can determine whether the command was successfully executed (return value = 0)
on the basis of the return value.
If a return value other than 0 is returned, an error has occurred (see the command syntax
in the Parameter Manual for the SIMOTION devices).
Basic functions
Function Manual, 05/2009 387
Programming of general standard functions
7.20 Application of certain system functions
NOTICE
The parameters for the _Xsend and _Xreceive commands have different names in the
SIMOTION system are in some cases have a different meaning than those you used in
your previous SIMATIC S7 system. You will find a comparison in the following tables.
The _GetStateOfXCommand command does not exist in an SIMATIC S7 system, thus
eliminating the need for comparison.
Table 7- 27 Comparison of the parameters for _Xsend in SIMATIC S7 and SIMOTION devices
Basic functions
388 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
Table 7- 28 Comparison of the parameters for _Xreceive in SIMATIC S7 and SIMOTION devices
Basic functions
Function Manual, 05/2009 389
Programming of general standard functions
7.20 Application of certain system functions
INTERFACE
PROGRAM xsend_control;
END_INTERFACE
IMPLEMENTATION
// The following program must be assigned
// to a MotionTask.
// In the task configuration, the "Activation
// after Startup Task" option must be selected.
PROGRAM xsend_control
VAR
retVal : DINT;
myAddress : StructXSendDestAddr;
myStaddr : ARRAY[0..4] OF BYTE;
myData : ARRAY[0..199] OF BYTE;
END_VAR
// Specify destination address and PROFIBUS interface ////////
myAddress.deviceID := 1;
// PROFIBUS interface X8
myAddress.remoteStaddrLength := 1;
// must always be assigned a value of 1
myAddress.remoteStaddr[0] := 4;
// PROFIBUS address of the receiving station
// Send data
myData[0] := 170;
Basic functions
390 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
, data := myData
, dataLength := 1
);
END_PROGRAM
END_IMPLEMENTATION
INTERFACE
PROGRAM xreceive_control;
END_INTERFACE
IMPLEMENTATION
VAR_GLOBAL
retVal : StructRetXReceive;
END_VAR
// The following program must be assigned
// to a MotionTask.
// In the task configuration, the "Activation
// after Startup Task" option must be selected.
PROGRAM xreceive_control
Table 7- 31 Communication steps of a TCP/IP connection and the corresponding system functions
Basic functions
Function Manual, 05/2009 391
Programming of general standard functions
7.20 Application of certain system functions
The system functions are described in detail in the Parameter Manual for the SIMOTION
devices, in the chapter on system functions.
Note
A sender or receiver can be a client as well as a server when establishing a connection.
There must be at least one client and one server to establish TCP/IP connection.
The client-server relationship is only valid until the connection is established. After
connection is established, both communication peers are equivalent, i.e. each of the two can
send or receive or close the connection at any point of time.
For detailed information, please refer to the Frequently Asked Questions (FAQs) on
SIMOTION Utilities & Applications (DVD2 - CD_14).
Basic functions
392 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
NOTICE
Synchronous start for motion commands is only ensured if the following conditions are
satisfied:
1. Commands included in a synchronous start must act on various technology objects.
2. The technology objects involved must be in the same execution level (IPO or IPO_2).
3. When you use the Synchronous Start command in MCC, you must generate the
UserInterruptTask_1 since this is called in the event of an error. You can program an
error response in this task, see UserInterruptTasks (Page 169).
The task controller is temporarily shut down during the synchronous start. It is not restarted
until the following conditions are met:
● All single-axis commands and synchronous operation and cam commands in the
branches have been started
● All basic commands in the branches have been completed
Start interruptions by other tasks (except SynchronousTasks) are thus prevented. This can
cause a timeout to occur in cyclic tasks (BackgroundTask, TimerInterruptTasks). This error
can be detected and caught by programming the TimeFaultBackgroundTask or
TimeFaultTask appropriately.
The BEGIN_SYNC, END_SYNC, and _startSyncCommand functions are system functions of
SIMOTION devices; for more information, refer to the parameter manual for the relevant
SIMOTION device.
Note
Synchronous start is often used in conjunction with the WAITFORCONDITION construct. In
this case, the system waits for a condition to be fulfilled before the synchronized start. The
_startSyncCommand function must not occur within the WAITFORCONDITION construct.
Basic functions
Function Manual, 05/2009 393
Programming of general standard functions
7.20 Application of certain system functions
Table 7- 32 Sample program for synchronized start of two axes with WAITFORCONDITION
INTERFACE
USEPACKAGE cam;
PROGRAM sync_motion;
END_INTERFACE
IMPLEMENTATION
EXPRESSION wait_sync_expression
wait_sync_expression := TRUE;
END_EXPRESSION
PROGRAM sync_motion
VAR
ret_val : DINT;
sync_id : CommandIdType;
END_VAR
sync_id := _getSyncCommandId();
BEGIN_SYNC(sync_id);
(* Position axis ('Pos') *)
ret_val := _pos (axis := Axis_1,
positioningMode := ABSOLUTE,
position := 100,
mergeMode := IMMEDIATELY,
nextCommand := IMMEDIATELY,
commandId := _getCommandId() );
(* Position axis ('Pos') *)
ret_val := _pos (axis := Axis_2,
positioningMode := ABSOLUTE
position := 50
mergeMode := IMMEDIATELY
nextCommand := IMMEDIATELY,
commandId := _getCommandId() );
END_SYNC();
WAITFORCONDITION wait_sync_expression DO
;
END_WAITFORCONDITION;
ret_val := _startSyncCommands(sync_id);
// In case of an error, start of the UserInterruptTask
//IF (_ret_val <> 0) THEN
_startTask(UserInterruptTask_1);
END_IF;
END_PROGRAM
END_IMPLEMENTATION
Basic functions
394 Function Manual, 05/2009
Programming of general standard functions
7.20 Application of certain system functions
To check the correct completion of the synchronous start, you can query whether the
commands of the two axes started in the previous example have been completed without
error.
The following MCC sample program shows a synchronous start with two axes and
subsequent query of the group variable _MccRetSyncStart. This is not equal to 0 when a
command within the synchronous start had a return value not equal to 0.
The following is the section from the appropriate ST program (generated here via export
from MCC unit)
_MccCommand1 := _getCommandId();
_MccCommand2 := _getCommandId();
_MccSync := _getSyncCommandId();
BEGIN_SYNC(_MccSync);
(* Start axis position-controlled ('Move') *)
_MccRetDINT_1:=_move(axis:=Axis_1, velocityType:=DIRECT,
velocity:=v_blue, moveTimeOutType:=WITHOUT_TIME_LIMIT,
mergeMode:=IMMEDIATELY, nextCommand:=IMMEDIATELY,
commandId:=_MccCommand1, movingMode:=POSITION_CONTROLLED);
(* Start axis position-controlled ('Move') *)
_MccRetDINT_2:=_move(axis:=Axis_2, velocityType:=DIRECT,
velocity:=v_red, moveTimeOutType:=WITHOUT_TIME_LIMIT,
mergeMode:=IMMEDIATELY, nextCommand:=IMMEDIATELY,
commandId:=_MccCommand2, movingMode:=POSITION_CONTROLLED);
Basic functions
Function Manual, 05/2009 395
Programming of general standard functions
7.20 Application of certain system functions
WAITFORCONDITION _MccMCC_1Condition1 DO
;
END_WAITFORCONDITION;
_MccRetDINT := _startSyncCommands(_MccSync);
// Start of the UserInterruptTask
IF (_MccRetDINT <> 0) THEN
_startTask(UserInterruptTask_1);
END_IF;
_MccRetStructRetMotionCommandState := _getMotionStateOfAxisCommand
(Axis_1, _MccCommand1);
WHILE ((_MccRetStructRetMotionCommandState.functionResult = 0 )
AND (_MccRetStructRetMotionCommandState.motionCommandIdState <>
IN_CONSTANT_MOTION) AND
(_MccRetStructRetMotionCommandState.motionCommandIdState <>
NOT_EXISTENT)) DO
_MccRetDINT := _waitTime(T#0d_0h_0m_0s_0ms);
_MccRetStructRetMotionCommandState :=
_getMotionStateOfAxisCommand(Axis_1, _MccCommand1);
END_WHILE;
_MccRetStructRetMotionCommandState :=
_getMotionStateOfAxisCommand(Axis_2, _MccCommand2);
WHILE ((_MccRetStructRetMotionCommandState.functionResult = 0 )
AND (_MccRetStructRetMotionCommandState.motionCommandIdState <>
IN_CONSTANT_MOTION) AND
(_MccRetStructRetMotionCommandState.motionCommandIdState <>
NOT_EXISTENT)) DO
_MccRetDINT := _waitTime(T#0d_0h_0m_0s_0ms);
_MccRetStructRetMotionCommandState :=
_getMotionStateOfAxisCommand(Axis_2, _MccCommand2);
END_WHILE;
Basic functions
396 Function Manual, 05/2009
Programming of general standard functions
7.21 HMI (Human Machine Interface) connection
(* ('Else') *)
ELSE
;
(* ('EndIf') *)
END_IF;
Note
Variables that are meant to be available in HMI must always be created as unit variables in
the interface section of a source.
Basic functions
Function Manual, 05/2009 397
Programming of general standard functions
7.21 HMI (Human Machine Interface) connection
Alarms
Everything that is displayed in the alarm list in SCOUT can also be displayed in WinCC
flexible with the appropriate configuration, except SINAMICS alarms!
All SIMOTION and SINAMICS alarms function with OPC Alarm&Event.
The present mechanism is as follows: When generating the HMI project, the SCOUT texts
(axis names, axis alarms, Alarm_S, ...) are synchronized on the HMI; whereby each TO has
a number.
Therefore, when an alarm occurs the TO number, alarm number, coefficient, etc. are
signaled and the HMI then writes the TO number, alarm text with coefficient, time stamp, etc.
With WinCC flexible or ProTool/Pro, warning and error messages of the technology objects
(axes, output cams, measuring inputs, etc.) are output directly on the HMI and are
acknowledged by the operator. The AlarmS concept also provides a method for configuring
and programming user messages. User messages are configured in SIMOTION SCOUT;
messages are called and acknowledged during runtime by calling the appropriate system
commands. OPC supports the same message mechanisms. For the OPC export, an
additional OPC alarm/event must be activated.
Basic functions
398 Function Manual, 05/2009
Programming of general standard functions
7.21 HMI (Human Machine Interface) connection
INTERFACE
VAR_GLOBAL
consistencyFlag : DINT;
myDint : DINT;
myArray : ARRAY[0..10] OF LREAL;
END_VAR
PROGRAM OPC_Prog;
END_INTERFACE
IMPLEMENTATION
PROGRAM OPC_Prog
IF (consistencyFlag MOD 2) = 1 THEN
myDint := 99;
myArray[0] := 0.0;
myArray[1] := 1.0;
myArray[10] := 10.0;
consistencyFlag := consistencyFlag + 1;
END_IF;
END_PROGRAM
END_IMPLEMENTATION
Option Explicit
Option Base 1
Basic functions
Function Manual, 05/2009 399
Programming of general standard functions
7.21 HMI (Human Machine Interface) connection
Basic functions
400 Function Manual, 05/2009
Programming of general system function blocks 8
8.1 Overview of the function blocks
ST contains a series of system function blocks that you can use in your ST source files
without having to declare them beforehand. You only have to create an instance and assign
the necessary parameters.
Basic functions
Function Manual, 05/2009 401
Programming of general system function blocks
8.1 Overview of the function blocks
Basic functions
402 Function Manual, 05/2009
Programming of general system function blocks
8.2 Bistable elements (set flip-flop)
0RGHRIRSHUDWLRQRI65
6 W
5 W
4 W
Basic functions
Function Manual, 05/2009 403
Programming of general system function blocks
8.2 Bistable elements (set flip-flop)
FUNCTION_BLOCK SR
VAR_INPUT
S1,R : BOOL;
END_VAR
VAR_OUTPUT
Q1 : BOOL;
END_VAR
END_FUNCTION_BLOCK
END_IMPLEMENTATION
0RGHRIRSHUDWLRQRI56
6 W
5 W
4 W
Basic functions
404 Function Manual, 05/2009
Programming of general system function blocks
8.3 Edge detection
FUNCTION_BLOCK RS
VAR_INPUT
R1,S : BOOL;
END_VAR
VAR_OUTPUT
Q1 : BOOL;
END_VAR
END_FUNCTION_BLOCK
0RGHRIRSHUDWLRQRI5B75,*
&/. W
4 W
7$ 7$ 7$
7$ F\FOHWLPH
Basic functions
Function Manual, 05/2009 405
Programming of general system function blocks
8.3 Edge detection
FUNCTION_BLOCK R_TRIG
VAR_INPUT
CLK : BOOL;
END_VAR
VAR_OUTPUT
Q : BOOL;
END_VAR
VAR
M : BOOL := 0;
END_VAR
END_FUNCTION_BLOCK
0RGHRIRSHUDWLRQRI)B75,*
&/. W
4 W
7$ 7$
7$ F\FOHWLPH
Basic functions
406 Function Manual, 05/2009
Programming of general system function blocks
8.4 Counters
FUNCTION_BLOCK F_TRIG
VAR_INPUT
CLK : BOOL;
END_VAR
VAR_OUTPUT
Q : BOOL;
END_VAR
VAR
M : BOOL := 1;
END_VAR
END_FUNCTION_BLOCK
8.4 Counters
Basic functions
Function Manual, 05/2009 407
Programming of general system function blocks
8.4 Counters
Sample code
FUNCTION_BLOCK CTU
VAR_INPUT
CU: BOOL; // Count
R : BOOL; // Reset
PV : INT; // Comparison value
END_VAR
VAR_OUTPUT
Q : BOOL; // Status
CV : INT; // Counter reading
END_VAR
// ... (Code)
END_FUNCTION_BLOCK
Input parameters
CU
Data type: BOOL
Count up if value changes from FALSE to TRUE (positive edge)
R
Data type: BOOL
TRUE: Reset the counter to 0
PV
Data type: INT
Comparison value
Output parameter
Q
Data type: BOOL
Status of counter (CV >= PV)
CV
Data type: INT
Counter value
Basic functions
408 Function Manual, 05/2009
Programming of general system function blocks
8.4 Counters
See also
CTU up counter (Page 407)
Basic functions
Function Manual, 05/2009 409
Programming of general system function blocks
8.4 Counters
Basic functions
410 Function Manual, 05/2009
Programming of general system function blocks
8.4 Counters
Basic functions
Function Manual, 05/2009 411
Programming of general system function blocks
8.4 Counters
Basic functions
412 Function Manual, 05/2009
Programming of general system function blocks
8.5 Timers
8.5 Timers
Timers are elements in your program used to execute and monitor time-driven processes.
ST provides a series of system function blocks that you can access with ST. You can use
timers in your program to do the following:
● Set waiting times
● Enable monitoring times
● Generate pulses
● Measure times
TP pulse
With a signal state change from 0 to 1 at the IN input, time ET is started. Output Q remains
at 1 until elapsed time ET is equal to programmed time value PT. As long as time ET is
running, the IN input has no effect.
The following figure illustrates the mode of operation of the TP pulse timer.
0RGHRIRSHUDWLRQRI73
,1 W
4 W
37
W
Basic functions
Function Manual, 05/2009 413
Programming of general system function blocks
8.5 Timers
TON ON delay
With the signal state change from 0 to 1 at the IN input, time ET is started. The output signal
Q only changes from 0 to 1 if the time ET = PT has elapsed and the input signal IN still has a
value of 1, i.e. the output Q is switched on with a delay. Input signals of shorter durations
than that of programmed time PT do not appear at the output.
The following figure illustrates the mode of operation of the TON ON delay timer.
0RGHRIRSHUDWLRQRI721
,1 W
4 W
37
W
VAR_TEMP
Mytimeout : TON;
End_VAR
Mytimeout(pt := T#2s, IN := TRUE);
IF (mytimeout.q) THEN
//Time expired
ENDIF
Basic functions
414 Function Manual, 05/2009
Programming of general system function blocks
8.5 Timers
PT has elapsed does output Q adopt a signal state of 0. This means that the output is
switched off with a delay.
The following figure illustrates the mode of operation of the TOF OFF delay timer.
0RGHRIRSHUDWLRQRI72)
,1 W
4 W
37
W
Basic functions
Function Manual, 05/2009 415
Programming of general system function blocks
8.6 Splitting bit-string data types
See also
General information for combining bit-string data types (Page 315)
FUNCTION_BLOCK _BYTE_TO_8BOOL
VAR_INPUT
bytein : BYTE;
END_VAR
VAR_OUTPUT
bit0, // Least significant bit
bit1, bit2, bit3, bit4, bit5, bit6,
bit7: BOOL; // Most significant bit
END_VAR
// ... (Code)
END_FUNCTION_BLOCK
Input parameters
bytein
Data type: BYTE
Variable of data type BYTE to be split into 8 variables of data type BOOL.
Output parameter
bit0
...
bit7
Basic functions
416 Function Manual, 05/2009
Programming of general system function blocks
8.6 Splitting bit-string data types
FUNCTION_BLOCK _WORD_TO_2BYTE
VAR_INPUT
wordin : WORD;
END_VAR
VAR_OUTPUT
byte0, // Less significant byte
byte1: BYTE; // More significant byte
END_VAR
// ... (Code)
END_FUNCTION_BLOCK
Input parameters
wordin
Data type: WORD
Variable of data type WORD to be split into 2 variables of data type BYTE.
Output parameter
byte0 (optional)
byte1 (optional)
Data type: BYTE
2 variables with the individual bytes of the input parameter
byte0: less significant byte
byte1: more significant byte
Basic functions
Function Manual, 05/2009 417
Programming of general system function blocks
8.6 Splitting bit-string data types
FUNCTION_BLOCK _DWORD_TO_2WORD
VAR_INPUT
dwordin : DWORD;
END_VAR
VAR_OUTPUT
word0, // Less significant word
word1: WORD; // More significant word
END_VAR
// ... (Code)
END_FUNCTION_BLOCK
Input parameters
dwordin
Data type: DWORD
Variable of data type DWORD to be split into 2 variables of data type WORD.
Output parameter
word0
word1
Data type: WORD
2 variables with the individual bytes of the input parameter
word0: less significant word
word1: more significant word
FUNCTION_BLOCK _DWORD_TO_4BYTE
VAR_INPUT
dwordin : DWORD;
Basic functions
418 Function Manual, 05/2009
Programming of general system function blocks
8.7 Emulation of SIMATIC S7 commands
END_VAR
VAR_OUTPUT
byte0, // Least significant byte
byte1, byte2,
byte3: BYTE; // Most significant byte
END_VAR
// ... (Code)
END_FUNCTION_BLOCK
Input parameters
in
Data type: DWORD
Variable of data type DWORD to be split into 4 variables of data type BYTE.
Output parameter
byte0
byte1
byte2
byte3
Data type: BYTE
Default BYTE#0
2 variables with the individual bytes of the input parameter
byte0: least significant byte
...
byte3: most significant byte
8.7.1 General
The following function blocks are interface-compatible with the commands for the SIMATIC
S7 counters and timers; see the reference manual SIMATIC Statement List (STL) for S7-
300/400.
Note
You should generally use the function blocks in accordance with IEC 61131-3 (counters and
timers).
Basic functions
Function Manual, 05/2009 419
Programming of general system function blocks
8.7 Emulation of SIMATIC S7 commands
See also
General information on counters (Page 407)
Timers (Page 413)
FUNCTION_BLOCK _S7_COUNTER
VAR_INPUT
CU: BOOL;
CD: BOOL;
PV : INT;
S: BOOL;
R : BOOL;
END_VAR
VAR_OUTPUT
Q : BOOL;
CV : INT;
END_VAR;
// ... (Code)
END_FUNCTION_BLOCK
Input parameters
CU
Data type: BOOL
Count up (with edge)
CD
Data type: BOOL
Count down (with edge)
PV
Data type: INT
Preset value
S
Data type: BOOL
Set preset value (with edge)
R
Data type: BOOL
Reset counter (static)
Basic functions
420 Function Manual, 05/2009
Programming of general system function blocks
8.7 Emulation of SIMATIC S7 commands
Output parameter
Q
Data type: BOOL
Counter status
CV
Data type: INT
Counter value
FUNCTION_BLOCK _S7_TIMER
VAR_INPUT
T_Type : WORD;
PR : BOOL;
S: BOOL;
R : BOOL;
TV : TIME;
TV_BCD : WORD;
END_VAR
VAR_OUTPUT
Q : BOOL;
BI: TIME;
END_VAR
// ... (Code)
END_FUNCTION_BLOCK
Basic functions
Function Manual, 05/2009 421
Programming of general system function blocks
8.7 Emulation of SIMATIC S7 commands
Input parameters
T_TYPE
Data type: WORD
S7 timer function to be executed
TYPE_S7T_SI_ = 16#0001 SI SP
TYPE_S7T_SV_ = 16#0002 SV SEE
TYPE_S7T_SE_ = 16#0004 SE SD
TYPE_S7T_SS_ = 16#0008 SS SS
TYPE_S7T_SA_ = 16#0010 SA SF
TYPE_S7T_BCD_IN = 16#0020 SA SF
TYPE_S7T_SI_ = 16#0040 R FR
TYPE_S7T_SI_ = 16#0080 L LC (U; UN; X ...)
FR
Data type: BOOL
Release
S
Data type: BOOL
Set preset value
R
Data type: BOOL
Reset timer
TV
Data type: TIME
Preset value (as data type TIME)
TV_BCD
Data type: WORD
Preset value in S7 coding
Output parameter
Q1
Data type: BOOL
Timer status
BI
Data type: TIME
Current time
Basic functions
422 Function Manual, 05/2009
SIMOTION memory concept (in the target device) 9
9.1 Overview of the memory in the target device
Memory types
SIMOTION has a staggered memory management concept. A distinction is made in the
target device between the DRAM (RAM disk and RAM) and the SRAM/NVRAM. The data
(TOs, units and TPs) in the DRAM are lost when the device is switched off whereas the
SRAM/NVRAM can retentively store smaller data quantities. A removable data medium (CF
card or memory card) is also available as ROM.
RAM disk
The RAM disk is a virtual memory that can be controlled in the same way as a hard disk, but
can be accessed much faster. A fixed memory area is reserved for the RAM disk in the
DRAM of the target device. After the download, the RAM disk contains the hardware and
device configuration, technology packages (TP), configuration data of the technology
objects, and the program units. With Copy RAM to ROM, the contents of the RAM disk are
written to the ROM (on the card). During an upload, the data is loaded from the RAM disk to
the programming device. You can display the utilization of the RAM disk in the device
diagnostics under System utilization (ONLINE only).
RAM
User data (user RAM) and system data (system RAM) are stored in the RAM. The user RAM
contains the TO Current data memory, the TO Next memory of the technology objects (for
more information, see Changing system variables and configuration data online) and is also
used to store technology packages, units (variables and code). During power-up or
download, the data is loaded from the RAM disk to the RAM.
The user RAM containing the TPs and units can be divided into a data memory (e.g.
variables) and a code memory (compiled user programs) for clarity. Retain variables are
saved retentively (powerfail-proof) in the SRAM/NVRAM.
The kernel, kernel data and further settings such as communication settings, cycle clock
settings and the contents of the diagnostic buffer are stored in the system RAM.
You can display the utilization of the RAM in the device diagnostics under System utilization
(ONLINE only).
Basic functions
Function Manual, 05/2009 423
SIMOTION memory concept (in the target device)
9.1 Overview of the memory in the target device
Basic functions
424 Function Manual, 05/2009
SIMOTION memory concept (in the target device)
9.1 Overview of the memory in the target device
72&XUUHQWGDWDPHPRU\
3URJUDPPLQJ & RQI UHWHQWLYHGDWD
LJXUD
'HYLFH3* WLRQG
DWDR
QOLQH
FKDQ
721(;7PHPRU\
JHVR
QWKH
81,76
9$5
'R
ZQ
ORD
9$55HWDLQ
8S
5(7$,1YDULDEOHV
G
ORD
G
0
DEVROXWHHQFRGHU
2
5
GDWD
WR
D
DG XS
DW
OR HU
G
&)&DUG0HPRU\&DUG
QW
5$0',6.
Z Q RZ
U UH
86(56,027,21
G R U W S
86(56,027,21
&X
&RPPXQLFDWLRQ
DG
D
VHWWLQJV
VW
R
QO
5H
RZ
D G
' DW &\FOHFORFNVHWWLQJV
72V<'% 5$0WR520 72V<'%
73 73 .HUQHO
.HUQHOGDWD 'LDJQRVWLFVEXIIHU
3RZHUXS
8QLWV 8QLWV
3RZHUXS
6'% 6'%
5$06\VWHP5$0
1) YDBs contain the configuration data of TOs, such as system variables, configuration data
or alarms
2) SDBs are system data blocks
See also
Download in RUN (Page 436)
Overview of the data download (Page 429)
Memory access (Page 426)
Basic functions
Function Manual, 05/2009 425
SIMOTION memory concept (in the target device)
9.2 Memory access
Note
IP and DP parameters in non-volatile data
If there is configuration data on the memory card, the IP and DP parameters are loaded from
the memory card during ramping up and used by the SIMOTION device. The addresses
defined in the configuration data are used to go online. During ramping up, the IP and DP
parameters on the memory card card are also written to the non-volatile data. If the
SIMOTION device is then powered up with a CF card with no configuration, the IP and DP
parameters are retained in the non-volatile data and are used by the device. This means the
SIMOTION device can continue to go online if a configuration has been loaded with
SIMOTION SCOUT at least once or if the SIMOTION device is powered up with a memory
card containing a configuration.
Basic functions
426 Function Manual, 05/2009
SIMOTION memory concept (in the target device)
9.2 Memory access
Note
Copy current to RAM does not transfer the values of the system variables to the RAM
memory. This means that "Save to memory card (Copy RAM to ROM)" or "Save in the
engineering project (Load to PG)" is not possible.
So that values of system variables can also be saved in the engineering project and on
memory card, the values of system variables must be changed OFFLINE and then loaded to
the target device per download and saved.
For information on how TOs, variables and programs behave during a download in RUN, see
Download in RUN (Page 436)
Basic functions
Function Manual, 05/2009 427
Downloading data to the target device 10
10.1 Overview of the data download
Description
You have to download the project data that you have created with the SCOUT to the target
system. The target system can contain several CPUs (SIMOTION controllers or drives). The
project data contains the programs (ST, MCC, LAD/FBD and DCC) that you have created
and compiled, the hardware configuration and the technology packages that you have
created and parameterized.
You must reload a project to the target system, if you have:
● Created or changed programs
● Changed definitions of global variables or symbolic I/O variables
● Made changes to the execution system
● Changed technology object configurations
Download requirements
The following conditions must be met before the project can be downloaded to the target
system:
● All cables must be plugged in and the interfaces configured
● All program sources are compiled (Project > Save and compile all) or the program
sources will be compiled automatically before the download
● The project has been checked for consistency (Project > Check consistency)
● The system status is ONLINE (menu: Project > Connect to target system)
If an error occurs, transfer of data to the target system is aborted. The Target system output
tab in which the transfer sequence and any errors are logged indicates the possible cause of
the error.
Note
As of SIMOTION SCOUT Version V3.2, a message appears in the diagnostics buffer if a
power failure occurs during the download: Starting lockout set, after you have switched to
RUN mode. Go online again and carry out the download once more.
In earlier versions, this can lead to various faults that cannot be corrected by the system.
Unexplainable error messages may appear.
If this happens:
Go online again and carry out the download once more.
Basic functions
Function Manual, 05/2009 429
Downloading data to the target device
10.2 Save and compile
Download scope
You can either download the entire project or perform a download for a specific device.
● Downloading a project to the target system (all target devices) (Page 432)
● Downloading CPU/drive unit to target device (Page 433)
Operating mode
You can perform a download in the STOP mode, and also in the RUN mode.
The project must be saved and compiled first before the download. SIMOTION SCOUT
distinguishes three commands in the main project menu that act differently when saving and
compiling:
● Save; the project is saved to the hard disk
● Save and compile all
● Save and recompile all
In addition, there is another command in the context menu of a source:
● Accept and compile (a single source)
Note
If there are sources in the project that cannot be compiled without error, or sources that
should not be compiled yet, they can be temporarily stored in an unused library.
Basic functions
430 Function Manual, 05/2009
Downloading data to the target device
10.3 Performing a consistency check
Note
If you perform a download with an older project, it is possible that the sources will no
longer be consistent. Select Project > Save and recompile all.
Basic functions
Function Manual, 05/2009 431
Downloading data to the target device
10.4 Downloading a project to the target system (all target devices)
Note
You can only perform a project download in the STOP mode and for all target devices with
which you are ONLINE. You cannot download to drives that cannot be configured in SCOUT,
such as MASTERDRIVE or 611U. The project data is selected as a body under Target
system -> Select target devices and loaded to devices connected ONLINE. This can only be
done in STOP mode.
Procedure
1. Click the Download project to target system button. The Download to Target System
dialog box is displayed.
Basic functions
432 Function Manual, 05/2009
Downloading data to the target device
10.5 Downloading CPU/drive unit to target device
● Initialization of the non-RETAIN program data and non-RETAIN global device variables
Initialization of the RETAIN program data and RETAIN global device variables
(see Separate initialization of source and TO data during a download (Page 435) )
● Load without HW configuration (see Download without HW Config information
(Page 444)
Click Yes to start the download.
The additional options are also active when they are not visible. If you do not select any
additional options, the global settings (Options > Download) are active.
For drive devices, you can only select After loading, copy RAM to ROM.
See also
Save and compile (Page 430)
Description
In addition to a project download, you can also selectively load data to each CPU / drive unit.
The standard procedure is the download in STOP mode. However, under certain
circumstances you can also perform a download in RUN mode, for more details, see
Download in RUN (Page 436).
Procedure
1. First select the device to which you want to load the data in the project navigator (device
must be ONLINE).
2. Click the Download CPU / drive unit to target system
or
right-click the device in the project navigator and perform Target device > Download in
the context menu.
3. The Download dialog box is displayed. The contents depend on the device for which you
want to download data.
Basic functions
Function Manual, 05/2009 433
Downloading data to the target device
10.5 Downloading CPU/drive unit to target device
● After loading, copy RAM to ROM; copies RAM to ROM to the selected device once the
download is complete.
● Perform download in RUN; enables a download to be performed in RUN mode (see
below).
Click Additional CPU options to display the following options:
● Initialization of the non-RETAIN technology object data - only effective in STOP mode
(see Separate initialization of source and TO data during a download (Page 435))
● Initialization of the non-RETAIN program data and the non-RETAIN global device
variables - only effective in STOP mode
– Initialization of the RETAIN program data and RETAIN global device variables
(see Separate initialization of source and TO data during a download (Page 435) )
● Load without HW configuration (see Download without HW Config information
(Page 444)
You can set the global default under Options > Settings > Download or CPU download.
Basic functions
434 Function Manual, 05/2009
Downloading data to the target device
10.6 Separate initialization of source and TO data during a download
By default, the download is performed in STOP. After a successful download, the CPU can
be restored to its previous status.
The "After loading, copy RAM to ROM" option copies RAM to ROM to the selected device
once the download is complete.
See also
Download of changed sources in RUN (Page 436)
Download of changed technology objects (Page 445)
Description
As of V4.1.2, you can initialize non-RETAIN and RETAIN data of programs (units) with global
device variables and technology objects separately via two settings. During the project
creation, the data is normally initialized together. During servicing or if you only want to
reload programs (units, sources) or technology objects, you can initialize the data separately.
● Initialization of the non-RETAIN technology object data; only non-RETAIN data can be
initialized for TOs. This does not affect the program data (source data).
● Initialization of the non-RETAIN program data and the non-RETAIN global device
variables The RETAIN program data and RETAIN global device variables can also be
initialized. This does not affect the technology object data. The global device variables
are initialized together with the settings for the program data (source data).
To make the settings, see Downloading CPU/drive unit to target device (Page 433).
The "Time of variable initialization" section in the programming manuals contains general
information on variable initialization.
Basic functions
Function Manual, 05/2009 435
Downloading data to the target device
10.7 Download in RUN
Basic functions
436 Function Manual, 05/2009
Downloading data to the target device
10.7 Download in RUN
● No changes may be made in the VAR_GLOBAL blocks. You can still enable these
changes by using the BlockInit_OnChange pragma (see below).
● Program instance data provides the static variables for the programs (VAR).
● No changes may be made in VAR blocks if these are used by cyclic tasks (the data of a
cyclic task is retained throughout the execution of that task). VAR_TEMP can be changed
for programs and FBs, as well as VAR for FCs. You can still use the BlockInit_OnChange
pragma and the "Only create program instance data once" compiler switch to enable
these changes, however (see below).
● The program instance data of non-cyclic tasks (MotionTasks) can be changed as this is
reinitialized on every start.
Basic functions
Function Manual, 05/2009 437
Downloading data to the target device
10.7 Download in RUN
Basic functions
438 Function Manual, 05/2009
Downloading data to the target device
10.7 Download in RUN
CAUTION
Changed behavior for the data initialization when "Only create program instance data once"
has been selected.
With sequential tasks, data initialization is no longer performed at the start of a task (or with
cyclic tasks, during the STOP-RUN transition), but is generally only performed during a
download or when the CPU is ramped up. If required, data initialization must be performed
applicatively in the StartUpTask or at the start of the programs in sequential tasks.
Initialization during the STOP-RUN transition is possible with V4.1.2 and higher, using the
"BlockInit_OnDeviceRun" pragma; see Initialization of data during a STOP - RUN transition
(Page 441).
If several tasks are assigned to one program, the same instance data is used as the basis
for all of them.
● For the local setting, select Only create program instance data once under Compiler in
the Insert xxx dialog (xxx = program, function, function block) when adding a program
source (ST and MCC). Note that a change is only possible if the check box is cleared
(click the check box twice). The compiler switch must be placed in RUN before a
download (i.e., source must have been loaded previously with a download in STOP).
Basic functions
Function Manual, 05/2009 439
Downloading data to the target device
10.7 Download in RUN
Basic functions
440 Function Manual, 05/2009
Downloading data to the target device
10.7 Download in RUN
See also
Download of changed technology objects (Page 445)
Description
With the "Only create program instance data once" compiler switch, data initialization only
occurs during a download or when the CPU is ramped up. With V4.1.2 and higher, you can
use a pragma in the units to make settings so that global unit variables and program
variables are also initialized during a STOP-RUN transition. The initialization is performed
immediately before the start of the StartupTask. You can therefore definitely perform an
initialization of the variables during a STOP - RUN transition.
You must insert the pragma "BlockInit_OnDeviceRun".
Basic functions
Function Manual, 05/2009 441
Downloading data to the target device
10.7 Download in RUN
Description
You can control MotionTasks from SCOUT without having created a user program.
In this way you can test programs and directly affect the execution of MotionTasks. You can
stop selected MotionTasks, disable them for the sequence or restart them.
Basic functions
442 Function Manual, 05/2009
Downloading data to the target device
10.7 Download in RUN
Requirement
To control MotionTasks, you must be ONLINE and switch to debug mode.
1. Right-click the relevant device and execute Test mode in the context menu.
2. Then select the Debug mode option in the Test Mode dialog box, read the safety
instructions, accept these by clicking the option and then clicking OK.
Procedure
1. After you have activated the debug mode, call the diagnostics via Target system > Device
diagnostics.
2. Select a MotionTask and right-click it.
A context menu is displayed.
3. Select Disable task start if you want to block the start of the MotionTask. This prevents
the task from restarting (TASKSTART_LOCKED in task status).
4. Select Reset task if you want to set the task in the STOPPED state. A download in RUN
can be performed in this state.
5. Select Enable task start if you want to release the start of the task. You can then restart
the task from the program or via SCOUT.
6. Select Start task if you want to start the MotionTask.
After executing the task control commands, it takes some time before the display in SCOUT
is refreshed. You can also click the Update (F5) button.
Note
The task control commands depend on the system task control commands. You can read
the task status in the Task runtimes tab under Task status.
Basic functions
Function Manual, 05/2009 443
Downloading data to the target device
10.7 Download in RUN
Note
The settings for the message frame length, address and data types are adapted in HW
Config in the DP Slave Properties dialog box in the Configuration tab.
The cycle clock settings are made in the Isochronous operation tab.
Basic functions
444 Function Manual, 05/2009
Downloading data to the target device
10.7 Download in RUN
Description
You can reload changes in the configuration data and system variables of a TO you made
offline in RUN (using restart and effective immediately). If necessary, a TO restart is
performed after the download.
Downloading TOs
It is possible to download a changed TO under the following circumstances or prerequisites:
● Only technology objects whose structure is retained can be downloaded (see below)
● A download is performed when a TO is used by a program, e.g. axis is enabled. If
necessary, TO alarms are then output.
● The substitute values of the TO supplied during the download are returned according to
the setting of "restart.behaviorInvalidSysvarAccess" (LAST_VALUE, DEFAULT_VALUE).
If a restart is performed during a download of TOs, access errors from the user program
may occur. The reaction of the CPU or the return value then depends on the settings of
the configuration data item "restart.behaviorInvalidSysvarAccess". If this configuration
data item is set to STOPPED, the CPU goes to STOP. For more information, refer to
System variables (Page 85).
● If the change to a TO cannot be loaded during the download or an error occurs, the
original configuration is retained or re-established (situation as prior to the download).
● The TOs are loaded in succession and take effect immediately.
Basic functions
Function Manual, 05/2009 445
Downloading data to the target device
10.7 Download in RUN
Permitting a TO restart
Before the download is performed, you can use an option to select whether a RESTART of
the TOs is to be permitted or not. In this way, you can prevent a TO RESTART. A RESTART
is then executed independently of the setting under RestartCondition.
Basic functions
446 Function Manual, 05/2009
Downloading data to the target device
10.7 Download in RUN
Description
If you have performed a download in RUN, you can also save the changes on the memory
card in a powerfail-safe manner.
The Copy RAM to ROM option can be selected beforehand in the download dialog. After a
download, this is also possible by means of a separate function (using the Copy RAM to
ROM button in the toolbar or in the device context menu under Target device).
To preset the option in the download dialog, select Options > Settings > CPU download.
Here, it can also be specified whether or not the actual values of the TO configuration data
are transferred to RAM before the copy RAM to ROM operation.
Note
During "Copy RAM to ROM in RUN", CPU utilization must not be at a critical level (see
device diagnostics) as this function generates additional load.
Basic functions
Function Manual, 05/2009 447
Downloading data to the target device
10.8 Download direct to memory card or hard disk
Procedure
To save the data, SCOUT must be in OFFLINE mode and the device must have been
selected in the project navigator for this function to be available.
Perform Edit > Load to file system or Load to file system using the context menu of the CPU
to save the data of a device on a memory card / CF card or locally on a hard disk.
SCOUT does not automatically recognize the connected read and storage media
automatically. The storage/read device must be explicitly selected using Select target. An
executable project is produced when the project data is saved.
Note
When you save data (either to hard disk or CF card), a USER directory is created
automatically so that you can copy data directly to the ROOT directory of a CF card.
Basic functions
448 Function Manual, 05/2009
Downloading data to the target device
10.9 Downloading using the device update tool
Note
The stored data must match the firmware of the card. If, for example, you load an old
configuration to a card with the latest firmware, you receive error messages during
ramp-up.
Description
SIMOTION offers a convenient solution when updating SIMOTION devices or SIMOTION
projects for machine manufacturers and machine operators. Updating does not simply refer
to an update to a higher version of firmware; rather, in general terms it refers to switching to
a defined configuration, e.g. a project update. It is also possible to return (restore) to a
previous configuration. Update or restore procedures can easily be performed on SIMOTION
devices in situ or remotely. The data can be imported to a SIMOTION device via a portable,
handy storage medium (e.g. memory stick) or a communication connection.
Note
The firmware of connected SINAMICS drives will only be updated if the automatic firmware
update function has been set in parameter p7826 (on every drive unit to be updated).
Basic functions
Function Manual, 05/2009 449
Downloading data to the target device
10.10 Loading data from the target device to the programming device (PG)/PC
10.10 Loading data from the target device to the programming device
(PG)/PC
With Load to PG, the data is loaded from the target device to the programming device/PC. In
this way, the currently loaded project can be loaded from the target device with all settings to
the local hard disk.
Sources or additional data of a project can only be loaded to a programming device when
they have previously been loaded to the target system. Options > Settings > CPU download
> Store additional data on the target device must have been set in the project for this.
The menu entry is only active when you are ONLINE and a device has been selected.
● Loading with an existing original project:
You are placing commissioned equipment into service, along with a project, or loading
the archived project from the memory card of the controller. The project is not consistent
online, but is essentially the same as the project that will run on the target device. You
can use "Load to PG" when performing the upload to create online consistency between
the SCOUT project and the CPU. Afterwards, possible errors are searched for and
changes downloaded to the target device.
Note
Objects in the OFFLINE project will be overwritten. As a result, objects which are only
present OFFLINE will be deleted. If you would like to use the OFFLINE project again,
activate the "Save before loading to PG" option before uploading. This creates a backup
copy of the project.
Basic functions
450 Function Manual, 05/2009
Downloading data to the target device
10.10 Loading data from the target device to the programming device (PG)/PC
See also
Overview of the data download (Page 429)
Basic functions
Function Manual, 05/2009 451
Error sources and efficient programming 11
11.1 Error sources during programming
See also
Functions for the conversion of numeric data types and bit data types (Page 303)
Basic functions
Function Manual, 05/2009 453
Error sources and efficient programming
11.1 Error sources during programming
//...
IF myStart = 0 THEN // If auxiliary variable has not yet been set
myStart := 1; // Set auxiliary variable (function started)
myCommandID := _getCommandId ();
myFC := _pos (axis := myAxis, // Execute function
position := position_1,
nextCommand := IMMEDIATELY,
commandID := myCommandID);
END_IF;
//...
IF myAxis.positioningState.actualPosition = position_1 THEN
myStart := 0; // Reset auxiliary variable, if
// function execution required.
END_IF;
//...
Note
Do not use commands with wait times in cyclic tasks, e.g. _waitTime.
Use only input parameter nextCommand := IMMEDIATELY for system functions in cyclic
tasks.
Basic functions
454 Function Manual, 05/2009
Error sources and efficient programming
11.1 Error sources during programming
//...
VAR
myCommandID : commandIdType;
myState : StructRetCommandState;
END_VAR
//...
myCommandID := _getCommandId ();
// Save unique ID
myFC := _pos (axis := myAxis,
// Execute function with ID
position := position_1,
nextCommand := IMMEDIATELY,
commandID := myCommandID);
myState := _getStateOfAxisCommand (axis:=myAxis,
commandID := myCommandID);
// Status check
IF myState.commandIdState = WAITING_FOR_SYNC_START THEN
;
//...
END_IF;
//...
See also
Function parameters of the technology functions (Page 69)
_getCommandId function (Page 359)
_getSyncCommandId function (Page 360)
Basic functions
Function Manual, 05/2009 455
Error sources and efficient programming
11.1 Error sources during programming
1. Comment out the program block-by-block before the line containing the error message,
i.e. enclose the selected section between the character pair (* and *). The line with the
error message must not be commented out.
2. Recompile the program.
3. If an error message still appears after steps 1 and 2, the commented-out section is too
small. Expand it until the error message disappears.
4. When the error message no longer appears, the error is contained in the commented-out
section. Now reduce the size of the commented-out section line by line and recompile the
program each time until the error message appears again. The last enabled line is the
line with the error message.
Note
You can consult a list of all compiler error messages in the appendix of the ST
programming manual.
Description
If the CPU changes to STOP mode then check the device diagnostics and the alarm window
in the SCOUT. Causes for the STOP are entered in the diagnostics buffer. The alarms of the
technology objects that can also cause a CPU STOP are displayed in the Alarms window.
Possible reasons, why a CPU can go into STOP are:
Basic functions
456 Function Manual, 05/2009
Error sources and efficient programming
11.1 Error sources during programming
See also
Execution errors in programs (Page 96)
Access errors to system variables and configuration data, as well as I/O variables for direct
access (Page 99)
SystemInterruptTasks (Page 164)
Possible errors in technology objects (Page 115)
Basic functions
Function Manual, 05/2009 457
Error sources and efficient programming
11.1 Error sources during programming
Note
The system tasks for the TControl technology package can be disabled in the system cycle
clock settings window.
Refer to the online help for information about how to check the device diagnostics, interpret
the alarm window and check/change your system clocks.
System functions and a Task Trace are available for checking the runtimes. The Task Trace
can be used to graphically display the sequence of individual tasks and user events
(generated per program command); see Task Trace function manual.
See also Isochronous data processing (Page 206) , Functions for message programming
(AlarmS) (Page 277)
Description
Sequential tasks (MotionTasks) can assume different statuses, including
TASK_STATE_WAITING. The status can be read out in the diagnostics display of the CPU.
If you do not know why the task is waiting, you must carry out an extensive search to identify
the point in the program at which the task is waiting on a condition.
You use the following functions to find these points:
Basic functions
458 Function Manual, 05/2009
Error sources and efficient programming
11.1 Error sources during programming
PROGRAM myRange
VAR
a,b : SINT := 100;
c: SINT;
END_VAR
c := a + b;
// If c is outside range, then exit program.
IF (a > 0) AND (c < a) AND (c < b) OR
(a < 0) AND (c > a) AND (c > b) THEN
// Range violation
RETURN;
ELSE
; // OK
END_IF;
END_PROGRAM
Basic functions
Function Manual, 05/2009 459
Error sources and efficient programming
11.2 Efficient programming
See also
Specifications for the configuring (Page 237)
Basic functions
460 Function Manual, 05/2009
Error sources and efficient programming
11.2 Efficient programming
NOTICE
When you access unit variables or global device variables with in/out parameters, note that
other tasks can access these variables at the same time.
Basic functions
Function Manual, 05/2009 461
Error sources and efficient programming
11.2 Efficient programming
Basic functions
462 Function Manual, 05/2009
Error sources and efficient programming
11.2 Efficient programming
For information about downloading in RUN, please see Download of changed sources in
RUN (Page 436) .
Description
Use of global unit variables in sources is preferable to use of device global variables (via the
project navigator).
Benefits:
● Variable structures can be used.
● Initialization (initial values) of the variables for the STOP-RUN transition is possible (via
program in StartupTask)
● For newly created global unit variables a download in RUN is also possible (in a new
declaration block)
Basic functions
Function Manual, 05/2009 463
Error sources and efficient programming
11.2 Efficient programming
Procedure
1. Define unit-global variables in a source file in the interface section.
Retain variables and HMI variables should likewise each be declared in a separate
source file or declaration block (see above).
2. Assign the program with the initialization of the variables to the StartupTask.
The variables will be set to a defined initial value in the startup.
INTERFACE
//global types
TYPE
MyStruct : STRUCT
Intvalue : INT;
Realvalue: REAL;
Bitvalue : BOOL;
END_STRUCT
END_TYPE
//global constants
VAR_GLOBAL CONSTANT
n : INT := 0;
m: INT := 15;
END_VAR
//global variables
VAR_GLOBAL
Bitarray : ARRAY [n..m] OF BOOL := [16 (FALSE)];
Intarray : ARRAY [0..15] OF INT := [16 (0) ];
Realarray: ARRAY [0..15] OF REAL:= [16 (0.0) ];
StructVar: MyStruct;
END_VAR
Basic functions
464 Function Manual, 05/2009
Error sources and efficient programming
11.2 Efficient programming
//programs
PROGRAM Init;
//end of the interface
END_INTERFACE
IMPLEMENTATION
PROGRAM Init
//////////////////////////////////////////////////
//initialization of the variables during startup//
//////////////////////////////////////////////////
StructVar.Intvalue :=0;
StructVar.Realvalue:=0;
StructVar.Bitvalue :=FALSE;
END_PROGRAM
END_IMPLEMENTATION
The program is then assigned to the StartupTask.
Always when unit global variables will be used in a different source file the source files must
be combined with the source file that contains the declaration (USES). See also Connection
to other program sources or to libraries in the MCC Programming Manual or Use of the
USES statement in the interface or implementation section of an importing unit in the ST
programming manual.
Basic functions
Function Manual, 05/2009 465
Error sources and efficient programming
11.2 Efficient programming
The Download in Run graphic shows which program units can be called in succession. For
example, Motion_Unit_01 calls FunctionBlock_01, which in turn calls the two functions
Function_01 and Function_02.
For Motion_Unit_01 and Cyclic_Unit_05, only the basic conditions described in Download of
changed sources in RUN (Page 436) exist.
The area highlighted in red identifies the program blocks where a download in RUN could
cause problems.
Motion_Unit_02 contains a While TRUE loop, from which FunctionBlock_02 and then
Function_02 are then called in turn (see example of a While loop in the corresponding
section). Because the loop prevents a download in RUN (no change-over time possible), the
function block and the function called in the loop are blocked. The conditions under which,
conversely, a download in RUN is possible, are listed in the table below.
Basic functions
466 Function Manual, 05/2009
Error sources and efficient programming
11.2 Efficient programming
0RWLRQB8QLWB )XQFWLRQ%ORFNB
PRWLRQBSUJB )XQFWLRQB
IEBVLQJOHBFDOOB
86(6*OREDO IFBVLQJOHBFDOOB
86(6*OREDO 86(6*OREDO
)XQFWLRQ%ORFNB )XQFWLRQB
F\FOLFYLDUHVWDUW7DVN )XQFWLRQB
0RWLRQB8QLWB
PRWLRQBSUJB
86(6*OREDO
*OREDOB)%
([HFXWLRQV\VWHP )XQFWLRQ%ORFNB
)XQFWLRQB
F\FOLFYLD:KLOH
6HTXHQWLDOWDVN IFBPXOWLBFDOOB
HJ0RWLRQB7DVNB 86(6*OREDO
6HTXHQWLDOWDVN 0RWLRQB8QLWB
HJ0RWLRQB7DVNB PRWLRQBSUJB )XQFWLRQ%ORFNB
86(6*OREDO IEBPXOWLBFDOOB
6HTXHQWLDOWDVN *OREDOB)% 86(6*OREDO
HJ0RWLRQB7DVNB )XQFWLRQ%ORFNB )XQFWLRQB
F\FOLFYLDUHVWDUW7DVN
&\FOLFWDVN
SURJUDPGDWDLQVWDQWLDWHG
HJ%DFNJURXQGB7DVN
RQFHRQO\
&\FOLFWDVN
HJ,32V\QFKURQRXVB7DVN
&\FOLFB8QLWB
F\FOLFBSUJB
86(6*OREDO
*OREDOB)%
)XQFWLRQ%ORFNB
*OREDO
&\FOLFB8QLWB
,QHYHU\XQLW86(6RQO\ F\FOLFBSUJB )XQFWLRQ%ORFNB
KDVWKHLQWHUIDFH )XQFWLRQB
86(6*OREDO 86(6*OREDO
FRPSRQHQW 86(6*OREDO
*OREDOB)% IEBVLQJOHBFDOOB
DQGYDULDEOHGHFODUDWLRQ IFBVLQJOHBFDOOB
)XQFWLRQ%ORFNB )XQFWLRQB
*/2%$/B)%
86(6*OREDO
)XQFWLRQ%ORFNB
&RQWDLQVJOREDOLQVWDQFHRI
IEBPXOWLBFDOOB
86(6LQ
0RWLRQ8QLW
F\FOLFXQLW
With SIMOTION V4.1.2, you can also control MotionTasks from SCOUT. You can therefore
stop the MotionUnit_02, perform the download and then restart the MotionUnit_02; see .
Basic functions
Function Manual, 05/2009 467
Error sources and efficient programming
11.2 Efficient programming
Basic functions
468 Function Manual, 05/2009
Error sources and efficient programming
11.2 Efficient programming
Change Function
location
Type Var Var Code Var_Input Var_In_Out Return
Constant change value
Function_01 Fc1_single_call_01
Function_02 Fc2_multi_call_01 1) 1) 1)
Function_03 Fc5_single_call_01
Footnote Description
1) MotionTask_2 must be stopped prior to commencing the download:
- Download is prevented by a continuous loop (WHILE TRUE) in the program.
- Download will also be prevented if the program waits too long in
"WAITFORCONDITION", remains set to "_waitTime" or waits for synchronous
commands to finish.
2) In terms of use, structural changes are the same as creating/modifying a variable.
3) Use the "BlockInit_OnChange" pragma.
4) Additional variable can be inserted by means of an additional variable block or using
the "BlockInit_OnChange" pragma.
5) Only possible if the "Only create program instance data once" setting has been
selected and you are using the "BlockInit_OnChange" pragma.
6) Ability to change depending on use:
- Code is always possible.
- Field lengths; same as when creating/modifying a variable, possible with
"BlockInit_OnChange" pragma.
- Initial value is always possible, analogous to code.
7) Reinitialization necessary, you may need to use the "BlockInit_OnChange" pragma.
It must always be possible to download the entire content of a unit. If one of the programs in a unit
(e.g. interface, implementation) is not functioning, download of the entire unit will be prevented.
Can always be changed.
Restricted changes are possible; a description of the information to be taken into
account is provided (see footnote).
Cannot be changed; see footnote for reason.
Basic functions
Function Manual, 05/2009 469
Error sources and efficient programming
11.2 Efficient programming
See also
Control of MotionTasks from SCOUT (Page 442)
Controlling MotionTasks (Page 442)
Basic functions
470 Function Manual, 05/2009
Appendix A A
A.1 Symbolic constants
The following table presents names of reserved constants that you must not use for
individual variable names.
Basic functions
Function Manual, 05/2009 471
Appendix A
A.1 Symbolic constants
Table A- 4 Symbolic constants for the value range limits of elementary data types
Basic functions
472 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
Basic functions
Function Manual, 05/2009 473
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
Icons
_2D
_3D
_abortAllReadWriteDriveParameterJobs
_abortReadWriteRecordJobs
_activateConfiguration
_activateDpSlave
_activateDpSlaveAddress
_activateNameOfStation
_activateTo
_addPointToCam
_addPolynomialSegmentToCam
_addSegmentToCam
_addSegmentToCam_V2_0
_alarmS
_alarmSc
_alarmScId
_alarmSId
_alarmSq
_alarmSqId
_allocateTokenToVariableName
_AND
_BOOL
_bufferActuatorCommandId
_bufferAdditionObjectCommandId
_bufferAxisCommandId
_bufferAxisCommandId_V3_1
_bufferCamCommandId
_bufferCamTrackCommandId
_bufferControllerObjectCommandId
_bufferExternalEncoderCommandId
_bufferExternalEncoderCommandId_V3_1
_bufferFixedGearCommandId
_bufferFollowingObjectCommandId
_bufferFollowingObjectCommandId_V3_1
_bufferFormulaObjectCommandId
Basic functions
474 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_bufferMeasuringInputCommandId
_bufferOutputCamCommandId
_bufferPathObjectCommandId
_bufferSensorCommandId
_BYTE_FROM_8BOOL
_BYTE_TO_8BOOL
_calculateTControllerParameter
_cancelAxisCommand
_cancelExternalEncoderCommand
_cancelFollowingObjectCommand
_changeEnableModeOfAdditionObjectIn
_changeEnableModeOfControllerObjectIn
_changeEnableModeOfFormulaObjectIn
_changeEnableOfFormula
_changeOperationMode
_checkEqualTask
_checkExistingUnitDataSet
_configurationManagement
_continue
_continue_V3_1
_continuePath
_copyTControllerShadow
_cpuData
_cpuDataRW
_DATE
_DATE_AND_TIME
_deactivateDpSlave
_deactivateTo
_deallocateTokenToVariableName
_defineFormula
_deleteAllUnitDataSets
_deleteUnitDataSet
_DINT
_disableAdditionObjectIn
_disableAxis
_disableAxis_V2_0
Basic functions
Function Manual, 05/2009 475
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_disableAxis_V3_1
_disableAxisAdditiveTorque
_disableAxisInterface
_disableAxisSimulation
_disableAxisTorqueLimitNegative
_disableAxisTorqueLimitPositive
_disableCamming
_disableCamming_V3_0
_disableCamTrack
_disableCamTrackSimulation
_disableCommandToActual
_disableControllerObject
_disableControllerObjectIn
_disableExternalEncoder
_disableExternalEncoderSimulation
_disableFixedGearing
_disableFixedGearMotionIn
_disableFollowingObjectSimulation
_disableFollowingObjectSimulation_V3_1
_disableForceLimiting
_disableFormula
_disableFormulaObjectIn
_disableGearing
_disableGearing_V3_0
_disableMaster_V3_0
_disableMeasuringInput
_disableMeasuringInputSimulation
_disableMonitoringOfEncoderDifference
_disableMovingToEndStop
_disableOutputCam
_disableOutputCamSimulation
_disablePathObjectSimulation
_disableQFAxis
_disableQFAxis_V3_0
_disableQFAxis_V3_1
_disableScheduler
Basic functions
476 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_disableSensor
_disableTorqueLimiting
_disableVelocityGearing
_disableVelocityLimiting
_DWORD_FROM_2WORD
_DWORD_FROM_4BYTE
_DWORD_TO_2WORD
_DWORD_TO_4BYTE
_enableAdditionObjectIn
_enableAxis
_enableAxis_V2_0
_enableAxis_V3_1
_enableAxis_V3_2
_enableAxisAdditiveTorque
_enableAxisInterface
_enableAxisSimulation
_enableAxisTorqueLimitNegative
_enableAxisTorqueLimitPositive
_enableCamming
_enableCamming_V3_0
_enableCamTrack
_enableCamTrackSimulation
_enableCommandToActual
_enableControllerObject
_enableControllerObjectIn
_enableDistributedMotionDelayValueCalculation
_enableDpInterfaceSynchronizationMode
_enableExternalEncoder
_enableExternalEncoderSimulation
_enableFixedGearing
_enableFixedGearMotionIn
_enableFollowingObjectSimulation
_enableFollowingObjectSimulation_V3_1
_enableForceControlByCondition
_enableForceControlByCondition_V2_1
_enableForceControlByCondition_V3_1
Basic functions
Function Manual, 05/2009 477
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_enableForceControlByCondition_V4_0
_enableForceLimitingByCondition
_enableForceLimitingByCondition_V4_0
_enableForceLimitingValue
_enableForceLimitingValue_V3_1
_enableFormula
_enableFormulaObjectIn
_enableGearing
_enableGearing_V3_0
_enableGearing_V3_1
_enableMaster_V3_0
_enableMeasuringInput
_enableMeasuringInputCyclic
_enableMeasuringInputCyclic_V3_2
_enableMeasuringInputSimulation
_enableMonitoringOfEncoderDifference
_enableMotionInPositionLockedForceLimitingProfile
_enableMotionInPositionLockedVelocityLimitingProfile
_enableMotionInPositionLockedVelocityLimitingProfile_V4_0
_enableMovingToEndStop
_enableMovingToEndStop_V2_0
_enableOutputCam
_enableOutputCamSimulation
_enablePathObjectSimulation
_enablePositionLockedForceLimitingProfile
_enablePositionLockedForceLimitingProfile_V3_1
_enablePositionLockedVelocityLimitingProfile
_enablePositionLockedVelocityLimitingProfile_V4_0
_enableQFAxis
_enableQFAxis_V3_0
_enableQFAxis_V4_0
_enableScheduler
_enableSensor
_enableTimeLockedForceLimitingProfile
_enableTimeLockedForceLimitingProfile_V3_1
_enableTimeLockedVelocityLimitingProfile
Basic functions
478 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_enableTimeLockedVelocityLimitingProfile_V4_0
_enableTorqueLimiting
_enableTorqueLimiting_V2_0
_enableVelocityGearing
_enableVelocityLimitingValue
_enableVelocityLimitingValue_V4_0
_exportUnitDataSet
_exportUnitDataSet2
_FALSE
_FB_MF_MultiAxis
_FB_MF_SET_DS_VALUES
_FB_MF_SingleAxis
_FB_MF_STGP
_FB_STGP_BasicMC
_FB_STGP_Cam
_FB_STGP_Cam_Ext
_FB_STGP_Gear
_FB_STGP_Path
_FB_STGP_Position
_finite
_forceTControllerIdentification
_getActiveDpSlaveAddress
_getActiveNameOfStation
_getActuatorErrorNumberState
_getActuatorErrorState
_getAdditionObjectErrorNumberState
_getAdditionObjectErrorState
_getAlarmId
_getAverageTaskIdRunTime
_getAverageTaskRunTime
_getAxisDataSetParameter
_getAxisDataSetParameter_V3_1
_getAxisErrorNumberState
_getAxisErrorState
_getAxisInternalPosition
_getAxisSpecificState
Basic functions
Function Manual, 05/2009 479
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_getAxisSpecificState2
_getAxisStoppingData
_getAxisUserPosition
_getBit
_getCamErrorNumberState
_getCamErrorState
_getCamFollowingDerivative
_getCamFollowingValue
_getCamLeadingValue
_getCamSpecificState
_getCamSpecificState2
_getCamTrackErrorNumberState
_getCamTrackErrorState
_getCircularPathData
_getCircularPathGeometricData
_getCommandId
_getConfigurationData
_getControllerObjectErrorNumberState
_getControllerObjectErrorState
_getCurrentTaskIdRunTime
_getCurrentTaskRunTime
_getDataByToken
_getDeviceId
_getDoIndexNumberFromLogAddress
_getDpStationAddressFromLogDiagnosticAddress
_getExternalEncoderErrorNumberState
_getExternalEncoderErrorState
_getExternalEncoderSpecificState
_getExternalEncoderSpecificState2
_getFixedGearErrorNumberState
_getFixedGearErrorState
_getFollowingObjectErrorNumberState
_getFollowingObjectErrorState
_getForceControlDataSetParameter
_getForceControlDataSetParameter_V3_1
_getFormulaObjectErrorNumberState
Basic functions
480 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_getFormulaObjectErrorState
_getGearAxisSpecificState
_getGearAxisSpecificState2
_getGeoAddressFromLogAddress
_getInOutByte
_getInternalTaskIdIdx
_getInternalTaskIdx
_getInternalTimeStamp
_getIO_Part_4
_getIPConfig
_getLinearPathData
_getLinearPathGeometricData
_getLogDiagnosticAddressFromDpStationAddress
_getMasterValue
_getMaximalTaskIdRunTime
_getMaximalTaskRunTime
_getMeasuringInputErrorNumberState
_getMeasuringInputErrorState
_getMeasuringInputSpecificState
_getMeasuringInputSpecificState2
_getMemoryCardId
_getMinimalTaskIdRunTime
_getMinimalTaskRunTime
_getMotionStateOfAxisCommand
_getMotionStateOfFollowingObjectCommand
_getMotionStateOfPathObjectCommand
_getNextLogAddress
_getOutputCamErrorNumberState
_getOutputCamErrorState
_getOutputCamSpecificState
_getOutputCamSpecificState2
_getPathAxesData
_getPathAxesPosition
_getPathCartesianData
_getPathCartesianPosition
_getPathObjectErrorNumberState
Basic functions
Function Manual, 05/2009 481
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_getPathObjectErrorState
_getPendingAlarms
_getPnInterfacePortNeighbour
_getPolynomialPathData
_getPolynomialPathGeometricData
_getPosAxisSpecificState
_getPosAxisSpecificState2
_getProgrammedTargetPosition
_getQFAxisDataSetParameter
_getQFAxisDataSetParameter_V3_1
_getSafeValue
_getSegmentIdentification
_getSensorErrorNumberState
_getSensorErrorState
_getSlaveValue
_getStateOfActuatorCommand
_getStateOfAdditionObjectCommand
_getStateOfAllDpSlaves
_getStateOfAllDpStations
_getStateOfAxisCommand
_getStateOfCamCommand
_getStateOfCamTrackCommand
_getStateOfControllerObjectCommand
_getStateOfDiagnosticDataCommand
_getStateOfDpSlave
_getStateOfExternalEncoderCommand
_getStateOfFixedGearCommand
_getStateOfFollowingObjectCommand
_getStateOfFormulaObjectCommand
_getStateOfMeasuringInputCommand
_getStateOfMotionBuffer
_getStateOfOutputCamCommand
_getStateOfPathObjectCommand
_getStateOfProcessInterruptCommand
_getStateOfRecordCommand
_getStateOfSensorCommand
Basic functions
482 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_getStateOfSingleDpSlave
_getStateOfTask
_getStateOfTaskId
_getStateOfTo
_getStateOfUnitDataSetCommand
_GetStateOfXCommand
_getStationType
_getSyncCommandId
_getSystemTime
_getTaskId
_getTimeDifferenceOfInternalTimeStamp
_getTimeDifferenceOfInternalTimeStamps
_homing
_imData
_IMPLEMENTATION
_importUnitDataSet
_importUnitDataSet2
_INT
_INTERFACE
_INTERFACE_AND_IMPLEMENTATION
_internalTest
_interpolateCam
_isNaN
_LINT
_loadUnitDataSet
_loadUnitDataSet2
_LREAL
_MC_CamIn
_MC_CamInMode
_MC_CamOut
_MC_Direction
_MC_EnableMode
_MC_GearIn
_MC_GearInMode
_MC_GearOut
_MC_Home
Basic functions
Function Manual, 05/2009 483
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_MC_HomingMode
_MC_Jog
_MC_MoveAbsolute
_MC_MoveAdditive
_MC_MoveRelative
_MC_MoveSuperimposed
_MC_MoveVelocity
_MC_Phasing
_MC_PositionProfile
_MC_Power
_MC_ReadActualPosition
_MC_ReadAxisError
_MC_ReadBoolParameter
_MC_ReadParameter
_MC_ReadStatus
_MC_Reset
_MC_Stop
_MC_StopMode
_MC_VelocityProfile
_MC_WriteBoolParameter
_MC_WriteParameter
_move
_movePathCircular
_movePathLinear
_movePathPolynomial
_movePointToPoint
_MRES
_NOT
_OR
_pos
_readDiagnosticData
_readDriveFaults
_readDriveMultiParameter
_readDriveMultiParameterDescription
_readDriveParameter
_readDriveParameterDescription
Basic functions
484 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_readRecord
_readSystemClock
_REAL
_redefineExternalEncoderPosition
_redefinePosition
_releaseSemaphore
_removeBufferedActuatorCommandId
_removeBufferedAdditionObjectCommandId
_removeBufferedAxisCommandId
_removeBufferedCamCommandId
_removeBufferedCamTrackCommandId
_removeBufferedControllerObjectCommandId
_removeBufferedExternalEncoderCommandId
_removeBufferedFixedGearCommandId
_removeBufferedFollowingObjectCommandId
_removeBufferedFormulaObjectCommandId
_removeBufferedMeasuringInputCommandId
_removeBufferedOutputCamCommandId
_removeBufferedPathObjectCommandId
_removeBufferedSensorCommandId
_reset_AllAlarmId
_resetActuator
_resetActuatorConfigDataBuffer
_resetActuatorError
_resetAdditionObject
_resetAdditionObjectConfigDataBuffer
_resetAdditionObjectError
_resetAlarmId
_resetAllAlarmId
_resetAxis
_resetAxis_V2_0
_resetAxis_V3_0
_resetAxisConfigDataBuffer
_resetAxisError
_resetAxisError_V3_0
_resetCam
Basic functions
Function Manual, 05/2009 485
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_resetCam_V2_0
_resetCam_V3_0
_resetCamConfigDataBuffer
_resetCamError
_resetCamError_V3_0
_resetCamTrack
_resetCamTrackConfigDataBuffer
_resetCamTrackError
_resetControllerObject
_resetControllerObjectConfigDataBuffer
_resetControllerObjectError
_resetDriveObjectFault
_resetExternalEncoder
_resetExternalEncoder_V2_0
_resetExternalEncoder_V3_0
_resetExternalEncoderConfigDataBuffer
_resetExternalEncoderError
_resetExternalEncoderError_V3_0
_resetFixedGear
_resetFixedGearConfigDataBuffer
_resetFixedGearError
_resetFollowingObject
_resetFollowingObject_V2_0
_resetFollowingObject_V3_0
_resetFollowingObject_V3_1
_resetFollowingObjectConfigDataBuffer
_resetFollowingObjectError
_resetFollowingObjectError_V3_0
_resetFormulaObject
_resetFormulaObjectConfigDataBuffer
_resetFormulaObjectError
_resetMeasuringInput
_resetMeasuringInput_V2_0
_resetMeasuringInput_V3_0
_resetMeasuringInputConfigDataBuffer
_resetMeasuringInputError
Basic functions
486 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_resetMeasuringInputError_V3_0
_resetMotionBuffer
_resetOutputCam
_resetOutputCam_V2_0
_resetOutputCam_V3_0
_resetOutputCamConfigDataBuffer
_resetOutputCamError
_resetOutputCamError_V3_0
_resetPathObject
_resetPathObjectConfigDataBuffer
_resetPathObjectError
_resetSensor
_resetSensorConfigDataBuffer
_resetSensorError
_resetTask
_resetTaskId
_resetTController
_resetTControllerError
_resetTechnologicalErrors
_resetUnitData
_restartTask
_restartTaskId
_resumeTask
_resumeTaskId
_RETAIN
_retriggerTaskControlTime
_retriggerTaskIdControlTime
_RUN
_runMotionInPositionLockedForceProfile
_runMotionInPositionLockedVelocityProfile
_runPositionBasedMotionIn
_runPositionBasedMotionIn_V3_2
_runPositionLockedForceProfile
_runPositionLockedVelocityProfile
_runTimeLockedForceProfile
_runTimeLockedForceProfile_V3_1
Basic functions
Function Manual, 05/2009 487
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_runTimeLockedPositionProfile
_runTimeLockedVelocityProfile
_runVelocityBasedMotionIn
_runVelocityBasedMotionIn_V3_2
_S7_COUNTER
_S7_TIMER
_saveConfigData
_savePersistentMemoryData
_saveUnitDataSet
_saveUnitDataSet2
_SC_ALARM_CONFIGURATION
_SC_ARRAY_BOUND_ERROR_READ
_SC_ARRAY_BOUND_ERROR_WRITE
_SC_BACKGROUND_TIMER_OVERFLOW
_SC_CYCLE_TIMER_OVERFLOW
_SC_DEVICE_COMMAND
_SC_DIAGNOSTIC_INTERRUPT
_SC_DIVISION_BY_ZERO
_SC_DP_CLOCK_DETECTED
_SC_DP_SLAVE_NOT_SYNCHRONIZED
_SC_DP_SLAVE_SYNCHRONIZED
_SC_DP_SYNCHRONIZATION_LOST
_SC_DRIVE_OBJECT_ALARM
_SC_DRIVE_OBJECT_FAULT
_SC_EXCEPTION
_SC_EXTERNAL_COMMAND
_SC_IMAGE_UPDATE_FAILED
_SC_IMAGE_UPDATE_OK
_SC_INVALID_ADDRESS
_SC_INVALID_FLOATING_POINT_OPERATION
_SC_IO_MODULE_NOT_SYNCHRONIZED
_SC_IO_MODULE_SYNCHRONIZED
_SC_MODE_SELECTOR
_SC_PC_INTERNAL_FAILURE
_SC_PROCESS_INTERRUPT
_SC_PULL_PLUG_INTERRUPT
Basic functions
488 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_SC_STATION_DISCONNECTED
_SC_STATION_RECONNECTED
_SC_TO_INSTANCE_NOT_EXISTENT
_SC_VARIABLE_ACCESS_ERROR_READ
_SC_VARIABLE_ACCESS_ERROR_WRITE
_sendProcessInterrupt
_SERVICE
_setAndGetEncoderValue
_setAxisDataSetActive
_setAxisDataSetParameter
_setAxisDataSetParameter_V3_1
_setAxisSTW
_setBit
_setCammingOffset
_setCammingOffset_V1_1
_setCammingOffset_V3_1
_setCammingScale
_setCammingScale_V1_1
_setCammingScale_V3_1
_setCamOffset
_setCamScale
_setCamTrackState
_setControllerObjectPIDControl
_setDataByToken
_setDeviceErrorLED
_setDpSlaveAddress
_setDriveObjectSTW
_setExternalEncoderValue
_setFixedGearingOffset
_setFixedGearMaster
_setForceCommandValue
_setForceCommandValue_V3_1
_setForceControlDataSetParameter
_setForceControlDataSetParameter_V3_1
_setFormula
_setFormulaObjectOutputValue
Basic functions
Function Manual, 05/2009 489
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_setGearingOffset
_setGearingOffset_V3_1
_setIO_Part_4
_setIPConfig
_setIpoClockBorderToPosition
_setMaster
_setMaster_V3_0
_setMasterValue_V3_0
_setModeSelfAdaptingConfiguration
_setNameOfStation
_setOutputCamCounter
_setOutputCamState
_setOutputCamState_V4_0
_setQFAxisDataSetParameter
_setQFAxisDataSetParameter_V3_1
_setQFAxisFCharacteristics
_setQFAxisQCharacteristics
_setSafeValue
_setSystemTime
_setTControllerActualIdentificationType
_setTControllerControlRangeParameter
_setTControllerCycleParameter
_setTControllerCycleParameterSecondary
_setTControllerDPIDParameter
_setTControllerDPIDParameterSecondary
_setTControllerIdentificationModifiedTangentMethodParameter
_setTControllerIdentificationModifiedTangentMethodProcessParameter
_setTControllerIdentificationStandardTangentMethodParameter
_setTControllerIdentificationStandardTangentMethodProcessParameter
_setTControllerInputDisplayValueParameter
_setTControllerInputFilterParameter
_setTControllerInputGradientCheckParameter
_setTControllerInputLimitCheckParameter
_setTControllerIntegrator
_setTControllerIntegratorSecondary
_setTControllerLowerPlausibilityParameter
Basic functions
490 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_setTControllerLowerPlausibilityParameterSecondary
_setTControllerManualOutputValue
_setTControllerOperatingMode
_setTControllerProcessModeParameter
_setTControllerPWMParameter
_setTControllerPWMParameterSecondary
_setTControllerSetpoint
_setTControllerUpperPlausibilityParameter
_setTControllerUpperPlausibilityParameterSecondary
_SHUTDOWN
_SINT
_sizeOf
_startSyncCommands
_startTask
_startTaskId
_STARTUP
_startupData
_STOP
_stop_V3_0
_stopEmergency
_stopEmergency_V3_0
_stopPath
_STOPU
_StructCamTrackArrayOfSingleCamSettings
_StructCamTrackSingleCamSettings
_suspendTask
_suspendTaskDebug
_suspendTaskId
_suspendTaskIdDebug
_synchronizeDpInterfaces
_synchronizeExternalEncoder
_tcpCloseConnection
_tcpCloseServer
_tcpOpenClient
_tcpOpenServer
_tcpReceive
Basic functions
Function Manual, 05/2009 491
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
_tcpSend
_testAndSetSemaphore
_testSFBSysDataInit
_TIME
_TIME_OF_DAY
_toggleBit
_triggerTestMode
_TRUE
_UDINT
_udpAddMulticastGroupMembership
_udpDropMulticastGroupMembership
_udpReceive
_udpSend
_UINT
_ULINT
_upsData
_USINT
_waitTime
_WORD_FROM_2BYTE
_WORD_TO_2BYTE
_writeAndSendMessage
_writeDriveMultiParameter
_writeDriveParameter
_writeRecord
_XOR
_Xreceive
_Xsend
A
ABORT_CONNECTION
ABORT_CURRENT_COMMAND
ABORTED
abortPosition
ABS
ABSOLUTE
absoluteEncoder
Basic functions
492 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
ACCELERATING
ACCELERATING_FORCE
ACCESS_DENIED
accessState
ACCORDING_TO_DEFINITION_ORDER
ACOS
ACTION
ACTIVATE_CHANGED_CONFIG_DATA
ACTIVATE_CONFIGURATION_DATA
ACTIVATE_FALL_BACK_CONFIGURATION
ACTIVATE_RESTART
ACTIVATED
ACTIVATED_NO_ALARM
activationModeChangedConfigData
ACTIVE
ACTIVE_ABSOLUTE
ACTIVE_AND_WAITING_FOR_CAM_TRACK_OUTPUT_INACTIVE
ACTIVE_AND_WAITING_FOR_DATA
ACTIVE_AND_WAITING_FOR_NEXT_CYCLE
ACTIVE_HOMING
ACTIVE_RELATIVE
ACTIVE_WITH_CONSTANT_LIMITS
ACTIVE_WITH_DYNAMIC_ADAPTION
ACTIVE_WITH_VARIABLE_LIMITS
ACTIVE_WITHOUT_DYNAMIC_ADAPTION
activeCam
activeMaster
actorData
actorMonitoring
ACTUAL
ACTUAL_ACTIVATED
ACTUAL_AND_DEFAULT_VALUE
ACTUAL_DIRECTION_PASSIVE
ACTUAL_VALUE
ACTUAL_VALUE_INSIDE_POSITIONING_WINDOW
ACTUAL_VALUE_OUT_OF_POSITIONING_WINDOW
Basic functions
Function Manual, 05/2009 493
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
ACTUAL_VALUE_TOLERANCE
actualCycleData
ActualDPIDData
actualIdentificationModifiedTangentMethodData
actualIdentificationStandardTangentMethodData
actualIdentificationType
actualInputData
actualInputLimitCheckData
actualInputState
actualTorque
actualValueDefault
actualValueIn
ADD
ADD_DT_TIME
ADD_TIME
ADD_TOD_TIME
additionalSensorData
additionResult
additiveTorque
additiveTorqueIn
ADVANCED_TYPE
ALARM_S
ALARM_SQ
ALARMS_ERROR
ALARMS_QSTATE
ALARMS_STATE
ALL
ALL_AXIS_MOTION
ALL_EDGES
ALL_ERRORS
ALL_GLOBAL
ALL_ID
ALL_POSITION_RELATED_MOTION
ANALOG
ANALOG_TEMPERATURE
AND
Basic functions
494 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
ANDN
ANYOBJECT
ANYOBJECT_TO_OBJECT
ANYTYPE_TO_BIGBYTEARRAY
ANYTYPE_TO_LITTLEBYTEARRAY
APPROACH_MOVE
APPROACH_NEGATIVE
APPROACH_NEGATIVE_PASSIVE
APPROACH_POSITIVE
APPROACH_POSITIVE_PASSIVE
ARRAY
ARTICULATED_ARM
AS
ASIN
ASSEMBLY_BASE_DRIVE
ASSEMBLY_BASE_EXTERN
ASSEMBLY_BASE_LINEAR
ASSEMBLY_BASE_LOAD
AT
AT_DECELERATION_START
AT_END_OF_COMMAND
AT_MOTION_START
AT_PROFILE_START
AT_THE_END_OF_CAM_CYCLE
ATAN
ATTACHED_STEADILY
AUTOMATIC_INTERFACE_SYNCHRONIZATION
AUTOMATICALLY
AVAILABLE
AVERAGING
AXIS_DISABLED
AXIS_HOMED
AXIS_STOPPED_AT_POSITION
B
B_SPLINE
Basic functions
Function Manual, 05/2009 495
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
BASIC
BASIC_AND_SUPERIMPOSED_MOTION_ACTIVE
BASIC_AND_SUPERIMPOSED_POS_MOTION_ACTIVE
BASIC_MOTION
BASIC_MOTION_ACTIVE
BASIC_MOTION_ACTIVE_WITH_LENGTH_OUTPUT
BASIC_NON_POS_AND_SUPERIMPOSED_POS_MOTION_ACTIVE
BASIC_POS_AND_SUPERIMPOSED_NON_POS_MOTION_ACTIVE
BASIC_POS_MOTION_ACTIVE
basicMotion
Baudrate_1
Baudrate_2
Baudrate_3
Baudrate_4
Baudrate_5
BCD_TO_BYTE
BCD_TO_DINT
BCD_TO_DWORD
BCD_TO_INT
BCD_TO_LWORD
BCD_TO_SINT
BCD_TO_WORD
bcs
BE_SYNCHRONOUS_AT_POSITION
BEFORE_ANTIWINDUP_LIMITATION
BEGIN_SYNC
BEGIN_TO_STOP_WHEN_POSITION_REACHED
BEHIND_ANTIWINDUP_LIMITATION
BigByteArray_to_AnyType
BIGBYTEARRAY_TOANYTYPE
BIN_CODE
BOOL
BOOL_TO_BYTE
BOOL_TO_DWORD
BOOL_TO_WORD
BOOL_VALUE_TO_DINT
Basic functions
496 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
BOOL_VALUE_TO_INT
BOOL_VALUE_TO_LREAL
BOOL_VALUE_TO_REAL
BOOL_VALUE_TO_SINT
BOOL_VALUE_TO_UDINT
BOOL_VALUE_TO_UINT
BOOL_VALUE_TO_USINT
BOTH
BOTH_DIRECTION
BOTH_EDGES
BOTH_EDGES_FIRST_FALLING
BOTH_EDGES_FIRST_RISING
BUFFERED
BY
BY_CAM_TRACK_END
BY_CENTER_AND_ARC
BY_COMMAND
BY_END_POSITION
BY_PROFILE_END
BY_START_POSITION
BY_STW_BIT
BY_VALUE
BYTE
BYTE_TO_BCD
BYTE_TO_BOOL
BYTE_TO_DINT
BYTE_TO_DWORD
BYTE_TO_INT
BYTE_TO_SINT
BYTE_TO_UDINT
BYTE_TO_UINT
BYTE_TO_USINT
BYTE_TO_WORD
BYTE_VALUE_TO_LREAL
BYTE_VALUE_TO_REAL
Basic functions
Function Manual, 05/2009 497
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
C
C_SPLINE
CAL
CALC
CALCN
CAM_AND_ZM_PASSIVE
CAM_DATA_RESET
CAM_PASSIVE
CAMMING
cammingAdjustments
CAMTRACK_DISABLE
camTrackPosition
CARTESIAN
CASE
CHANGE_DS_IS_LOCKED
CHANGE_FAILED
CHANNEL_0
CHANNEL_1
CHANNEL_2
CHANNEL_3
CHANNEL_4
CHANNEL_5
CHANNEL_6
CHANNEL_7
circularPathCommand
CLAMP_BY_FOLLOWING_ERROR_DEVIATION
CLAMP_WHEN_TORQUE_LIMIT_REACHED
CLOSE_ON_EXIT
CMD_CONTINUEAXIS
CMD_DISABLEAXIS
CMD_DISABLEAXISSIMULATION
CMD_ENABLEAXIS
CMD_ENABLEAXISSIMULATION
CMD_ENABLEMEASURINGINPUT
CMD_HOMING
CMD_INIT
Basic functions
498 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
CMD_MOVE
CMD_POSABS
CMD_POSREL
CMD_RESETAXIS
CMD_SETDATASETPARAM
CMD_STOPAXIS
CMD_STOPEMERGENCY
COLLECT_CHANGED_CONFIG_DATA
COMMAND_DONE
COMMAND_DYNAMICS
COMMAND_FAILED
COMMAND_NOT_FOUND
COMMAND_VALUE
COMMAND_VALUE_BASIC_MOTION
COMMAND_VALUE_SUPERIMPOSED_MOTION
COMMAND_VALUE_TOLERANCE
CommandIdType
COMPLETE_RANGE
CONCAT
CONCAT_DATE_TOD
CONDITION_1
CONDITION_1_AND_CONDITION_2
CONDITION_1_OR_CONDITION_2
CONDITION_2
CONFIG_TO_SHADOW
CONFIGURATION
CONFIGURATION_DELETED
CONFIGURATION_ERROR
CONFIGURATION_ID_NOT_FOUND
CONFIGURATION_NOT_FOUND
CONFIGURATION_VERSION
CONFIGURED
CONFIGURED_OUTPUT_VALUE
CONSTANT
CONSTANT_FORCE
CONSTANT_MOVE
Basic functions
Function Manual, 05/2009 499
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
CONTINUOUS
control
CONTROL_STOP
controlDeviation
controllerOutput
controlRangeParameter
COS
counterCamData
counterMeasuredValue1
counterMeasuredValue2
CRITICAL
CTD
CTD_DINT
CTD_LINT
CTD_UDINT
CTD_ULINT
CTU
CTU_DINT
CTU_LINT
CTU_UDINT
CTU_ULINT
CTUD
CTUD_DINT
CTUD_LINT
CTUD_UDINT
CTUD_ULINT
CUBIC_MODE
CURRENT
CURRENT_MODE
currentMasterData
currentSlaveData
currentSyncPosition
cycleParameter
cycleParameterSecondary
CYCLIC
CYCLIC_ABSOLUTE
Basic functions
500 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
CYCLIC_RELATIVE
cyclicMeasuringEnableCommand
D
DATA_EXCHANGE_INACTIVE
DATA_INCOMPATIBLE
DATA_INCOMPLETE
DATA_MISMATCH
DATASET_ALREADY_EXISTS
DATASET_ID_NOT_VALID
DATASET_NOT_FOUND
dataSetMonitoring
DATE
DATE_AND_TIME
DATE_AND_TIME_TO_DATE
DATE_AND_TIME_TO_TIME_OF_DAY
dccAux_2Clock
dccAuxClock
DEACTIVATED
DEACTIVATED_NO_ALARM
DECELERATING
DECELERATING_FORCE
DECODE_STOP
DEFAULT_MODE
DEFAULT_PASSIVE
DEFAULT_UNIT
DEFAULT_VALUE
defaultAdditiveTorque
defaultMotionIn
defaultTorqueLimitNegative
defaultTorqueLimitPositive
definitionState
DELETE
DELTA_2D_PICKER
DELTA_3D_PICKER
DEPENDING_ON_OUTER_INPUT_LIMITCHECK_STATUS
Basic functions
Function Manual, 05/2009 501
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
derivedValue
DESYNCHRONIZING
DIFF_NEGATIVE
DIFF_POSITIVE
DIFFERENTIATION
DINT
DINT_TO_BCD
DINT_TO_BYTE
DINT_TO_DWORD
DINT_TO_INT
DINT_TO_LREAL
DINT_TO_REAL
DINT_TO_SINT
DINT_TO_STRING
DINT_TO_UDINT
DINT_TO_UINT
DINT_TO_USINT
DINT_TO_WORD
DINT_VALUE_TO_BOOL
DINTIn1
DINTIn1Default
DINTIn2
DINTIn2Default
DINTIn3
DINTIn3Default
DINTIn4
DINTIn4Default
DINTOut1
DINTOut1Default
DINTOut2
DINTOut2Default
DINTOut3
DINTOut3Default
DINTOut4
DINTOut4Default
DIRECT
Basic functions
502 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
DIRECT_HOMING
DIRECT_HOMING_RELATIVE
DIRECT_MODE
DIRECT_OUTPUT
DIRECT_TO_SHADOW
DIRECT_VALUE
DISABLE
DISABLE_ALL
DISABLE_CONTROLLER
DISABLE_DRIVE_IMMEDIATELY
DISABLE_MEASURE_AND_AVARAGE_OUTPUT_VALUE
DISABLE_MEASURE_AND_MANUAL_OUTPUT_VALUE
DISABLE_MOTION
DISABLE_OUTPUT
disableCommand
DISCONTINUOUS
distributedMotion
DIV
DIVTIME
DO
DO_NOT_CHANGE
DO_NOT_CLAMP
DO_NOT_CLOSE_ON_EXIT
DO_NOT_SET_DP_ALARM
DO_NOT_STOP
DONE
DP_1
DP_2
DP_3
DP_CLOCk_DETECTED
DP_INTERFACES_SYNCHRONIZED
DP_SLAVE_NOT_SYNCHRONIZED
DP_SLAVE_SYNCHRONIZED
DP_TEL1_STANDARD
DP_TEL101_611U_VELCTRL_NO_ENCODER
DP_TEL102_611U_POSCTRL_1_ENCODER
Basic functions
Function Manual, 05/2009 503
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
DP_TEL103_611U_POSCTRL_2_ENCODER
DP_TEL105_611U_DSC_1_ENCODER
DP_TEL106_611U_DSC_2_ENCODER
DP_TEL2_STANDARD
DP_TEL3_STANDARD
DP_TEL4_STANDARD
DP_TEL5_STANDARD
DP_TEL6_STANDARD
DP_TEL81_STANDARD
DPIDParameter
DPIDParameterSecondary
DPMASTER
DRIVE
DRIVE_INTERFACE
driveData
DSC_SVS_DEVICE_ALARMS_EVENT_ID_IN_USE
DSC_SVS_DEVICE_ALARMS_EVENT_ID_NOT_USED
DSC_SVS_DEVICE_ALARMS_ILLEGAL_EVENT_ID
DSC_SVS_DEVICE_ALARMS_INTERNAL_ERROR
DSC_SVS_DEVICE_ALARMS_IV_CALL
DSC_SVS_DEVICE_ALARMS_IV_FIRST_CALL
DSC_SVS_DEVICE_ALARMS_IV_SFC_TYP
DSC_SVS_DEVICE_ALARMS_LAST_ENTRY_USED
DSC_SVS_DEVICE_ALARMS_LAST_SIGNAL_USED
DSC_SVS_DEVICE_ALARMS_NO_ENTRY
DT
DT_TO_DATE
DT_TO_TOD
DWORD
DWORD_TO_BCD
DWORD_TO_BOOL
DWORD_TO_BYTE
DWORD_TO_DINT
DWORD_TO_INT
DWORD_TO_REAL
DWORD_TO_SINT
Basic functions
504 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
DWORD_TO_UDINT
DWORD_TO_UINT
DWORD_TO_USINT
DWORD_TO_WORD
DWORD_VALUE_TO_LREAL
DWORD_VALUE_TO_REAL
E
EDGE_NEG_SIDE_NEG
EDGE_NEG_SIDE_NEG_PASSIVE
EDGE_NEG_SIDE_POS
EDGE_NEG_SIDE_POS_PASSIVE
EDGE_POS_SIDE_NEG
EDGE_POS_SIDE_NEG_PASSIVE
EDGE_POS_SIDE_POS
EDGE_POS_SIDE_POS_PASSIVE
EFFECTIVE
effectiveData
effectiveTaskRuntime
ELSE
ELSIF
EMPTY
EN
ENABLE
ENABLE_OFFSET_OF_ABSOLUTE_ENCODER
enableCommand
enableForceControlByConditionCommand
enableForceLimitingByConditionCommand
enableValidCam
ENCODER_DISABLE
END_ACTION
END_CASE
END_CONFIGURATION
END_EXPRESSION
END_FOR
END_FUNCTION
Basic functions
Function Manual, 05/2009 505
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
END_FUNCTION_BLOCK
END_IF
END_IMPLEMENTATION
END_INTERFACE
END_LABEL
END_MOUNTED_SWITCH
END_OF_INTERPOLATION
END_OF_MOTION_STOP
END_POINT
END_PROGRAM
END_REPEAT
END_RESOURCE
END_STEP
END_STRUCT
END_SYNC
END_TRANSITION
END_TYPE
END_VAR
END_WAITFORCONDITION
END_WHILE
ENDAT
ENO
Enum_STGP_CMD
Enum_STGP_STATE
ENUM_TO_DINT
EnumAbsBaudrate
EnumAbsMsgFormat
EnumAbsMsgLength
EnumAbsoluteRelative
EnumAbsState
EnumAcceleration
EnumAccessMode
EnumActivatedDeactivated
EnumActiveAbsRelInactive
EnumActiveInactive
EnumActiveInactiveNoChange
Basic functions
506 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumActiveNoChange
EnumActiveWaitingForDataInactive
EnumActualDirect
EnumActualValueFormat
EnumAdditionExecution
EnumAdditionObjectErrorReaction
EnumAlarmIdState
EnumAlarmIdType
EnumApproachPositionType
EnumAxisActuatorInterfaceAllocationConfig
EnumAxisAdditionalSensorType
EnumAxisApproachDirection
EnumAxisCompareMode
EnumAxisControllerOutput
EnumAxisControllerType
EnumAxisCyclicSetUpInForceLimiting
EnumAxisDelayValueCalculationMode
EnumAxisDelayValueState
EnumAxisDioActorType
EnumAxisDriverMode
EnumAxisEnableMovingMode
EnumAxisEncoderAssemblyType
EnumAxisEncoderIdentification
EnumAxisEncoderMode
EnumAxisEncoderSystem
EnumAxisEncoderType
EnumAxisEncoderValueType
EnumAxisErrorReaction
EnumAxisExtrapolatedVelocitySwitch
EnumAxisFilterMode
EnumAxisFineInterpolatorMode
EnumAxisFollowingMotionState
EnumAxisForceCommand
EnumAxisForceDerivativeLimitingMode
EnumAxisForceExtrapolationType
EnumAxisForceLimitingCommandType
Basic functions
Function Manual, 05/2009 507
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumAxisForceProfileModeConditionCommand
EnumAxisForceProfileProcessingState
EnumAxisForceState
EnumAxisForceValueConditionCommand
EnumAxisFrictionReference
EnumAxisHomingMode
EnumAxisHomingReverseCamType
EnumAxisHomingState
EnumAxisIdentification
EnumAxisInterfaceActivationConfig
EnumAxisInterfaceAllocationConfigSharable
EnumAxisIntervalCounterMode
EnumAxisLimitingProfileProcessingState
EnumAxisMotionCommand
EnumAxisMotionInCommandState
EnumAxisMotionState
EnumAxisMotorType
EnumAxisOperatingMode
EnumAxisPassiveApproachDirection
EnumAxisPassiveHomingMode
EnumAxisPathMotionState
EnumAxisPathPosToleranceCommandValue
EnumAxisPosCommandSpecification
EnumAxisProfileProcessingState
EnumAxisProgrammedTargetPosition
EnumAxisReferenceCamType
EnumAxisReferenceMaxNominal
EnumAxisSensorInterfaceAllocationConfig
EnumAxisServoMonitoringPositioningState
EnumAxisSwitchingCondition
EnumAxisSwitchingCondition_1
EnumAxisSwitchingCondition_2
EnumAxisSwLimitModeSpecificMonitoring
EnumAxisTelegramType
EnumAxisTorqueForceReductionGranularity
EnumAxisType
Basic functions
508 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumAxisUpdateCycle
EnumAxisUserDefaultHighLow
EnumAxisValueReferenceType
EnumAxisVelocityLimitingCommandType
EnumAxisVelocityLimitingDirection
EnumAxisVelocityLimitingValueMode
EnumBackLashDiff
EnumBackLashType
EnumBalanceFilterMode
EnumBlendingMode
EnumCamData
EnumCamDefinitionState
EnumCamErrorReaction
EnumCamFollowingRangeSpecificationMode
EnumCamInterpolationMode
EnumCamLeadingRangeStartPoint
EnumCammingActivationMode
EnumCammingDirection
EnumCammingMode
EnumCamMode
EnumCamPositionMode
EnumCamRange
EnumCamRepresentation
EnumCamTrackActivationMode
EnumCamTrackErrorReaction
EnumCamTrackNextCommand
EnumCamTrackOutputType
EnumCamTrackPositionReference
EnumCamTrackSetState
EnumCamTrackStartMode
EnumCamTrackState
EnumCamTrackStopMode
EnumCamTrackTaskLevel
EnumCamTrackType
EnumCamTrackValue
EnumCamValueType
Basic functions
Function Manual, 05/2009 509
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumChangeMode
EnumCommandIdState
EnumCommandValueQuantizationMode
EnumCompactControllerControllerType
EnumConfigurationInfoId
EnumContinueSpecification
EnumControllerObjectErrorBehaviorMode
EnumControllerObjectErrorReaction
EnumControllerObjectInputType
EnumControllerObjectISetMode
EnumControllerObjectPrecontrolAddupMode
EnumControllerObjectValueBehaviorMode
EnumConversionDataType
EnumDataDefault
EnumDataSetChangingState
EnumDataType
EnumDecodeSequentialMotionCommand
EnumDefaultValueDirect
EnumDeviceAbortReadWriteJobs
EnumDeviceCommandIdState
EnumDeviceConfigurationActivationState
EnumDeviceDataActivationState
EnumDeviceDataScope
EnumDeviceDpAlarmMode
EnumDeviceIdType
EnumDeviceKindOfData
EnumDeviceModeOfOperation
EnumDeviceStartupOperationMode
EnumDeviceStateOfDpSlave
EnumDeviceStorageType
EnumDeviceUnitDataSetCommand
EnumDirectEffectiveUserDefault
EnumDirection
EnumDirectionType
EnumDisableQFAxisOutputEnableMode
EnumDisableQFAxisOutputMode
Basic functions
510 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumDoNotChangeDirect
EnumDpInterfaceSyncMode
EnumDpInterfaceSyncState
EnumDpSegmentId
EnumDpSlaveSyncState
EnumDriveFaultsType
EnumEffectiveUserDefault
EnumEnableAxisMode
EnumEnableDisable
EnumEncoderErrorReaction
EnumEncoderIdentification
EnumEndBehaviourOfProfile
EnumErrorReporting
EnumErrorReset
EnumEventClass
EnumExtendedValue
EnumExtendedValueType
EnumFctGenStartStop
EnumFctGenState
EnumFixedGearDirectEffectiveUserDefault
EnumFixedGearDirection
EnumFixedGearDisableMode
EnumFixedGearEnableMode
EnumFixedGearErrorBehaviorMode
EnumFixedGearErrorReaction
EnumFixedGearGearingMode
EnumFixedGearGearingType
EnumFixedGearMergeModeDisableGearing
EnumFixedGearMergeModeEnableGearing
EnumFixedGearMotionOutBehaviorMode
EnumFixedGearNextCommandDisableGearing
EnumFixedGearNextCommandEnableGearing
EnumFollowingObjectDynamicMergeMode
EnumFollowingObjectDynamicReference
EnumFollowingObjectErrorReaction
EnumFollowingObjectMotionImpact
Basic functions
Function Manual, 05/2009 511
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumFollowingObjectStateSetMasterCommand
EnumFollowingObjectSynchronizeWithLookAhead
EnumFollowingObjectSynchronizingDirection
EnumFollowingObjectSynchronizingState
EnumFollowingObjectSyncMode
EnumFollowingObjectVelocityMode
EnumFollowingState
EnumForceControlByConditionCommandState
EnumForceController
EnumForceControllerFilterType
EnumForceControllerState
EnumForceControllerType
EnumForceControllerTypeOfSensorData
EnumForceDirection
EnumForceLimitingByConditionCommandState
EnumFormulaErrorReaction
EnumFormulaObjectErrorBehaviorMode
EnumFormulaObjectOutBehaviorMode
EnumGearingActivationMode
EnumGearingDirection
EnumGearingMode
EnumGearingPosToleranceCommandValue
EnumGearingType
EnumGetValue
EnumHomingMode
EnumInactiveNoChange
EnumIncomingOutgoing
EnumInOutDirection
EnumInSensorIdentification
EnumInSensorMode
EnumInSensorSystem
EnumInSensorType
EnumInSensorValueType
EnumInsertMode
EnumIntegratorMode
EnumInterfaceID
Basic functions
512 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumInterfaceValueDefaultValue
EnumInterpolationState
EnumIoIdType
EnumJerk
EnumLastValidInterfaceValueDefaultValue
EnumLeadingRangeEndPoint
EnumLimitExceededOk
EnumLogicOperation
EnumMasterMode
EnumMeasuredEdge
EnumMeasuringInputAccess
EnumMeasuringInputCyclicMode
EnumMeasuringInputErrorReaction
EnumMeasuringInputInputType
EnumMeasuringInputTaskLevel
EnumMeasuringRangeMode
EnumMeasuringState
EnumMemoryCardIdType
EnumMergeMode
EnumMergeModeDisableCamming
EnumMergeModeDisableGearing
EnumMergeModeEnableCamming
EnumMergeModeEnableGearing
EnumMergeModeEnableMotionIn
EnumMergeModeForceTimeProfile
EnumMergeModeStop
EnumModeSelfAdaptingConfiguration
EnumMotionBaseType
EnumMotionBufferState
EnumMotionCommandIdState
EnumMountSwitch
EnumMoveTimeOut
EnumMovingMode
EnumMovingModeStopCommand
EnumNextCommand
EnumNextCommandCamming
Basic functions
Function Manual, 05/2009 513
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumNextCommandCancelCommand
EnumNextCommandDelayValueCalculation
EnumNextCommandDisableClamping
EnumNextCommandDisableForceLimiting
EnumNextCommandDisableLimiting
EnumNextCommandDisableTorqueLimiting
EnumNextCommandEnable
EnumNextCommandEnableAxisInterface
EnumNextCommandEnableClamping
EnumNextCommandEnableForceControl
EnumNextCommandEnableForceLimitingValue
EnumNextCommandEnableLimitingValue
EnumNextCommandEnableMeasuring
EnumNextCommandEnableMotionIn
EnumNextCommandEnableTorqueLimiting
EnumNextCommandEncoderSimulation
EnumNextCommandForceProfile
EnumNextCommandForceValue
EnumNextCommandGearing
EnumNextCommandHoming
EnumNextCommandIpoClockBorderToPosition
EnumNextCommandMode
EnumNextCommandPathMove
EnumNextCommandProfile
EnumNextCommandReset
EnumNextCommandScaling
EnumNextCommandSensor
EnumNextCommandSetMaster
EnumNextCommandSyncEncoder
EnumOffsetMode
EnumOkFaulted
EnumOnOff
EnumOperationMode
EnumOutputCamErrorReaction
EnumOutputCamInvert
EnumOutputCamOutputType
Basic functions
514 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumOutputCamPosition
EnumOutputCamState
EnumOutputCamTaskLevel
EnumOutputCamType
EnumOutputCamValue
EnumPathBlendingMode
EnumPathCartesianKinematicsType
EnumPathCircularDirection
EnumPathCircularType
EnumPathDynamicAdaption
EnumPathErrorReaction
EnumPathIjkMode
EnumPathKinematicsConfig2D
EnumPathKinematicsType
EnumPathMergeMode
EnumPathMode
EnumPathMotionCommand
EnumPathMotionCommandIdState
EnumPathMotionState
EnumPathPlane
EnumPathPointType
EnumPathPolynomialMode
EnumPathStopMode
EnumPathSyncAxisMotionState
EnumPathVelocity
EnumPathVelocityProfile
EnumPathWDirection
EnumPathWMode
EnumPersistentDataState
EnumPositioningMode
EnumPositiveNegative
EnumPosValue
EnumProfile
EnumProfileDynamicsLimiting
EnumQFAxisOutputEnableMode
EnumQFAxisOutputMode
Basic functions
Function Manual, 05/2009 515
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumQFAxisOutputSetMode
EnumRange
EnumRecognitionMode
EnumRedefineMode
EnumRedefineSpecification
EnumRemoveMode
EnumReqActDeactGetStateMode
EnumReqSysFunctMode
EnumRestartAxisCondition
EnumSaveState
EnumScaleSpecification
EnumScalingSpecification
EnumSensorDataType
EnumSensorErrorReaction
EnumSensorState
EnumSensorValueBehaviorMode
EnumSetAndGetSafeValue
EnumSetNoSet
EnumSlaveMode
EnumStartStop
EnumStateOfDpSlave
EnumStateOfDpStation
EnumStateOfTo
EnumStopDriveMode
EnumStopMode
EnumStopSpecification
EnumSyncCommandState
EnumSynchronizingMode
EnumSyncModeCamming
EnumSyncModeGearing
EnumSyncOffModeCamming
EnumSyncOffModeGearing
EnumSyncOffPositionReference
EnumSyncPositionReference
EnumSyncProfileReference
EnumSystemDirect
Basic functions
516 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumTControllerActivationModeChangedConfigData
EnumTControllerBinaryIObits
EnumTControllerCommandDestination
EnumTControllerControllerType
EnumTControllerCopyShadow
EnumTControllerDataResetMode
EnumTControllerErrorReaction
EnumTControllerErrorResetMode
EnumTControllerExecutionLevel
EnumTControllerIdentificationAvailableType
EnumTControllerIdentificationModifiedTangentMethodStage
EnumTControllerIdentificationStandardTangentMethodStage
EnumTControllerIdentificationTransitionMode
EnumTControllerIdentificationType
EnumTControllerInputGradientCheckMode
EnumTControllerInputLimitCheckMode
EnumTControllerInputLimitCheckState
EnumTControllerInputType
EnumTControllerIntegrationLimitState
EnumTControllerIntegrationMode
EnumTControllerNextCommand
EnumTControllerOperatingMode
EnumTControllerOutputLimitState
EnumTControllerOutputType
EnumTControllerPlausibilityCheckMode
EnumTControllerPlausibilityState
EnumTControllerProcessControlState
EnumTControllerProcessMode
EnumTControllerRestartActivation
EnumTControllerRestartActivationSetting
EnumTControllerRestartCondition
EnumTControllerSimulationMode
EnumTcpNextCommandMode
EnumToActivationModeSetConfigData
EnumToExecutionLevel
EnumToInvalidSysvarAccess
Basic functions
Function Manual, 05/2009 517
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
EnumToRestartActivation
EnumToRestartActivationSetting
EnumTorqueLimitUnitType
EnumToSetStateOfTo
EnumTraceState
EnumTransferSuperimposedPosition
EnumTrueFalse
EnumUdpCommunicationMode
EnumUpsBatteryState
EnumUpsState
EnumUserDefaultDirect
EnumUserDefaultYesNo
EnumValueSpecification
EnumValueType
EnumVelocity
EnumXCommandIdState
EnumXCommunicationMode
EnumXNextCommandEnable
EnumYesNo
EQ
error
errorGroup
errorReaction
EXCLUSIVE
EXECUTED
EXIT
EXP
EXPD
EXPRESSION
EXPT
EXTENDED_LOOK_AHEAD
extrapolationData
extrapolationValue
F
F_EDGE
Basic functions
518 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
F_TRIG
FAILED
FALLING_EDGE
FALLING_EDGES_ONLY
FALSE
FAST
FAULTED
FCTGEN_DISABLED
FCTGEN_ENABLED
FCTGEN_LIMIT_EXCEEDED
FCTGEN_PARAM_VALID
FCTGEN_RUNNING
FCTGEN_START
FCTGEN_START_FG1
FCTGEN_START_FG2
FCTGEN_STARTING
FCTGEN_STOP
FCTGEN_STOPPING
FCTGEN_WAIT_FG1
FCTGEN_WAIT_FG2
FEEDBACK
FEEDBACK_EMERGENCY_STOP
FIND
FINISHED
FIXED_GEAR_DISABLE
fixedGearValue
FLEXIBLE_MOUNTED_SWITCH
FOLLOWING_OBJECT_DISABLE
FOLLOWING_RANGE
followingRangeSettings
FOR
FORCE_AND_INPUT
FORCE_AND_POSITION
FORCE_AND_TIME
FORCE_CONDITION
FORCE_CONTROLLED
Basic functions
Function Manual, 05/2009 519
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
FORCE_LIMITED
FORCE_OR_INPUT
FORCE_OR_POSITION
FORCE_OR_TIME
FORCE_POSITION
FORCE_TIME
FORCE_VALUE
forceActualValueSettings
forceControllerData
forceControllerMonitorings
forceControllerSettings
forceLimitingCommand
forceMotionInPositionProfileCommand
forcePositionProfileCommand
forceStateData
forceTimeProfileCommand
FROM
FROM_BACKUP
FROM_FILE
FROM_RAM
FULL
FUNCTION
FUNCTION_BLOCK
FUNCTION_IS_ACTIVATED
FUNCTION_IS_ACTIVE
FUNCTION_IS_WAITING_FOR_ACTIVATION
G
GE
GEARING
GEARING_WITH_FRACTION
GEARING_WITH_RATIO
gearingAdjustments
GOTO
GRAY_CODE
GREATER_EQUAL
Basic functions
520 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
GT
H
HARDWARE_LIMIT_SWITCH
HARDWARE_LIMIT_SWITCH_NEGATIVE
HARDWARE_LIMIT_SWITCH_POSITIVE
HEAT_AND_COOL_OUTPUT_ZERO
HEAT_OUTPUT_ZERO
HEATING
HIGH
HOLD_CONNECTION
HOME_POSITION_ENTRY_MOVE
homingCommand
HW_TYPE
I
IDENTIFICATION
identificationModifiedTangentMethodParameter
identificationStandardTangentMethodParameter
IE_01
IE_02
IE_1
IE_2
IF
IMMEDIATELY
IMMEDIATELY_AND_BE_SYNCHRONOUS_AT_MASTER_POSITION
IMMEDIATELY_AND_SLAVE_POSITION
IMMEDIATELY_BY_CAM_TRACK_OUTPUT_INACTIVE
IMMEDIATELY_BY_TIME_PROFILE
IMMEDIATLY
IMPLEMENTATION
IN
IN_ACCELERATION
IN_ACTIVATION
IN_ALL_CONTROL_MODES
IN_CALCULATION
Basic functions
Function Manual, 05/2009 521
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
IN_CLOSED_LOOP_POSITION_CONTROL
IN_CONSTANT_MOTION
IN_DEACTIVATION
IN_DECELERATION
IN_DEFINED_TIME
IN_EXECUTION
IN_INTERPOLATION
IN_INTERPOLATION_BUT_NOT_ON_PROFILE
IN_MOTION
IN_OPERATION
IN_POSITION
IN_STANDSTILL
INACTIVE
INACTIVE_AND_WAITING_FOR_NEXT_CYCLE
INCOMING
INCOMING_ALARM
INCREMENT_COUNTER
INCREMENT_DURATION
INITIAL_STEP
INPUT
INPUT_CONDITION
inputDisplayValueParameter
inputFilterParameter
inputGradientCheckParameter
inputLimitCheckParameter
INSERT
INT
INT_TO_BCD
INT_TO_BYTE
INT_TO_DINT
INT_TO_DWORD
INT_TO_LREAL
INT_TO_REAL
INT_TO_SINT
INT_TO_TIME
INT_TO_UDINT
Basic functions
522 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
INT_TO_UINT
INT_TO_USINT
INT_TO_WORD
INT_VALUE_TO_BOOL
INTERFACE
INTERFACE_VALUE
INTERNAL_ERROR
INTERNAL_RELATED
internalServoSettings
internalToTrace
INTERNEL_ERROR
INTERPOLATED
interpolation
INTERPOLATION_DONE
INTERVAL_COUNTER
INVALID
INVALID_VALUE
IPO
IPO_2
ipoClock
ipoClock_2
J
JMP
JMPC
JMPCN
K
kinematicsData
L
LABEL
LAST_INTERFACE_VALUE
LAST_OPERATION_MODE
LAST_VALID_INTERFACE_VALUE
LAST_VALUE
Basic functions
Function Manual, 05/2009 523
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
LD
LDN
LE
LEADING_RANGE
LEADING_RANGE_END
LEADING_RANGE_START
LEADING_RANGE_VALUE
leadingRange
leadingRangeSettings
LEFT
LEN
LENGTH_13
LENGTH_21
LENGTH_25
LESS
lifeSign
LIMIT
LIMIT_EXCEEDED
LIMITING_BY_DIRECT_VALUE
LIMITING_BY_USER_DEFAULT_VALUE
limitsOfPathDynamics
LINEAR
LINEAR_CONVERSIONDATA
LINEAR_MODE
LINEAR_MOTORTYPE
LINEAR_SYSTEM
linearPathCommand
LINT
LITTLEBYTEARRAY_TO_ANYTYPE
LITTLEBYTEARRAY_TOANYTYPE
LN
LOAD_CONFIGURED_DATA
LOG
LONG_RUN_NEGATIVE
LONG_RUN_POSITIVE
LOW
Basic functions
524 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
LOWER_PRIMARY_FAILED
LOWER_SECONDARY_FAILED
lowerPlausibilityParameter
lowerPlausibilityParameterSecondary
LREAL
LREAL_INTERFACE
LREAL_TO_DINT
LREAL_TO_INT
LREAL_TO_REAL
LREAL_TO_SINT
LREAL_TO_STRING
LREAL_TO_UDINT
LREAL_TO_UINT
LREAL_TO_USINT
LREAL_VALUE_TO_BOOL
LREAL_VALUE_TO_BYTE
LREAL_VALUE_TO_DWORD
LREAL_VALUE_TO_WORD
LREALIn1
LREALIn1Default
LREALIn2
LREALIn2Default
LREALIn3
LREALIn3Default
LREALIn4
LREALIn4Default
LREALOut1
LREALOut1Default
LREALOut2
LREALOut2Default
LREALOut3
LREALOut3Default
LREALOut4
LREALOut4Default
LT
LWORD
Basic functions
Function Manual, 05/2009 525
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
LWORD_TO_BCD
M
manualOutputValue
MASTER_RANGE
MASTER_SLAVE_ALARMMESSAGES_1
masterState
MAX
MAX_CONFIGURED_DYNAMICS
MAX_VALUE
mcs
measuredValue1
measuredValue2
MEASURING_AND_MANUAL_OUTPUT
MEASURING_AND_OUTPUT_ZERO
MEASURING_ERROR
MEASURING_INPUT_DISABLE
MEMORY_CARD_FULL
MEMORY_CARD_SERIAL_NUMBER
MID
MIN
MIN_MAX
minusLimitsOfDynamics
MOD
MODE_1
MODE_2
MODE_CAM
MODE_CAM_AND_ZM
MODE_NO_REFERENCE
MODE_REFERENCE_CAM_AND_EXTERNAL_ZM
MODE_ZM
modeOfDpInterfaceSynchronization
modeOfOperation
MODIFICATION_ACTIVE
MODIFIED_TANGENTMETHOD
modulo
Basic functions
526 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
monitorings
MOTION_DONE
MOTION_EMERGENCY_ABORT
MOTION_EMERGENCY_STOP
MOTION_IN_POSITION_LOCKED_PROFILE
MOTION_INTERFACE
MOTION_STOP
motionIn
MotionIn1
MotionIn1Default
MotionIn2
MotionIn2Default
MotionIn3
MotionIn3Default
MotionIn4
MotionIn4Default
MotionInDefault
motionOut
MotionOut1
MotionOut1Default
MotionOut2
MotionOut2Default
MotionOut3
MotionOut3Default
MotionOutDefault
motionState
motionStateData
motionType
MOVE_WITH_CONSTANT_SPEED
moveCommand
MOVING_WITH_REDUCED_VELOCITY
movingToEndStopCommand
MUL
MULTIME
MUX
Basic functions
Function Manual, 05/2009 527
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
N
NE
NEGATIVE
NEGATIVE_ALL_HOMING
NEGATIVE_DIRECTION
NEVER
NEXT_CAM_CYCLE
NEXT_CAM_TRACK_CYCLE
NEXT_IPO_CYCLE
NEXT_MOTION
NEXT_WITH_REFERENCE
NO
NO_ACCESS
NO_ACTIVATE
NO_ALARMMESSAGES
NO_CHANGE
NO_COMMAND_BUFFER_AVAILABLE
NO_CONSTRAINTS
NO_CYCLIC
NO_DP_SEGMENT
NO_HOMING_MODE
NO_POS_MOTION_ACTIVE
NO_REPORTING
NO_REQUEST_TO_ACTIVATE
NO_RESSOURCES_AVAILABLE
NO_RESTART_ACTIVATION
NO_RETAIN_GLOBAL
NO_SET
NO_STORAGE_AVAILABLE
NO_TELEGRAM
NO_TYPE
NO_VALID_CONFIGURATION_ID
NO_VALID_STATE
NOCYCLIC
NODEF
NOMINAL_VALUE
Basic functions
528 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
NON_AVAILABLE
NON_CONTINUOUS
NON_EXCLUSIVE_AND_STARTUP_ACTIVATED
NON_EXCLUSIVE_AND_STARTUP_DEACTIVATED
NONE
NOT
NOT_ACTIVATED
NOT_EMPTY
NOT_ENOUGH_RAM
NOT_EXISTENT
NOT_INTERPOLATED
NOT_LIMITED
NOT_POSSIBLE
NOT_PRESENT
NOT_VALID
NOTSUPP
numberOfSummarizedTaskOverflow
O
O_K_
OF
OFF
OFFSET_MOVE
OFFSET_SCALE
OK
ON
ON_MASTER_AND_SLAVE_POSITION
ON_MASTER_POSITION
ON_PROFILE
ON_SLAVE_POSITION
ONBOARD
ONLY_POSITION_COMMAND
OPEN_POSITION_CONTROL
operatingMode
OPERATION_AND
OPERATION_OR
Basic functions
Function Manual, 05/2009 529
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
OR
ORDER_ID
ORN
OUT
OUTGOING
OUTGOING_ALARM
output
OUTPUT_CAM_DISABLE
OUTPUT_PATH_LENGTH
OUTPUT_PATH_LENGTH_ADDITIVE
outputData
outputDefault
outputDerivative
outputDerivativeDefault
outputMonitoring
outputSettings
outputValue
outputValueSecondary
OVER
OVER_POSITION_TO_ENDPOSITION
override
P
P_CONTROLLER
PARABOLIC
PASSIVE_HOMING
path
pathMotion
pathSyncMotion
PD
PERMANENT_STORAGE
persistentDataPowerMonitoring
PID
PID_ACTUAL
PID_CONTROLLER
pidController
Basic functions
530 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
pidControllerDefault
pidControllerEffective
pidControllerMonitorings
PINETREE
plusLimitsOfDynamics
PN_1
POLYNOMIAL
polynomialPathCommand
posCommand
POSITION
POSITION_AND_DIRECT_NIST_B
POSITION_AND_DYNAMIC_BASED
POSITION_AND_INPUT
POSITION_AND_PROFIDRIVE_NIST_B
POSITION_AND_TIME
POSITION_BASED
POSITION_CONDITION
POSITION_CONTROLLED
POSITION_LOCKED_PROFILE
POSITION_OR_INPUT
POSITION_OR_TIME
positionBasedMotionInCommand
positioningState
positionTimeProfileCommand
POSITIVE
POSITIVE_ALL_HOMING
POSITIVE_DIRECTION
POWER
precontrol
precontrolValueDefault
precontrolValueIn
PREDEFINED_APPLICATION_EVENTS
PREDEFINED_MODULE_INFORMATION
PRESSURE_DIFFERENCE_MEASUREMENT
PREVIOUS_ACTIVATED
PRIMARY
Basic functions
Function Manual, 05/2009 531
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
processedValue
processModeParameter
PROFIDRIVE_NIST_A
PROFIDRIVE_NIST_B
PROFILE_DONE
PROFILE_END
PROGRAM
PT1
PT2
PV
PWM
PWMParameter
PWMParameterSecondary
Q
QUADRATIC_MODE
R
R_EDGE
R_TRIG
RAM_DISK_FULL
RATED
rawValue
READ_AND_WRITE_JOBS
READ_ERROR
READ_JOBS
REAL
REAL_AXIS
REAL_AXIS_WITH_FORCE_CONTROL
REAL_AXIS_WITH_SIGNAL_OUTPUT
REAL_QFAXIS
REAL_QFAXIS_WITH_CLOSED_LOOP_FORCE_CONTROL
REAL_QFAXIS_WITH_OPEN_LOOP_FORCE_CONTROL
REAL_QFAXIS_WITH_OPEN_LOOP_FORCE_CONTROL_ONLY
REAL_TO_DINT
REAL_TO_DWORD
Basic functions
532 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
REAL_TO_INT
REAL_TO_LREAL
REAL_TO_SINT
REAL_TO_STRING
REAL_TO_TIME
REAL_TO_UDINT
REAL_TO_UINT
REAL_TO_USINT
REAL_VALUE_TO_BOOL
REAL_VALUE_TO_BYTE
REAL_VALUE_TO_DWORD
REAL_VALUE_TO_WORD
RECTANGLE_TTL
REFER_TO_ACTUAL_SENSOR_VALUE_RESOLUTION
REFERENCE_CAM_AND_EXTERNAL_ZM_PASSIVE
RELATE_SYNC_PROFILE_TO_LEADING_VALUE
RELATE_SYNC_PROFILE_TO_TIME
RELATIVE
RELEASE_DISABLE
REPEAT
REPLACE
REQUEST_ABORT
REQUEST_FALSE
REQUEST_TRUE
RESET
RESOLVER
RESOURCE
RESTART_BY_COMMAND
RESTART_BY_SYSVAR_AND_COMMAND
RESTART_NONE
restartActivation
RESULTING
RET
RETAIN
RETC
RETCN
Basic functions
Function Manual, 05/2009 533
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
RETURN
REVERSE
RIGHT
RIGHT_MARGIN
RISING_EDGE
RISING_EDGES_ONLY
ROL
ROLL_PICKER
ROR
ROTATORY
ROTATORY_SYSTEM
RS
RTC
RUN
S
SAME_DIRECTION
SAVE_ABORTED
SAVE_FINISHED
SCARA
SEARCH_ENDPOINT
SEARCH_INFLECTIONPOINT
SEARCH_STARTPOINT
SECONDARY
SEL
SEMA
SENSOR_ABSOLUTE
SENSOR_ANALOG
SENSOR_CYCLIC_ABSOLUTE
SENSOR_INCREMENTAL
SENSOR_POSITION_DIFFERENCE_MEASUREMENT
sensorData
sensorMonitoring
sensorSettings
SEQUENTIAL
SERIAL_NUMBER
Basic functions
534 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
SERVO
servoControlClock
servodata
servoMonitoring
servoSettings
servoTaskCycle
SET
SET_ACTUAL_VALUE
SET_DP_ALARM
SET_OFFSET_OF_ABSOLUTE_ENCODER_BY_POSITION
SET_VALUE
setForceCommandValueCommand
setMasterCommand
setpoint
SETPOINT_VALUE
setpointDefault
setpointIn
SETTING_OF_COEFFICIENTS
SETTING_UP
SHADOW
SHADOW_TO_DIRECT
SHL
SHORTEST_WAY
SHR
SIMULATION
SIMULATION_ABORT
SIMULATION_STOP
SIN
singleCamState
SINT
SINT_TO_BCD
SINT_TO_BYTE
SINT_TO_DINT
SINT_TO_DWORD
SINT_TO_INT
SINT_TO_LREAL
Basic functions
Function Manual, 05/2009 535
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
SINT_TO_REAL
SINT_TO_UDINT
SINT_TO_UINT
SINT_TO_USINT
SINT_TO_WORD
SINT_VALUE_TO_BOOL
SINUS_1VPP
SINUSOIDAL
SLAVE_ALARMMESSAGES_1
SLAVE_RANGE
SLOW
SMOOTH
SPECIFIC
SPECIFIC_AXIS_MOTION
SPECIFIC_ERROR
SPECIFIC_ID
SPECIFIC_NUMBER
SPECIFIC_PART_OF_RANGE
SPECIFIC_POINT
SPECIFIC_START_DATA
SPEED_CONTROLLED
speedMode
SQRT
SR
SSI_MODE
ST
STANDARD
STANDARD_AND_INVERSE
STANDARD_MOTORTYPE
STANDARD_TANGENTMETHOD
STANDARD_TYPE
STANDSTILL
STANDSTILL_MONITORING_ACTIVE
START
START_POINT
STARTPOINT_ENDPOINT
Basic functions
536 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
STARTUP_ACTIVATED
STARTUP_DEACTIVATED
state
STATE_HOMED
STATE_HOMING
STATE_INITIAL
STATE_MOVING
STATE_POSABS
STATE_POSITION_END
STATE_POSREL
STATE_STOPPED
STATE_TOACTIVE
stateCammingAdjustments
stateGearingAdjustments
stateOfDpInterfaceSynchronization
stateOfDpSlaveSynchronization
stateSetMasterCommand
STEP
STEPMOTOR
STN
STOP
STOP_ALL_FORMULA
STOP_AND_ABORT
STOP_DEVICE
STOP_IN_DEFINED_TIME
STOP_IN_PROFILE_END
STOP_SPECIFIC_FORMULA
STOP_SYMMETRIC_WITH_POSITION
STOP_WHEN_PROFILE_END_REACHED
STOP_WITH_COMMAND_VALUE_ZERO
STOP_WITH_DYNAMIC_PARAMETER
STOP_WITH_MAXIMAL_DECELERATION
STOP_WITHOUT_ABORT
stopEmergencyCommand
STOPPED
STOPPED_WITHOUT_ABORT
Basic functions
Function Manual, 05/2009 537
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
STOPU
STRING
STRING_TO_DINT
STRING_TO_LREAL
STRING_TO_REAL
STRING_TO_UDINT
STRUCT
StructAdditionalSensorNumber
StructAdditionObjectMotionIn
StructAdditionObjectMotionOut
StructAlarmId
STRUCTALARMID_TO_DINT
StructAxisAbsoluteEncoder
StructAxisActorData
StructAxisActorMonitoring
StructAxisActualTorque
StructAxisAdditionalSensorData
StructAxisAdditiveTorque
StructAxisAdditiveTorqueIn
StructAxisDataSetReadWrite
StructAxisDataSetReadWrite_V3_1
StructAxisDefaultType
StructAxisDistributedMotion
StructAxisDriveData
StructAxisDriveSafetyExtendedFunctionsInfoData
StructAxisDynamicLimit
StructAxisDynamicQFData
StructAxisExtrapolationData
StructAxisForceActualValueSettings
StructAxisForceControlByConditionCommand
StructAxisForceControlDataSet
StructAxisForceControlDataSet_V3_1
StructAxisForceControllerData
StructAxisForceControllerMonitorings
StructAxisForceControllerSettings
StructAxisForceLimitingByConditionCommand
Basic functions
538 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructAxisForceLimitingCommand
StructAxisForceMotionInPositionProfileCommand
StructAxisForcePositionProfileCommand
StructAxisForceStateData
StructAxisForceTimeProfileCommand
StructAxisHomingCommand
StructAxisHomingDefault
StructAxisInvertQOutput
StructAxisInvertSetPointHydraulicType
StructAxisModuloData
StructAxisMotionData
StructAxisMotionInData
StructAxisMotionStateData
StructAxisMoveCommand
StructAxisMovingToEndStopCommand
StructAxisOverride
StructAxisPathMotion
StructAxisPathSyncMotion
StructAxisPosCommand
StructAxisPositionBasedMotionInCommand
StructAxisPositioningDefault
StructAxisPositioningState
StructAxisPositionTimeProfileCommand
StructAxisSensorData
StructAxisSensorMonitoring
StructAxisSensorSettings
StructAxisServoData
StructAxisServoMonitoring
StructAxisServoSettings
StructAxisSetForceCommandValueCommand
StructAxisSwLimit
StructAxisSwLimitState
StructAxisTorqueLimitIn
StructAxisTorqueLimitingCommand
StructAxisUserDefaultClamping
StructAxisUserDefaultForceLimiting
Basic functions
Function Manual, 05/2009 539
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructAxisUserDefaultTorqueLimit
StructAxisVelocityBasedMotionInCommand
StructAxisVelocityLimitingCommand
StructAxisVelocityMotionInPositionProfileCommand
StructAxisVelocityPositionProfileCommand
StructAxisVelocityTimeProfileCommand
StructCamInterpolation
StructCammingAdjustments
StructCammingSettings
StructCamRange
StructCamScaleRange
StructCamSettings
StructCamTrackArrayOfSingleCamSettings
StructCamTrackEffectiveData
StructCamTrackSingleCamSettings
StructCamTrackUserDefault
StructCamUserDefault
StructClampingMonitoring
StructControllerDynamic
StructControllerObjectControlDeviation
StructControllerObjectOutputData
StructControllerObjectOutputMonitoring
StructControllerObjectPControllerData
StructControllerObjectPControllerDefault
StructControllerObjectPIDControllerData
StructControllerObjectPIDControllerDefault
StructControllerObjectPIDControllerEffective
StructControllerObjectPIDControllerMonitorings
StructControllerObjectPrecontrolData
StructControllerObjectValueIn
StructControllerType
StructControllerType_V3_1
StructCyclicMeasuringEnableCommand
StructDataSetMonitoring
StructDeviceConfigurationData
StructDeviceConfigurationManagement
Basic functions
540 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructDeviceCpuData
StructDeviceCpuDataRW
StructDeviceDataActivationState
StructDeviceIm0
StructDeviceIm0Softwareversion
StructDeviceIm0Version
StructDeviceImData
StructDeviceStartUp
StructDeviceUpsData
StructDpStationAddressType
StructDynamicComp
StructDynamicData
StructDynamicFollowing
StructEffectiveTaskRuntimeType
StructEncoderEffective
StructEncoderMotionState
StructEncoderNumber
StructEncoderSyncCommand
StructEncoderUserDefault
StructFilterForceControl
StructFixedGearingAdjustments
StructFixedGearingOffset
StructFixedGearingSettings
StructFixedGearMotionIn
StructFixedGearMotionOut
StructFixedGearUserDefault
StructFollowingObjectCurrentSyncPosition
StructFollowingObjectDistributedMotion
StructFollowingObjectMasterDynamics
StructFollowingObjectUserDefault
StructForceControllerData2
StructForceControllerData2_V3_1
StructForceControllerDifference
StructForceControlSwitchingData
StructForceControlUserDefault
StructForceLimitingSwitchingData
Basic functions
Function Manual, 05/2009 541
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructFormulaObjectDINTIn
StructFormulaObjectDINTOut
StructFormulaObjectLREALIn
StructFormulaObjectLREALOut
StructFormulaObjectMotionIn
StructFormulaObjectMotionOut
StructGear
StructGearingAdjustments
StructGearingOffset
StructGearingSettings
StructInternalServoSettings
StructInternalToTrace
StructLimitsOfPathDynamics
StructMeasuringInputEffective
StructMeasuringInputUserDefault
StructMotionVector
StructOutputCamCounterData
StructOutputCamEffectiveData
StructOutputCamUserDefault
StructOutputControllerOutput
StructOutputData
StructOutputLimits
StructOutputMonitoring
StructOutputSettings
StructPathAbortPosition
StructPathAxisMotionVector
StructPathBcsData
StructPathBlending
StructPathCircularCommand
StructPathData
StructPathDynamics
StructPathKinematicsData
StructPathLinearCommand
StructPathMcsData
StructPathMotionActual
StructPathMotionVector
Basic functions
542 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructPathOverride
StructPathPolynomialCommand
StructPathSettings
StructPathUserDefault
StructPathVector
StructPathWSettings
StructPDController
StructPendingAlarmState
structPersistentDataPowerMonitoringtype
StructPID_Controller
StructPID_Controller_V3_1
StructPIDController
StructPIDController_V3_1
StructProcessModel
StructPVController
StructPVController_V3_1
StructQFAxisDataSet
StructQFAxisDataSet_V3_1
StructQFAxisMaxDerivative
StructQFAxisUserDefault
StructRetAllocateToken
StructRetCommandState
StructRetConfiguration
StructRetDeviceCommandState
StructRetDeviceGetStateOfAllDpStations
StructRetDeviceGetStateOfDpSlave
StructRetDeviceNameOfStation
StructRetDiagnosticData
StructRetDpSlaveAddress
StructRetEncoderValue
StructRetGetAxisProgrammedTargetPosition
StructRetGetAxisSpecificState
StructRetGetAxisSpecificState2
StructRetGetAxisStoppingData
StructRetGetCamFollowingDerivative
StructRetGetCamSpecificState
Basic functions
Function Manual, 05/2009 543
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructRetGetCamSpecificState2
StructRetGetCircularPathData
StructRetGetCircularPathGeometricData
StructRetGetConfigurationData
StructRetGetDataByToken
StructRetGetDeviceId
StructRetGetDoIndexNumberFromLogAddress
StructRetGetDpStationAddressFromLogDiagnosticAddress
StructRetGetErrorNumberState
StructRetGetExternalEncoderSpecificState
StructRetGetExternalEncoderSpecificState2
StructRetGetForceControlDataSetParameter
StructRetGetForceControlDataSetParameter_V3_1
StructRetGetGearAxisSpecificState
StructRetGetGearAxisSpecificState2
StructRetGetGeoAddressFromLogAddress
StructRetGetInOutByte
StructRetGetLinearPathData
StructRetGetLinearPathGeometricData
StructRetGetLogDiagnosticAddressFromStationAddress
StructRetGetMeasuringInputSpecificState
StructRetGetMeasuringInputSpecificState2
StructRetGetMemoryCardId
StructRetGetNextLogAddress
StructRetGetOutputCamSpecificState
StructRetGetOutputCamSpecificState2
StructRetGetPendingAlarms
StructRetGetPendingAlarmState
StructRetGetPolynomialPathData
StructRetGetPolynomialPathGeometricData
StructRetGetPosAxisSpecificState
StructRetGetPosAxisSpecificState2
StructRetGetQFAxisDataSetParameter
StructRetGetQFAxisDataSetParameter_V3_1
StructRetGetSegmentIdentification
StructRetGetStateOfAllDpSlaves
Basic functions
544 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructRetGetStateOfSingleDpSlave
StructRetGetStateOfTo
StructRetGetStationType
StructRetGetToError
StructRetGetValue
StructRetIPConfig
StructRetMotionBuffer
StructRetMotionCommandState
StructRetPathAxesData
StructRetPathAxesPosition
StructRetPathCartesianData
StructRetPathCartesianPosition
StructRetPathMotionCommandState
StructRetReadDriveFaults
StructRetReadDriveMultiParameter
StructRetReadDriveMultiParameterDescription
StructRetReadDriveParameter
StructRetReadDriveParameterDescription
StructRetReadGetAxisDataSet
StructRetReadGetAxisDataSet_V3_1
StructRetReadRecord
StructRetTcpOpenClient
StructRetTcpOpenServer
StructRetTcpReceive
StructRetUdpReceive
StructRetUnitDataSetCommand
StructRetWriteDriveMultiParameter
StructRetWriteDriveParameter
StructRetXCommandState
StructRetXreceive
StructScaleOffset
StructSensorMonitorings
StructStateOfDpStations
StructSyncDynamics
StructSyncMonitoring
StructSyncPositions
Basic functions
Function Manual, 05/2009 545
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructSyncProfileDefinitions
StructSystemLoad
StructTaskId
StructTaskOverflowType
StructTaskRuntimeType
StructTaskRuntimeValues
StructTCOFctGenOverride
StructTControllerActualDPIDData
StructTControllerActualIdentificationModifiedTangentMethodData
StructTControllerActualIdentificationStandardTangentMethodData
StructTControllerActualInputData
StructTControllerActualInputLimitCheckData
StructTControllerActualInputSingleLimitCheckData
StructTControllerControlRangeParameter
StructTControllerCycleParameter
StructTControllerDPIDParameter
StructTControllerIdentificationModifiedTangentMethodParameter
StructTControllerIdentificationModifiedTangentMethodProcessParameter
StructTControllerIdentificationStandardTangentMethodParameter
StructTControllerIdentificationStandardTangentMethodProcessParameter
StructTControllerIdentificationStaticCondition
StructTControllerInputDisplayValueParameter
StructTControllerInputFilterParameter
StructTControllerInputGradientCheckParameter
StructTControllerInputLimitCheckParameter
StructTControllerInputSingleLimitCheckParameter
StructTControllerOutputValue
StructTControllerPlausibilityParameter
StructTControllerProcessModeParameter
StructTControllerPWMParameter
StructTorqueLimit
StructTraceControl
StructTraceState
StructUserData
StructValueAndDerivedMasterValue
StructValueAndDerivedSlaveValue
Basic functions
546 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
StructVelocityGearingSettings
StructXsendDestAddr
SUB
SUB_DATE_DATE
SUB_DT_DT
SUB_DT_TIME
SUB_TIME
SUB_TOD_TIME
SUB_TOD_TOD
SUPERIMPOSED_MOTION
SUPERIMPOSED_MOTION_ACTIVE
SUPERIMPOSED_MOTION_MERGE
SUPERIMPOSED_POS_MOTION_ACTIVE
superimposedMotion
SWITCH_BY_VALUE
SWITCHING_CONDITION_DONE
swLimit
swLimitState
SYMBOL_INFORMATION_NOT_AVAILABLE
SYMBOL_INFORMATION_NOT_FOUND
syncCommand
SYNCHRONIZE_SYMMETRIC
SYNCHRONIZE_WHEN_POSITION_REACHED
SYNCHRONIZED
SYNCHRONIZING
SYNCHRONIZING_NOT_POSSIBLE
synchronizingState
syncMonitoring
syncState
SYSTEM
SYSTEM_DEFINED
systemClock
systemLoad
T
TAN
Basic functions
Function Manual, 05/2009 547
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
TARGET_POSITION_MODE
TASK_STATE_INVALID
TASK_STATE_LOCKED
TASK_STATE_RUNNING
TASK_STATE_STOP_PENDING
TASK_STATE_STOPPED
TASK_STATE_SUSPENDED
TASK_STATE_WAIT_NEXT_CYCLE
TASK_STATE_WAIT_NEXT_INTERRUPT
TASK_STATE_WAITING
taskRuntime
taskRuntimeMonitoring
TCOFctGenOverride
TEMPORARY_STORAGE
THEN
TIME
TIME_AND_INPUT
TIME_CONDITION
TIME_LOCKED_PROFILE
TIME_OF_DAY
TIME_OR_INPUT
TIME_OUT
TIME_STAMP
TIME_TO_INT
TIME_TO_REAL
TIME_TO_UDINT
TO
TO_CONNECTION
TO_INTERFACE
TOD
TOF
TON
TORQUE
torqueLimitingCommand
torqueLimitNegative
torqueLimitNegativeIn
Basic functions
548 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
torqueLimitPositive
torqueLimitPositiveIn
TOTAL_MOVE
tOutput
TP
TRACE_ABORTED
TRACE_FINISHED
TRACE_INACTIVE
TRACE_MISMATCH
TRACE_NO_TIME
TRACE_PARAM_VALID
TRACE_RUNNING
TRACE_WAIT_FOR_TRIGGER
traceControl
traceState
TRANSFER
TRANSFER_MERGE
TRANSFER_RESET
TRANSFER_STANDSTILL
TRANSIENT_BEHAVIOR_DIRECT
TRANSIENT_BEHAVIOR_WITH_DYNAMICS
TRANSIENT_BEHAVIOR_WITH_NEXT_SYNC
TRANSITION
TRAPEZOIDAL
TRIGGER_OCCURED
TRUE
TRUNC
TYPE
TYPE_REVERSE
TYPE_SWITCH
TYPE_TIME
TYPE_TIME_WITH_MAX_LENGTH
TYPE_WAY
typeOfAxis
Basic functions
Function Manual, 05/2009 549
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
U
UDINT
UDINT_TO_BYTE
UDINT_TO_DINT
UDINT_TO_DWORD
UDINT_TO_INT
UDINT_TO_LREAL
UDINT_TO_REAL
UDINT_TO_SINT
UDINT_TO_STRING
UDINT_TO_TIME
UDINT_TO_UINT
UDINT_TO_USINT
UDINT_TO_WORD
UDINT_VALUE_TO_BOOL
UINT
UINT_TO_BYTE
UINT_TO_DINT
UINT_TO_DWORD
UINT_TO_INT
UINT_TO_LREAL
UINT_TO_REAL
UINT_TO_SINT
UINT_TO_UDINT
UINT_TO_USINT
UINT_TO_WORD
UINT_VALUE_TO_BOOL
ULINT
UNDER
UNI_DIRECTION
UNIT
UNIT_NOT_FOUND
UNTIL
UPPER_PRIMARY_FAILED
UPPER_SECONDARY_FAILED
upperPlausibilityParameter
Basic functions
550 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
upperPlausibilityParameterSecondary
USELIB
USEPACKAGE
USER
USER_DEFAULT
USER_DEFINED
USER_EVENTS_1
USER_EVENTS_2
USER_STORAGE
userData
userDefault
userDefaultClamping
userDefaultDynamics
userDefaultForceControl
userDefaultForceLimiting
userDefaultHoming
userDefaultPositioning
userDefaultQFAxis
userDefaultTorqueLimiting
USES
USINT
USINT_TO_BYTE
USINT_TO_DINT
USINT_TO_DWORD
USINT_TO_INT
USINT_TO_LREAL
USINT_TO_REAL
USINT_TO_SINT
USINT_TO_UDINT
USINT_TO_UINT
USINT_TO_WORD
USINT_VALUE_TO_BOOL
V
VALID
VALUE
Basic functions
Function Manual, 05/2009 551
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
VALUE_LEFT_MARGIN
VALUE_LEFT_MARGIN_WITHOUT_SIGN
VALUE_RIGHT_MARGIN
VALUE_RIGHT_MARGIN_WITHOUT_SIGN
VAR
VAR_ACCESS
VAR_ALIAS
VAR_EXTERNAL
VAR_GLOBAL
VAR_IN_OUT
VAR_INPUT
VAR_OBJECT
VAR_OUTPUT
VAR_TEMP
VELOCITY
VELOCITY_CONTROLLED
VELOCITY_GEARING
velocityBasedMotionInCommand
velocityLimitingCommand
velocityMotionInPositionProfileCommand
velocityPositionProfileCommand
velocityTimeProfileCommand
VERSION_MISSMATCH
VIRTUAL_AXIS
VOID
W
W
WAIT_FOR_CONDITION
WAIT_FOR_DP_CLOCK
WAIT_FOR_VALID
WAITFORCONDITION
WAITING
WAITING_FOR_CHANGE_OF_MASTER_DIRECTION
WAITING_FOR_MERGE
WAITING_FOR_RESTART
Basic functions
552 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
WAITING_FOR_SYNC_POSITION
WAITING_FOR_SYNC_START
WAITING_FOR_TRIGGER
WAITING_TO_START
WARNING
WHEN_ACCELERATION_DONE
WHEN_AXIS_HOMED
WHEN_AXIS_SYNCHRONIZED
WHEN_BUFFER_READY
WHEN_CAM_TRACK_DONE
WHEN_COMMAND_DONE
WHEN_DATA_ACTIVE
WHEN_ENCODER_SYNCHRONIZED
WHEN_ENDSTOP_REACHED
WHEN_FORCE_CONTROL_ENABLED
WHEN_FORCE_LIMIT_REACHED
WHEN_FORCE_LIMITING_ACTIVATED
WHEN_FUNCTION_DISABLED
WHEN_GEARING_START
WHEN_INTERPOLATION_DONE
WHEN_LIMIT_REACHED
WHEN_LIMITING_COMMAND_ACTIVATED
WHEN_MOTION_DONE
WHEN_PROFILE_DONE
WHEN_TORQUELIMIT_GONE
WHEN_TORQUELIMIT_REACHED
WHEN_TRIGGER_OCCURED
WHILE
WITH
WITH_CAM_TRACK_ACTIVATION
WITH_COMMAND_VALUE_ZERO
WITH_DYNAMIC_RESTRICTION
WITH_DYNAMICS
WITH_JERK
WITH_MAXIMAL_DECELERATION
WITH_NEXT_SYNCHRONIZING
Basic functions
Function Manual, 05/2009 553
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
WITH_RADIUS_AND_ENDPOSITION
WITH_SPECIFIC_AREA
WITH_TIME_LIMIT
WITHOUT_CHANGE
WITHOUT_DYNAMIC_RESTRICTION
WITHOUT_JERK
WITHOUT_LIMITING
WITHOUT_SPECIFIC_AREA
WITHOUT_TIME_LIMIT
WORD
WORD_TO_BCD
WORD_TO_BOOL
WORD_TO_BYTE
WORD_TO_DINT
WORD_TO_DWORD
WORD_TO_INT
WORD_TO_SINT
WORD_TO_UDINT
WORD_TO_UINT
WORD_TO_USINT
WORD_VALUE_TO_LREAL
WORD_VALUE_TO_REAL
WRITE_JOBS
WRITEABLE
X
X_Y
X_Y_Z
XOR
XORN
Y
Y_Z
YES
Basic functions
554 Function Manual, 05/2009
Appendix A
A.2 Identifiers with defined meaning in SIMOTION
Z
Z_X
ZERO_VALUE
ZM_PASSIVE
Basic functions
Function Manual, 05/2009 555
Index
_finite
Description, 319
_ _fixedGearType, 73
_formulaObjectType, 73
_additionObjectType, 73
_getAlarmId
_alarm, 278, 370
Application, 370
_alarmS
Description, 286
Application, 368, 369
_getAverageTaskIdRunTime, 274
_alarmSc
_getBit, 294
Application, 368, 369
_getCommandId, 359
_alarmScId
Error source, 454
Application, 368, 369
_getCurrentTaskIdRunTime, 273
Description, 285
_getDeviceId, 362
_alarmSId
_getInOutByte
Application, 368
Description, 335
Application, 369
_getMaximalTaskIdRunTime, 270
Description, 279
_getMemoryCardId, 363
_alarmSq
_getMinimalTaskIdRunTime, 271
Application, 368
_getPendingAlarms, 287
Application, 369
_getsafeValue, 329
_alarmSqId
_getStateOfTaskId
Application, 369
Brief description, 255
Application, 368
Description, 257
Description, 282
_getStateOfUnitDataSetCommand
_AND, 298
Description, 354
_BYTE_TO_8BOOL, 416
Example, 381
_camTrackType, 73
_GetStateOfXCommand, 388
_checkEqualTask
_getSyncCommandId, 360
Description, 268
Application, 393
Example, 113
_getTaskId
_checkExistingDataSet
Application, 255
Application, 376
Application, 278
Description, 355
Description, 267
_controllerObjectType, 73
_importUnitDataSet
_deleteAllUnitDataSets
Application, 376
Application, 376
_isNaN
Description, 357
Description, 320
_deleteUnitDataSet
_loadUnitDataSet
Application, 376
Application, 376
Description, 352
Description, 341
_device, 338, 342, 349, 352, 356, 358, 377
Example, 380
_disableScheduler
_NOT11, 298
Brief description, 256
_OR, 298
_DWORD_FROM_2WORD, 316
_pathAxis, 73
_DWORD_FROM_4BYTE, 317
_pathobjecttype, 73
_DWORD_TO_2WORD, 418
_project, 82
_DWORD_TO_4BYTE, 418
See also name space, 82
_exportUnitDataSet
_releaseSemaphore
Application, 376
Basic functions
Function Manual, 05/2009 557
Index
Basic functions
558 Function Manual, 05/2009
Index
Basic functions
Function Manual, 05/2009 559
Index
Basic functions
560 Function Manual, 05/2009
Index
ENUM_TO_DINT, 308 F
Enumerator data types, 70
F_TRIG, 406
Enumerators, 70
Fault, 95
Error
Cyclic tasks, 454
CommandId missing, 454
Wait times in cycle, 454
Comparing REAL variables, 458
FBD, 19
CPU not in RUN, 456
Fields of application, 20
Cyclic tasks, 453
Filter for error numbers, 373
Data type conversion, 453
Fixed gear, 38
during operations with floating-point numbers, 97
Floating-point number
Locating, 455
Error cause, 458
Range violation, 459
Floating-point numbers
Return values of commands, 65
Error, 97
runtime, 95
Following axis, 73
TO function in cycle, 453
Following object, 37, 73
while accessing system data, 130
followingAxis, 73
Error activation, 118
followingObjectType, 73
errorgroup, 116
Formula object, 38
Event-driven tasks, 137
FPU exception, 97
Example
Free-running tasks, 137
Expression, 249
Function
Using data types of TOs, 74
Communication, 385
WaitForCondition, 249
Error sources during a call, 453, 454
Execution errors, 96
Semaphores (application), 374
Execution level, 235
Semaphores (description);, 326
Interrupts, 236
Standard function, 289
Overview, 133
Function block
Round robin, 236
Efficient parameter access, 461
Tasks, 135
System function block, 401
Time-controlled, 236
Function chart, 19
Execution system, 133
Function parameters
configuring, 176
System functions, 69
Symbol browser, 145
ExecutionFaultTask, 99, 166, 236
TaskStartInfo, 105
G
EXP, 291
EXPD, 291 General interconnection screen form, 35
Expert list General standard functions, 290
Comparing, 47, 50 Global control telegram (GC), 204
Saving as executable script, 46 Global response
User-defined parameter list, 44 Technological alarms, 117
Using, 41
Expert List, 38
Exponentiation, 291 H
EXPRESSION
Hardware platforms, 22
Description (in context), 247
HMI (Human Machine Interface), 397
EXPT, 291
HW Config, 16
External encoder, 37, 73
externalEncoderType, 73
I
I/O processing
Basic functions
Function Manual, 05/2009 561
Index
Isochronous, 203 L
Identifier
Ladder diagram, 19
Reserved for basic system, 473
Level overflow, 190
Implicit interconnection, 34
Monitoring, 192
Infinity, 97
Library
Initialization
Technology package, 94
Data for STOP-RUN transition, 441
LIMIT, 325
Source and TO data separated, 435
LittleByteArray_to_AnyType
Technology objects, 73
Description, 313
InputSynchronousTask_1:, 158, 236
LN, 291
TaskStartInfo, 103
Loading
InputSynchronousTask_2, 158, 236
CPU/drive unit, 433
TaskStartInfo, 103
Data from the hard disk to the card, 449
Instantiation, 27, 29
Project to PG, 450
INT#MAX, 472
To file system, 448
INT#MIN, 472
Local response
INT_TO_BYTE, 305
Technological alarms, 117
INT_TO_DINT, 305
LOG, 291
INT_TO_DWORD, 305
Logarithmic standard functions, 291
INT_TO_LREAL, 305
LREAL_TO_DINT, 305
INT_TO_REAL, 305
LREAL_TO_INT, 305
INT_TO_SINT, 305
LREAL_TO_REAL, 305
INT_TO_TIME, 307
LREAL_TO_SINT, 305
INT_TO_UDINT, 305
LREAL_TO_UDINT, 305
INT_TO_UINT, 305
LREAL_TO_UINT, 305
INT_TO_USINT, 305
LREAL_TO_USINT, 305
INT_TO_WORD, 305
LREAL_VALUE_TO_BOOL, 305
INT_VALUE_TO_BOOL, 305
LREAL_VALUE_TO_BYTE, 305
Interconnection
LREAL_VALUE_TO_DWORD, 305
implicit, 34
LREAL_VALUE_TO_WORD, 305
of technology objects, 51
Via general interconnection screen forms, 35
via technological interconnection screen forms, 35
M
Interconnection overview, 52
Interconnection table, 53 Marshalling, 311
Interface arrangements, 385 Masked error numbers, 373
Interpolator cycle clock, 182 MAX, 323
Interpolator cycle clock 2, 182 Measuring input, 37, 73
Interrupt measuringInputType, 73
Programmable, 247 Mechatronics, 19
IPO cycle clock, 182 Messages
IPO_2 cycle clock, 182 Alarms, 95
IPOsynchronousTask, 160, 236 Programming, 277, 368
TaskStartInfo, 103 MIN, 324
IPOsynchronousTask_2, 160, 236 Monitoring
TaskStartInfo, 103 Cycle time, 193
IPOTask, 161 Timeouts and level overflows, 192
IPOTask_2, 161 Motion
Isochronous data processing, 206 Interface type, 59
Isochronous I/O processing, 203 Motion basis, 59
Motion control, 133
Motion Control, 19, 133
Basic functions
562 Function Manual, 05/2009
Index
Basic functions
Function Manual, 05/2009 563
Index
Basic functions
564 Function Manual, 05/2009
Index
Basic functions
Function Manual, 05/2009 565
Index
Basic functions
566 Function Manual, 05/2009
Index
Variables
Efficient access, 460
Instance declaration of TO, 65
Range violation, 459
Semaphores (application), 374
W
Wait for condition, 141
WAITFORCONDITION, 141
Description (in context), 247
Watchdog, 193
Basic functions
Function Manual, 05/2009 567
Basic functions
Function Manual, 05/2009 568
Basic functions
Function Manual, 05/2009 569