simotion mcc motion control chartftp.ruigongye.com/download/siemens/simotion...simotion mcc motion...

538
Preface Description 1 Software interface 2 MCC Source Files and MCC Charts 3 Programming in MCC 4 MCC commands 5 Commissioning (software) 6 Error Handling and Program Test 7 Appendix A SIMOTION SIMOTION MCC Motion Control Chart Programming and Operating Manual 03/2007

Upload: doandieu

Post on 23-Mar-2018

252 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Preface

Description 1

Software interface 2

MCC Source Files and MCC Charts

3

Programming in MCC 4

MCC commands 5

Commissioning (software) 6

Error Handling and Program Test

7

Appendix A

SIMOTION

SIMOTION MCC Motion Control Chart

Programming and Operating Manual

03/2007

Page 2: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Safety Guidelines 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.

Prescribed Usage Note the following:

Warning

This device may only be used for the applications described in the catalog or the technical description and only in connection with devices or components from other manufacturers which have been approved or recommended by Siemens. Correct, reliable operation of the product requires proper transport, storage, positioning and assembly as well as careful operation and maintenance.

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.

Siemens AG Automation and Drives Postfach 48 48 90437 NÜRNBERG GERMANY

Copyright © Siemens AG 2007. Technical data subject to change

Page 3: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3

Preface

Scope This document is part of the SIMOTION Programming documentation package. The document is valid for SIMOTION SCOUT V4.1: • SIMOTION SCOUT V4.1 (engineering system for the SIMOTION product range),

in combination with • SIMOTION Kernel V4.1, V4.0, V3.2, V3.1, V3.0 or V2.1 • SIMOTION technology packages Cam, Path (as of Kernel V4.1), Cam_ext (as of Kernel

V3.2) and TControl in the version for the respective kernel (including technology packages Gear, Position and Basic MC up to Kernel V3.0).

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 60 SIMOTION documents and documents on other products (e.g. SINAMICS). The following documentation packages are available for SIMOTION V4.1: • SIMOTION Engineering System • SIMOTION System and Function Descriptions • SIMOTION Diagnostics • SIMOTION Programming • SIMOTION Programming - References • SIMOTION C2xx • SIMOTION P350 • SIMOTION D4xx • SIMOTION Supplementary Documentation

Page 4: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Preface

SIMOTION MCC Motion Control Chart 4 Programming and Operating Manual, 03/2007

Hotline and Internet addresses If you have any technical questions, please contact our hotline (worldwide): A&D Technical Support: • Phone: +49 (180) 50 50 222 • Fax: +49 (180) 50 50 223 • E–mail: [email protected] • Internet: http://www.siemens.de/automation/support-request If you have any questions, suggestions, or corrections regarding the documentation, please fax or e-mail them to: • Fax: +49 (9131) 98 63315 • E–mail: [email protected]

Siemens Internet address The latest information about SIMOTION products, product support, and FAQs can be found on the Internet at: • General information:

– http://www.siemens.de/simotion (German) – http://www.siemens.com/simotion (international)

• Product support: – http://support.automation.siemens.com/WW/view/en/10805436

Additional support We also offer introductory courses to help you familiarize yourself with SIMOTION. Please contact your regional training center or our main training center at D-90027 Nuremberg, phone +49 (911) 895 3202.

Page 5: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 5

Contents Preface ...................................................................................................................................................... 3 1 Description............................................................................................................................................... 29

1.1 Overview ......................................................................................................................................29 1.2 Introduction to MCC (Motion Control Chart) ................................................................................29 1.3 Principles of programming ...........................................................................................................31 1.4 Procedure for programming .........................................................................................................32

2 Software interface.................................................................................................................................... 33 2.1 User interface in MCC editor........................................................................................................33 2.2 Representation of MCC chart and MCC source file in Workbench .............................................33 2.3 Operator input options .................................................................................................................35 2.4 Settings for the MCC editor..........................................................................................................38 2.5 Calling up the online help.............................................................................................................38

3 MCC Source Files and MCC Charts ........................................................................................................ 39 3.1 General ........................................................................................................................................39 3.2 Inserting and managing MCC source files...................................................................................39 3.2.1 Inserting a new MCC source file ..................................................................................................39 3.2.2 Opening existing MCC source files..............................................................................................42 3.2.3 Transferring and compiling an MCC source file...........................................................................42 3.2.4 Closing an open MCC source file ................................................................................................43 3.2.5 Cutting, copying, and deleting an MCC source file......................................................................44 3.2.6 Pasting a cut or copied MCC source file......................................................................................44 3.2.7 Know-how protection for MCC source files..................................................................................44 3.2.8 Exporting and importing an MCC source file ...............................................................................45 3.2.8.1 Exporting an MCC source file as an ST source file .....................................................................45 3.2.8.2 Exporting an MCC source file in XML format...............................................................................45 3.2.8.3 Importing an MCC source file from XML data..............................................................................46 3.2.9 Properties of an MCC source file .................................................................................................47 3.2.9.1 Renaming MCC source files ........................................................................................................47 3.2.9.2 Using test functions......................................................................................................................48 3.2.10 Viewing the current compiler options...........................................................................................48 3.2.11 Selecting compiler options ...........................................................................................................48 3.3 Inserting and managing MCC charts ...........................................................................................51 3.3.1 Inserting a new MCC chart ..........................................................................................................51 3.3.2 Opening an existing MCC chart ...................................................................................................52 3.3.3 Transferring and compiling an MCC chart ...................................................................................53 3.3.4 Closing an open MCC chart.........................................................................................................53 3.3.5 Cutting, copying, and deleting an MCC chart ..............................................................................53 3.3.6 Pasting a cut or copied MCC chart ..............................................................................................53 3.3.7 Specifying the order of MCC charts in the MCC source file ........................................................54

Page 6: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 6 Programming and Operating Manual, 03/2007

3.3.8 Exporting and importing an MCC chart....................................................................................... 54 3.3.8.1 Exporting an MCC chart in XML format ...................................................................................... 54 3.3.8.2 Importing an MCC chart from XML data ..................................................................................... 55 3.3.8.3 Importing an MCC chart .............................................................................................................. 55 3.3.9 Properties of an MCC chart......................................................................................................... 56 3.3.9.1 Renaming MCC charts................................................................................................................ 56 3.3.9.2 Changing the creation type of the MCC chart............................................................................. 56 3.3.9.3 Changing usability in other charts (export capability) ................................................................. 57

4 Programming in MCC .............................................................................................................................. 59 4.1 Programming an MCC chart ....................................................................................................... 59 4.2 Principles of programming .......................................................................................................... 59 4.2.1 General principles of programming............................................................................................. 59 4.2.2 Simplified example of programming principles ........................................................................... 60 4.3 Managing MCC commands......................................................................................................... 61 4.3.1 inserting commands .................................................................................................................... 61 4.3.2 Representation of commands in the MCC chart ......................................................................... 63 4.3.3 Translating comments................................................................................................................. 64 4.3.4 Numbering of commands ............................................................................................................ 64 4.3.5 Selecting commands................................................................................................................... 64 4.3.6 Hiding and displaying commands ............................................................................................... 65 4.3.7 Copying, deleting, cutting, or pasting commands ....................................................................... 65 4.3.8 Undo/redo.................................................................................................................................... 66 4.3.9 Module creation........................................................................................................................... 66 4.3.9.1 Procedure for creating a module................................................................................................. 67 4.3.9.2 Opening and closing a module ................................................................................................... 68 4.3.9.3 Canceling a module .................................................................................................................... 68 4.3.9.4 Changing the module structure................................................................................................... 68 4.4 Processing MCC commands....................................................................................................... 69 4.4.1 Assigning command parameters ................................................................................................ 69 4.4.2 Input fields and selection lists ..................................................................................................... 71 4.4.2.1 Input field..................................................................................................................................... 71 4.4.2.2 Selection list (combo box) ........................................................................................................... 71 4.4.2.3 Editable selection list (editable combo box)................................................................................ 72 4.4.2.4 Unit .............................................................................................................................................. 72 4.4.3 Dynamics tab .............................................................................................................................. 73 4.4.4 Expert tab.................................................................................................................................... 75 4.4.5 Transition behavior and step enabling condition......................................................................... 78 4.4.5.1 Transition behavior from the currently active motion command ................................................. 78 4.4.5.2 Delay program execution (step enabling condition).................................................................... 79 4.4.5.3 Example of transition behavior and step enabling condition....................................................... 80 4.4.6 Closing the parameter screen form............................................................................................. 81 4.4.7 Relevant system function, system variable, or command in the ST programming language..... 81 4.4.8 Return values .............................................................................................................................. 82 4.4.8.1 Return value for the system functions of the technology packages ........................................... 82 4.5 General information about variables and data types .................................................................. 84 4.5.1 Overview of variable types.......................................................................................................... 84 4.5.2 Scope of the declarations............................................................................................................ 86 4.5.3 Rules for identifiers ..................................................................................................................... 86 4.5.4 Frequently used arrays in declarations ....................................................................................... 87 4.5.4.1 Array length and array element................................................................................................... 87 4.5.4.2 Initial value .................................................................................................................................. 87 4.5.4.3 Comments................................................................................................................................... 88

Page 7: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 7

4.6 Data types....................................................................................................................................88 4.6.1 General ........................................................................................................................................88 4.6.2 Elementary data types .................................................................................................................89 4.6.2.1 Elementary data types .................................................................................................................89 4.6.2.2 Value range limits of elementary data types................................................................................91 4.6.2.3 General data types.......................................................................................................................92 4.6.2.4 Elementary system data types.....................................................................................................93 4.6.3 Declaring derived data types (UDT) ............................................................................................93 4.6.3.1 Defining user-defined data types (UDT) ......................................................................................93 4.6.3.2 Scope of the data type declaration ..............................................................................................93 4.6.3.3 Defining structures .......................................................................................................................94 4.6.3.4 Defining enumerations .................................................................................................................94 4.6.4 Technology object data types ......................................................................................................95 4.6.4.1 Description of the technology object data types ..........................................................................95 4.6.4.2 Inheritance of the properties for axes ..........................................................................................96 4.6.5 System data types .......................................................................................................................96 4.7 Variables ......................................................................................................................................97 4.7.1 Keywords for variable types.........................................................................................................97 4.7.2 Defining variables ........................................................................................................................98 4.7.2.1 Defining global device variables in the symbol browser ..............................................................98 4.7.2.2 Declaring a unit variable in the source file ...................................................................................99 4.7.2.3 Declaring local variables ............................................................................................................100 4.7.3 Time of the variable initialization................................................................................................101 4.7.3.1 Initialization of retentive global variables ...................................................................................102 4.7.3.2 Initialization of non-retentive global variables ............................................................................103 4.7.3.3 Initialization of local variables ....................................................................................................104 4.7.3.4 Initialization of instances of function blocks (FBs) .....................................................................104 4.7.3.5 Initialization of system variables of technology objects .............................................................105 4.7.3.6 Version ID of global variables and their initialization during download......................................106 4.7.3.7 Initialization of static program variables.....................................................................................107 4.8 Access to inputs and outputs (process image, I/O variables)....................................................108 4.8.1 Overview of access to inputs and outputs .................................................................................108 4.8.2 Important features of direct access and process image access................................................109 4.8.3 Direct access and process image of cyclic tasks.......................................................................111 4.8.3.1 Rules for I/O addresses for direct access and the process image of the cyclical tasks ............112 4.8.3.2 Creating I/O variables for direct access or process image of cyclic tasks.................................112 4.8.3.3 Syntax for entering I/O addresses .............................................................................................114 4.8.3.4 Possible data types of I/O variables ..........................................................................................115 4.8.4 Access to fixed process image of the BackgroundTask ............................................................115 4.8.4.1 Absolute access to the fixed process image of the BackgroundTask (absolute PI access)......116 4.8.4.2 Syntax for the identifier for an absolute process image access ................................................117 4.8.4.3 Defining symbolic access to the fixed process image of the BackgroundTask .........................117 4.8.4.4 Possible data types for symbolic PI access...............................................................................118 4.8.4.5 Example: Defining symbolic access to the fixed process image of the BackgroundTask.........118 4.8.4.6 Creating an I/O variable for access to the fixed process image of the BackgroundTask..........118 4.8.5 Accessing I/O variables .............................................................................................................120 4.9 Connections to other program source files or libraries ..............................................................121 4.9.1 Defining connections..................................................................................................................122 4.9.1.1 Procedure for defining connections to other units (program source files) .................................122 4.9.1.2 Procedure for defining connections to libraries..........................................................................122 4.9.2 Using the name space ...............................................................................................................123 4.10 Subroutine..................................................................................................................................124 4.10.1 Inserting a function (FC) or function block (FB) .........................................................................126

Page 8: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 8 Programming and Operating Manual, 03/2007

4.10.2 Inserting a subroutine call into the MCC chart and assigning parameters ............................... 126 4.10.2.1 Overview of parameters for....................................................................................................... 128 4.10.3 Example: Function (FC) ............................................................................................................ 129 4.10.3.1 Creating and programming the function (FC) ........................................................................... 130 4.10.3.2 Subroutine call of function (FC) ................................................................................................ 130 4.10.4 Example: Function block (FB)................................................................................................... 132 4.10.4.1 Creating and programming the function block (FB) .................................................................. 132 4.10.4.2 Subroutine call of function block (FB) ....................................................................................... 133 4.10.4.3 Creating a function block instance ............................................................................................ 133 4.10.4.4 Programming the subroutine call of the function block ............................................................. 135 4.10.4.5 Accessing the output parameters of the function block retrospectively.................................... 137 4.11 Reference data.......................................................................................................................... 138 4.11.1 Cross reference list ................................................................................................................... 138 4.11.1.1 Creating a cross-reference list .................................................................................................. 138 4.11.1.2 Example: Cross-reference tab in detail view............................................................................. 139 4.11.1.3 Content of the cross-reference list ............................................................................................ 139 4.11.1.4 Working with a cross-reference list ........................................................................................... 140 4.11.2 Program structure ..................................................................................................................... 140 4.11.2.1 Example: Program Structure tab in the detail view................................................................... 141 4.11.2.2 Content of the program structure .............................................................................................. 141 4.11.3 Code attributes.......................................................................................................................... 142 4.11.3.1 Code attribute contents ............................................................................................................. 143 4.12 LAD/FBD/formula ...................................................................................................................... 144 4.12.1 Ladder diagram (LAD)............................................................................................................... 145 4.12.1.1 Description of LAD elements..................................................................................................... 146 4.12.1.2 Opens a branch......................................................................................................................... 147 4.12.1.3 Closing a branch ....................................................................................................................... 147 4.12.2 Function block diagram (FBD) .................................................................................................. 147 4.12.2.1 Description of FBD elements .................................................................................................... 149 4.12.3 Formula ..................................................................................................................................... 150 4.13 Command library and system function...................................................................................... 151 4.13.1 Command library....................................................................................................................... 151 4.13.1.1 Using the command library ....................................................................................................... 152 4.13.1.2 User functions and function blocks ........................................................................................... 153 4.13.2 Using the System function call command................................................................................. 153 4.13.2.1 Overview of parameters for....................................................................................................... 155 4.14 MCC charts in libraries.............................................................................................................. 157 4.14.1 Using technology packages in libraries..................................................................................... 157 4.14.2 Compiling a library .................................................................................................................... 159 4.15 Print ........................................................................................................................................... 161

5 MCC commands .................................................................................................................................... 163 5.1 Basic commands....................................................................................................................... 163 5.1.1 Wait time ................................................................................................................................... 163 5.1.1.1 Wait time ................................................................................................................................... 163 5.1.1.2 Overview of parameters for Wait time....................................................................................... 164 5.1.1.3 Overview of parameters for Wait time - Parameters tab........................................................... 164 5.1.1.4 Overview of parameters for Wait time - Expert tab................................................................... 164 5.1.1.5 Relevant system functions for Wait time................................................................................... 164 5.1.2 Wait for axis .............................................................................................................................. 165 5.1.2.1 Wait for axis .............................................................................................................................. 165 5.1.2.2 Overview of parameters for Wait for axis.................................................................................. 166 5.1.2.3 Axis status................................................................................................................................. 167

Page 9: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 9

5.1.2.4 Comparison operators for axis values .......................................................................................168 5.1.2.5 Relevant commands of the ST (Structured Text) programming language for Wait for axis ......168 5.1.3 Wait for signal ............................................................................................................................168 5.1.3.1 Wait for signal ............................................................................................................................168 5.1.3.2 Overview of parameters for Wait for signal................................................................................169 5.1.3.3 Relevant commands of the ST (Structured Text) programming language for Wait for

signal..........................................................................................................................................170 5.1.4 Wait for condition .......................................................................................................................170 5.1.4.1 Wait for condition .......................................................................................................................170 5.1.4.2 Relevant commands of the ST (Structured Text) programming language for Wait for

condition.....................................................................................................................................173 5.1.5 Module .......................................................................................................................................174 5.1.6 Subroutine call ...........................................................................................................................174 5.1.7 System function call ...................................................................................................................174 5.1.8 Set output...................................................................................................................................175 5.1.8.1 Set output...................................................................................................................................175 5.1.8.2 Overview of parameters for Set output ......................................................................................175 5.1.8.3 Relevant commands of the ST (Structured Text) programming language for Set output .........176 5.1.9 Reset output...............................................................................................................................176 5.1.9.1 Reset output...............................................................................................................................176 5.1.9.2 Overview of parameters for Reset output ..................................................................................177 5.1.9.3 Relevant commands of the ST (Structured Text) programming language for Reset output .....177 5.1.10 Variable assignment ..................................................................................................................177 5.1.11 ST zoom.....................................................................................................................................177 5.1.12 Activate simulation for object .....................................................................................................179 5.1.12.1 Activate simulation for object .....................................................................................................179 5.1.12.2 Overview of parameters for Activate simulation for object ........................................................179 5.1.12.3 Overview of parameters for Activate simulation for object - Parameters tab ............................180 5.1.12.4 Overview of parameters for Activate simulation for object - Expert tab.....................................180 5.1.12.5 Relevant system functions for Activate simulation for object.....................................................180 5.1.13 Deactivate simulation for object .................................................................................................181 5.1.13.1 Deactivate simulation for object .................................................................................................181 5.1.13.2 Overview of parameters for Deactivate simulation for object ....................................................182 5.1.13.3 Overview of parameters for Deactivate simulation for object - Parameters tab ........................182 5.1.13.4 Overview of parameters for Deactivate simulation for object - Expert tab ................................182 5.1.13.5 Relevant system function for Deactivate simulation for object ..................................................183 5.1.14 Reset object ...............................................................................................................................183 5.1.14.1 Reset object ...............................................................................................................................183 5.1.14.2 Overview of parameters for Reset object ..................................................................................184 5.1.14.3 Overview of parameters for Reset object - Parameters tab ......................................................184 5.1.14.4 Overview of parameters for Reset object - Expert tab...............................................................184 5.1.14.5 Relevant system functions for Reset object...............................................................................185 5.1.15 Change operating mode ............................................................................................................186 5.1.15.1 Change operating mode ............................................................................................................186 5.1.15.2 Overview of parameters for Change operating mode................................................................186 5.1.15.3 Relevant system functions for Change operating mode............................................................187 5.1.15.4 Return value for Change operating mode..................................................................................187 5.1.16 Activate trace .............................................................................................................................187 5.1.17 Comment block ..........................................................................................................................187 5.2 Task commands.........................................................................................................................189 5.2.1 Start task ....................................................................................................................................189 5.2.1.1 Start task ....................................................................................................................................189 5.2.1.2 Call from the BackgroundTask...................................................................................................190 5.2.1.3 Overview of parameters for Start task .......................................................................................190 5.2.1.4 Relevant system functions for Start task ...................................................................................190

Page 10: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 10 Programming and Operating Manual, 03/2007

5.2.1.5 Return value for Start task ........................................................................................................ 190 5.2.2 Interrupt task ............................................................................................................................. 191 5.2.2.1 Interrupt task ............................................................................................................................. 191 5.2.2.2 Overview of parameters for Interrupt task................................................................................. 192 5.2.2.3 Relevant system functions for Interrupt task............................................................................. 192 5.2.2.4 Return value for Interrupt task................................................................................................... 192 5.2.3 Continue task ............................................................................................................................ 193 5.2.3.1 Continue task ............................................................................................................................ 193 5.2.3.2 Overview of parameters for Continue task................................................................................ 194 5.2.3.3 Relevant system functions for Continue task............................................................................ 194 5.2.3.4 Return value for Continue task ................................................................................................. 194 5.2.4 Reset task ................................................................................................................................. 195 5.2.4.1 Reset task ................................................................................................................................. 195 5.2.4.2 Overview of parameters for Reset task..................................................................................... 196 5.2.4.3 Relevant system functions for Reset task................................................................................. 196 5.2.4.4 Return value for Reset task....................................................................................................... 196 5.2.5 Task status................................................................................................................................ 197 5.2.5.1 Task status................................................................................................................................ 197 5.2.5.2 Overview of parameters for Task status ................................................................................... 198 5.2.5.3 Relevant system functions for Task status ............................................................................... 198 5.2.6 Determine TaskId...................................................................................................................... 199 5.2.6.1 Determine TaskId...................................................................................................................... 199 5.2.6.2 Overview of parameters for Determine TaskId ......................................................................... 199 5.2.6.3 Relevant system functions for Determine TaskId ..................................................................... 200 5.3 Program structures.................................................................................................................... 200 5.3.1 IF: Program branching .............................................................................................................. 200 5.3.1.1 IF: Program branching .............................................................................................................. 200 5.3.1.2 Note on inserting the IF statement............................................................................................ 201 5.3.1.3 Note on deleting/cutting or copying an IF statement ................................................................ 201 5.3.1.4 Relevant commands of the ST (Structured Text) programming language for IF: Program

branching................................................................................................................................... 201 5.3.2 WHILE: Loop with condition at the start.................................................................................... 202 5.3.2.1 WHILE: Loop with condition at the start.................................................................................... 202 5.3.2.2 Relevant commands of the ST (Structured Text) programming language for WHILE: Loop

with condition at the start .......................................................................................................... 203 5.3.3 FOR: Loop with fixed number of runs ....................................................................................... 203 5.3.3.1 FOR: Loop with fixed number of runs ....................................................................................... 203 5.3.3.2 Overview of parameters for FOR: Loop with fixed number of runs........................................... 203 5.3.3.3 Relevant commands of the ST (Structured Text) programming language for FOR: Loop

with fixed number of runs .......................................................................................................... 205 5.3.4 UNTIL: Loop with condition at the end...................................................................................... 205 5.3.4.1 UNTIL: Loop with condition at the end...................................................................................... 205 5.3.4.2 Relevant commands of the ST (Structured Text) programming language for UNTIL: Loop

with condition at the end ........................................................................................................... 206 5.3.5 CASE: Multiple branching ......................................................................................................... 206 5.3.5.1 CASE: Multiple branching ......................................................................................................... 206 5.3.5.2 Inserting a branch in the CASE statement................................................................................ 207 5.3.5.3 Deleting a branch from the CASE statement ............................................................................ 207 5.3.5.4 Comparison constant in the CASE statement........................................................................... 207 5.3.5.5 Overview of parameters for CASE: Multiple branching ............................................................ 208 5.3.5.6 Relevant commands of the ST (Structured Text) programming language for CASE:

Multiple branching ..................................................................................................................... 208 5.3.6 Go to.......................................................................................................................................... 208 5.3.6.1 Go to.......................................................................................................................................... 208 5.3.6.2 Overview of parameters for Go to............................................................................................. 209

Page 11: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 11

5.3.6.3 Relevant commands of the ST (Structured Text) programming language for Go to: ................209 5.3.7 Selection ....................................................................................................................................210 5.3.7.1 Selection ....................................................................................................................................210 5.3.7.2 Overview of parameters for Selection........................................................................................210 5.3.7.3 Relevant commands of the ST (Structured Text) programming language for Selection: ..........210 5.3.8 Return ........................................................................................................................................211 5.3.8.1 Return ........................................................................................................................................211 5.3.8.2 Relevant commands of the ST (Structured Text) programming language for Return: ..............211 5.3.9 Exit .............................................................................................................................................212 5.3.9.1 Exit .............................................................................................................................................212 5.3.9.2 Relevant commands of the ST (Structured Text) programming language for Exit:...................212 5.3.10 Synchronous start ......................................................................................................................213 5.3.10.1 Synchronous start ......................................................................................................................213 5.3.10.2 Programming a condition ...........................................................................................................214 5.3.10.3 Checkbox ...................................................................................................................................214 5.3.10.4 Insert branch ..............................................................................................................................215 5.3.10.5 Deleting a branch.......................................................................................................................215 5.3.10.6 Permissible commands..............................................................................................................215 5.3.10.7 Transition behavior ....................................................................................................................217 5.3.10.8 Step enabling condition..............................................................................................................217 5.3.10.9 Deleting/cutting or copying.........................................................................................................217 5.3.10.10 Relevant system functions and commands of the ST (Structured Text) programming

language for synchronous start..................................................................................................217 5.4 Communication ..........................................................................................................................218 5.4.1 Acknowledge technology object alarms.....................................................................................218 5.4.1.1 Acknowledge technology object alarms.....................................................................................218 5.4.1.2 Overview of parameters for Acknowledge technology object alarms ........................................218 5.4.1.3 Overview of parameters for Acknowledge technology object alarms - Parameters tab ............219 5.4.1.4 Overview of parameters for Acknowledge technology object alarms - Expert tab ....................219 5.4.1.5 Relevant system functions for Acknowledge technology object alarms ....................................219 5.4.2 Acknowledge specific technology object alarm .........................................................................220 5.4.2.1 Acknowledge specific technology object alarm .........................................................................220 5.4.2.2 Overview of parameters for Acknowledge specific technology object alarm.............................221 5.4.2.3 Overview of parameters for Acknowledge specific technology object alarm - Parameters

tab ..............................................................................................................................................221 5.4.2.4 Overview of parameters for Acknowledge specific technology object alarm - Expert tab.........221 5.4.2.5 Relevant system functions for Acknowledge specific technology object alarm.........................222 5.4.3 Incoming message.....................................................................................................................222 5.4.3.1 Incoming message.....................................................................................................................222 5.4.3.2 Overview of parameters for Incoming message ........................................................................223 5.4.3.3 Overview of parameters for Incoming message - Parameters tab ............................................224 5.4.3.4 Overview of parameters for Incoming message - Expert tab ....................................................224 5.4.3.5 Relevant system functions for Incoming message ....................................................................224 5.4.4 Outgoing message.....................................................................................................................225 5.4.4.1 Outgoing message.....................................................................................................................225 5.4.4.2 Overview of parameters for Outgoing message ........................................................................225 5.4.4.3 Overview of parameters for Outgoing message - Parameters tab ............................................226 5.4.4.4 Overview of parameters for Outgoing message - Expert tab ....................................................226 5.4.4.5 Relevant system functions for Outgoing message ....................................................................226 5.4.5 Establish connection using TCP/IP............................................................................................227 5.4.5.1 Establish connection using TCP/IP............................................................................................227 5.4.5.2 Overview of parameters for Establish connection using TCP/IP ...............................................228 5.4.5.3 Relevant system functions for Establish connection using TCP/IP ...........................................229 5.4.5.4 Return value for Establish connection using TCP/IP.................................................................229 5.4.6 Remove connection using TCP/IP.............................................................................................230

Page 12: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 12 Programming and Operating Manual, 03/2007

5.4.6.1 Remove connection using TCP/IP ............................................................................................ 230 5.4.6.2 Overview of parameters for Remove connection using TCP/IP ............................................... 231 5.4.6.3 Relevant system functions for Remove connection using TCP/IP............................................ 231 5.4.7 Send data.................................................................................................................................. 232 5.4.7.1 Send data.................................................................................................................................. 232 5.4.7.2 Overview of parameters for Send data ..................................................................................... 234 5.4.7.3 Overview of parameters for Send data - Parameters tab ......................................................... 235 5.4.7.4 Overview of parameters for Send data - Expert tab ................................................................. 236 5.4.7.5 Querying the command status for Send data with XSend/XReceive protocol.......................... 237 5.4.7.6 Structure of destination address of the communications partner, when address is entered

directly (XSend/XReceive protocol) .......................................................................................... 237 5.4.7.7 Relevant system functions for Send data ................................................................................. 238 5.4.8 Receive data ............................................................................................................................. 239 5.4.8.1 Receive data ............................................................................................................................. 239 5.4.8.2 Overview of parameters for Receive data................................................................................. 240 5.4.8.3 Overview of parameters for Receive data - Parameters tab..................................................... 241 5.4.8.4 Overview of parameters for Receive data - Expert tab............................................................. 242 5.4.8.5 Querying the command status for Receive data with XSend/XReceive protocol ..................... 242 5.4.8.6 Relevant system functions for Receive data............................................................................. 242 5.4.8.7 Return value for Receive data .................................................................................................. 244 5.5 Single axis commands .............................................................................................................. 245 5.5.1 Home axis ................................................................................................................................. 245 5.5.1.1 Overview of parameters for Home axis..................................................................................... 246 5.5.1.2 Overview of parameters for Home axis – Parameters tab ........................................................ 247 5.5.1.3 Overview of parameters for Home axis – Dynamic response tab............................................. 248 5.5.1.4 Overview of parameters for Home axis – Expert tab ................................................................ 249 5.5.1.5 Relevant system functions for Home axis................................................................................. 249 5.5.1.6 Referencing mode..................................................................................................................... 250 5.5.1.7 Home position offset ................................................................................................................. 251 5.5.2 Switch axis enable .................................................................................................................... 252 5.5.2.1 Overview of parameters for Switch axis enable........................................................................ 253 5.5.2.2 Overview of parameters for Switch axis enable – Parameters tab ........................................... 254 5.5.2.3 Overview of parameters for Switch axis enable – Expert tab ................................................... 255 5.5.2.4 Meaning of bits of control word 1 (STW1) in accordance with PROFIdrive.............................. 255 5.5.2.5 Relevant system function for Switch axis enable...................................................................... 256 5.5.3 Switch QF axis enable .............................................................................................................. 257 5.5.3.1 Overview of parameters for Switch QF axis enable.................................................................. 258 5.5.3.2 Overview of parameters for Switch QF axis enable – Parameters tab ..................................... 258 5.5.3.3 Overview of parameters for Switch QF axis enable – QF_Parameters tab .............................. 259 5.5.3.4 Overview of parameters for Switch QF axis enable – Expert tab ............................................. 260 5.5.3.5 Relevant system function for Switch QF axis enable................................................................ 261 5.5.4 Remove axis enable.................................................................................................................. 262 5.5.4.1 Overview of parameters for Remove axis enable..................................................................... 263 5.5.4.2 Overview of parameters for Remove axis enable – Parameters tab ........................................ 263 5.5.4.3 Overview of parameters for Remove axis enable – Expert tab................................................. 264 5.5.4.4 Relevant system function for Remove axis enable................................................................... 265 5.5.5 Remove QF axis enable............................................................................................................ 266 5.5.5.1 Overview of parameters for Remove QF axis enable............................................................... 267 5.5.5.2 Overview of parameters for Remove QF axis enable – Parameters tab .................................. 268 5.5.5.3 Overview of parameters for Remove QF axis enable – QF_Parameters tab ........................... 268 5.5.5.4 Overview of parameters for Remove QF axis enable – Expert tab........................................... 270 5.5.5.5 Relevant system function for Remove QF axis enable............................................................. 270 5.5.6 Start axis position-controlled..................................................................................................... 271 5.5.6.1 Overview of parameters for Start axis position-controlled ........................................................ 272 5.5.6.2 Overview of parameters for Start axis position-controlled – Parameters tab............................ 272

Page 13: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 13

5.5.6.3 Overview of parameters for Start axis position-controlled – Dynamic response tab .................273 5.5.6.4 Overview of parameters for Start axis position-controlled – Expert tab.....................................273 5.5.6.5 Relevant system function for Start axis position-controlled .......................................................274 5.5.7 Speed preset..............................................................................................................................275 5.5.7.1 Overview of parameters for speed specification........................................................................276 5.5.7.2 Overview of parameters for Speed specification – Parameters tab...........................................277 5.5.7.3 Overview of parameters for Speed specification – Dynamic response tab ...............................278 5.5.7.4 Overview of parameters for Speed specification – Expert tab...................................................278 5.5.7.5 Relevant system function for speed specification......................................................................279 5.5.8 Switch on torque limitation .........................................................................................................280 5.5.8.1 Overview of parameters for Switch on torque limitation ............................................................281 5.5.8.2 Overview of parameters for Switch on torque limitation – Parameters tab................................281 5.5.8.3 Overview of parameters for Switch on torque limitation – Expert tab........................................282 5.5.8.4 Relevant system function for Switch on torque limitation ..........................................................282 5.5.9 Deactivate torque limitation........................................................................................................283 5.5.9.1 Overview of parameters for Switch off torque limitation ............................................................283 5.5.9.2 Relevant system function for Switch off torque limitation ..........................................................284 5.5.10 Position axis ...............................................................................................................................285 5.5.10.1 Parameter screen form: Position axis........................................................................................286 5.5.10.2 Overview of parameters for Position axis – Parameters tab......................................................286 5.5.10.3 Overview of parameters for Position axis – Dynamic response tab ..........................................288 5.5.10.4 Overview of parameters for Position axis – Expert tab..............................................................288 5.5.10.5 Example of positioning...............................................................................................................289 5.5.10.6 Relevant system functions for Position axis ..............................................................................289 5.5.11 Travel to fixed endstop...............................................................................................................290 5.5.11.1 Overview of parameters for Travel to fixed endstop..................................................................291 5.5.11.2 Overview of parameters for Travel to fixed endstop – Parameters tab .....................................291 5.5.11.3 Overview of parameters for Travel to fixed endstop – Expert tab..............................................292 5.5.11.4 Relevant system function for Travel to fixed endstop................................................................292 5.5.12 Remove fixed endstop ...............................................................................................................293 5.5.12.1 Overview of parameters for Remove fixed endstop...................................................................294 5.5.12.2 Relevant system function for Remove fixed endstop.................................................................294 5.5.13 Time-dependent position profile.................................................................................................295 5.5.13.1 Overview of parameters for Time-dependent position profile....................................................295 5.5.13.2 Overview of parameters for Time-dependent position profile – Profile tab................................296 5.5.13.3 Overview of parameters for Time-dependent position profile – Dynamic response tab ............297 5.5.13.4 Overview of parameters for Time-dependent position profile – Expert tab ...............................297 5.5.13.5 Relevant system function for Time-dependent position profile..................................................298 5.5.14 Time-dependent velocity profile .................................................................................................299 5.5.14.1 Overview of parameters for Time-dependent velocity profile ....................................................300 5.5.14.2 Overview of parameters for Time-dependent velocity profile – Profile tab ................................300 5.5.14.3 Overview of parameters for Time-dependent velocity profile – Dynamic response tab ............301 5.5.14.4 Overview of parameters for Time-dependent velocity profile – Expert tab................................301 5.5.14.5 Relevant system function for Time-dependent velocity profile ..................................................302 5.5.15 Stop axis ....................................................................................................................................302 5.5.15.1 Overview of parameters for Stop axis........................................................................................303 5.5.15.2 Overview of parameters for Stop axis – Parameters tab ...........................................................304 5.5.15.3 Overview of parameters for Stop axis – Dynamic response tab................................................305 5.5.15.4 Overview of parameters for Stop axis – Expert tab ...................................................................306 5.5.15.5 Relevant system functions for Stop axis....................................................................................306 5.5.16 Continue motion.........................................................................................................................307 5.5.16.1 Overview of parameters for Continue motion ............................................................................307 5.5.16.2 Overview of parameters for Continue motion - Parameters tab ................................................308 5.5.16.3 Overview of parameters for Continue motion - Expert tab ........................................................308 5.5.16.4 Relevant system function for Continue motion ..........................................................................308

Page 14: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 14 Programming and Operating Manual, 03/2007

5.5.17 Online correction ....................................................................................................................... 309 5.5.17.1 Overview of parameters for Online correction .......................................................................... 309 5.5.17.2 Relevant system function for Online correction ........................................................................ 310 5.5.18 Set axis parameter .................................................................................................................... 310 5.5.18.1 Overview of parameters for Set axis parameter ....................................................................... 311 5.5.18.2 Example of Set axis parameter................................................................................................. 313 5.5.18.3 Relevant system function for Set axis parameter ..................................................................... 314 5.5.19 Set virtual axis values ............................................................................................................... 315 5.5.19.1 Overview of parameters for Set virtual axis values................................................................... 315 5.5.19.2 Overview of parameters for Set virtual axis values – Parameters tab ...................................... 316 5.5.19.3 Overview of parameters for Set virtual axis values – Expert tab .............................................. 316 5.5.19.4 Relevant system function for Set virtual axis values................................................................. 317 5.5.20 Delete command queue............................................................................................................ 318 5.5.20.1 Overview of parameters for Delete command queue ............................................................... 318 5.5.20.2 Example of Delete command queue......................................................................................... 319 5.5.20.3 Relevant system function for Delete command queue ............................................................. 319 5.5.21 Switch parameter set ................................................................................................................ 320 5.5.21.1 Overview of parameters for Switch parameter set.................................................................... 321 5.5.21.2 Overview of parameters for Switch parameter set – Parameters tab ....................................... 321 5.5.21.3 Overview of parameters for Switch parameter set – Expert tab ............................................... 321 5.5.21.4 Relevant system function for Switch parameter set.................................................................. 322 5.6 Commands for external encoders, measuring inputs and output cams ................................... 323 5.6.1 External encoder on .................................................................................................................. 323 5.6.1.1 Overview of parameters for External encoder on ..................................................................... 324 5.6.1.2 Relevant system function for External encoder on ................................................................... 324 5.6.2 External encoder off .................................................................................................................. 325 5.6.2.1 Overview of parameters for External encoder off ..................................................................... 325 5.6.2.2 Relevant system function for External encoder off ................................................................... 326 5.6.3 Synchronize external encoder .................................................................................................. 327 5.6.3.1 Overview of parameters for Synchronize external encoder...................................................... 327 5.6.3.2 Overview of parameters for Synchronize external encoder – Parameters tab ......................... 328 5.6.3.3 Overview of parameters for Synchronize external encoder – Expert tab ................................. 328 5.6.3.4 Relevant system function for Synchronize external encoder.................................................... 329 5.6.4 Encoder monitoring on .............................................................................................................. 330 5.6.4.1 Overview of parameters for Encoder monitoring on ................................................................. 330 5.6.4.2 Overview of parameters for Encoder monitoring on – Parameters tab..................................... 331 5.6.4.3 Overview of parameters for Encoder monitoring on – Expert tab............................................. 331 5.6.4.4 Relevant system function for Encoder monitoring on ............................................................... 332 5.6.5 Encoder monitoring off .............................................................................................................. 333 5.6.5.1 Overview of parameters for Encoder monitoring off ................................................................. 333 5.6.5.2 Relevant system function for Encoder monitoring off ............................................................... 334 5.6.6 Activate measuring input........................................................................................................... 334 5.6.6.1 Overview of parameters for Activate measuring input .............................................................. 336 5.6.6.2 Overview of parameters for Activate measuring input – Parameters tab ................................. 337 5.6.6.3 Overview of parameters for Activate measuring input – Expert tab.......................................... 339 5.6.6.4 Relevant system functions for Activate measuring input .......................................................... 339 5.6.7 Deactivate measuring input....................................................................................................... 340 5.6.7.1 Overview of parameters for Deactivate measuring input.......................................................... 341 5.6.7.2 Overview of parameters for Deactivate measuring input – Parameters tab ............................. 341 5.6.7.3 Overview of parameters for Deactivate measuring input – Expert tab ..................................... 342 5.6.7.4 Relevant system functions for Deactivate measuring input ...................................................... 342 5.6.8 Shift measuring system............................................................................................................. 343 5.6.8.1 Overview of parameters for Shift measuring system ................................................................ 344 5.6.8.2 Overview of parameters for Shift measuring system – Set actual value tab ............................ 344 5.6.8.3 Overview of parameters for Shift measuring system – Expert tab............................................ 345

Page 15: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 15

5.6.8.4 Relevant system function for Shift measuring system...............................................................345 5.6.9 Synchronize measuring system.................................................................................................346 5.6.9.1 Overview of parameters for Synchronize measuring system ....................................................346 5.6.9.2 Overview of parameters for Synchronize measuring system – Parameters tab........................347 5.6.9.3 Overview of parameters for Synchronize measuring system – Expert tab................................347 5.6.9.4 Relevant system function for Synchronize measuring system ..................................................348 5.6.10 Switch output cam on.................................................................................................................349 5.6.10.1 Overview of parameters for Switch output cam on....................................................................353 5.6.10.2 Overview of parameters for Switch output cam on – Parameters tab .......................................354 5.6.10.3 Overview of parameters for Switch output cam on – Expert tab................................................356 5.6.10.4 Relevant system functions for Switch output cam on ................................................................357 5.6.11 Switch output cam off.................................................................................................................358 5.6.11.1 Overview of parameters for Switch output cam off ....................................................................359 5.6.11.2 Overview of parameters for Switch output cam off – Parameters tab .......................................359 5.6.11.3 Overview of parameters for Switch output cam off – Expert tab................................................360 5.6.11.4 Relevant system functions for Switch output cam off ................................................................360 5.6.12 Switch output cam signal ...........................................................................................................361 5.6.12.1 Overview of parameters for Switch output cam signal ..............................................................362 5.6.12.2 Overview of parameters for Switch output cam signal – Parameters tab..................................363 5.6.12.3 Overview of parameters for Switch output cam signal – Expert tab ..........................................364 5.6.12.4 Relevant system functions for Switch output cam signal...........................................................364 5.6.13 Output cam track On..................................................................................................................365 5.6.13.1 Overview of parameters for Output cam track On .....................................................................368 5.6.13.2 Overview of parameters for Output cam track On – Parameters tab.........................................369 5.6.13.3 Overview of parameters for Output cam track On – Expert tab.................................................371 5.6.13.4 Relevant system function for Output cam track On ...................................................................371 5.6.14 Output cam track Off..................................................................................................................372 5.6.14.1 Overview of parameters for Output cam track Off .....................................................................373 5.6.14.2 Overview of parameters for Output cam track Off – Parameters tab.........................................374 5.6.14.3 Overview of parameters for Output cam track Off – Expert tab.................................................374 5.6.14.4 Relevant system function for Output cam track Off ...................................................................375 5.7 Commands for synchronous operation and camming ...............................................................376 5.7.1 Gearing on .................................................................................................................................376 5.7.1.1 Overview of parameters for Gearing on.....................................................................................377 5.7.1.2 Overview of parameters for Gearing on – Parameters tab ........................................................379 5.7.1.3 Overview of parameters for Gearing on – Synchronization tab .................................................381 5.7.1.4 Overview of parameters for Gearing on – Dynamic response tab.............................................386 5.7.1.5 Overview of parameters for Gearing on – Expert tab ................................................................387 5.7.1.6 Example of Gearing on ..............................................................................................................388 5.7.1.7 Relevant system functions for Gearing on.................................................................................388 5.7.2 Gearing off .................................................................................................................................390 5.7.2.1 Overview of parameters for Gearing off.....................................................................................391 5.7.2.2 Overview of parameters for Gearing off – Desynchronization tab .............................................392 5.7.2.3 Overview of parameters for Gearing off – Dynamic response tab.............................................394 5.7.2.4 Overview of parameters for Gearing off – Expert tab ................................................................395 5.7.2.5 Relevant system function for Gearing off...................................................................................395 5.7.3 Set offset on the gearing............................................................................................................396 5.7.3.1 Overview of parameters for Set offset on the gearing ...............................................................397 5.7.3.2 Overview of parameters for Set offset on the gearing – Parameters tab...................................399 5.7.3.3 Overview of parameters for Set offset on the gearing – Dynamic response tab .......................399 5.7.3.4 Overview of parameters for Set offset on the gearing – Expert tab...........................................400 5.7.3.5 Relevant system function for Set offset on the gearing .............................................................400 5.7.4 Synchronous velocity operation on............................................................................................401 5.7.4.1 Overview of Synchronous velocity operation on........................................................................402 5.7.4.2 Overview of parameters for Synchronous velocity operation on – Parameters tab...................403

Page 16: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 16 Programming and Operating Manual, 03/2007

5.7.4.3 Overview of parameters for Synchronous velocity operation on – Dynamic response tab ...... 404 5.7.4.4 Overview of parameters for Synchronous velocity operation on – Expert tab .......................... 404 5.7.4.5 Example of Synchronous velocity operation on........................................................................ 405 5.7.4.6 Relevant system functions for Synchronous velocity operation on........................................... 405 5.7.5 Synchronous velocity operation off ........................................................................................... 407 5.7.5.1 Overview of parameters for Synchronous velocity operation off .............................................. 408 5.7.5.2 Overview of parameters for Synchronous velocity operation off – Dynamic response tab ...... 409 5.7.5.3 Overview of parameters for Synchronous velocity operation off – Expert tab .......................... 409 5.7.5.4 Relevant system function for Synchronous velocity operation off ............................................ 410 5.7.6 Cam on...................................................................................................................................... 411 5.7.6.1 Overview of parameters for Cam on ......................................................................................... 412 5.7.6.2 Overview of parameters for Cam on – Parameters tab ............................................................ 413 5.7.6.3 Overview of parameters for Cam on – Synchronization tab ..................................................... 415 5.7.6.4 Overview of parameters for Cam on – Dynamic response tab ................................................. 419 5.7.6.5 Overview of parameters for Cam on – Expert tab..................................................................... 419 5.7.6.6 Example of Cam on................................................................................................................... 420 5.7.6.7 Relevant system functions for Cam on ..................................................................................... 421 5.7.7 Cam off...................................................................................................................................... 422 5.7.7.1 Overview of parameters for Cam off ......................................................................................... 423 5.7.7.2 Overview of parameters for Cam off – Desynchronization tab ................................................. 424 5.7.7.3 Overview of parameters for Cam off – Dynamic response tab ................................................. 426 5.7.7.4 Overview of parameters for Cam Off – Expert tab.................................................................... 427 5.7.7.5 Relevant system function for Cam off ....................................................................................... 427 5.7.8 Set scaling on camming............................................................................................................ 428 5.7.8.1 Overview of parameters for Set scaling on camming ............................................................... 429 5.7.8.2 Overview of parameters for Set scaling on camming – Parameters tab................................... 430 5.7.8.3 Overview of parameters for Set scaling on camming – Dynamic response tab ....................... 431 5.7.8.4 Overview of parameters for Set scaling on camming – Expert tab........................................... 431 5.7.8.5 Relevant system function for Set scaling on camming ............................................................. 432 5.7.9 Set offset on camming .............................................................................................................. 433 5.7.9.1 Overview of parameters for Set offset on camming.................................................................. 434 5.7.9.2 Overview of parameters for Set offset on camming – Parameters tab ..................................... 435 5.7.9.3 Overview of parameters for Set offset on camming – Dynamic response tab.......................... 436 5.7.9.4 Overview of parameters for Set offset on camming – Expert tab ............................................. 436 5.7.9.5 Relevant system function for Set offset on camming................................................................ 437 5.7.10 Parameterize cam..................................................................................................................... 438 5.7.10.1 Overview of parameters for Parameterize cam ........................................................................ 440 5.7.10.2 Overview of parameters for Parameterize cam – Offset tab..................................................... 440 5.7.10.3 Overview of parameters for Parameterize cam – Basic scaling tab ......................................... 441 5.7.10.4 Overview of parameters for Parameterize cam – Range scaling tab ....................................... 441 5.7.10.5 Overview of parameters for Parameterize cam – Expert tab .................................................... 442 5.7.10.6 Relevant system functions for Parameterize cam..................................................................... 442 5.7.11 Switch master setpoint .............................................................................................................. 443 5.7.11.1 Overview of parameters for Switch master setpoint ................................................................. 444 5.7.11.2 Overview of parameters for Switch master setpoint – Parameters tab..................................... 445 5.7.11.3 Overview of parameters for Switch master setpoint – Dynamic response tab ......................... 445 5.7.11.4 Overview of parameters for Switch master setpoint – Expert tab............................................. 446 5.7.11.5 Relevant system function for Switch master setpoint ............................................................... 447 5.8 Commands for path interpolation.............................................................................................. 448 5.8.1 Traverse path linearly................................................................................................................ 449 5.8.1.1 Overview of parameters for Traverse path linearly................................................................... 450 5.8.1.2 Overview of parameters for Traverse path linearly – Parameters tab ...................................... 450 5.8.1.3 Overview of parameters for Traverse path linearly – Dynamic response tab ........................... 452 5.8.1.4 Overview of parameters for Traverse path linearly – Path-synchronous motion tab................ 454 5.8.1.5 Overview of parameters for Traverse path linearly – Expert tab............................................... 455

Page 17: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 17

5.8.1.6 Relevant system function for Traverse path linearly..................................................................456 5.8.2 Traverse path circularly..............................................................................................................457 5.8.2.1 Overview of parameters for Traverse path circularly .................................................................458 5.8.2.2 Overview of parameters for Traverse path circularly – Parameters tab ....................................458 5.8.2.3 Overview of parameters for Traverse path circularly – Dynamic response tab .........................462 5.8.2.4 Overview of parameters for Traverse path circularly – Path-synchronous motion tab ..............464 5.8.2.5 Overview of parameters for Traverse path circularly – Expert tab.............................................465 5.8.2.6 Relevant system function for Traverse path circularly ...............................................................466 5.8.3 Traverse path using polynomials ...............................................................................................467 5.8.3.1 Overview of parameters for Traverse path using polynomials ..................................................469 5.8.3.2 Overview of parameters for Traverse path using polynomials – Parameters tab......................469 5.8.3.3 Overview of parameters for Traverse path using polynomials – Dynamic response tab...........472 5.8.3.4 Overview of parameters for Traverse path using polynomials – Path-synchronous motion

tab ..............................................................................................................................................475 5.8.3.5 Overview of parameters for Traverse path using polynomials – Expert tab ..............................476 5.8.3.6 Relevant system function for Traverse path using polynomials ................................................476 5.8.4 Stop path motion........................................................................................................................479 5.8.4.1 Overview of parameters for Stop path motion ...........................................................................480 5.8.4.2 Overview of parameters for Stop path motion – Parameters tab...............................................480 5.8.4.3 Overview of parameters for Stop path motion – Dynamic response tab ...................................481 5.8.4.4 Overview of parameters for Stop path motion – Expert tab.......................................................481 5.8.4.5 Relevant system functions for Stop path motion .......................................................................482 5.8.5 Continue path motion.................................................................................................................483 5.8.5.1 Overview of parameters: Continue path motion ........................................................................484 5.8.5.2 Relevant system function for Continue path motion ..................................................................484

6 Commissioning (software) ..................................................................................................................... 485 6.1 Assigning programs to a task and downloading them to the target system ..............................485 6.1.1 Assigning programs to a task.....................................................................................................485 6.1.1.1 Execution levels and tasks in SIMOTION..................................................................................487 6.1.1.2 Task start sequence...................................................................................................................488 6.1.2 Downloading programs to the target system .............................................................................489

7 Error Handling and Program Test .......................................................................................................... 491 7.1 Modes for program testing .........................................................................................................491 7.1.1 Modes of the SIMOTION devices ..............................................................................................491 7.1.2 Important information for the debug mode.................................................................................492 7.2 Monitoring variables in the symbol browser and watch tables ..................................................494 7.2.1 Symbol browser .........................................................................................................................494 7.2.2 Watch tables ..............................................................................................................................496 7.3 Monitoring the program execution .............................................................................................499 7.3.1 Tracking program execution ......................................................................................................499 7.3.2 Tracking single program steps...................................................................................................500 7.4 Program status...........................................................................................................................502 7.5 Trace ..........................................................................................................................................504 7.5.1 Activate trace .............................................................................................................................504 7.6 Breakpoints ................................................................................................................................507 7.6.1 General procedure for setting breakpoints ................................................................................507 7.6.2 Setting the debug mode.............................................................................................................507 7.6.3 Breakpoints toolbar ....................................................................................................................508 7.6.4 Define the debug task group......................................................................................................509 7.6.5 Setting breakpoints ....................................................................................................................511 7.6.6 Defining the call path for a single breakpoint.............................................................................512

Page 18: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 18 Programming and Operating Manual, 03/2007

7.6.7 Defining the call path for all breakpoints ................................................................................... 514 7.6.8 Display callstack........................................................................................................................ 515 7.6.9 Activating breakpoints ............................................................................................................... 516

A Appendix................................................................................................................................................ 519 A.1 Basics of LAD/FBD/Formula for MCC....................................................................................... 519 A.1.1 Ladder logic (LAD) for MCC...................................................................................................... 519 A.1.2 Function block diagram (FBD) for MCC.................................................................................... 523 A.1.3 Formula for MCC....................................................................................................................... 526 A.2 Key combinations...................................................................................................................... 528

Index...................................................................................................................................................... 531

Tables

Table 3-1 Local compiler settings................................................................................................................ 49 Table 4-1 Frequently selected options in combo boxes.............................................................................. 71 Table 4-2 Overview of parameters for Dynamics tab.................................................................................. 73 Table 4-3 Overview of parameters for Expert tab ....................................................................................... 76 Table 4-4 List for dialog adaptation............................................................................................................. 77 Table 4-5 Description of return value for Cam, Path and Cam_EXT technology package functions ......... 82 Table 4-6 Preassignment of array elements ............................................................................................... 87 Table 4-7 Bit widths and value ranges of the elementary data types ......................................................... 89 Table 4-8 Symbolic constants for the value range limits of elementary data types .................................... 91 Table 4-9 General data types...................................................................................................................... 92 Table 4-10 Elementary system data types and their use.............................................................................. 93 Table 4-11 Symbolic constants for invalid values of elementary system data types .................................... 93 Table 4-12 Data types of technology objects (TO data type)........................................................................ 95 Table 4-13 Symbolic constants for invalid values of technology object data types ...................................... 95 Table 4-14 Initializing retentive global variables during download.............................................................. 102 Table 4-15 Initializing non-retentive global variables during download....................................................... 103 Table 4-16 Initializing local variables when calling the program organizational unit................................... 104 Table 4-17 Initializing technology object system variables during download.............................................. 105 Table 4-18 Version ID of global variables and their initialization during download..................................... 106 Table 4-19 Important features of direct access and process image access............................................... 109 Table 4-20 Address range of SIMOTION devices for direct access and process image of cyclic tasks

according to SIMOTION Kernel version.................................................................................... 111 Table 4-21 Predefined name spaces .......................................................................................................... 123 Table 4-22 Elements of the display for the program structure .................................................................... 142 Table 5-1 Overview of parameters for Wait time....................................................................................... 164 Table 5-2 Overview of parameters for Wait time - Parameters tab........................................................... 164

Page 19: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 19

Table 5-3 Overview of parameters for Wait time - Expert tab....................................................................164 Table 5-4 Overview of parameters for Wait for axis...................................................................................166 Table 5-5 Overview of parameters for........................................................................................................169 Table 5-6 Overview of parameters for Set output ......................................................................................175 Table 5-7 Assigned values for Reset output command according to data type.........................................176 Table 5-8 Overview of parameters for Reset output ..................................................................................177 Table 5-9 Overview of parameters for Activate simulation for object ........................................................179 Table 5-10 Overview of parameters for Activate simulation for object - Parameters tab ............................180 Table 5-11 Overview of parameters for Activate simulation for object - Expert tab.....................................180 Table 5-12 Overview of parameters for Deactivate simulation for object ....................................................182 Table 5-13 Overview of parameters for Deactivate simulation for object - Parameters tab ........................182 Table 5-14 Overview of parameters for Deactivate simulation for object - Expert tab ................................182 Table 5-15 Overview of parameters for Reset object ..................................................................................184 Table 5-16 Overview of parameters for Reset object - Parameters tab ......................................................184 Table 5-17 Overview of parameters for Deactivate simulation for object - Expert tab ................................184 Table 5-18 Overview of parameters for Change operating mode................................................................186 Table 5-19 Overview of parameters for Start task .......................................................................................190 Table 5-20 Overview of parameters for Interrupt task .................................................................................192 Table 5-21 Parameter screen form for Continue task..................................................................................194 Table 5-22 Overview of parameters for Reset task .....................................................................................196 Table 5-23 Parameter screen form for Task status .....................................................................................198 Table 5-24 Overview of parameters for Determine TaskId ..........................................................................199 Table 5-25 Overview of parameters for FOR loop with fixed number of runs..............................................203 Table 5-26 Overview of parameters for CASE multiple branching ..............................................................208 Table 5-27 Overview of parameters for Go to..............................................................................................209 Table 5-28 Overview of parameters for Selection........................................................................................210 Table 5-29 Permissible commands for a synchronous start with specification of timing for proper

completion of commands; timing depends on whether an additional command is present on the relevant axis....................................................................................................................216

Table 5-30 Overview of parameters for Acknowledge technology object alarms ........................................218 Table 5-31 Overview of parameters for Acknowledge technology object alarms - Parameters tab ............219 Table 5-32 Overview of parameters for Acknowledge technology object alarms - Expert tab ....................219 Table 5-33 Overview of parameters for Acknowledge specific technology object alarm.............................221 Table 5-34 Overview of parameters for Acknowledge specific technology object alarm - Parameters

tab ..............................................................................................................................................221 Table 5-35 Overview of parameters for Acknowledge specific technology object alarm - Expert tab.........221 Table 5-36 Overview of parameters for Incoming message ........................................................................223

Page 20: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 20 Programming and Operating Manual, 03/2007

Table 5-37 Overview of parameters for Incoming message - Parameters tab ........................................... 224 Table 5-38 Overview of parameters for Incoming message - Expert tab.................................................... 224 Table 5-39 Overview of parameters for Outgoing message ....................................................................... 225 Table 5-40 Overview of parameters for Outgoing message - Parameters tab ........................................... 226 Table 5-41 Overview of parameters for Outgoing message - Expert tab.................................................... 226 Table 5-42 Overview of parameters for Establish connection using TCP/IP .............................................. 228 Table 5-43 Overview of parameters for Establish connection using TCP/IP - Parameters for server........ 228 Table 5-44 Overview of parameters for Establish connection using TCP/IP - Parameters for client.......... 228 Table 5-45 Structure of the return value (TYPE StructRetTcpOpenServer) ............................................... 229 Table 5-46 Structure of the return value (TYPE StructRetTcpOpenClient) ................................................ 229 Table 5-47 Overview of parameters for Remove connection using TCP/IP ............................................... 231 Table 5-48 Overview of parameters for Send data ..................................................................................... 234 Table 5-49 Overview of parameters for Send data - Parameters tab for Protocol = Xsend/XReceive....... 235 Table 5-50 Overview of parameters for Send data - Parameters tab for Protocol = UDP.......................... 236 Table 5-51 Overview of parameters for Send data – Parameters tab for Protocol = TCP/IP ..................... 236 Table 5-52 Overview of parameters for Send data – Expert tab................................................................. 236 Table 5-53 Structure of destination address of the communications partner, when address is entered

directly (TYPE StructXSendDestAddr – XSend/XReceive protocol)......................................... 237 Table 5-54 Parameters (MCC Send data command compared to _XSend system function)..................... 238 Table 5-55 Parameters (MCC Send data command compared to _tcpSend system function) .................. 238 Table 5-56 Parameters (MCC Send data command compared to _udpSend system function) ................. 239 Table 5-57 Overview of parameters for Receive data................................................................................. 240 Table 5-58 Overview of parameters for Receive data – Parameters tab for Protocol =

XSend/XReceive ....................................................................................................................... 241 Table 5-59 Overview of parameters for Receive data - Parameters tab for Protocol = UDP ..................... 241 Table 5-60 Overview of parameters for Receive data – Parameters tab for Protocol = TCP/IP................. 242 Table 5-61 Overview of parameters for Receive data – Expert tab ............................................................ 242 Table 5-62 Parameters (MCC Receive data command compared to _XReceive system function) ........... 243 Table 5-63 Parameters (MCC Receive data command compared to _tcpReceive system function) ......... 243 Table 5-64 Parameters (MCC Receive data command compared to _udpReceive system function)........ 243 Table 5-65 Structure of return value (TYPE StructRetXReceive) ............................................................... 244 Table 5-66 Structure of the return value (TYPE StructRetUdpReceive)..................................................... 244 Table 5-67 Structure of the return value (TYPE StructRetTcpReceive) ..................................................... 245 Table 5-68 Overview of parameters for Home axis..................................................................................... 246 Table 5-69 Overview of parameters for Home axis – Parameters tab ........................................................ 247 Table 5-70 Overview of parameters for Home axis – Dynamic response tab............................................. 248 Table 5-71 Overview of parameters for Home axis – Expert tab ................................................................ 249

Page 21: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 21

Table 5-72 Parameters (MCC Home axis command compared to _homing system function)....................249 Table 5-73 Homing mode for active and passive homing............................................................................250 Table 5-74 Follow-up mode for various axis technologies...........................................................................253 Table 5-75 Overview of parameters for Switch axis enable.........................................................................253 Table 5-76 Overview of parameters for Switch axis enable – Parameters tab ............................................254 Table 5-77 Overview of parameters for Switch axis enable – Expert tab ....................................................255 Table 5-78 Meaning of bits of control word 1 (STW1) in accordance with PROFIdrive ..............................255 Table 5-79 Parameters (MCC Switch axis enable command compared to _enableAxis system

function) .....................................................................................................................................256 Table 5-80 Overview of parameters for Switch QF axis enable...................................................................258 Table 5-81 Overview of parameters for Switch QF axis enable – Parameters tab......................................258 Table 5-82 Overview of parameters for Switch QF axis enable – QF_Parameters tab ...............................259 Table 5-83 Overview of parameters for Switch QF axis enable – Expert tab ..............................................260 Table 5-84 Parameters (MCC Switch QF axis enable command compared to _enableQFAxis system

function) .....................................................................................................................................261 Table 5-85 Overview of parameters for Remove axis enable......................................................................263 Table 5-86 Overview of parameters for Remove axis enable – Parameters tab .........................................263 Table 5-87 Overview of parameters for Remove axis enable – Expert tab .................................................264 Table 5-88 Parameters (MCC Remove axis enable command compared to _disableAxis system

function) .....................................................................................................................................265 Table 5-89 Overview of parameters for Remove QF axis enable................................................................267 Table 5-90 Overview of parameters for Remove QF axis enable – Parameters tab ...................................268 Table 5-91 Overview of parameters for Remove QF axis enable – QF_Parameters tab ............................268 Table 5-92 Overview of parameters for Remove QF axis enable – Expert tab ...........................................270 Table 5-93 Parameters (MCC Remove QF axis enable command compared to _disableQFAxis

system function) .........................................................................................................................270 Table 5-94 Overview of parameters for Start axis position-controlled .........................................................272 Table 5-95 Overview of parameters for Start axis position-controlled – Parameters tab ............................272 Table 5-96 Overview of parameters for Start axis position-controlled – Dynamic response tab .................273 Table 5-97 Overview of parameters for Start axis position-controlled – Expert tab.....................................273 Table 5-98 Parameters (MCC Start axis position-controlled command compared to _move system

function) .....................................................................................................................................274 Table 5-99 Overview of parameters for speed specification........................................................................276 Table 5-100 Overview of parameters for Speed specification – Parameters tab...........................................277 Table 5-101 Overview of parameters for Speed specification – Dynamic response tab ...............................278 Table 5-102 Overview of parameters for Speed specification – Expert tab...................................................278 Table 5-103 Parameters (MCC Speed specification command compared to _move system function).........279 Table 5-104 Overview of parameters for Switch on torque limitation ............................................................281

Page 22: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 22 Programming and Operating Manual, 03/2007

Table 5-105 Overview of parameters for Switch on torque limitation – Parameters tab............................... 281 Table 5-106 Overview of parameters for Switch on torque limitation – Expert tab ....................................... 282 Table 5-107 Parameters (MCC Switch on torque limiting command compared to

_enableTorqueLimiting system function) .................................................................................. 282 Table 5-108 Overview of parameters for Switch off torque limitation ........................................................... 283 Table 5-109 Parameters (MCC Switch off torque limitation command compared to

_disableTorqueLimiting system function).................................................................................. 284 Table 5-110 Parameter screen form: Position axis ....................................................................................... 286 Table 5-111 Overview of parameters for Position axis – Parameters tab..................................................... 286 Table 5-112 Overview of parameters for Position axis – Dynamic response tab.......................................... 288 Table 5-113 Overview of parameters for Position axis – Expert tab ............................................................. 288 Table 5-114 Parameters (MCC Position axis command compared to _pos system function)...................... 289 Table 5-115 Overview of parameters for Travel to fixed endstop ................................................................. 291 Table 5-116 Overview of parameters for Travel to fixed endstop – Parameters tab .................................... 291 Table 5-117 Overview of parameters for Travel to fixed endstop – Expert tab............................................. 292 Table 5-118 Parameters (MCC Travel to fixed endstop command compared to

_enableMovingToEndStop)....................................................................................................... 292 Table 5-119 Overview of parameters for Remove fixed endstop.................................................................. 294 Table 5-120 Parameters (MCC Remove fixed endstop command compared to

_disableMovingToEndStop system function) ............................................................................ 294 Table 5-121 Overview of parameters for Time-dependent position profile ................................................... 295 Table 5-122 Overview of parameters for Time-dependent position profile – Profile tab............................... 296 Table 5-123 Overview of parameters for Time-dependent position profile – Dynamic response tab ........... 297 Table 5-124 Overview of parameters for Time-dependent position profile – Expert tab............................... 297 Table 5-125 Parameters (MCC Time-dependent position profile command compared to

_runTimeLockedPositionProfile system function) ..................................................................... 298 Table 5-126 Overview of parameters for Time-dependent velocity profile ................................................... 300 Table 5-127 Overview of parameters for Time-dependent velocity profile – Profile tab ............................... 300 Table 5-128 Overview of parameters for Time-dependent velocity profile – Dynamic response tab ........... 301 Table 5-129 Overview of parameters for Time-dependent velocity profile – Expert tab ............................... 301 Table 5-130 Parameters (MCC Time-dependent velocity profile command compared to

_runTimeLockedVelocityProfile system function) ..................................................................... 302 Table 5-131 Overview of parameters for Stop axis....................................................................................... 303 Table 5-132 Overview of parameters for Stop axis – Parameters tab .......................................................... 304 Table 5-133 Overview of parameters for Stop axis – Dynamic response tab............................................... 305 Table 5-134 Overview of parameters for Stop axis – Expert tab .................................................................. 306 Table 5-135 Parameters (MCC Stop axis command compared to _stop, _stopEmergency system

functions)................................................................................................................................... 306 Table 5-136 Overview of parameters for Continue motion ........................................................................... 307

Page 23: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 23

Table 5-137 Overview of parameters for Continue motion - Parameters tab ................................................308 Table 5-138 Overview of parameters for Continue motion - Expert tab ........................................................308 Table 5-139 Parameters (MCC Continue motion command compared to _continue system function).........308 Table 5-140 Overview of parameters for Online correction ...........................................................................309 Table 5-141 Overview of parameters for Set axis parameter ........................................................................311 Table 5-142 Overview of parameters for Set virtual axis values....................................................................315 Table 5-143 Overview of parameters for Set virtual axis values – Parameters tab.......................................316 Table 5-144 Overview of parameters for Set virtual axis values – Expert tab ...............................................316 Table 5-145 Parameters (MCC Set virtual axis values command compared to _redefinePosition

system function) .........................................................................................................................317 Table 5-146 Overview of parameters for Delete command queue ................................................................318 Table 5-147 Parameters (MCC Delete command queue command compared to _resetMotionBuffer

system function) .........................................................................................................................319 Table 5-148 Overview of parameters for Switch parameter set.....................................................................321 Table 5-149 Overview of parameters for Switch parameter set – Parameters tab........................................321 Table 5-150 Overview of parameters for Set virtual axis values – Expert tab ...............................................321 Table 5-151 Parameters (MCC Switch parameter set command compared to _setAxisDataSetActive

system function) .........................................................................................................................322 Table 5-152 Overview of parameters for External encoder on ......................................................................324 Table 5-153 Parameters (MCC External encoder on command compared to _enableExternalEncoder

system function) .........................................................................................................................324 Table 5-154 Overview of parameters for External encoder off ......................................................................325 Table 5-155 Parameters (MCC External encoder off command compared to _disableExternalEncoder

system function) .........................................................................................................................326 Table 5-156 Overview of parameters for Synchronize external encoder.......................................................327 Table 5-157 Overview of parameters for Synchronize external encoder – Parameters tab ..........................328 Table 5-158 Overview of parameters for Synchronize external encoder – Expert tab ..................................328 Table 5-159 Parameter (MCC Synchronize external encoder command compared to

_synchronizeExternalEncoder system function) ........................................................................329 Table 5-160 Overview of parameters for Encoder monitoring on ..................................................................330 Table 5-161 Overview of parameters for Encoder monitoring on – Parameters tab......................................331 Table 5-162 Overview of parameters for Encoder monitoring on – Expert tab..............................................331 Table 5-163 Parameters (MCC Encoder monitoring on command compared to

_enableMonitoringOfEncoderDifference system function) ........................................................332 Table 5-164 Overview of parameters for Encoder monitoring off ..................................................................333 Table 5-165 Parameters (MCC Encoder monitoring off command compared to

_disableMonitoringOfEncoderDifference system function)........................................................334 Table 5-166 Content of system variables measuredValue1 and measuredValue2 according to the

measurement and the triggering edge.......................................................................................335

Page 24: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 24 Programming and Operating Manual, 03/2007

Table 5-167 Overview of parameters for Activate measuring input .............................................................. 336 Table 5-168 Overview of parameters for Activate measuring input – Parameters tab ................................. 337 Table 5-169 Overview of parameters for Activate measuring input – Expert tab.......................................... 339 Table 5-170 Parameters (MCC Activate measuring input command compared to

_enableMeasuringInput, _enableMeasuringInputCyclic system functions) .............................. 339 Table 5-171 Overview of parameters for Deactivate measuring input.......................................................... 341 Table 5-172 Overview of parameters for Deactivate measuring input – Parameters tab ............................. 341 Table 5-173 Overview of parameters for Deactivate measuring input – Expert tab ..................................... 342 Table 5-174 Parameters (MCC Deactivate measuring input command compared to

_disableMeasuringInput system function)................................................................................. 342 Table 5-175 Overview of parameters for Shift measuring system ................................................................ 344 Table 5-176 Overview of parameters for Shift measuring system – Set actual value tab ............................ 344 Table 5-177 Overview of parameters for Shift measuring system – Expert tab............................................ 345 Table 5-178 Parameters (MCC Shift measuring system command compared to _redefinePosition

system function) ........................................................................................................................ 345 Table 5-179 Overview of parameters for Synchronize measuring system ................................................... 346 Table 5-180 Overview of parameters for Synchronize measuring system – Parameters tab....................... 347 Table 5-181 Overview of parameters for Synchronize measuring system – Expert tab ............................... 347 Table 5-182 Structure of the return value (TYPE StructRetEncoderValue).................................................. 347 Table 5-183 Parameters (MCC Synchronize measuring system command compared to

_setAndGetEncoderValue system function) ............................................................................. 348 Table 5-184 Overview of parameters for Switch output cam on ................................................................... 353 Table 5-185 Overview of parameters for Switch output cam on – Parameters tab ...................................... 354 Table 5-186 Overview of parameters for Switch output cam on – Expert tab............................................... 356 Table 5-187 Parameters (MCC Switch output cam on command compared to _enableOutputCam and

_setOutputCamCounter system functions) ............................................................................... 357 Table 5-188 Overview of parameters for Switch output cam off ................................................................... 359 Table 5-189 Overview of parameters for Switch output cam off – Parameters tab ...................................... 359 Table 5-190 Overview of parameters for Switch output cam off – Expert tab............................................... 360 Table 5-191 Parameters (MCC Switch output cam off command compared to _disableOutputCam and

_setOutputCamState system functions).................................................................................... 360 Table 5-192 Overview of parameters for Switch output cam signal.............................................................. 362 Table 5-193 Overview of parameters for Switch output cam off – Parameters tab ...................................... 363 Table 5-194 Overview of parameters for Switch output cam signal – Expert tab ......................................... 364 Table 5-195 Parameters (MCC Switch output cam signal command compared to _setOutputCamState

system function) ........................................................................................................................ 364 Table 5-196 Overview of parameters for Output cam track On .................................................................... 368 Table 5-197 Overview of parameters for Output cam track On – Parameters tab........................................ 369 Table 5-198 Overview of parameters for Output cam track On – Expert tab ................................................ 371

Page 25: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 25

Table 5-199 Parameters (MCC Output cam track On command compared to _enableCamTrack system functions) .......................................................................................................................371

Table 5-200 Overview of parameters for Output cam track Off .....................................................................373 Table 5-201 Overview of parameters for Output cam track Off – Parameters tab.........................................374 Table 5-202 Overview of parameters for Output cam track Off – Expert tab.................................................374 Table 5-203 Parameters (MCC Output cam track Off command compared to _disableCamTrack

system functions) .......................................................................................................................375 Table 5-204 Overview of parameters for Gearing on.....................................................................................377 Table 5-205 Overview of parameters for Gearing on – Parameters tab ........................................................379 Table 5-206 Overview of parameters for Gearing on – Synchronization .......................................................381 Table 5-207 Overview of parameters for Gearing on – Dynamic response tab.............................................386 Table 5-208 Overview of parameters for Gearing on – Expert tab ................................................................387 Table 5-209 Parameters (MCC Gearing on command compared to _enableGearing and _setMaster

system functions) .......................................................................................................................389 Table 5-210 Overview of parameters for Gearing off.....................................................................................391 Table 5-211 Overview of parameters for Gearing off – Desynchronization tab .............................................392 Table 5-212 Overview of parameters for Gearing off – Dynamic response tab.............................................394 Table 5-213 Overview of parameters for Gearing off – Expert tab ................................................................395 Table 5-214 Parameters (MCC Gearing off command compared to _disableGearing system functions).....395 Table 5-215 Overview of parameters for Set offset on the gearing ...............................................................397 Table 5-216 Overview of parameters for Set offset on the gearing – Parameters tab...................................399 Table 5-217 Overview of parameters for Set offset on the gearing – Dynamic response tab .......................399 Table 5-218 Overview of parameters for Set offset on the gearing – Expert tab...........................................400 Table 5-219 Parameters (MCC Set gearing on the offset command compared to _setGearingOffset

system function) .........................................................................................................................400 Table 5-220 Overview of Synchronous velocity operation on........................................................................402 Table 5-221 Overview of parameters for Synchronous velocity operation on – Parameters tab...................403 Table 5-222 Overview of parameters for Synchronous velocity operation on – Dynamic response tab .......404 Table 5-223 Overview of parameters for Synchronous velocity operation on – Expert tab...........................404 Table 5-224 Parameters (MCC Synchronous velocity operation on command compared to

_enableVelocityGearing and _setMaster system functions) ......................................................406 Table 5-225 Overview of parameters for Synchronous velocity operation off ...............................................408 Table 5-226 Overview of parameters for Synchronous velocity operation off – Dynamic response tab .......409 Table 5-227 Overview of parameters for Synchronous velocity operation off – Expert tab...........................409 Table 5-228 Parameters (MCC Synchronous velocity operation off command compared to

_disableVelocityGearing system function) .................................................................................410 Table 5-229 Overview of parameters for Cam on..........................................................................................412 Table 5-230 Overview of parameters for Cam on – Parameters tab .............................................................413

Page 26: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 26 Programming and Operating Manual, 03/2007

Table 5-231 Overview of parameters for Cam on – Synchronization tab ..................................................... 415 Table 5-232 Overview of parameters for Cam on – Dynamic response tab ................................................. 419 Table 5-233 Overview of parameters for Cam on – Expert tab..................................................................... 419 Table 5-234 Parameters (MCC Cam on command compared to _enableCamming and _setMaster

system functions) ...................................................................................................................... 421 Table 5-235 Overview of parameters for Cam off ......................................................................................... 423 Table 5-236 Overview of parameters for Cam off – Desynchronization tab ................................................. 424 Table 5-237 Overview of parameters for Cam off – Dynamic response tab ................................................. 426 Table 5-238 Overview of parameters for Cam Off – Expert tab.................................................................... 427 Table 5-239 Parameters (MCC Cam off command compared to _disableCamming system functions) ...... 427 Table 5-240 Overview of parameters for Set scaling on camming ............................................................... 429 Table 5-241 Overview of parameters for Set scaling on camming – Parameters tab................................... 430 Table 5-242 Overview of parameters for Set scaling on camming – Dynamic response tab ....................... 431 Table 5-243 Overview of parameters for Set scaling on camming – Expert tab........................................... 431 Table 5-244 Parameters (MCC Set scaling on camming command compared to _setCammingScale

system function) ........................................................................................................................ 432 Table 5-245 Overview of parameters for Set offset on camming.................................................................. 434 Table 5-246 Overview of parameters for Set offset on camming – Parameters tab ..................................... 435 Table 5-247 Overview of parameters for Set offset on camming – Dynamic response tab.......................... 436 Table 5-248 Overview of parameters for Set offset on camming – Expert tab ............................................. 436 Table 5-249 Parameters (MCC Set offset on camming command compared to _setCammingOffset

system function) ........................................................................................................................ 437 Table 5-250 Overview of parameters for Parameterize cam ........................................................................ 440 Table 5-251 Overview of parameters for Parameterize cam – Offset tab..................................................... 440 Table 5-252 Overview of parameters for Parameterize cam – Basic scaling tab ......................................... 441 Table 5-253 Overview of parameters for Parameterize cam – Range scaling tab ....................................... 441 Table 5-254 Overview of parameters for Parameterize cam – Expert tab .................................................... 442 Table 5-255 Parameters (MCC Parameterize cam command compared to _setCamOffset and

_setCamScale system functions).............................................................................................. 442 Table 5-256 Overview of parameters for Switch master setpoint ................................................................. 444 Table 5-257 Overview of parameters for Switch master setpoint – Parameters tab..................................... 445 Table 5-258 Overview of parameters for Switch master setpoint – Dynamic response tab ......................... 445 Table 5-259 Overview of parameters for Switch master setpoint – Expert tab............................................. 446 Table 5-260 Parameters (MCC Switch master setpoint command compared to _setMaster system

function)..................................................................................................................................... 447 Table 5-261 Overview of parameters for Traverse path linearly................................................................... 450 Table 5-262 Overview of parameters for Traverse path linearly – Parameters tab ...................................... 450 Table 5-263 Overview of parameters for Traverse path linearly – Dynamic response tab ........................... 452

Page 27: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 27

Table 5-264 Overview of parameters for Traverse path linearly – Path-synchronous motion tab.................454 Table 5-265 Overview of parameters for Traverse path linearly – Expert tab ...............................................455 Table 5-266 Parameters (MCC Traverse path linearly command compared to _movePathLinear

system function) .........................................................................................................................456 Table 5-267 Overview of parameters for Traverse path circularly .................................................................458 Table 5-268 Overview of parameters for Traverse path circularly – Parameters tab ....................................458 Table 5-269 Overview of parameters for Traverse path circularly – Dynamic response tab .........................462 Table 5-270 Overview of parameters for Traverse path circularly – Path-synchronous motion tab ..............464 Table 5-271 Overview of parameters for Traverse path circularly – Expert tab.............................................465 Table 5-272 Parameters (MCC Traverse path circularly command compared to _movePathCircular

system function) .........................................................................................................................466 Table 5-273 Overview of parameters for Traverse path using polynomials ..................................................469 Table 5-274 Overview of parameters for Traverse path using polynomials – Parameters tab......................469 Table 5-275 Overview of parameters for Traverse path using polynomials – Dynamic response tab...........472 Table 5-276 Overview of parameters for Traverse path using polynomials – Path-synchronous motion

tab ..............................................................................................................................................475 Table 5-277 Overview of parameters for Traverse path using polynomials – Expert tab ..............................476 Table 5-278 Parameters (MCC Traverse path using polynomials command compared to

_movePathPolynomial system function) ....................................................................................476 Table 5-279 Overview of parameters for Stop path motion ...........................................................................480 Table 5-280 Overview of parameters for Stop path motion – Parameters tab...............................................480 Table 5-281 Overview of parameters for Stop path motion – Dynamic response tab ...................................481 Table 5-282 Overview of parameters for Stop path motion – Expert tab.......................................................481 Table 5-283 Parameters (MCC Stop path motion command compared to _stopPath system function) .......482 Table 5-284 Overview of parameters: Continue path motion ........................................................................484 Table 5-285 Parameters (MCC Continue path motion command compared to _continuePath system

function) .....................................................................................................................................484 Table 7-1 Modes of a SIMOTION device...................................................................................................491 Table 7-2 Behavior on reaching an activated breakpoint depending on the tasks in the debug task

group ..........................................................................................................................................510 Table A-1 Example of an AND operation (keyword AND)..........................................................................526 Table A-2 Example of an AND operation (keyword AND)..........................................................................526 Table A-3 Example of an AND operation (keyword AND)..........................................................................527 Table A-4 Key combinations.......................................................................................................................528

Page 28: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Contents

SIMOTION MCC Motion Control Chart 28 Programming and Operating Manual, 03/2007

Page 29: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 29

Description 11.1 Overview

This chapter introduces the MCC (Motion Control Chart) graphical programming language and also describes the programming principles and procedures involved.

1.2 Introduction to MCC (Motion Control Chart) MCC is a new graphical programming language, which has been designed to reduce the complexity of automating production machines. Many production machines are very complex. They require a control system (SIMOTION) that is capable of handling motion control and technologies with a wide variety of motion functions, as well as PLC functions, arithmetic functions, and data management tasks. MCC is the neutral description tool represented as a flowchart. This flowchart is referred to as "MCC chart" in this document. MCC provides you with all of the descriptive symbols you will need to define your automation task quickly and efficiently. It also offers a wide range of tools for structuring large-scale automation jobs. With an MCC chart, you can create a program, a function block, or a function that complies with IEC 61131-3. An MCC source file is comprised of several MCC charts.

Page 30: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Description 1.2 Introduction to MCC (Motion Control Chart)

SIMOTION MCC Motion Control Chart 30 Programming and Operating Manual, 03/2007

Figure 1-1 MCC for automating production machines

Application of MCC MCC facilitates automation by offering the following features: • The motion sequences on the machine can be easily programmed and are clearly

defined. • The programmer's logic is supported. • Structured programming available through use of subroutines and modular creation of

commands and library functions. • Wait commands for quick reaction to interrupts. • Simultaneous starting of axes. • Online functions allow tracking of the program execution (program execution monitoring

and breakpoints). • Integrated online help. These features help the inexperienced programmer to achieve results fast and let the experienced programmer create complex programs more efficiently.

Page 31: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Description 1.3 Principles of programming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 31

1.3 Principles of programming The SIMOTION motion control system offers powerful functions for motion control in production machines. As a graphical programming language, MCC helps you to formulate process and motion sequences easily by creating a sequence of graphical MCC commands. The characteristics of every MCC command can be assigned individually. Control structures such as IF commands make for easy implementation of alternative branches. The flowchart format makes it easy to follow the logical execution sequence. Furthermore, each MCC command has its own graphic design, making the functionality of each action within an MCC chart immediately evident. Consequently, the system greatly facilitates the programming of automation tasks and enhances readability. Supplementary online functions enable you to locate errors quickly or simply help you to keep track of the current states.

Page 32: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Description 1.4 Procedure for programming

SIMOTION MCC Motion Control Chart 32 Programming and Operating Manual, 03/2007

1.4 Procedure for programming Let us look at an example of how MCC programming works.

Function When you press a key, an axis will travel to position 1,000 mm at a velocity of 100 mm/s. Once this position has been reached, an output is to be set (for example, lamp ON). This task is now broken down into several subtasks: • Set axis enable signals • Wait until the key is pressed • Traverse axis to position • Set output when motion ends An MCC command is available for each of the listed subtasks. Each command is represented by a rectangular symbol in MCC. The parameters for individual commands (position = 1000, input = 1.0, etc.) are entered using a command dialog box. This opens when you double-click the command. This example deals only with the MCC programming aspect. For this reason, information about the keys, axis, and lamp should already be available to the control system.

Figure 1-2 MCC chart for example task

Page 33: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 33

Software interface 22.1 User interface in MCC editor

This chapter describes the various operating features offered by the MCC editor. The user interface is graphically displayed and described.

2.2 Representation of MCC chart and MCC source file in Workbench The Workbench is divided into three main windows: • Project navigator: Displays the project structure • Working area: Displays the MCC chart or MCC source file and parameter screen forms • Detail view: Displays the variables, alarms, error messages, etc., depending on which

element is selected in the project navigator

Page 34: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Software interface 2.2 Representation of MCC chart and MCC source file in Workbench

SIMOTION MCC Motion Control Chart 34 Programming and Operating Manual, 03/2007

Figure 2-1 Workbench view

For additional information on using the Workbench: • Maximizing working area and detail view • Zooming in and out of an MCC chart • Moving the MCC chart or MCC source file to the foreground • Hiding and displaying the declaration table • Zooming in and out of the declaration table

Maximizing working area and detail view The windows working area and detail view can be set to maximum zoom. Select View > Maximize Working Area or View > Maximize Detail View from the menu.

Zooming in and out of an MCC chart The size of an MCC chart, that is, the size of the command symbols, can be altered in the Zoom Factor box. Select a factor from the list, or enter an integer value of your own choice. The changes always apply to the currently selected MCC chart.

Page 35: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Software interface 2.3 Operator input options

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 35

Moving the MCC chart or MCC source file to the foreground If several MCC charts or MCC source files are open in the working area, they will be cascaded in most cases. Therefore, only the top window will be visible. You can use two different methods to move concealed windows to the foreground: • By selecting the appropriate tab below the working window • By selecting the appropriate name in the Window menu

Hiding and displaying the declaration table If you need more space, you can completely hide the declaration table of an MCC chart. • Double-click the separation line. In order to display the declaration line again, double-click the separation line again.

Zooming in and out of the declaration table • Move the pointer over the separation line until it turns into a double line. • Keep pressing the left mouse button while you move the separation line:

– Up, to zoom out of the declaration area – Down, to zoom in to the declaration area

2.3 Operator input options The MCC editor provides the programmer with a variety of different operator input options. Alternatives for executing individual operator inputs include the following: • Via the menu bar • Via the context menu • Via the toolbar • Via keystroke combinations • Texts and variables can be moved into the input field using a drag-and-drop operation.

Menu bar There are two separate menu bars for the MCC source file and the MCC chart. Each contains a complete set of action commands. The appropriate menu bar is displayed for the active window in the working area.

Page 36: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Software interface 2.3 Operator input options

SIMOTION MCC Motion Control Chart 36 Programming and Operating Manual, 03/2007

Context menu To use the context menu for an object, proceed as follows: 1. Select the appropriate object with the left mouse button (left click). 2. Briefly click the right mouse button. 3. Left-click the appropriate menu item.

Note In this document, work steps and action commands are executed wherever possible via the context menu. However, some action commands can only be executed via the menu bar or toolbar.

Toolbar The toolbars contain important operator input steps, for example, for saving or for inserting elements. The toolbars can be positioned as required within the Workbench. Using the menu View > Toolbars, you can display or hide these. The MCC editor toolbar contains the full range of MCC commands. The list of commands is displayed when you place the cursor on the appropriate button (see inserting commands (Page 61)).

Keystroke combination You can input commands quickly in the MCC editor using keystroke combinations. The keystroke combinations available in the MCC editor are listed in Annex Key combinations (Page 528). The online help system is called up with the keystroke combination Shift+F1 or F1.

Page 37: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Software interface 2.3 Operator input options

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 37

Drag&drop Variables can be moved from the detail view (Symbol browser tab) to the input field using a drag-and-drop operation. Left-click the line number of the variable you wish to move. The line with the variable is selected. Keeping the left mouse button depressed, drag the line number into the input field of the parameter screen form. As soon as you release the left mouse button, the variable will be inserted at the appropriate position.

Figure 2-2 Inserting a variable with drag-and-drop

Page 38: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Software interface 2.4 Settings for the MCC editor

SIMOTION MCC Motion Control Chart 38 Programming and Operating Manual, 03/2007

2.4 Settings for the MCC editor You can adjust important properties of the MCC editor to suit your individual requirements. Select Options > Settings, and the MCC editor tab. • In the case of conditions or a variable assignment, you can define the valid language

setting on opening. Possible settings are LAD, FBD, or Formula. • The Display only known types in declaration list check box allows you to choose which

function blocks are displayed as data types in the declaration tables of the MCC source files and MCC charts. – When the check box is selected, the declaration table contains only function blocks

that are defined in the same MCC source file or in linked source files or libraries. – When the check box is cleared, the declaration table contains all function blocks

defined in the project.

Figure 2-3 Settings for the MCC editor

2.5 Calling up the online help The online help can provide assistance for many of the operating steps. Call up the online help using either the: • Help menu

– Help topics – Context-sensitive help – Getting Started

• Using the Help button in an open parameter screen form • Using the F1 button for general help • Using keystroke combination Shift+F1 for context-sensitive help

Page 39: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 39

MCC Source Files and MCC Charts 3This chapter describes how to create and work with an MCC source file containing MCC charts.

3.1 General MCC source files are assigned to the SIMOTION device on which they will subsequently be run (e.g., SIMOTION C230). They are stored in the project navigator under the SIMOTION device in the PROGRAMS folder. MCC charts are the individual programming units (program, function, function block) in an MCC source file. They are stored under the MCC source file in the project navigator.

Note ST source files and LAD/FBD programs etc. are also stored in the PROGRAMS folder under the SIMOTION device. For a description of the SIMOTION ST (Structured Text) programming language, refer to the SIMOTION ST Programming Manual. For a description of the SIMOTION LAD (Ladder Diagram) and SIMOTION FBD (Function Block Diagram) programming languages, refer to the SIMOTION LAD/FBD Programming Manual.

3.2 Inserting and managing MCC source files

3.2.1 Inserting a new MCC source file You can insert a new MCC source file in the following ways: • In the project navigator: in the PROGRAMS folder using the Insert MCC source file

element • via the menu Insert -> Program -> MCC Source File • via the context menu Insert new object -> MCC program source • Using the Insert MCC source file button on the MCC source file toolbar

Page 40: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart 40 Programming and Operating Manual, 03/2007

Proceed as follows To insert a new MCC source file using the context menu, proceed as follows: 1. Select the PROGRAMS folder of the relevant SIMOTION device in the project navigator. 2. Select the Insert new object > MCC program source file command on the context menu. 3. Enter the name of the MCC source file.

The names of program source files must comply with the rules for identifiers: They consist of letters (A to Z, a to z), numbers (0 to 9), or single underscores (_) in any order, whereby the first character must be a letter or an underscore. The letters are not case-sensitive. The permissible length of the name depends on the version of the SIMOTION kernel: – Version V4.1 and higher of the SIMOTION kernel: a maximum of 128 characters – Version V4.0 and below of the SIMOTION kernel: a maximum of 8 characters Names must be unique within the SIMOTION device.

4. If necessary, select the Compiler tab and make any local compiler settings (see Selecting compiler options (Page 48)).

5. You can also enter an author, version, and a comment. 6. Click OK to confirm.

Notice When you click OK, the MCC source file will only be transferred to the project. The data are not saved to disk, together with the project, unless you select Project > Save or Project > Save and compile all.

Page 41: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 41

Figure 3-1 Creation dialog for a new MCC source file

Figure 3-2 New MCC source file (declaration table for the interface and implementation sections)

Page 42: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart 42 Programming and Operating Manual, 03/2007

3.2.2 Opening existing MCC source files All existing MCC source files are located in the PROGRAMS folder in the project navigator. To open an MCC source file, do one of the following: • Double-click the name of the source file • Select Open in the shortcut menu when the MCC source file is selected. The MCC source file (declaration table) is opened in the working window. Multiple MCC source files can be opened.

3.2.3 Transferring and compiling an MCC source file

Procedure: 1. To transfer an MCC source file with its associated MCC charts to the project and start its

compilation, proceed as follows: 2. Make sure that the MCC source file or one of the associated MCC charts is the active

window in the Workbench. Select one of the following menu commands: – Transfer and compile button in the MCC source file or MCC editor toolbar – MCC source file > Transfer and compile menu item or MCC chart > Transfer and

compile menu item Alternative way of saving and compiling: • Select the MCC source file or an MCC chart in the project navigator; then, in the shortcut

menu, select Transfer and compile.

Notice Pay attention to the order of the MCC charts in an MCC source file. A subroutine (function or function block) must be defined before it is used. This is the case when the MCC chart of the subroutine appears above the chart in which it is used in the project navigator If necessary, reorder the charts (see Specifying the order of MCC charts in the MCC source file (Page 54)). The Transfer and compile command transfers the changes in the MCC source file and associated MCC charts to the project only. The data are not saved to disk, together with the project, unless you select Project > Save or Project > Save and compile all.

You can also save (export) an MCC source file outside the project (see Exporting and importing an MCC source file (Page 45)). Error messages and warnings relating to compilation are displayed in the Compile/check output tab in the detail view.

Page 43: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 43

Note If certain commands (for example, Synchronous Start, Uninterruptible Variable Assignment) are included in the MCC chart, UserInterruptTask_1 must be configured in the execution system in order to ensure error-free compilation. You must program the error reactions to these commands in UserInterruptTask_1. If you receive an applicable error message, proceed as follows: 1. Insert an MCC chart for a program, and program the appropriate error reactions. 2. Assign the program to UserInterruptTask_1.

MCC source file toolbar This toolbar contains important command buttons for an MCC source file:

Figure 3-3 MCC source file toolbar

3.2.4 Closing an open MCC source file To close an open MCC source file in the working window, do one of the following: • Click the x button in the header • Select the MCC source file > Close menu command • Select the Window > Close All Windows menu command If the changes have not yet been saved in the project, you can save or cancel them, or abort the close operation.

Page 44: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart 44 Programming and Operating Manual, 03/2007

3.2.5 Cutting, copying, and deleting an MCC source file You can cut or copy an MCC source file and all of its associated MCC charts and paste them under the same or a different SIMOTION device. An MCC source file that has been deleted cannot be pasted.

Proceed as follows Follow these steps: 1. Select the MCC source file in the project navigator. 2. In the context menu, select the appropriate item (Cut, Copy, or Delete).

3.2.6 Pasting a cut or copied MCC source file

Proceed as follows To paste a cut or copied MCC source file, proceed as follows: 1. Under the SIMOTION device, select the PROGRAMS folder. 2. In the context menu, select Insert.

The MCC source file is pasted (with a different name, if necessary). 3. Change the name, if necessary (see Renaming MCC source files (Page 47)).

3.2.7 Know-how protection for MCC source files You can protect MCC source files from access by unauthorized third parties. Then, a password must be entered in order to open or view the protected MCC source files and associated MCC charts. For procedures on how to set up know-how protection, refer to the SIMOTION online help.

Note MCC charts from know-how-protected MCC source files cannot be exported as plain text files (as an MCC chart or ST source file). However, they can still be exported in XML format.

Page 45: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 45

3.2.8 Exporting and importing an MCC source file The export and import functions offer you the option of saving an MCC source file outside the project on your hard disk so that you can copy it from there into another project. You can export an MCC source file as a text file for the SIMOTION ST (Structured Text) programming language. You can either import this file as an ST source file or edit it with any ASCII editor. You can also export/import an MCC source file as an encoded XML file.

See also Exporting an MCC source file as an ST source file (Page 45) Exporting an MCC source file in XML format (Page 45) Importing an MCC source file from XML data (Page 46)

3.2.8.1 Exporting an MCC source file as an ST source file

Proceed as follows You can export an MCC source file as a text file for the SIMOTION ST (Structured Text) programming language. You can either import this file as an ST source file or edit it with any ASCII editor. 1. Select the MCC source file in the project navigator. 2. In the context menu, select Export > As ST. 3. Select the directory and file name.

Note Text files for the ST programming language cannot be imported as MCC source files. Know-how-protected MCC source files cannot be exported as plain text files (as an ST source file). However, they can still be exported in XML format.

3.2.8.2 Exporting an MCC source file in XML format

Proceed as follows This operation allows you to save an MCC source file in encoded form in a directory outside the project. 1. Select the MCC source file in the project navigator. 2. Select Expert > Save Project and Export Object in the context menu. 3. Select the directory for the XML export and confirm withOK.

Page 46: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart 46 Programming and Operating Manual, 03/2007

Notice MCC in SIMOTION SCOUT Version 3.2 and higher permits structures (e.g., multiple charts in one source file, source-file-internal unit variables) that are not supported in earlier versions.

Note Know-how-protected MCC source files can also be exported in XML format. The know-how protection is retained when the files are imported.

3.2.8.3 Importing an MCC source file from XML data

Proceed as follows This operation allows you to import MCC source files that were exported as encoded files in XML format. 1. If applicable, insert a new MCC source file (see Inserting a new MCC source file

(Page 39)). 2. Select the MCC source file in the project navigator. 3. In the context menu, select Expert > Import Object. 4. Select the XML data to be imported. The imported XML data overwrite the existing data in the selected MCC source file. The entire project is saved and recompiled.

Note Individual objects (e.g., MCC source files) from a project that was exported as XML data cannot be imported selectively.

Page 47: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 47

3.2.9 Properties of an MCC source file

Proceed as follows The properties of an MCC source file are already defined when you insert it. However, these properties can be viewed and modified by doing the following: 1. Select the MCC source file in the project navigator. 2. In the shortcut menu, select Properties.

Figure 3-4 Properties of an MCC source file

3.2.9.1 Renaming MCC source files To rename an MCC source file, proceed as follows: 1. Open the Properties window of the MCC source file. 2. Click the ... button 3. Click OK to confirm.

Page 48: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart 48 Programming and Operating Manual, 03/2007

3.2.9.2 Using test functions You can make use of various test functions (single step or program status) during program execution by doing the following: 1. Select the Compiler tab. 2. Make the necessary settings (see Selecting compiler options (Page 48)). These functions facilitate debugging of your program.

3.2.10 Viewing the current compiler options You can view the current compiler options by doing the following: 1. Open the Properties window of the MCC source file. 2. Select the Compiler tab. 3. Click OK to confirm.

3.2.11 Selecting compiler options

Proceed as follows To select the compiler options, proceed as follows: 1. Open the Properties window of the MCC source file. 2. Enter settings. 3. Click OK to confirm.

Figure 3-5 Local compiler settings for MCC source files in the Properties window

Page 49: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 49

Table 3-1 Local compiler settings

Parameter Description Ignore global settings Affects:

• Warning classes • Selective linking • Use preprocessor • Enable program status • Permit language extensions • Only create program instance data once Active: Only the selected local settings apply. The global settings are ignored. Inactive: The respective global setting (Options > Settings > Compiler menu command) can be accepted. The corresponding checkbox is grayed out.

Suppress warnings In addition to error messages, the compiler can output warnings. You can set the scope of the warning messages to be outputted: Active: The compiler outputs the warning messages according to the selection in the global settings of the warning classes. The checkboxes of the warning classes can no longer be selected. Inactive: The compiler outputs the warning messages according to the following selection of the warning classes.

Warning classes1 Only for Suppress warnings = inactive. Active: The compiler outputs warning messages of the selected class. Inactive: The compiler suppresses warning messages of the respective class. Grey background: The displayed global setting is adopted (only for Ignore global settings = inactive). For the meaning of warning classes, see the SIMOTION ST Programming and Operating Manual.

Selective linking1 Active: Unused code is removed from the executable program. Inactive: Unused code is retained in the executable program. Grey background: The displayed global setting is adopted (only for Ignore global settings = inactive).

Use preprocessor1 Active: The preprocessor is used (see SIMOTION ST Programming Manual). Inactive: Preprocessor is not used. Grey background: The displayed global setting is adopted (only for Ignore global settings = inactive).

Enable program status1 Active: Additional program code is generated to enable monitoring of program variables (including local variables) (see Program status (Page 502)). Inactive: Program status not possible. Grey background: The displayed global setting is adopted (only for Ignore global settings = inactive).

Permit language extensions1 Active: Language elements are permitted that do not comply with IEC 61131-3. Inactive: Only language elements are permitted that comply with IEC 61131-3. Grey background: The displayed global setting is adopted (only for Ignore global settings = inactive).

Page 50: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.2 Inserting and managing MCC source files

SIMOTION MCC Motion Control Chart 50 Programming and Operating Manual, 03/2007

Parameter Description Only create program instance data once1

Active: The local variables of a program are only stored once in the user memory of the unit. The setting is required when a further program is to be called within a program. Inactive: The local variables of a program are stored according to the task assignment in the user memory of the respective task. Grey background: The displayed global setting is adopted (only for Ignore global settings = inactive). See the SIMOTION ST Programming and Operating Manual.

Enable OPC-XML Symbol information for the unit variables of the ST source file interface section are available in the SIMOTION device (required for the _exportUnitDataSet and _importUnitDataSet functions; see the SIMOTION Basic Functions Function Manual).

Permit single step When active, additional program code is generated, which enables individual program steps to be monitored. This function facilitates debugging of your program. See Tracking single program steps (Page 500).

1 Global setting is also possible (Options > Settings > Compiler menu), see SIMOTION ST Programming and Operating Manual.

Page 51: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.3 Inserting and managing MCC charts

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 51

3.3 Inserting and managing MCC charts MCC charts are displayed in the project navigator under the respective MCC source file.

3.3.1 Inserting a new MCC chart You can insert a new MCC chart for an existing MCC source file in any of the following ways: • In the project navigator: below an MCC source file using the Insert MCC chart command • Using the Insert > Program > MCC chart menu command • In the context menu using the Insert new object > MCC chart command • In the MCC editor toolbar using Insert MCC chart

Proceed as follows To insert a new MCC chart using the context menu, proceed as follows: 1. The MCC source file must already exist. 2. Select the relevant MCC source file in the project navigator. 3. In the context menu, select Insert new object > MCC chart. 4. Enter the name of the MCC chart (see Rules for identifiers in Keywords for variable types

(Page 97)). 5. For creation type, select Program. For creation types Function and Function block, see

Example of executing a subroutine (Page 124). 6. Select the Exportable check box.

This check box must be selected in order to assign the program to a task. 7. You can also enter an author, version, and a comment. 8. Click OK to confirm.

Notice When you click OK, the MCC chart will only be transferred to the project. The data are not saved to disk, together with the project, unless you select Project > Save or Project > Save and compile all.

Page 52: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.3 Inserting and managing MCC charts

SIMOTION MCC Motion Control Chart 52 Programming and Operating Manual, 03/2007

Figure 3-6 Dialog box for creating a new MCC chart

Figure 3-7 New MCC chart with declaration table and starting and end nodes

3.3.2 Opening an existing MCC chart All existing MCC charts for an MCC source file are located in the project navigator below the relevant MCC source file. To open an MCC chart, do one of the following: • Double-click the name of the chart • Select Open in the shortcut menu when the MCC chart is selected. The MCC chart is opened in the working window. Multiple MCC charts can be opened.

Page 53: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.3 Inserting and managing MCC charts

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 53

3.3.3 Transferring and compiling an MCC chart You cannot compile an MCC chart independently. The MCC source file is always compiled with all of its associated MCC charts (see Transferring and compiling an MCC source file (Page 42)).

3.3.4 Closing an open MCC chart To close an open MCC chart in the working window, do one of the following: • Click the x button in the header • Select the MCC chart > Close menu command • Select the Window > Close All Windows menu command If the changes have not yet been saved in the project, you can save or cancel them, or abort the close operation.

3.3.5 Cutting, copying, and deleting an MCC chart You can cut or copy an MCC chart and paste it under the same or a different MCC source file (as well as under a different SIMOTION device). An MCC chart that has been deleted can no longer be pasted.

Proceed as follows Follow these steps: 1. Select the MCC chart in the project navigator. 2. In the context menu, select the appropriate item (Cut, Copy, or Delete).

3.3.6 Pasting a cut or copied MCC chart

Proceed as follows Proceed as follows to paste a cut or copied MCC chart: 1. Select an MCC source file in the project navigator. 2. In the context menu, select Insert.

The MCC chart is inserted with a different name. 3. Change the name, if necessary (see Renaming MCC charts (Page 56)).

Page 54: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.3 Inserting and managing MCC charts

SIMOTION MCC Motion Control Chart 54 Programming and Operating Manual, 03/2007

3.3.7 Specifying the order of MCC charts in the MCC source file The order of the MCC charts in the MCC source file is important for compilation. A POU (e.g., a function) must be defined before it is used.

Proceed as follows To change the order: 1. Select an MCC chart in the project navigator. 2. In the shortcut menu, select Up/Down.

3.3.8 Exporting and importing an MCC chart The export and import functions offer you the option of saving an MCC chart outside the project on your hard disk so that you can copy it from there into another project. If you have exported an MCC chart using an older software version, it can be imported and processed with any of the later software versions.

3.3.8.1 Exporting an MCC chart in XML format This operation allows you to save an MCC chart in encoded form in a directory outside the project.

Proceed as follows 1. Select the MCC chart in the project navigator. 2. Select Expert > Save Project and Export Object in the context menu. 3. Select the directory for the XML export and confirm withOK.

Notice MCC in SIMOTION SCOUT Version 3.2 and higher permits structures (e.g., multiple charts in one source file, source-file-internal unit variables) that are not supported in earlier versions.

Note Know-how-protected MCC charts can also be exported in XML format. The know-how protection is retained when the files are imported.

Page 55: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.3 Inserting and managing MCC charts

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 55

3.3.8.2 Importing an MCC chart from XML data This operation allows you to import an MCC chart that was exported as a decoded file in XML format.

Proceed as follows 1. Insert a new MCC chart, if necessary (Inserting a new MCC chart (Page 51)). 2. Select the MCC chart in the project navigator. 3. In the context menu, select Expert > Import Object. 4. Select the XML data to be imported. The imported XML data overwrite the existing data in the selected MCC chart. The entire project is saved and recompiled.

Note Individual objects (e.g., MCC charts) that were exported as XML data cannot be imported selectively.

3.3.8.3 Importing an MCC chart This operation imports an MCC chart that was exported as an MCC chart from a project of an earlier version into an existing MCC source file.

Proceed as follows 1. Select the relevant MCC source file in the project navigator. 2. In the context menu, select Import MCC Chart > From MCC Format. 3. Select the directory and file name (name.mcc).

The dialog window for inserting an MCC chart is displayed. 4. Enter the name of the MCC chart in the project. If the existing technology objects do not match the MCC chart to be imported, it is possible to create them later.

Page 56: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.3 Inserting and managing MCC charts

SIMOTION MCC Motion Control Chart 56 Programming and Operating Manual, 03/2007

3.3.9 Properties of an MCC chart

Proceed as follows The properties of an MCC chart are already defined when you insert it. However, these properties can be viewed and modified by doing the following: 1. Select the MCC chart in the project navigator. 2. In the shortcut menu, select Properties.

Figure 3-8 Properties of an MCC chart

3.3.9.1 Renaming MCC charts To change the name of an MCC chart, proceed as follows: 1. Open the Properties window of the MCC chart. 2. Click the... button 3. Click OK to confirm.

3.3.9.2 Changing the creation type of the MCC chart To change the creation type of an MCC chart, proceed as follows: 1. Open the Properties window of the MCC chart. 2. Select the new creation type (Program, Function or Function block). 3. Click OK to confirm.

Page 57: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.3 Inserting and managing MCC charts

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 57

3.3.9.3 Changing usability in other charts (export capability) To change the export capability of an MCC chart, proceed as follows: 1. Open the Properties window of the MCC chart. 2. If required, select the Exportable check box.

With activated checkbox, the MCC chart can be used in other program sources (e.g. MCC units, ST source files). A program can be assigned to a task only when this check box is selected (see assigning programs to a task (Page 485)). When the check box is cleared, the MCC chart can only be used in the associated MCC source file.

3. Click OK to confirm.

Page 58: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC Source Files and MCC Charts 3.3 Inserting and managing MCC charts

SIMOTION MCC Motion Control Chart 58 Programming and Operating Manual, 03/2007

Page 59: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 59

Programming in MCC 44.1 Programming an MCC chart

This chapter contains detailed instructions on how to program in the MCC language.

4.2 Principles of programming

4.2.1 General principles of programming Every new MCC chart already contains a starting and an end node. You program commands and instructions between these two nodes. The commands you program are executed from the starting node in the direction of the end node.

Motion commands Motion commands are executed based the transition behavior and step enabling conditions that are selected in the parameter screen forms. Motion commands can be issued from all tasks. The overall status of an axis motion is recorded in the system and can be queried at any time using system variables. A command can be waiting, active, or inactive.

Wait commands Execution of the task is delayed until the programmed event (that is, the condition) occurs. The program is not executed again cyclically, and the task does not require any processor time. All other tasks continue to run unaffected. The events are scanned in the interpolator cycle clock (IPO cycle clock). If the appropriate event occurs, the highest-priority task in its own level is continued. In the case of MotionTasks, the subsequent motion command is executed in the following IPO cycle clock.

Page 60: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.2 Principles of programming

SIMOTION MCC Motion Control Chart 60 Programming and Operating Manual, 03/2007

4.2.2 Simplified example of programming principles Axis_3 will move to absolute position 1,000 mm at a velocity of 100 mm/s. As soon as output 1 is switched, axis_3 will move back to position 0 mm.

Figure 4-1 Example of programming principles

Page 61: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.3 Managing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 61

4.3 Managing MCC commands

4.3.1 inserting commands You can insert commands into the MCC chart using one of the following: • MCC editor toolbar • MCC Chart > Insert menu command

MCC editor toolbar This toolbar contains important programming command buttons (for example, Insert MCC Chart, Accept and Compile, and Monitor) together with the complete range of commands. The commands are subdivided into seven command groups.

Figure 4-2 MCC editor toolbar

Each of these groups is represented by a button on the toolbar. The list of commands is displayed when you move the cursor over the button; you can insert the appropriate command by clicking it with the left mouse button.

Page 62: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.3 Managing MCC commands

SIMOTION MCC Motion Control Chart 62 Programming and Operating Manual, 03/2007

Figure 4-3 Inserting a command from the MCC editor toolbar

You can detach the displayed command list using the cursor and place it anywhere on the screen. It will then be easily accessible while you are creating your program. If all of the command lists have been detached, every command can be inserted in the MCC chart with one click. The figure below shows a working window with an MCC chart and opened command lists.

Figure 4-4 Opened command lists in the Workbench making every command available with one

mouse click

The command that is selected and thus programmed is always inserted after the highlighted command.

Page 63: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.3 Managing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 63

4.3.2 Representation of commands in the MCC chart Commands are represented as a rectangular block. The starting and end nodes are oval, the conditions are diamond-shaped. All commands are assigned a symbol that graphically represents the command function. The commands are also color-coded:

Color Commands Light blue Basic commands White Subroutines and module creation Green Start commands Red Stop commands

The figure below shows how most of the commands are represented in an MCC chart. The symbolic representation of commands makes it immediately obvious that axis_1 is being positioned. You can modify the brief comment if desired.

Figure 4-5 Representation of a motion command in the MCC chart

Brief comment The brief comment is used to document the MCC chart or the command. It is preset with the name of the relevant command. Clicking the text allows you to change it, if necessary. There is no maximum text length. The text length that can be displayed on the screen is dependent on the following factors: • Font size and type • Screen resolution

Page 64: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.3 Managing MCC commands

SIMOTION MCC Motion Control Chart 64 Programming and Operating Manual, 03/2007

Command comment You can enter an additional comment for each command: • On the shortcut menu, select Insert comment. • Enter the text of the comment in the displayed window. • Click OK to confirm. If a command comment is present, a green indicator appears at the top right of the command.

Comment block In addition, there is also a separate command for entering comments (see Comment block (Page 187)).

4.3.3 Translating comments Brief comments and command comments can be translated into various languages and displayed. To do so, use the Project > Language-Dependent Texts menu command. Select MCC comments as the text source. The remaining steps are presented in the online help.

4.3.4 Numbering of commands When a command is inserted, it is automatically assigned a serial number. This number is unique and is used to identify the command, for example, in the cross-reference list.

Note The user is not able to change this number. A number that is freed up after deletion of a command is reassigned only after the MCC chart has been saved and closed and then reopened.

4.3.5 Selecting commands If you wish to copy a command, for example, you must select it beforehand. You select a command by clicking it. You can select several commands by moving the cursor over them with the left mouse button depressed. If you wish to select all of the commands, use Select All in the context menu. Selected commands are identified by a thick blue border; in addition, the border of the last selected command flashes.

Page 65: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.3 Managing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 65

4.3.6 Hiding and displaying commands You can hide commands for test purposes; hidden commands are excluded from the code generation process and are unavailable for selection. Follow these steps: 1. Select the commands you want to hide. 2. On the shortcut menu, select Mask Out. If you hide a control structure, all of the commands it contains and their parameters are also hidden. To show hidden commands again, proceed as follows: 1. Select the commands you want to show. 2. On the shortcut menu, select Display.

4.3.7 Copying, deleting, cutting, or pasting commands The functions Copy, Delete etc. can be selected either from the context menu or the Edit menu. If you copy or cut a command and then paste it, the programmed parameters are also copied or cut and pasted. You can also paste the copied command into other MCC charts. You cannot paste a command that has been deleted.

Note If you delete a command by mistake, you can undo the delete operation. Select the Edit > Undo menu command.

If you copy a control structure, all of the commands it contains and their parameters are also copied. The same applies when Delete, Cut, or Paste is used.

Page 66: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.3 Managing MCC commands

SIMOTION MCC Motion Control Chart 66 Programming and Operating Manual, 03/2007

4.3.8 Undo/redo All actions can be undone in reverse order. Select the Edit > Undo menu command or the Undo button.

Notice The following actions cannot be undone: • Save • Accept and compile

If you want to redo one or more undone actions, use the Edit > Redo menu command or the Redo button.

4.3.9 Module creation

Modules are used to structure the MCC chart. Modules comprise a number of interrelated commands that are joined to make one single command. This feature allows even complex MCC charts to be structured in a clear, easily readable fashion. A module can contain all types of commands. You can also nest modules and copy them for multiple use in different charts. Programming sections to be included in multiple programs (MCC charts) must be swapped out as subroutines (see Example of executing a subroutine (Page 124)).

See also Procedure for creating a module (Page 67) Opening and closing a module (Page 68) Canceling a module (Page 68) Changing the module structure (Page 68)

Page 67: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.3 Managing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 67

4.3.9.1 Procedure for creating a module You can use two different methods to create a module: • You can insert an empty module using the appropriate MCC editor toolbar command.

You can then open the module by double-clicking it or using the context menu, and program the commands.

• You can use the shortcut menu command directly to combine existing commands in the MCC chart to form a module:

Figure 4-6 Combining existing commands to create a module

Page 68: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.3 Managing MCC commands

SIMOTION MCC Motion Control Chart 68 Programming and Operating Manual, 03/2007

4.3.9.2 Opening and closing a module The module opens when you double-click the module command or select Zoom in to Module in the context menu. Close the module again by selecting Zoom out of module on the shortcut menu.

Figure 4-7 Opened module

4.3.9.3 Canceling a module You can cancel the module by selecting Cancel module in the shortcut menu. The commands previously grouped in the module are then displayed in the MCC chart instead of the module command.

4.3.9.4 Changing the module structure If you wish to change the module structure, cancel the existing modules and create new ones.

Page 69: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 69

4.4 Processing MCC commands

4.4.1 Assigning command parameters All commands are assigned parameters in parameter screen forms. The structure of the parameter screen forms varies depending on the command.

Opening the parameter screen form To open a parameter screen form, double-click the command or select Parameterize Command in the context menu. You can open and edit any number of parameter screen forms from the same or different charts. Changes in the symbol browser and in the project structure and commissioning are possible while a parameter screen form is open.

Structure of parameter screen forms for motion commands The axis that is to be moved or stopped must always be specified in the top half of the box. The center section contains different input fields and selection lists relating to the axis motion or stop commands. For reasons of clarity, this section contains several tabs. You need only assign the parameters in the first tab to obtain an executable command. All of the other tabs are optional and designed for special settings (such as jerk, acceleration, velocity profile, etc.). The lower half of the box contains the settings for the transition behavior of the previous command and the step enabling condition for the next command.

Page 70: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart 70 Programming and Operating Manual, 03/2007

Figure 4-8 Parameter screen form for a motion command

The number of commands in the parameter screen form (presentation and selection options) depend on the following: • Configuration data and system variables of the selected technology object (seeExpert tab

(Page 75)) • Entries you have already made in the parameter screen form See footnote 2 in table

Selection list (combo box) (Page 71).

Structure of parameter screen forms for conditions and branches You can program conditions and branches in the MCC editor using the LAD, FBD, or Formula languages (see Insert variable (Page 144)).

Page 71: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 71

4.4.2 Input fields and selection lists

4.4.2.1 Input field Each input field must contain one of the following entries: • Value

In many cases, the entered value is checked for a maximum value that was specified during configuration of the technology object. This value is displayed in the tooltip.

• Unit variables (of the MCC source file) and global device variables or I/O variables These can be moved from the symbol browser to the input field with a drag-and-drop operation (see Formula (Page 150)).

• Local variables of the MCC chart • Formula

You can drag commands and functions from the command library with a drag-and-drop operation (see Using the command library (Page 152)).

4.4.2.2 Selection list (combo box) Combo boxes provide different selection options. Frequently occurring selection options are listed in the following table below.

Table 4-1 Frequently selected options in combo boxes

Selectable options Significance Default The preassigned value in the associated system variable is used.

Preassigned values can be defined during configuration of the technology object (see online help). The Set Axis Parameter (Page 310) command is used to change frequently used preassigned Axis values.

Last programmed The last programmed value is entered. Last programmed velocity For velocities only:

The last programmed velocity is applied. For superimposed motion, the velocity of the base motion and the superimposition are added up.

Current For velocities only: The active axis velocity is applied. Use for on-the-fly transitions and substitute motions.

Note Not all of the options listed here are available in every case. Note the following regarding the "preassigned value" and "last programmed" selection options: If the display of additional fields in the parameter screen form depends on this entry, these fields may not be displayed or some selection options may not be available.

Page 72: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart 72 Programming and Operating Manual, 03/2007

4.4.2.3 Editable selection list (editable combo box) Editable selection lists are used for inputting values associated with physical variables (such as position and velocity). They are always linked to a unit of measure. • Select an entry from the selection options offered (see Selection list (combo box)

(Page 71)). or • Enter the value directly in the same way as in an entry field (as a value, variable, or

formula). To do this, select the entry in the selection list and overwrite it.

Note When you select "%" in the "Unit" selection field: note that the value entered represents a percentage of the associated preassigned value.

4.4.2.4 Unit Here you can select what the value in the adjacent editable selection list represents. The following are available: • The unit of the physical quantity defined during configuration of the technology object

The value in the adjacent field represents a physical quantity with the indicated unit. • "%" (percentage)

The value in the adjacent field represents a percentage of the associated preassigned value.

Page 73: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 73

4.4.3 Dynamics tab The parameter dialog boxes for most of the motion commands include a Dynamics tab. Here you can specify the velocity profile type and the associated values for acceleration, deceleration, and jerk.

Figure 4-9 Dynamics tab for motion commands

Overview of parameters for

Table 4-2 Overview of parameters for Dynamics tab

Field/Button Explanation/instructions Velocity profile The velocity profile is used to specify the transitions between the

individual motion phases. The velocity profile influences the motion transitions as follows: • At the start and end of the acceleration phase, the transition to the

constant acceleration or constant velocity phase • At the start and end of the deceleration phase, the transition to the

constant deceleration or constant velocity phase Select the velocity profile. Trapezoidal A trapezoidal velocity profile is in effect for the command. Only the acceleration and deceleration can be programmed. Constant The velocity profile with smooth acceleration characteristic is in effect for the command. The change in acceleration/deceleration (jerk) can be verified. With the Gearing command (Gearing on (Page 376)), a constant velocity profile only takes effect if configuration data syncingMotion.smoothAbsoluteSynchronization = YES is set. Preassigned value Last programmed See Selection list (combo box) (Page 71) The system variable for the preassigned value is given together with the description of each command.

Page 74: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart 74 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Acceleration The acceleration value during the constant acceleration phase

Enter the value in the editable selection list. Preassigned value Last programmed See Selection list (combo box) (Page 71) The system variable for the preassigned value is given together with the description of each command.

Deceleration Deceleration value during the constant deceleration phase Enter the value in the editable selection list. Preassigned value Last programmed See Selection list (combo box) (Page 71) The system variable for the preassigned value is given together with the description of each command.

Jerk Only active with constant velocity profile. Change in acceleration or deceleration • At acceleration start • At acceleration end • At deceleration start • At deceleration end Enter the value in the editable selection list () Selection list (combo box) (Page 71). Preassigned value Last programmed See Selection list (combo box) (Page 71) The system variable for the preassigned value is given together with the description of each command.

Velocity Not always included in the Dynamics tab. Velocity value during the constant velocity phase Enter the value in the editable selection list. Preassigned value Last programmed velocity Current See Selection list (combo box) (Page 71) The system variable for the preassigned value is given together with the description of each command.

Page 75: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 75

Field/Button Explanation/instructions Constant traversing time Only for the Start axis position-controlled and Speed specification

commands. A time limit can be programmed for this command. • Select the check box if the movement of the axis is to be time limited.

If you do not select the check box, the axis moves until it receives a new command.

• Enter the duration of the constant motion phase (from the end of acceleration up to the start of deceleration). At the end of this time, the axis is decelerated until its speed reaches 0.

If no time is specified, then the axis moves until it receives a new command.

See also Input field (Page 71) Time for deceleration Only for the Stop Axis command

Duration of braking operation for a quick stop within a defined time period Enter the value in the editable selection list (Selection list (combo box) (Page 71)). Preassigned value Last programmed See Selection list (combo box) (Page 71) System variable for preassigned value: userDefaultDynamics.stopTime

4.4.4 Expert tab The parameter dialog boxes for many motion commands contain an Expert tab. The content of this tab depends on the motion command: • You can define the variable for the CommandID. • You can view configuration data or system variables that affect the parameter dialog box. • You can define the variable to which the return value is written (return variable).

Figure 4-10 Expert tab for motion commands

Page 76: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart 76 Programming and Operating Manual, 03/2007

Overview of parameters for

Table 4-3 Overview of parameters for Expert tab

Field/Button Explanation/instructions CommandID variable The status of many motion commands can be tracked using the unique,

project-wide CommandId. • If you enter the name of a variable of data type CommandIdType, you

can track the command status with this variable. The variables of this data type that were declared previously in the MCC source file or MCC chart are available for selection. • When the Assign value check box is selected, a unique project-

wide CommandId is automatically generated, stored in the variables, and transferred to the command.

You can use the stored CommandId to track the command status until the command has been completed properly or has been aborted.

• When the Assign value check box is cleared, only the variable is transferred to the command. You must take steps to ensure that a unique project-wide CommandId is stored in the variable. You obtain the CommandId with the _getCommandId system function.

In addition, you can buffer the CommandId in this case so that it is available even after the command has been completed.

• If you leave the field empty, the CommandID is not assigned to any variables; this means that you cannot access the CommandID (default).

When the field is empty, the Assign value check box must be selected. Dialog box adaptation The technology object configuration data or system variables that affect

the parameter screen form (presentation or selection options) are displayed in the List for dialog adaptation. If you have selected (e.g. in a library) a variable of a technology object data type as the technology object (), you can select a value in order to adapt the parameter screen form to the properties of the technology object. This selection does not change the configuration data or system variables of the technology object.

Return variable Many commands are mapped onto one or more system functions (command steps). These usually have a return value that provides information to the user on the result of the system function. For each command step, you can specify a return variable in which the respective return value is stored: • When you enter the name of a variable of the specified data type, the

return value of the command step is stored in this variable. The variables of this data type that were declared previously in the MCC source file or MCC chart are available for selection.

A reference to the documentation describing the meaning of the individual values is given for each command.

• If you leave the field empty, the return value of the command step is assigned to an internal variable that you cannot access (default).

See also Relevant system function, system variable, or command in the ST programming language (Page 81) and Return values (Page 82)

Page 77: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 77

Table 4-4 List for dialog adaptation

Field/Button Explanation/instructions Parameter Indicates the name of the field for the technology object whose

configuration data or system variables affect the parameter dialog box. Object Indicates the technology object selected in the parameter dialog box. Property Name Indicates the configuration datum or system variable affecting the

parameter dialog box. Plain text Indicates the meaning of the configuration data or system variable. Value The behavior depends on whether the technology object is defined on the

SIMOTION device or whether it is a variable of the data type of a technology object: • If the technology object is defined on the SIMOTION device:

The value defined during configuration is indicated. • If the technology object is a variable of the data type of a technology

object:

You can select a value from among the values of the enumeration data type of the configuration datum or the system variable.

The parameter dialog box is presented according to the selected value.

This selection does not affect the configuration data or system variables of the technology object.

See also Gearing on (Page 376)

Page 78: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart 78 Programming and Operating Manual, 03/2007

4.4.5 Transition behavior and step enabling condition The transition behavior for all motion commands must be indicated by the motion command that is currently active on the axis. The transition behavior always relates to motion commands on the same axis irrespective of the program that issued the commands. You can also program a step enabling condition to the next command in the flow chart.

4.4.5.1 Transition behavior from the currently active motion command For motion commands, you specify the transition behavior from the command that is currently active on the axis. The table shows the transition behavior of the currently active command on the axis (thick line = programmed command, thin line = active command on the axis):

Transition behavior Graph Description Substitute

The programmed command is executed immediately. The active command is aborted.

Attach

The programmed motion is attached to the active motion for this axis. Pending commands will be executed.

Attach, delete pending command

The programmed motion is attached to the active motion for this axis. Pending commands will be discarded.

Blending The transition from the velocity of the active command to that of the programmed command takes place smoothly when deceleration begins in the active command. Therefore the active command should be programmed with step enabling condition Start of deceleration phase.

Superimpose The programmed and active motions are superimposed. The command does not affect superimposed motions that are already active. The motion is started immediately.

Page 79: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 79

4.4.5.2 Delay program execution (step enabling condition) This check box determines when the next command is to be executed. MCC is optimized for sequential programming; therefore, the default setting for this check box is "active". The next command in the chart is otherwise executed immediately afterwards. The table shows the step enabling conditions to the subsequent command (thin line = programmed command, thick line = subsequent command):

Wait for ... Graph Description Motion start The next command is started when the currently programmed

motion begins. Acceleration end The next command is started when the acceleration phase for

the active motion ends. Speed/velocity reached

The next command is started when the speed/velocity for the active motion is reached.

Start of deceleration phase

The next command is started when the deceleration phase for the active motion begins.

End of setpoint interpolation

The next command is started when setpoint interpolation for the active motion has ended.

Motion is finished Axis stopped

The next command is started when the active motion has been completed (e.g., the minimum dwell time of the actual value in the configured position window around the target position has elapsed).

Axis synchronized The next command is started when the axis is synchronized for the active motion.

Axis homed

The next command is started when the zero mark is detected for the active homing motion.

Note You can query the current status of the axis by means of system variables. For a selection with corresponding values, see Axis status (Page 167).

Page 80: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart 80 Programming and Operating Manual, 03/2007

4.4.5.3 Example of transition behavior and step enabling condition

Figure 4-11 Example of transition behavior and step enabling condition

Page 81: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 81

Note The status of a motion command can be queried using the CommandID variable. This may be necessary, in particular, if a transition to the next command is made before a motion has been completed (Delay program execution parameter is deactivated or set to an appropriate value, such as Motion Start, Velocity Reached). The following system functions can be used for this purpose: • For querying single axis commands:

_getStateOfAxisCommand _getMotionStateOfAxisCommand

• For querying commands for synchronous operation and camming: _getStateOfFollowingObjectCommand _getMotionStateOfFollowingObjectCommand

For a description of the functions, refer to the SIMOTION Cam Technology Package, System Functions, Parameter Manual.

ST commands can be programmed using the System Function Call (System function call (Page 174)) or ST Zoom (ST zoom (Page 177)) command, for example.

4.4.6 Closing the parameter screen form Click OK to close the parameter dialog box. The syntax of the assigned command is checked when you close the screen form. Any errors are displayed.

Note When a syntax check is performed on an MCC command, the declaration tables in the MCC chart and the MCC source file are also read. Inconsistent data within the declaration tables may therefore cause unexpected error messages during parameter assignment.

4.4.7 Relevant system function, system variable, or command in the ST programming language Each MCC command is mapped to a system function, an ST programming language command, or a value assignment to a system variable. This is specified for each MCC command. For system function, the way in which the parameters of the MCC command are assigned to the parameters of the system function is also specified.

Page 82: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart 82 Programming and Operating Manual, 03/2007

4.4.8 Return values Many commands are mapped onto one or more system functions (command steps). These usually have a return value that provides information to the user on the result of the system function. For these MCC commands, you can specify a return variable in which the respective return value is stored for each command step in the Expert tab (Expert tab (Page 75)) • When you enter the name of a variable of the specified data type, the return value of the

command step is stored in this variable. The variables of this data type that were declared previously in the MCC source file or MCC chart are available for selection. A reference to the documentation describing the meaning of the individual values is given for each command.

• If you leave the field empty, the return value of the command step is assigned to an internal variable that you cannot access (default).

4.4.8.1 Return value for the system functions of the technology packages The return values for the system functions of the Cam, Path and Cam_EXT technology packages are described in the table.

Table 4-5 Description of return value for Cam, Path and Cam_EXT technology package functions

Error code Significance 0 No error 1 Invalid command parameter 2 Invalid range information in command parameters 3 Command aborted 4 Unknown command 5 Command cannot be executed due to current object state 6 Command aborted due to termination of user task 7 Command rejected due to suspension of command interpretation of the addressed

technology object 8 Command aborted due to full command buffer 9 Insufficient memory 10 A connection to a technology object required for this operation does not exist 11 No object configuration 12 The error to be reset cannot be reset due to its configuration 13 Axis is not homed 14 Measurement job on virtual axis not possible 15 Ambiguous commandId 16 Command not implemented 17 Read access denied 18 Write access denied 19 Command argument not supported 20 The cam has already been interpolated and cannot be manipulated 21 The interpolation condition was violated

Page 83: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.4 Processing MCC commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 83

Error code Significance 22 The programmed jerk is 0 23 The alarm to be deleted is not present 24 Command not possible on a virtual axis 25 A synchronized start of this command is not possible 26 Higher-level command was aborted because it is not permitted by the active

command 27 Time exceeded during communication with the drive 28 Actual values are not valid 29 This command cannot be executed when velocity control is active 30 This command cannot be executed when position control is active 31 This command cannot be executed in torque-reduced operation or during travel to

fixed limit stop 32 This command can only be executed when force/pressure control is active 33 This command cannot be executed when force/pressure control is active 34 This command can only be executed when pressure limiting is active 35 Master values are not valid 36 Slave values are not valid 37 No slave value can be determined for a master value 38 No master value can be determined for a slave value 39 This command cannot be executed when synchronous operation is inactive 40 This command cannot be executed with non-synchronous operation 41 This command can be executed when gearing is active 42 This command cannot be executed when camming is inactive 43 This command can only be used for an interpolated cam 44 This command cannot be executed when pressure limiting is active 45 Insufficient interpolation points are available to interpolate the cam 46 The specified path point cannot be reached due to restrictions of the kinematics. 47 Path axis values are not valid. 48 Maximum number of active commands exceeded. ≥10000 Internal error.

Page 84: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.5 General information about variables and data types

SIMOTION MCC Motion Control Chart 84 Programming and Operating Manual, 03/2007

4.5 General information about variables and data types

4.5.1 Overview of variable types The following table shows all the variable types available for programming with ST. • System variables of the SIMOTION device and the technology objects • Global user variables (I/O variables, device-global variables, unit variables) • Local user variables (variables within a program, a function or a function block)

System variables Variable type Significance System variables of the SIMOTION device System variables of technology objects

Each SIMOTION device and technology object has specific system variables. These can be accessed as follows: • Within the SIMOTION device from all programs • From HMI devices You can monitor system variables in the symbol browser.

Global user variables Variable type Meaning I/O variables You can assign symbolic variable names to the I/O addresses of the SIMOTION device or

the peripherals. This allows you to have the following direct accesses to the I/O: • Within the SIMOTION device from all programs • From HMI devices You create these variables in the symbol browser after you have selected the I/O element in the project navigator. You can monitor I/O variables in the symbol browser.

Global device variables User-defined variables which can be accessed by all SIMOTION device programs and HMI devices. You create these variables in the symbol browser after you have selected the GLOBAL DEVICE VARIABLES element in the project navigator. Global device variables can be defined as retentive. This means that they will remain stored even when the SIMOTION device power supply is disconnected. You can monitor global device variables in the symbol browser.

Page 85: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.5 General information about variables and data types

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 85

Variable type Meaning Unit variables User-defined variables that all programs (programs, function blocks, and functions) can

access within a unit (source file). You declare these variables in the declaration table of the source file: • In the interface section:

After connection, these variables are also available in other units (e.g., MCC source files, ST source files, and LAD/FBD source files), as well as on HMI devices (maximum size of the interface section: 64 Kbytes).

• In the implementation section: You can access these variables only within the source file.

You can declare unit variables as retentive. This means that they will remain stored even when the SIMOTION device power supply is disconnected. You can monitor unit variables in the symbol browser.

Local user variables Variable type Meaning User-defined variables that can only be accessed within the program/chart (program,

function, function block) in which they were defined. Variable of a program (program variable)

Variable is declared in a program. The variable can only be accessed within this program. A differentiation is made between static and temporary variables: • Static variables are initialized according to the memory area in which they are stored.

Specify this memory area by means of a compiler option. By default, the static variables are initialized depending on the task to which the program is assigned (see SIMOTION Basic Functions Function Manual).

You can monitor static variables in the symbol browser. • Temporary variables are initialized every time the program in a task is called.

Temporary variables cannot be monitored in the symbol browser. Variable of a function (FC variable)

Variable is declared in a function (FC). The variable can only be accessed within this function. FC variables are temporary; they are initialized each time the FC is called. They cannot be monitored in the symbol browser.

Variable of a function block (FB variable)

Variable is declared in a function (FB). The variable can only be accessed within this function block. A differentiation is made between static and temporary variables: • Static variables retain their value when the FB terminates. They are initialized only when

the instance of the FB is initialized; this depends on the variable type with which the instance of the FB was declared.

You can monitor static variables in the symbol browser. • Temporary variables lose their value when the FB terminates. The next time the FB is

called, they are reinitialized.

Temporary variables cannot be monitored in the symbol browser.

Page 86: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.5 General information about variables and data types

SIMOTION MCC Motion Control Chart 86 Programming and Operating Manual, 03/2007

4.5.2 Scope of the declarations

Scope of variable and data type declarations according to location of declaration Location of declaration What can be declared here Scope Symbol browser • Global device variables

• I/O variables The declared variables are valid in all units (e.g., ST source files, MCC source files, LAD/FBD source files) of the SIMOTION device. All programs, function blocks, and functions in all units of the device can access the variables.

Interface section of the unit1 • Unit variables • Data types • Symbolic accesses to the fixed

process image of the BackgroundTask

The declared variables, data types, etc., are valid in the entire unit (e.g., ST source file, MCC source file, LAD/FBD source file); all programs, function blocks, and functions within the unit can access them. In addition, they are also available in other units after connection.

Implementation section of the unit1

• Unit variables • Data types • Symbolic accesses to the fixed

process image of the BackgroundTask

The declared variables, data types, etc., are valid in the entire unit (e.g., ST source file, MCC source file, LAD/FBD source file); all programs, function blocks, and functions within the source file can access them.

POU (program/ function block/ function)2

• Local variables • Data types • Symbolic accesses to the fixed

process image of the BackgroundTask

The declared variables, data types, etc., can only be accessed within the POU in which they were declared.

1 MCC and LAD/FBD programming languages: in the declaration table of the respective source file. 2 MCC and LAD/FBD programming languages: in the declaration table of the respective chart/program.

4.5.3 Rules for identifiers Names for variables, data types, charts/programs must comply with the following rules for identifiers: 1. They are made up of letters (A to Z, a to z), numbers (0 to 9), and underscores ( _ ). 2. The first character must be a letter or underscore. 3. This can be followed by as many letters, digits or underscores as needed in any order. 4. Exception: You must not use more than one underscore in a row 5. Both upper and lower case letters are allowed. No distinction is made between upper and

lower case notation (thus, for example, Anna and AnNa are regarded as identical).

Page 87: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.5 General information about variables and data types

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 87

4.5.4 Frequently used arrays in declarations

4.5.4.1 Array length and array element An array is a chain of variables of the same type that can be addressed with the same name and different indices. By entering an array length N, you set up the variable as an array [1 to N]. You can enter constant positive integer values. If the array is empty, a single variable is set up rather than an array.

Example definition of an array in the declaration table

Figure 4-12 Definition of an array in the declaration table

Example of use of array elements in a variable assignment

Figure 4-13 Use of array elements in a variable assignment

4.5.4.2 Initial value You can specify an initialization value in this column. You can specify this initialization value as a constant or an expression. The following are permissible: • Constants • Arithmetic operations • Bit slice and data conversion functions

Table 4-6 Preassignment of array elements

10(1) 10 array elements [1 to 10] are preset to the same value. 1,2,3,4,5 5 array elements [1 to 5] are preset to different values.

Variables with technology object data types are always initialized with TO#NIL. For variables of data type followingAxis, select the associated synchronous object (variable of data type followingObjectType).

Page 88: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart 88 Programming and Operating Manual, 03/2007

4.5.4.3 Comments A comment can be entered in this column. It may contain any characters or special characters.

4.6 Data types

4.6.1 General A data type is used to determine how the value of a variable or constant in a program source file is to be used. The following data types are available to the user: • Elementary data types • User-defined data types (UDT)

– Enumerators – Structures (Struct)

• Technology object data types • System data types

Page 89: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 89

4.6.2 Elementary data types

4.6.2.1 Elementary data types Elementary data types define the structure of data that cannot be broken down into smaller units. An elementary data type describes a memory area with a fixed length and stands for bit data, integers, floating-point numbers, duration, time, date and character strings. All the elementary data types are listed in the table below:

Table 4-7 Bit widths and value ranges of the elementary data types

Type Reserv. word Bit width Range of values Bit data type Data of this type use either 1 bit, 8 bits, 16 bits or 32 bits. The initialization value of a variable of this data type is 0.

Bit BOOL 1 0, 1 or FALSE, TRUE Byte BYTE 8 16#0 to 16#FF Word WORD 16 16#0 to 16#FFFF

Double word DWORD 32 16#0 to 16#FFFF_FFFF Numeric types These data types are available for processing numeric values. The initialization value of a variable of this data type is 0 (all integers) or 0.0 (all floating-point numbers).

Short integer SINT 8 -128 to 127 (-2**7 to 2**7-1) Unsigned short integer USINT 8 0 to 255 (0 to 2**8-1) Integer INT 16 -32_768 to 32_767 (-2**15 to 2**15-1) Unsigned integer UINT 16 0 to 65_535 (0 to 2**16-1) Double integer DINT 32 -2_147_483_648 to 2_147_483_647 (-2**31 to 2**31-1) Unsigned double integer

UDINT 32 0 to 4_294_96_7295 (0 to 2**32-1)

Floating-point number (per IEEE -754)

REAL 32 -3.402_823_466E+38 to -1.175_494_351E−38, 0.0, +1.175_494_351E−38 to +3.402_823_466E+38 Accuracy: 24-bit mantissa, corresponds to 6 decimal places

Long floating-point number (in accordance with IEEE-754)

LREAL 64 −1.797_693_134_862_315_8E+308 to −2.225_073_858_507_201_4E308, 0.0, +2.225_073_858_507_201_4E−308 to +1.797_693_134_862_315_8E+308 Accuracy: 53-bit mantissa, corresponds to 15 decimal places

Page 90: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart 90 Programming and Operating Manual, 03/2007

Type Reserv. word Bit width Range of values Time types These data types are used to represent various date and time values.

Duration in increments of 1 ms

TIME 32 T#0d_0h_0m_0s_0ms to T#49d_17h_2m_47s_295ms Maximum of two digits for the values day, hour, minute, second and a maximum of three digits for milliseconds Initialization with T#0d_0h_0m_0s_0ms

Date in increments of 1 day

DATE 32 D#1992-01-01 to D#2200-12-31 Leap years are taken into account, year has four digits, month and day are two digits each Initialization with D#0001-01-01

Time of day in steps of 1 ms

TIME_OF_DAY (TOD)

32 TOD#0:0:0.0 to TOD#23:59:59.999 Maximum of two digits for the values hour, minute, second and maximum of three digits for milliseconds Initialization with TOD#0:0:0.0

Date and time DATE_AND_TIME (DT)

64 DT#1992-01-01-0:0:0.0 to DT#2200-12-31-23:59:59.999 DATE_AND_TIME consists of the data types DATE and TIME Initialization with DT#0001-01-01-0:0:0.0

String type Data of this type represents character strings, in which each character is encoded with the specified number of bytes. The length of the string can be defined at the declaration. Indicate the length in "[" and "]", e.g. STRING[100]. The default setting consists of 80 characters. The number of assigned (initialized) characters can be less than the declared length. String with 1

byte/character STRING 8 All characters with ASCII code $00 to $FF are permitted.

Default ’ ’ (empty string)

Notice During variable export to other systems, the value ranges of the corresponding data types in the target system must be taken into account.

Page 91: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 91

4.6.2.2 Value range limits of elementary data types The value range limits of certain elementary data types are available as constants.

Table 4-8 Symbolic constants for the value range limits of elementary data types

Symbolic constant Data type

Value Hex notation

SINT#MIN SINT -128 16#80SINT#MAX SINT 127 16#7FINT#MIN INT -32768 16#8000INT#MAX INT 32767 16#7FFFDINT#MIN DINT -2147483648 16#8000_0000DINT#MAX DINT 2147483647 16#7FFF_FFFFUSINT#MIN USINT 0 16#00USINT#MAX USINT 255 16#FFUINT#MIN UINT 0 16#0000UINT#MAX UINT 65535 16#FFFFUDINT#MIN UDINT 0 16#0000_0000UDINT#MAX UDINT 4294967295 16#FFFF_FFFFREAL#MIN REAL +1.175_494_351E−38 16#0080_0000REAL#MAX REAL +3.402_823_466E+38 16#7F7F_FFFFLREAL#MIN LREAL +2.225_073_858_507_201_4E−308 16#0010_0000_0000_0000LREAL#MAX LREAL +1.797_693_134_862_315_8E+308 16#7FEF_FFFF_FFFF_FFFFT#MIN TIME#MIN

TIME T#0ms 16#0000_0000

T#MAX TIME#MAX

TIME T#49d_17h_2m_47s_295ms 16#FFFF_FFFF

TOD#MIN TIME_OF_DAY#MIN

TOD TOD#00:00:00.000 16#0000_0000

TOD#MAX TIME_OF_DAY#MAX

TOD TOD#23:59:59.999 16#0526_5BFF

Page 92: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart 92 Programming and Operating Manual, 03/2007

4.6.2.3 General data types General data types are often used for the input and output parameters of system functions and system function blocks. The subroutine can be called with variables of each data type that is contained in the general data type. The following table lists the available general data types:

Table 4-9 General data types

General data type Data types contained ANY_BIT BOOL, BYTE, WORD, DWORD ANY_INT SINT, INT, DINT, USINT, UINT, UDINT ANY_REAL REAL, LREAL ANY_NUM ANY_INT, ANY_REAL ANY_DATE DATE, TIME_OF_DAY (TOD), DATE_AND_TIME (DT) ANY_ELEMENTARY ANY_BIT, ANY_NUM, ANY_DATE, TIME, STRING ANY ANY_ELEMENTARY, user-defined data types (UDT), system data types,

data types of the technology objects

Note You cannot use general data types as type identifiers in variable or type declarations. The general data type is retained when a user-defined data type (UDT) is derived directly from an elementary data type (only possible with the SIMOTION ST programming language).

Page 93: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 93

4.6.2.4 Elementary system data types In the SIMOTION system, the data types specified in the table are treated similarly to the elementary data types. They are used with many system functions.

Table 4-10 Elementary system data types and their use

Identifier Bit width Use StructAlarmId 32 Data type of the alarmId for the project-wide unique identification of

the messages. The alarmId is used for the message generation. See Function Manual SIMOTION Basic Functions. Initialization with STRUCTALARMID#NIL

StructTaskId 32 Data type of the taskId for the project-wide unique identification of the tasks in the execution system. See Function Manual SIMOTION Basic Functions. Initialization with STRUCTTASKID#NIL

Table 4-11 Symbolic constants for invalid values of elementary system data types

Symbolic constant Data type Significance STRUCTALARMID#NIL StructAlarmId Invalid AlarmId STRUCTTASKID#NIL StructTaskId Invalid TaskId

4.6.3 Declaring derived data types (UDT)

4.6.3.1 Defining user-defined data types (UDT) You can create derived data types in source files and programs: • Structures • Enumerations The scope of the data type declaration depends on the location of the declaration.

4.6.3.2 Scope of the data type declaration You create derived data types in the declaration tables of the source file or the program/chart. The scope of the data type declaration depends on the location of the declaration. • In the Interface (exported declaration) source file section of the declaration table:

The data type is valid for the entire source file; all programs/charts (programs, function blocks, and functions) within the source file can access the data type. These variables are also available, if appropriately connected, in other source files (or other units).

Page 94: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart 94 Programming and Operating Manual, 03/2007

• In the Implementation (source-internal declaration) source file section of the declaration table: The data type is valid in the source file; all programs/charts (programs, function blocks, and functions) within the source file can access the data type.

• In the declaration table of the program: The data type can only be accessed within the program/chart in which it is declared.

4.6.3.3 Defining structures You define structures in the declaration tables of the source file or the program/chart. The scope of the structures depends on the location of the declaration. To define structures, proceed as follows: 1. Select the declaration table and, if applicable, the section of the declaration table for the

desired scope. 2. Select the Structures tab. 3. Enter the name of the structure. 4. In the same line, enter:

– The name of the first element – Data type of element – Additional characteristics (array length, start value).

5. Enter additional elements of the structure in the following lines; leave the Structure name field empty.

6. Begin the definition of the new structure by entering a new name in the Structure name field.

4.6.3.4 Defining enumerations You define enumerations in the declaration tables of the source file or the program/chart. The scope of the structures depends on the location of the declaration. To define enumerations, proceed as follows: 1. Select the declaration table and, if applicable, the section of the declaration table for the

desired scope. 2. Select the Enumerations tab. 3. Enter the name of the enumeration. 4. In the same line, enter:

– The name of the first element – The initialization value of the element

5. Enter additional elements of the enumeration in the following lines; leave the Enumeration name field empty.

6. You begin the definition of the new enumeration by entering a new name in the Enumeration name field.

Page 95: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 95

4.6.4 Technology object data types

4.6.4.1 Description of the technology object data types You can declare variables with the data type of a technology object (TO). The following table shows the data types for the available technology objects in the individual technology packages. For example, you can declare a variable with the data type posaxis and assign it an appropriate instance of a position axis. Such a variable is often referred to as a reference.

Table 4-12 Data types of technology objects (TO data type)

Technology object Data type Contained in the technology package

Drive axis driveAxis CAM12, PATH, CAM_EXT External encoder externalEncoderType CAM12, PATH, CAM_EXT Measuring input measuringInputType CAM12, PATH, CAM_EXT Output cam outputCamType CAM12, PATH, CAM_EXT Cam track (V3.2 and higher) _camTrackType CAM, PATH, CAM_EXT Position axis posAxis CAM13, PATH, CAM_EXT Following axis followingAxis CAM14, PATH, CAM_EXT Following object followingObjectType CAM14, PATH, CAM_EXT Cam camType CAM, PATH, CAM_EXT Path axis (V4.1 and higher) _pathAxis PATH, CAM_EXT Path object (V4.1 and higher) _pathObjectType PATH, CAM_EXT Fixed gear (V3.2 and higher) _fixedGearType CAM_EXT Addition object (V3.2 and higher) _additionObjectType CAM_EXT Formula object (V3.2 and higher) _formulaObjectType CAM_EXT Sensor (V3.2 and higher) _sensorType CAM_EXT Controller object (V3.2 and higher) _controllerObjectType CAM_EXT Temperature channel temperatureControllerType TControl General data type, to which every TO can be assigned

ANYOBJECT

1) Version V3.1 and higher no longer contain the BasicMC, Position and Gear technology packages. 2) Up to Version V3.0, also contained in the BasicMC, Position and Gear technology packages 3) Up to Version V3.0, also contained in the Position and Gear technology packages 4) Up to Version V3.0, also contained in the Gear technology package.

You can access the elements of technology objects (configuration data and system variables) via structures (see SIMOTION Basic Functions Function Manual).

Table 4-13 Symbolic constants for invalid values of technology object data types

Symbolic constant Data type Significance TO#NIL ANYOBJECT Invalid technology object

Page 96: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.6 Data types

SIMOTION MCC Motion Control Chart 96 Programming and Operating Manual, 03/2007

4.6.4.2 Inheritance of the properties for axes Inheritance for axes means that all of the data types, system variables and functions of the TO driveAxis are fully included in the TO positionAxis. Similarly, the position axis is fully included in the TO followingAxis, the following axis in the TO pathAxis. This has, for example, the following effects: • If a function or a function block expects an input parameter of the driveAxis data type, you

can also use a position axis or a following axis or a path axis when calling. • If a function or a function block expects an input parameter of the posAxis data type, you

can also use a following axis or a path axis when calling.

4.6.5 System data types There are a number of system data types available that you can use without a previous declaration. And, each imported technology packages provides a library of system data types. Additional system data types (primarily enumerator and STRUCT data types) can be found • In parameters for the general standard functions (see SIMOTION Basic Functions

Function Manual) • In parameters for the general standard function modules (see SIMOTION Basic

Functions Function Manual) • In system variables of the SIMOTION devices (see relevant parameter manuals) • In parameters for the system functions of the SIMOTION devices (see relevant parameter

manuals) • In system variables and configuration data of the technology objects (see relevant

parameter manuals) • In parameters for the system functions of the technology objects (see relevant parameter

manuals)

Page 97: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 97

4.7 Variables Variables are an important component of programming and provide structure to programs. They are placeholders which can be assigned values that can be accessed several times in the program. Variables have: • A specific initialization behavior and scope of validity • A data type and operations which are defined for that data type User and system variables are differentiated. User variables can be defined by the user. System variables are provided by the system.

4.7.1 Keywords for variable types The various keywords for variable types are shown in the following table.

Description of keywords for variable types Keyword Description Application Global user variables (declared in the interface or implementation section of the unit1) VAR_GLOBAL Unit variable; can be accessed by all POUs within the source file.

If the variable was declared in the interface section, it can be used in another source file once a connection has been defined in its declaration table.

FB, FC, program

VAR_GLOBAL RETAIN Retentive unit variable; retained during power outage. FB, FC, programVAR_GLOBAL CONSTANT Unit constant; cannot be changed from the program. FB, FC, programLocal user variables (declared within a POU2) VAR Local variable FB, FC, programVAR_TEMP Temporary local variable FB, program VAR_INPUT Input parameters: Local variable; value is supplied from external source

and can only be read in the MCC chart. FB, FC

VAR_OUTPUT Output parameters: Local variable; value is sent to an external destination by the FB. It can be read as an instance variable after being called by the FB (FB instance name.variable name).

FB

VAR_IN_OUT In/out parameter; the FB accesses this variable directly (by means of a reference) and can change it directly.

FB

VAR CONSTANT Local constant; cannot be changed from the program. FB, FC, program1 MCC and LAD/FBD programming languages: in the declaration table of the respective source file. 2 MCC and LAD/FBD programming languages: in the declaration table of the respective chart/program.

Page 98: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart 98 Programming and Operating Manual, 03/2007

4.7.2 Defining variables Variables are defined in the symbol browser or in the declaration table of the source file or chart/program. The following table provides an overview of where the relevant variable is defined.

Definition of variables(Continued)

Variable type Defined in... Global device user variables

Symbol browser

unit variable Declaration table of the source file as VAR_GLOBAL, VAR_GLOBAL RETAIN or VAR_GLOBAL CONSTANT

Local variable Declaration table of the program/chart as: • VAR, VAR_TEMP, or VAR CONSTANT • Additionally for function blocks as VAR_INPUT, VAR_OUTPUT,

VAR_INOUT • Additionally for functions as VAR_INPUT

I/O variable Symbol browser Symbolic access to the fixed process image of the BackgroundTask

• Declaration table of the source file • Declaration table of the program/chart (programs and FB only)

4.7.2.1 Defining global device variables in the symbol browser Global device variables are user-defined variables that you can access from all program sources (e.g. ST source files, MCC units) of a SIMOTION device. Global device user variables are defined in the Symbol Browser tab of the detail view; for this purpose they must be in offline mode. Here is a brief overview of the procedure: 1. In the project navigator of SIMOTION SCOUT, select the GLOBAL DEVICE VARIABLES

element in the SIMOTION device subtree. 2. In the detail view, select the Symbol browser tab and scroll down to the end of the

variable table (empty row). 3. In the last (empty) row of the table, enter or select the following:

– Name of variable – Data type of variable (only elementary data types are permitted)

4. Optionally, you can make the following entries: – Selection of Retain checkbox (This declares the variable as retentive, so that its value

will be retained after a power failure.) – Array length (array size) – Initial value (if array, for each element) – Display format (if array, for each element)

Page 99: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 99

You can now access this variable using the symbol browser or any program of the SIMOTION device. In MCC charts, you can use a global device variable just like any other variable.

Note If you have declared unit variables or local variables of the same name (e.g. var-name), specify the global device variable with _device.var-name. An alternative to global device variables is the declaration of unit variables in a separate unit, which is imported into other units. This has the following advantages: 1. Variable structures can be used. 2. The initialization of the variables during the STOP-RUN transition is possible (via

Program in StartupTask). 3. For newly created global unit variables, a download in RUN is also possible. Please refer to the SIMOTION Basic Functions Function Manual.

4.7.2.2 Declaring a unit variable in the source file The unit variable is declared in the source file. The valid range (scope) of the variable is dependent on the section of the declaration table in which the variable is declared: • In the interface section of the declaration table (INTERFACE):

The unit variable is valid for the entire source file; all programs/charts (programs, function blocks, and functions) within the source file can access the unit variable. In addition, these variables are available on HMI devices and, once connected, in other source files (or other units), as well. The total size of all unit variables in the interface section is limited to 64 Kbytes.

• In the implementation section of the declaration table (IMPLEMENTATION): The unit variable is valid in the source file only; all programs/charts (programs, function blocks, and functions) within the source file can access the unit variable.

Proceed as follows; the source file (declaration table) is open: 1. In the declaration table, select the section for the desired scope. 2. Then select the Parameter tab. 3. Enter:

– Name of the variable – Variable type – Data type of the variable

You can select elementary data types; other data types must be entered in the appropriate field.

– Optional array length (to define the array size) – Optional initial value (initialization value)

Page 100: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart 100 Programming and Operating Manual, 03/2007

The variable is now declared and can be used immediately.

Figure 4-14 Example: Declaring a unit variable in the MCC source file

Note The declaration table of the source file is read each time parameters are assigned for a command. Inconsistent data within the declaration table can therefore cause unexpected error messages during parameter assignment.

4.7.2.3 Declaring local variables A local variable can only be accessed within the program/chart (program, function, function block) in which it is declared. Proceed as follows; the program/chart with the declaration table is open: 1. In the declaration table, select the Parameter/Variables tab. 2. Enter:

– Name of the variable – Type of variable – You can select elementary data types; other data types must be entered in the

appropriate field. – Optional array length (to define the array size) – Optional initial value (initialization value)

Page 101: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 101

The variable is now declared and can be used immediately.

Figure 4-15 Example: Declaring a local variable in the chart/program

Note The declaration table of the program/chart is read each time parameters are assigned for a command. Inconsistent data within the declaration table can therefore cause unexpected error messages during parameter assignment.

4.7.3 Time of the variable initialization The timing of the variable initialization is determined by: • Memory area to which the variable is assigned • Operator actions (e.g., source file download to the target system) • Execution behavior of the task (sequential, cyclic) to which the program was assigned. All variable types and the timing of their variable initialization are shown in the following tables. You will find basic information about tasks in the SIMOTION Basic Functions Function Manual. The behavior for variable initialization during download can be set: To do this, select the Options > Settings menu command, and the Download tab.

Note You can upload values of unit variables or global device variables from the SIMOTION device into SIMOTION SCOUT and save them in XML format. 1. Save the required data segments of the unit variables or global device variables as a data

set with the function _saveUnitDataSet. 2. Use the Save variables function in SIMOTION SCOUT. You can use the Restore variables function to download these data records and variables back to the SIMOTION device. For more information, refer to the SIMOTION SCOUT Configuring Manual. This makes it possible, for example, to obtain these data, even if they are initialized by a project download or if they become unusable (e.g. due to a version change of SIMOTION SCOUT).

Page 102: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart 102 Programming and Operating Manual, 03/2007

4.7.3.1 Initialization of retentive global variables Retentive variables retain their last value after a loss of power. All other data are reinitialized when the device is switched on again. Retentive global variables are initialized: • When the backup or buffer for retentive data fails • When the firmware is updated • When a memory reset (MRES) is performed • With the restart function (Del. SRAM) in SIMOTION P350 • By applying the _resetUnitData function (as of kernel V3.2), possible selectively for

different data segments of the retentive data • When a download is performed according to the following description

Table 4-14 Initializing retentive global variables during download

Variable type Time of the variable initialization Retentive global device variables

The behavior when downloading is dependent on the Initialization of all non-retentive data setting1: • Yes2: All retentive global device variables are initialized. • No3:

• As of version V3.2 of the SIMOTION kernel:

Separate version ID for retentive global device variables. If the version ID is changed, the retentive global device variables are initialized.

• Up to Version V3.1 of the SIMOTION kernel:

Joint version ID for all global device variables (retentive and non-retentive). If the version ID is changed, all global device variables are initialized.

Retentive unit variables of a unit

The behavior when downloading is dependent on the Initialization of all non-retentive data setting1: • Yes2: All retentive unit variables (all units) are initialized. • No3:

• As of version V3.2 of the SIMOTION kernel:

Separate version identifiers for each individual declaration block of retentive unit variables in the interface or implementation section. If this version identifier is changed, the retentive unit variables in the interface or implementation section are initialized.

• Up to Version V3.1 of the SIMOTION kernel:

Common version ID for all unit variables (retentive and non-retentive, in the interface and implementation section) of a unit. If the version ID is changed, all unit variables of this unit are initialized.

1Options > Settings menu command, Download tab. 2 The corresponding check box is selected. 3 The corresponding check box is cleared.

Page 103: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 103

See also Version ID of global variables and their initialization during download (Page 106)

4.7.3.2 Initialization of non-retentive global variables Non-retentive global variables lose their value during power outages. They are initialized: • On initialization of retentive variables, e.g., on a firmware update or general reset (MRES) • During power up • By applying the _resetUnitData function (as of kernel V3.2), possible selectively for

different data segments of the non-retentive data • When a download is performed according to the following description:

Table 4-15 Initializing non-retentive global variables during download

Variable type Time of the variable initialization Non-retentive global device variables

The behavior when downloading is dependent on the Initialization of all non-retentive data setting1: • Yes2: All non-retentive global device variables are initialized. • No3:

• As of version V3.2 of the SIMOTION kernel:

Separate version ID for non-retentive global device variables. If the version ID is changed, the non-retentive global device variables are initialized.

• Up to Version V3.1 of the SIMOTION kernel:

Joint version ID for all global device variables (retentive and non-retentive). If the version ID is changed, all global device variables are initialized.

Non-retentive unit variables of a unit

The behavior when downloading is dependent on the Initialization of all non-retentive data setting1: • Yes2: All non-retentive unit variables (all units) are initialized. • No3:

• As of version V3.2 of the SIMOTION kernel:

Separate version identifiers for each individual declaration block of non-retentive unit variables in the interface or implementation section. If this version identifier is changed, the non-retentive unit variables in the interface or implementation section are initialized.

• Up to Version V3.1 of the SIMOTION kernel:

Common version ID for all unit variables (retentive and non-retentive, in the interface and implementation section) of a unit. If the version ID is changed, all unit variables of this unit are initialized.

1Options > Settings menu command, Download tab. 2 The corresponding check box is selected. 3 The corresponding check box is cleared.

See also Version ID of global variables and their initialization during download (Page 106)

Page 104: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart 104 Programming and Operating Manual, 03/2007

4.7.3.3 Initialization of local variables Local variables are initialized: • When retentive unit variables are initialized • When non-retentive unit variables are initialized • Also, according to the following description

Table 4-16 Initializing local variables when calling the program organizational unit

Variable type Time of the variable initialization Local program variables

Local variables of programs are initialized differently: • Static variables (VAR) are initialized according to the memory area in which they are stored.

Refer to the initialization of static program variables. • Temporary variables (VAR_TEMP) are initialized every time the program of the task is called.

Local variables of function blocks (FB)

Local variables of function blocks are initialized differently: • Static variables (VAR, VAR_IN, VAR_OUT) are only initialized when the FB instance is

initialized. • Temporary variables (VAR_TEMP) are initialized every time the FB instance is called.

Local variables of functions (FC)

Local variables of functions are temporary and are initialized every time the function is called.

4.7.3.4 Initialization of instances of function blocks (FBs) The initialization of a function block instance is determined by the location of its declaration: • Like a non-retentive unit variable • Like a local variable of programs • Like a local variable of function blocks An FB instance can be declared within a function block.

Note You can obtain information about the memory requirements of a POU in the local data stack using the Program Structure function.

Page 105: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 105

4.7.3.5 Initialization of system variables of technology objects The system variables of a technology object are usually not retentive. Depending on the technology object, a few system variables are stored in the retentive memory area (e.g. absolute encoder calibration). The initialization behavior (except during a download) is the same as that of retentive or non-retentive global variables (see retentive global variables; non-retentive global variables). The behavior during the download is shown below for: • Non-retentive system variables • Retentive system variables

Table 4-17 Initializing technology object system variables during download

Variable type Time of the variable initialization Non-retentive system variables

Behavior during download, depending on the Initialization of all non-retentive datasetting1: • Yes2: All technology objects are initialized.

• All technology objects are restructured and all non-retentive system variables are initialized.

• All technological alarms are cleared. • No3: Only technology objects changed in SIMOTION SCOUT are initialized.

• The technology objects in question are restructured and all non-retentive system variables are initialized.

• All alarms that are pending on the relevant technology objects are cleared. • If an alarm that can only be acknowledged with Power On is pending on a technology

object that will not be initialized, the download is aborted. Retentive system variables

The Initialization of all retentive data setting1 does not have any influence on the behavior during downloading. Only if a technology object was changed in SIMOTION SCOUT, will its retentive system variables be initialized. The retentive system variables of all other technology objects are retained (e.g. absolute encoder calibration).

1Options > Settings menu command, Download tab. 2 The corresponding check box is selected. 3 The corresponding check box is cleared.

Page 106: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart 106 Programming and Operating Manual, 03/2007

4.7.3.6 Version ID of global variables and their initialization during download

Table 4-18 Version ID of global variables and their initialization during download

Data segment As of Version V3.2 of the SIMOTION kernel Up to Version V3.1 of the SIMOTION kernel

Global device variables Retentive global device variables

Non-retentive global device variables

• Separate version ID for each data segment of the global device variables

• This version ID changes in response to the following changes within the data segment: • Addition or removal of a variable • Changing the data type of a variable

• This version ID does not change on: • Changes in other data segments • Changes to initialization values1

• During downloading2, the rule is: Initialization of a data segment only if its version ID has changed.

• Use of the functions for data backup and initialization possible

• Common version ID for all data segments of the global device variables.

• This version ID changes when the variable declaration is changed in a data segment.

• During downloading2, the rule is: Initialization of all data segments if the version ID changes

• Use of the functions for data backup not possible.

Unit variables of a unit Retentive unit variables in the interface section Retentive unit variables in the implementation section Non-retentive unit variables in the interface section

Non-retentive unit variables in the implementation section

• Separate version ID for each declaration block within a data segment.

• This version ID changes in response to the following changes within the data block: • Addition or removal of a variable • Changing the data type of a variable • Change of a data type definition used in the

data block (from a separate or imported3 unit)

• This version ID does not change on: • Addition of other declaration blocks • Changes in other data blocks • Changes to initialization values1 • Changes to data type definitions that are not

used in the data block • Changes to functions

• During downloading2, the rule is: Initialization of a data block only if its version ID has changed.

• Functions for data backup and initialization take into account the version ID of the declaration blocks.

• Common version ID for all global declarations in a unit

• This version ID changes in response to the following changes: • Variable declaration in a data

segment • Declaration of global data types

in the unit • Declaration in the interface

section of an imported3 unit. • During downloading2, the rule is:

Initialization of all data segments if the version ID changes

• Use of the functions for data backup only possible for: Non-retentive unit variables in the interface section

1 Changed initial values are not effective until the data segment in question is initialized. 2 If initialization of all retentive data = No and Initialization of all non-retentive data = No. In the case of other settings: see the sections for retentive and non-retentive global variables in Timing of the variable initialization. 3 For import and export, refer to See-also link below.

Page 107: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.7 Variables

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 107

See also Connections to other program source files or libraries (Page 121)

4.7.3.7 Initialization of static program variables The following versions affect the following static variables: • Local variables of a unit program declared with VAR • Function block instances declared with VAR within a unit program, including the

associated static variables (VAR, VAR_INPUT, VAR_OUTPUT). The initialization behavior is determined by the memory area in which the static variables are stored. This is determined by the Create program instance data only once compiler option. • For the non-activated Create program instance data only once (standard) compiler

option: The static variables are stored in the user memory of each task, which is assigned to the program. The initialization of the variables thus depends on the execution behavior of the task to which the program is assigned (see SIMOTION Basic Functions Function Manual): – Sequential tasks (MotionTasks, UserInterruptTasks, SystemInterruptTasks,

StartupTask, ShutdownTask): The static variables are initialized every time the task is started.

– Cyclic tasks (BackgroundTask, SynchronousTasks, TimerInterruptTasks): The static variables are initialized one time only during the transition from STOP to RUN.

• For the activated Create program instance data only once compiler option: The static variables are stored only once in the user memory of the task. They are thus initialized together with the non-retentive unit variables (see Initialization of non-retentive global variables). This setting is necessary if a program is to be called within a program.

See also Selecting compiler options (Page 48)

Page 108: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart 108 Programming and Operating Manual, 03/2007

4.8 Access to inputs and outputs (process image, I/O variables)

4.8.1 Overview of access to inputs and outputs You can access the SIMOTION device inputs and outputs as well as the central and distributed I/O: • Via direct access with I/O variables

You define an I/O variable (name and I/O address). The entire address range can be used. It is preferable to use direct access with sequential programming (in MotionTasks); access to current input and output values at a particular point in time is especially important in this case.

• Via the process image of cyclic tasks using I/O variables A memory area in the RAM of the SIMOTION device, on which the address space of the SIMOTION device is mapped. The mirror image is refreshed with the assigned task and is consistent throughout the entire cycle. It is used preferentially when programming the assigned task (cyclic programming). Define an I/O variable (name and I/O address) and assign a task to it. The entire address area of the SIMOTION device can be used. Direct access to this I/O variable is still possible: Specify direct access with _direct.var-name.

• Using the fixed process image of the BackgroundTask A memory area in the RAM of the SIMOTION device on which a subset of the I/O address space is mapped. The mirror image is refreshed with the BackgroundTask and is consistent throughout the entire cycle. It is used preferentially when programming the BackgroundTask (cyclic programming). The address range 0 .. 63 can be used, except for the process image of the cyclic tasks.

Note An access via the process image is more efficient than direct access.

Page 109: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 109

4.8.2 Important features of direct access and process image access

Table 4-19 Important features of direct access and process image access

Direct access Access to process image of cyclic tasks

Access to fixed process image of the BackgroundTask

Permissible address range

Entire address range of the SIMOTION device Exception: I/O variables comprising more than one byte must not contain addresses 63 and 64 contiguously (example: PIW63 or PQD62 are not permitted). The addresses used must be present in the I/O and appropriately configured.

0 .. 63, except for the addresses used in the process image of cyclic tasks Addresses that are not present in the I/O or have not been configured can also be used.

Assigned task None. Cyclic task for selection: • SynchronousTasks, • TimerInterruptTasks, • BackgroundTask.

BackgroundTask.

Updating • Onboard I/O of SIMOTION devices C230-2, C240, and P350:

Update occurs in a cycle clock of 125 µs.

• I/O via PROFIBUS DP, PROFINET, P-Bus, and DRIVE-CLiQ as well as Onboard I/O of the D4xx SIMOTION devices:

Update occurs in the position control cycle clock.

Inputs are read at the start of the cycle clock. Outputs are written at the end of the cycle clock.

Update occurs with the assigned task: • Inputs are read before the

assigned task is started and transferred to the process input image.

• Process output image is written to the outputs after the assigned task has been completed.

An update is made with the BackgroundTask: • Inputs are read before the

BackgroundTask is started and is transferred to the process input image.

• Process output image is written to the outputs when the BackgroundTask is complete.

– During the entire cycle of the assigned task. Exception: Direct access to output occurs.

Consistency

Consistency is only ensured for elementary data types. When using arrays, the user is responsible for ensuring data consistency.

During the entire cycle of the BackgroundTask. Exception: Direct access to output occurs.

Use Preferred in MotionTasks Preferred in the assigned task Preferred in the BackgroundTask

Declaration as variable

Necessary, for the entire device in the symbol browser Possible, but not necessary: • For the entire device in the

symbol browser, • As unit variable, • As local variable in a

program. Write protection for outputs

Possible; Read only status can be selected.

Not supported. Not supported.

Page 110: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart 110 Programming and Operating Manual, 03/2007

Direct access Access to process image of cyclic tasks

Access to fixed process image of the BackgroundTask

Declaration of arrays Possible. Not supported. Error during access from user program, alternative reactions available: • CPU stop1 • Substitution value • Last value

Error during generation of process image, alternative reactions available: • CPU stop1 • Substitution value • Last value

Error during generation of process image, reaction: CPU stop1. Exception: If a direct access has been created at the same address, the behavior set there applies.

Responses in the event of an error

Please refer to the SIMOTION Basic Functions function description Use the absolute address

Not supported. Supported

Access • In RUN mode Without any restrictions. Without any restrictions. Without any restrictions. • During

StartupTask Possible with restrictions: • Inputs can be read. • Outputs are not written until

StartupTask is complete.

Possible with restrictions: • Inputs are read at the start

of the StartupTask. • Outputs are not written until

StartupTask is complete.

Possible with restrictions: • Inputs are read at the start

of the StartupTask. • Outputs are not written until

StartupTask is complete. • During

ShutdownTask Without any restrictions. Possible with restrictions:

• Inputs retain status of last update

• Outputs are no longer written.

Possible with restrictions: • Inputs retain status of last

update • Outputs are no longer

written. 1 Call the PeripheralFaultTask.

Page 111: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 111

4.8.3 Direct access and process image of cyclic tasks Direct access to inputs and outputs and access to the process image of the cyclic task always take place via I/O variables. Features: See Important features of direct access and process image access.

Table 4-20 Address range of SIMOTION devices for direct access and process image of cyclic tasks according to SIMOTION Kernel version

Address range for SIMOTION Kernel version SIMOTION device Up to V3.0 V3.1, V3.2 V4.0 and higher

C230-2 0 .. 1023 0 .. 2047 4 0 .. 2047 4 C240 – – 0 .. 4096 4

D410 1 – – 0 .. 16383 4 5 D4252 – 0 .. 4095 4 0 .. 16383 4 5 D4353 0 .. 1023 0 .. 4095 4 0 .. 16383 4 5 D4452 – 0 .. 4095 4 0 .. 16383 4 5 P350 0 .. 1023 0 .. 2047 4 0 .. 4095 4

1 Available as of V4.1. 2 Available as of V3.2. 3 Available as of V3.0 4 For distributed I/O (over PROFIBUS DP), the transmission volume is restricted to 1024 bytes per PROFIBUS DP line. 5 For distributed I/O (over PROFINET), the transmission volume is restricted to 4096 bytes per PROFINET segment.

Note Observe the rules for I/O addresses for direct access and the process image of the cyclical tasks.

See also Important features of direct access and process image access (Page 109) Rules for I/O addresses for direct access and the process image of the cyclical tasks (Page 112)

Page 112: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart 112 Programming and Operating Manual, 03/2007

4.8.3.1 Rules for I/O addresses for direct access and the process image of the cyclical tasks You must observe the following rules for the I/O variable addresses for direct access and the process image of the cyclic tasks. Compliance with the rules is checked during the consistency check of the SIMOTION project (e.g. during the download). 1. Addresses used for I/O variables must be present in the I/O and configured appropriately

in the HW Config. 2. I/O variables comprising more than one byte must not contain addresses 63 and 64

contiguously. The following I/O addresses are not permitted: Inputs: PIW63, PID61, PID62, PID63 Outputs: PQW63, PQD61, PQD62, PQD63

3. All addresses of an I/O variable comprising more than one byte must be within an address area configured in HW-config.

4. An I/O address (input or output) can only be used by a single I/O variable of data type BYTE, WORD or DWORD or an array of these data types. Access to individual bits with I/O variables of data type BOOL is possible.

5. If several processes (e.g. I/O variable, technology object, PROFIBUS message frame) access an I/O address, the following applies: – All processes must access with the same data type (BYTE, WORD or DWORD or

ARRAY of these data types). Access to individual bits is possible irrespective of this. – Only a single process can have write access to an I/O address of an output (data type

BYTE, WORD or DWORD). Read access to an output with an I/O variable that is used by another process for write access, is possible.

– Write access to different bits of an address is possible from several processes; however, write access with the data types BYTE, WORD or DWORD is then not possible.

4.8.3.2 Creating I/O variables for direct access or process image of cyclic tasks You create I/O variables in the symbol browser of the detail view; to do this, you must be working in offline mode. Here is a brief overview of the procedure: 1. In the project navigator of SIMOTION SCOUT, select the I/O element in the subtree of the

SIMOTION device. 2. In the detail view, select the Symbol browser tab and scroll down to the end of the

variable table (empty row). 3. In the last (empty) row of the table, enter or select the following:

– Name of variable – I/O address according to the syntax in the syntax for entering I/O addresses – Optional for outputs:

Activate the Read only checkbox if you only want to have read access to the output. You can then read an output that is already being written by another process (e.g. output of an output cam, PROFIBUS message frame).

Page 113: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 113

A read-only output variable cannot be assigned to the process image of a cyclic task. – Data type of the variables (see possible data types of the I/O variables).

4. Optionally, you can also enter or select the following (not for data type BOOL): – Array length (array size) – Process image or direct access:

Can only be assigned if the Read only checkbox is cleared. For process image, select the cyclic task to which you want to assign the I/O variable. In order to be able to select a task, it must be enabled in the runtime system and a program must be assigned to it. For direct access, select the blank entry.

– Strategy for the behavior in an error situation (see SIMOTION Basic Functions Function Manual).

– Substitute value (if array, for each element) – Display format (if array, for each element)

You can now access this variable using the symbol browser or any program of the SIMOTION device.

Notice Note the following for the process image for cyclic tasks: • A variable can only be assigned to one task. • Each byte of an input or output can only be assigned to one variable. In the case of data type BOOL, please note: • The process image for cyclic tasks and a strategy for errors cannot be defined. The

behavior defined via an I/O variable for the entire byte is applicable (default: direct access or CPU stop).

• The individual bits of an I/O variable can also be accessed using the bit access functions.

Note I/O variables can only be created in offline mode. You create the I/O variables in SIMOTION SCOUT and then use them in your program sources (e.g. ST sources, MCC charts, LAD/FBD sources). Note that you can read and write outputs but you can only read inputs. Before you can monitor and modify new or updated I/O variables, you must download the project to the target system.

Page 114: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart 114 Programming and Operating Manual, 03/2007

See also Syntax for entering I/O addresses (Page 114) Possible data types of I/O variables (Page 115)

4.8.3.3 Syntax for entering I/O addresses

Syntax for inputting I/O addresses (with data type and input/output identifier)

Permissible address range Data type Input Output Direct access Process image e.g. direct access

D435 V4.1 BOOL PIn.x PQn.x n: 0 .. MaxAddr

0 .. 7 -1 n:

x: 0 .. 16383 0 .. 7

BYTE PIBn PQBn x : 0 .. MaxAddr n: 0 .. MaxAddr n: 0 .. 16383 WORD PIWn PQWn n: 0 .. 62

64 .. MaxAddr - 1 n: 0 .. 62

64 .. MaxAddr - 1 n: 0 .. 62

64 .. 16382 DWORD PIDn PQDn n: 0 .. 60

64 .. MaxAddr - 3 n: 0 .. 60

64 .. MaxAddr - 3 n: 0 .. 60

64.. 16380 n = logical address x = bit number MaxAddr = Maximum I/O address of SIMOTION device depending on the SIMOTION Kernel version. Examples: Input at logic address 1022, data type WORD: PIW1022

Output at logical address 63, bit 3, BOOL data type: PQ63.3 1 For data type BOOL, it is not possible to define the process image for cyclic tasks. The behavior defined via an I/O variable for the entire byte is applicable (default: direct access).

Page 115: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 115

4.8.3.4 Possible data types of I/O variables

Possible data types of I/O variables for direct access and process image of cyclic tasks depending on the data type of the I/O address

Data type of I/O address Possible data types for I/O variables BOOL (PIn.x, PQn.x) BOOL BYTE (PIBn, PQBn) BYTE, SINT, USINT WORD (PIWn, PQWn) WORD, INT, UINT DWORD (PIDn, PQDn) DWORD, DINT, UDINT

4.8.4 Access to fixed process image of the BackgroundTask The fixed process image of the BackgroundTask is a memory area in the random access memory (RAM) of the SIMOTION device on which a subset of the I/O address space is mapped. It is preferably used for programming the BackgroundTask (cyclic programming) as it is consistent throughout the entire cycle. Features: See table of Important features of direct access and process image access. The size of the fixed process image of the BackgroundTask for all SIMOTION devices is 64 bytes (address range 0 ... 63).

Notice Addresses that are accessed with the process image of cyclic tasks must not be used. These addresses cannot be read or written to with the fixed process image of the BackgroundTask. The rules for I/O addresses for direct access and the process image of the cyclical tasks do not apply. The accesses to the fixed process image of the BackgroundTask are not taken into account during the consistency check of the project (e.g. during download). Addresses not present in the I/O or not configured in HW Config are treated like normal memory addresses.

You can access the fixed process image of the BackgroundTask by means of: • Absolute PI access: The absolute PI access identifier contains the address of the

input/output and the data type. • Symbolic PI access: You declare a variable that references the relevant absolute PI

access. • I/O variable: In the symbol browser, you define a valid I/O variable for the entire device

that references the corresponding absolute PI access. All options are described in this section.

Page 116: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart 116 Programming and Operating Manual, 03/2007

Notice Please observe that if the inputs and outputs work with the Little Endian byte order (e.g. the integrated digital inputs of the SIMOTION device C230-2) and the following conditions are fulfilled: 1. The inputs and outputs are configured to an address 0 ... 62. 2. An I/O variable for direct access (data type WORD, INT or UINT) has been created for

these inputs and outputs. 3. You also access these inputs and outputs via the fixed process image of the

BackgroundTask. then the following is valid: • Access with the data type WORD supplies the same result via the I/O variable and the

fixed process image of the BackgroundTask. • The access to the individual bytes with the _getInOutByte function (see SIMOTION Basic

Functions Function Manual) supplies these in the Little Endian order. • Access to the individual bytes or bits with the fixed process image of the BackgroundTask

supplies these in the Big Endian order. For information on the order of the bytes Little Endian and Big Endian: Please refer to the SIMOTION Basic Functions Function Manual.

See also Important features of direct access and process image access (Page 109) Rules for I/O addresses for direct access and the process image of the cyclical tasks (Page 112)

4.8.4.1 Absolute access to the fixed process image of the BackgroundTask (absolute PI access) You make absolute access to the fixed process image of the BackgroundTask by directly using the identifier for the address (with implicit data type). The syntax of the identifier is described in the following section. You can use the identifier in the same manner as a normal variable.

Note Outputs can be read and written to, but inputs can only be read.

Page 117: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 117

4.8.4.2 Syntax for the identifier for an absolute process image access

Syntax for the identifier for an absolute process image access

Data type Input Output Permissible address range BOOL %In.x

or %IXn.x1

%Qn.x oder %QXn.x1

n: x :

0 .. 632 0 .. 7

BYTE %IBn %QBn n: 0 .. 632 WORD %IWn %QWn n: 0 .. 632 DWORD %IDn %QDn n: 0 .. 632 n = logical address x = bit number Examples: Input at logic address 62, data type WORD: %IW62

Output at logic address 63, bit 3, data type BOOL: %Q63.3 1 The syntax %IXn.x or %QXn.x is not permitted when defining I/O variables. 2 Except for the addresses used in the process image of the cyclic tasks.

4.8.4.3 Defining symbolic access to the fixed process image of the BackgroundTask You create symbolic access to the fixed process image of the BackgroundTask in the declaration table of the source file or the program/chart (program, function, function block). The scope of the symbolic process image access is dependent on the location of the declaration: • In the interface section of the declaration table of the source file (INTERFACE):

Symbolic process image access behaves like a unit variable; it is valid for the entire source file; all programs/charts (programs, function blocks, and functions) within the source file can access the process image. In addition, these variables are available on HMI devices and, once connected, in other source files (or other units), as well. The total size of all unit variables in the interface section is limited to 64 Kbytes.

• In the implementation section of the declaration table of the source file (IMPLEMENTATION): Symbolic process image access behaves like a unit variable; it is valid only for the source file; all programs/charts (programs, function blocks, and functions) within the source file can access the process image.

• In the declaration table of the program/chart (for programs and function blocks only): Symbolic process image access behaves like a local variable; it can only be accessed within the program/chart in which it is declared.

Proceed as follows; the source file or program/chart with the declaration table is open: 1. Select the declaration table and, if applicable, the section of the declaration table for the

desired scope. 2. Select the I/O Symbols tab.

Page 118: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart 118 Programming and Operating Manual, 03/2007

3. Enter: – Name of symbol (variable name) – For Absolute ID, the identifier of the absolute process image access – Data type of symbol (this must agree with the length of the process image access.

4.8.4.4 Possible data types for symbolic PI access

Possible data types for symbolic PI access according to data type of absolute PI access

Data type of the absolute PI access

Possible data types of the symbolic PI access

BOOL (%In.x, %IXn.x, %Qn.x. %QXn.x) BOOL BYTE (%IBn, %QBn) BYTE, SINT, USINT WORD (%IWn, %QWn) WORD, INT, UINT DWORD (%IDn, %PQDn) DWORD, DINT, UDINT

4.8.4.5 Example: Defining symbolic access to the fixed process image of the BackgroundTask

Figure 4-16 Example: Defining symbolic access to the fixed process image of the BackgroundTask

4.8.4.6 Creating an I/O variable for access to the fixed process image of the BackgroundTask You create I/O variables in the symbol browser of the detail view; to do this, you must be working in offline mode. Here is a brief overview of the procedure: 1. In the project navigator of SIMOTION SCOUT, select the I/O element in the subtree of the

SIMOTION device. 2. In the detail view, select the Symbol browser tab and scroll down to the end of the

variable table (empty row).

Page 119: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 119

3. In the last (empty) row of the table, enter or select the following: – Name of variable. – Under I/O address, the absolute PI access according to the syntax for the identifier for

an absolute PI access (exception: The syntax %IXn.x or %QXn.x is not permitted for data type BOOL).

– Data type of the I/O variables (see possible data types of the symbolic PI access). 4. Optionally, select the display format. You can now access this variable using the symbol browser or any program of the SIMOTION device.

Note I/O variables can only be created in offline mode. You create the I/O variables in SIMOTION SCOUT and use them in your program sources. Note that you can read and write outputs but you can only read inputs. Before you can monitor and modify new or updated I/O variables, you must download the project to the target system.

You can use an I/O variable just like any other variable.

Note If you have declared unit variables or local variables of the same name (e.g. var-name), specify the I/O variable using _device.var-name (predefined namespace).

See also Syntax for the identifier for an absolute process image access (Page 117) Possible data types for symbolic PI access (Page 118)

Page 120: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.8 Access to inputs and outputs (process image, I/O variables)

SIMOTION MCC Motion Control Chart 120 Programming and Operating Manual, 03/2007

4.8.5 Accessing I/O variables You can use an I/O variable just like any other variable.

Notice Consistency is only ensured for elementary data types. When using arrays, the user is responsible for ensuring data consistency.

Note If you have declared unit variables or local variables of the same name (e.g. var-name), specify the I/O variable using _device.var-name (predefined namespace, see the Predefined namespaces table in Namespaces). It is possible to directly access an I/O variable that you created as a process image of a cyclic task. Specify direct access with _direct.var-name. _device.varname

If you want to deviate from the default behavior when errors occur during variable access, you can use the _getSafeValue and _setSafeValue functions (see SIMOTION Basic Functions Function Manual). For errors associated with access to I/O variables, see SIMOTION Basic Functions Function Manual.

Page 121: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.9 Connections to other program source files or libraries

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 121

4.9 Connections to other program source files or libraries In the declaration table of a source file, you can define connections to: • LAD/FBD programs under the same SIMOTION device • MCC source files under the same SIMOTION device • ST source files under the same SIMOTION device • Libraries This will then allow you to access the following in this source file: • In the case of connected program sources, the following items which are defined there

– Functions – Function blocks – Unit variables – User-defined data types (structures, enumerations) – Symbolic accesses to the fixed process image of the BackgroundTask

• In the case of connected libraries, the following items which are defined there – Functions – Function blocks – User-defined data types (structures, enumerations)

Program source files and libraries must be compiled beforehand. In the declaration table of a source file, you can define connections to: For information about the library concept, see also the SIMOTION ST Programming Manual.

Note Libraries can be created in all programming languages (MCC, ST, or LAD/FBD).

Page 122: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.9 Connections to other program source files or libraries

SIMOTION MCC Motion Control Chart 122 Programming and Operating Manual, 03/2007

4.9.1 Defining connections

4.9.1.1 Procedure for defining connections to other units (program source files) Connections to other units (program sources) are defined in the declaration table of the source file. The mode of action of a connection is dependent on the section of the declaration table in which it is defined. • In the interface section of the declaration table:

The imported functions, variables, etc., will continue to be exported to other units and to HMI devices. This can lead to name conflicts. This setting is necessary, for example, if unit variables are declared in the interface section of the source file with a data type that is defined in the imported program source file.

• In the implementation section of the declaration table: The imported functions, variables, etc. will no longer be exported. This setting is usually sufficient.

Proceed as follows; the source file (declaration table) is open: 1. In the declaration table, select the section for the desired mode of action. 2. Select the Connections tab. 3. For the connection type, select: Program/Unit 4. In the same line, select the name of the unit to be connected:

Units (program sources) must be compiled beforehand.

4.9.1.2 Procedure for defining connections to libraries Connections to libraries are defined in the declaration table of the source file. Proceed as follows; the source file (declaration table) is open: 1. In the interface section of the declaration table, select the Connections tab. 2. For the connection type, select: Library. 3. In the same line, select the name of the library to be connected.

Libraries must be compiled beforehand. 4. Optionally, you can define a name space for libraries:

To do this, enter a name under Name space.

Note When programming the Subroutine Call command () with a library function or a library function block, the connection to the library is automatically entered in the declaration table of the source file; the name of the library is assigned as the name space. You can also change the designation of the name space at a later point in time.

Page 123: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.9 Connections to other program source files or libraries

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 123

4.9.2 Using the name space You can optionally assign a name space to every connected library. You define the designation of the name space when connecting the library. It is important to specify the name space if the current MCC chart or MCC source file contains variables, data types, functions, or function blocks with the same name as the connected library. The name space will then allow you to specifically access the variables, data types, functions, or function blocks in the library. This can also resolve naming conflicts between connected libraries. If you wish to use variables, data types, functions, or function blocks from the connected library in a command in the MCC chart, then insert the designation of the name space in front of the variable name, etc., from the library, separated by a period (for example, namespace.var_name, namespace.fc_name). Name spaces are predefined for device-specific and project-specific variables, direct accesses to I/O variables, and variables of TaskId and AlarmId in the following table: If necessary, write their designation before the variable name, separated by a period, e.g. _device.var_name or _task.task_name.

Table 4-21 Predefined name spaces

Name space Description _alarm For AlarmId: The _alarm.name variable contains the AlarmId of the message with

the name identifier – see SIMOTION ST Programming Manual. _device For device-specific variables (global device user variables, I/O variables, system

variables, and system variables of the SIMOTION device) _direct By means of direct access to I/O variables.

Local name space for _device. Nesting as in _device._direct.name is permitted. _project For names of SIMOTION devices in the project; only used with technology objects

on other devices. With unique project-wide names of technology objects, used also for these names and their system variables

_task For TaskID: The _task.name variable contains the TaskId of the task with the name identifier – see SIMOTION ST Programming and Operating Manual.

_to For technology objects as well as their system variables and configuration data – see SIMOTION ST Programming and Operating Manual.

Page 124: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart 124 Programming and Operating Manual, 03/2007

4.10 Subroutine Universal, reusable sections of a program can be created in the form of subroutines. When a subroutine is called, the program branches from the current task into the subroutine. The commands in the subroutine are executed. The program then jumps back to the previously active task. Subroutines can be called repeatedly, as required, by one or more MCC programs of the SIMOTION device.

Example of executing a subroutine

Figure 4-17 Execution of a subroutine

Subroutine as a function (FC) or function block (FB) The creation type of a subroutine can be a function (FC) or a function block (FB). • Function

A function (FC) is a subroutine without static data, that is, all local variables lose their value when the function has been executed. They are re-initialized when the function is next started. Data are transferred to the function using input or in/out parameters; the output of a function value (return value) is also possible.

• Function block A function block (FB) is a subroutine with static data, that is, local variables retain their value after the function block has been executed. Only variables that have been explicitly declared as temporary lose their value.

Page 125: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 125

An instance has to be defined before using an FB: Define a variable (VAR or VAR_GLOBAL) and enter the name of the FB as data type. The FB static data is saved in this instance. You can define several FB instances; each instance is independent from the others. The static data of an FB instance is retained until the next call-up of this instance. They are re-initialized if the variable type of the FB type is re-initialized. Data are transferred to the FB using input parameters or in/out parameters; the data are returned from the FB using in/out or output parameters.

Exchange of information between the subroutine and calling program Information is exchanged between the subroutine and the calling program using transfer parameters. These can be input, in/out, or output parameters. They are defined in the starting node of the subroutine: • Input parameters: As variable type VAR_INPUT • In/out parameter: As variable type VAR_IN_OUT • Output parameter (for FB only): As variable type VAR_OUTPUT In the case of functions, a function value can be returned; the data type of the return value can be specified when the function is inserted (created). You assign current values to the input and/or in/out parameters when you call the subroutine (FC or FB instance). You may only assign user-defined variables to the in/out parameters of an FB because the called FB accesses the assigned variables directly and can therefore change them. The output parameters of an FB can be read-accessed as often as required in the calling program. A function does not formally contain any output parameters, since the result of the function can in this case be assigned to the return value of the function. See also the examples of functions and function blocks.

See also Inserting a function (FC) or function block (FB) (Page 126) Inserting a subroutine call into the MCC chart and assigning parameters (Page 126) Example: Function (FC) (Page 129) Example: Function block (FB) (Page 132)

Page 126: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart 126 Programming and Operating Manual, 03/2007

4.10.1 Inserting a function (FC) or function block (FB) The creation dialog is similar to that of an MCC program: 1. The MCC source file must already exist (see Inserting and managing MCC source files) 2. Select the relevant MCC source file in the project navigator. 3. In the context menu, select Insert new object > MCC chart.

The input screen form opens. – Enter the name of the MCC chart (see Rules for identifiers). – For the creation type, select Function or Function block. – With creation type Function only: – Select the data type of the return value as the return type (<--> for no return value). – Check the Exportable option if the function or function block is to be used in other

program source files. If the check box is not selected, the MCC chart can only be used in the associated MCC source file (see also Changing usability in other charts (export capability)).

– You can also enter an author, version, and a comment. – Click OK to confirm.

4. Program the instructions in the function or function block. Assign an expression to the return value of a function (= function name) or to the output parameters of a function block.

5. Accept and compile the MCC source file. The subroutine you have created will then be displayed in the list.

4.10.2 Inserting a subroutine call into the MCC chart and assigning parameters

The Subroutine call command is available on the MCC editor toolbar (Basic commands command list). You can use this command to call: • Functions or function blocks of the same MCC source file or a different program source

file (e.g., MCC source file, ST source file). • Library functions or library function blocks from a program library.

Page 127: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 127

Figure 4-18 Subroutine call for a function

Notice Pay attention to the order of the MCC charts in an MCC source file. A subroutine (function or function block) must be defined before it is used. This is the case when the MCC chart of the subroutine appears above the chart in which it is used in the project navigator If necessary, reorder the charts.

See also Overview of parameters for (Page 128)

Page 128: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart 128 Programming and Operating Manual, 03/2007

4.10.2.1 Overview of parameters for You can set the following parameters (see table below):

Overview of Subroutine call parameters

Field/Button Explanation/instructions Subroutine type Here, select the subroutine type.

Function(default value) A function is a calculation subroutine that supplies a defined result as a return value based on the parameter entered. Functions have no memory beyond the call. Function block A function block is a subroutine that can have several return values. A function block corresponds to a data type. Instances are defined. They have a memory, that is, they retain instance data of a function block extending over several calls. Return values of the call can also be scanned in the instance. Library function Function from library. Library function block Function block from the library

Subroutine The selection list displays all of the subroutines available on the SIMOTION device of the selected subroutine type. Select the subroutine to be called. Important: The functions and function blocks themselves can be created in every available programming language. They must be available in compiled form in the device. A connection to the program source (if required) is automatically set up when the subroutine is selected. The library functions and library function blocks can be created in every available programming language. A connection to the library (if required) is automatically set up when the subroutine is selected.

Return value For subroutine type Function or Library function: Here, you enter the variable in which the return value is to be stored. The type of variable must match the return value type.

Type For subroutine type Function or Library function: The data type of the return value is displayed.

Instance For subroutine type Function block or Library function block: Here, enter the name of the function block instance. The instance contains the memory of the function block in the form of instance data. You define the instance as a variable whose data type is the name of the function block in one of the following ways: • In the declaration table of the MCC source file as VAR_GLOBAL • In the declaration table of the MCC chart as VAR

Page 129: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 129

Field/Button Explanation/instructions List of transfer parameters Name The name of the transfer parameter is displayed here. On / Off The variable type of the transfer parameter is displayed here.

VAR_INPUT Input parameter (for functions and function blocks) VAR_IN_OUT In/out parameter (for functions and function blocks) VAR_OUTPUT Output parameter (for function blocks only)

Data type The data type of the transfer parameter is displayed here. Value Here, you can assign current variables or values to the transfer parameters:

• Input parameter (variable type VAR_IN):

Here, you enter a variable name or an expression. The assignment of system variables or I/O variables is permissible; type transformations are possible.

• In/out parameter (variable type VAR_IN):

Enter a variable name; the variable must be directly writable and readable. System variables of SIMOTION devices and technology objects are not permitted nor are I/O variables. The data type of the in/out parameter must correspond to that of the assigned variables; application of type transformation functions is not possible.

• Output parameter (variable type VAR_OUTPUT – for FB only):

The assignment of an output parameter to a variable in this parameter screen form is optional; you can also access an output parameter after executing the function block.

When assigned in this parameter screen form: Enter a variable name. The data type of the output parameter must correspond to that of the assigned variables; the application of type transformation functions is not possible.

Comments The comment for the transfer parameters is displayed here.

4.10.3 Example: Function (FC) You want to create a subroutine with a circumference calculation for a circle. The calculation is performed in a function (FC). This is named Circumference. The circle circumference calculation can thus be called as a subroutine by any task. Formula for circumference calculation: Circumference = PI * 2 * radius You define the Radius and PI variables in the declaration table of the function.

See also Creating and programming the function (FC) (Page 130) Subroutine call of function (FC) (Page 130)

Page 130: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart 130 Programming and Operating Manual, 03/2007

4.10.3.1 Creating and programming the function (FC) 1. In the project navigator, select the MCC source file in which you want to create the

function. 2. In the context menu, select Insert New Object > MCC chart.

– Enter the name Circumference. – For creation type, select Function. – For return type (data type of return value), select REAL. – Click OK to confirm.

3. In the declaration table, define the input parameter radius and the constant PI (see figure).

4. Program the variable assignment for the return value (see figure). 5. Accept and compile the MCC source file. You have now finished programming the Circumference function.

Figure 4-19 Declaring variables (e.g., input parameters) in the MCC chart

Figure 4-20 Programming the Circumference subroutine (e.g., assignment to a return value)

4.10.3.2 Subroutine call of function (FC) The function (FC) is called from a program in the example. 1. Create an MCC chart as a program in the same MCC source file (see Inserting a new

MCC source file). 2. In the MCC source file or MCC chart, declare the following (see figure):

– The mycircum variable. The return value of the "Circumference" function is assigned to this variable.

– The myradius variable. This variable contains the radius and is assigned to the input parameter "Radius" of the "Circumference" function.

Note that the validity range of the variables is dependent on the declaration location. 3. Insert the Subroutine call command.

Page 131: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 131

4. Assign parameters in the parameter screen form (see figure). 5. Pay attention to the order of the MCC charts in the MCC source file. The MCC chart with

the function must appear in the project navigator above the chart containing the program with the subroutine call. If necessary, reorder the charts.

6. Accept and compile the MCC source file. You have now finished programming the subroutine call.

Figure 4-21 Declaring a variable in the MCC chart

Figure 4-22 Opened parameter screen form for the subroutine call

Page 132: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart 132 Programming and Operating Manual, 03/2007

4.10.4 Example: Function block (FB) You want to calculate a following error. The calculation is performed in a function block (FB) named FollError. The following error calculation can thus be called as a subroutine by any task. Formula for following error calculation: Difference = Specified position – Actual position Define the required input and output parameters Set position, Actual position, and Difference (with the other variables, if necessary) in the MCC chart (function block) or MCC source file.

See also Creating and programming the function block (FB) (Page 132) Subroutine call of function block (FB) (Page 133) Creating a function block instance (Page 133) Programming the subroutine call of the function block (Page 135) Accessing the output parameters of the function block retrospectively (Page 137)

4.10.4.1 Creating and programming the function block (FB) 1. In the project navigator, select the MCC source file in which you want to create the

function block. 2. In the context menu, select Insert New Object > MCC chart.

– Enter the name FollError. – For creation type, select Function block. – Click OK to confirm.

3. In the declaration table, define the variables (e.g., input and output parameters – see picture).

4. The following error is calculated in a variable assignment (see figure). 5. Accept and compile the MCC source file. You have now finished programming the "FollError" function block.

Figure 4-23 Declaring variables (e.g., input and output parameters) in the MCC chart

Page 133: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 133

Figure 4-24 Programming a variable assignment

4.10.4.2 Subroutine call of function block (FB) In this example, the function block (FB) is called from a program. 1. Create an MCC chart as a program (see Inserting a new MCC chart). 2. Create a function block instance.

– In the MCC source file or MCC chart, declare the instances of the function block along with the variables.

Note that the validity range of the instance and the variables is dependent on the declaration location.

3. Call the function block: – Program the Subroutine call command.

4. After executing an instance of the function block, you can access the output parameters at any location in the calling program. – Program the Variable assignment command.

5. Accept and compile the program. You have now finished programming the subroutine call.

4.10.4.3 Creating a function block instance Before you can use a function block, you must define an instance. Each instance of an FB is independent of the others; once an instance has ended, its static variables remain stored. You define the instances of an FB in the declaration table of the MCC source file or MCC chart. The scope of the instance declaration is dependent on the location of the declaration: • In the interface section of the declaration table of the MCC source file:

The instance behaves like a unit variable; it is valid for the entire MCC source file; all MCC charts (programs, function blocks, and functions) within the MCC source file can access the instance. In addition, the instance is available on HMI devices and, once connected, in other MCC source files (or other units), as well. The total size of all unit variables in the interface section is limited to 64 Kbytes.

Page 134: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart 134 Programming and Operating Manual, 03/2007

• In the implementation section of the declaration table of the MCC source file: The instance behaves like a unit variable that is valid only for the MCC source file; all MCC charts (programs, function blocks, and functions) within the MCC source file can access the instance.

• In the declaration table of the MCC chart (for programs and function blocks only): The instance behaves like a local variable; it can only be accessed within the MCC chart in which it is declared.

Proceed as follows; the MCC source file or MCC chart with the declaration table is open: 1. Select the declaration table and, if applicable, the section of the declaration table for the

desired scope. 2. Select the Parameter tab. 3. Enter or select the following:

– Name of instance (variable name – see Rules for identifiers) – Variable type VAR or VAR_GLOBAL, depending on the declaration location (in MCC

chart or MCC source file, respectively) – Designation of the function block as data type.

4. Declare the other variables.

Figure 4-25 Define an instance of the function block and variables in the MCC chart or MCC source

file

Page 135: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 135

4.10.4.4 Programming the subroutine call of the function block 1. Insert the Subroutine Call command in the MCC chart. 2. Program the command as follows:

– For subroutine type, select Function block. – Select the designation of the function block as the subroutine. – Enter the instance defined in the declaration table in the Instance field. The input and

in/out parameters of the FB are displayed. 3. Assign the current values to the transfer parameters:

– Input parameters: Variable or expression – In/out parameter: Directly readable/writable variable – Output parameter (optional): Variable You can insert unit and system variables from the detail view using a drag-and-drop operation.

4. Click OK to confirm. 5. Pay attention to the order of the MCC charts in the MCC source file. The MCC chart with

the function block must appear in the project navigator above the chart containing the program with the subroutine call. If necessary, reorder the charts.

Page 136: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart 136 Programming and Operating Manual, 03/2007

Figure 4-26 Opened parameter screen form for the subroutine call

Page 137: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.10 Subroutine

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 137

4.10.4.5 Accessing the output parameters of the function block retrospectively After an instance of the function block has been executed, the static variables of the function block (including the output parameters) are retained. You can access the output parameters at any point in the calling program. If you have defined the FB instance as VAR_GLOBAL, you can also access the output parameter in other MCC charts. 1. Insert the Variable assignment command in the MCC chart. 2. Program the command (see figure). 3. Click OK to confirm.

Figure 4-27 Programming a variable assignment

Page 138: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.11 Reference data

SIMOTION MCC Motion Control Chart 138 Programming and Operating Manual, 03/2007

4.11 Reference data The reference data provide you with an overview of: • Utilized identifiers with information on their declaration and use

(Cross reference list) • Function calls and their nesting

(Program structure) • For the memory requirement of various data areas of the program sources

(code attribute)

See also Cross-reference list (Page 138) Program structure (Page 140) Code attributes (Page 142)

4.11.1 Cross reference list The cross-reference list shows all identifiers in program sources (e.g. ST source files, MCC source files): • Declared as variables, data types, or program organization units (program, function,

function block) • Used as previously defined type identifiers in declarations • Used as variables in the statement section of a program organization unit You can generate the cross-reference list as required for: • An individual program source (e.g. ST source file, MCC source file, LAD/FBD source) • All program sources of a SIMOTION device • All program sources and libraries of the project • Libraries (all libraries, single library)

4.11.1.1 Creating a cross-reference list To create the cross-reference list: 1. In the project navigator, select the element for which you want to create a cross-reference

list. 2. Select the menu Edit > Reference data > Create. The cross-reference list is displayed in its own tab in the detail view.

Page 139: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.11 Reference data

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 139

4.11.1.2 Example: Cross-reference tab in detail view

Figure 4-28 Cross-reference tab in detail view

4.11.1.3 Content of the cross-reference list The created cross-reference list shows the following for each identifier: • The identifier name (for structures and enumerators, also the individual components and

elements). • The type (e.g. data type, POU type). • The declaration location (e.g. name of the program source, name of the technology

package). • Information about the current use of the identifier:

– Type of the use (e.g. R = read access, W = write access, variable type = declaration), – Path details of the program source (SIMOTION device, name of the program source), – Area in the program source (e.g. implementation section, POU name), – Program language of the program source, – Line number in the ST source (or block number in the MCC chart or reference number

in the LAD/FBD source).

Note The generated cross-reference list is saved automatically and can be displayed selectively after selecting the appropriate element in the project navigator. To display the cross-reference list, select the Edit > Reference data > Display > Cross-Reference List menu command. When a cross-reference list is recreated, it is updated selectively (corresponding to the selected element in the project navigator). Other existing cross-reference data are retained and displayed, if applicable.

Page 140: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.11 Reference data

SIMOTION MCC Motion Control Chart 140 Programming and Operating Manual, 03/2007

4.11.1.4 Working with a cross-reference list In the cross-reference list you are able to: • Sort the column contents alphabetically • Set filter functions (via context menu, which you can call with the right mouse button) • Copy contents to the clipboard in order, for example, to paste them into a spread-sheet

program • Print contents • Open the referenced program source and position the cursor on the relevant line of the

ST command (or MCC or LAD/FBD element): – Double-click on the corresponding line in the cross-reference list.

or – Place the cursor in the corresponding line of the cross-reference list and click the Go

to application button. Further details about working with cross-reference lists can be found in the online help.

4.11.2 Program structure In the program structure are all function calls and their nesting within a selected element. When the cross-reference list has been successfully created, you can display the program structure selectively for: • An individual program source (e.g. ST source file, MCC source file, LAD/FBD source) • All program sources of a SIMOTION device • All program sources and libraries of the project • Libraries (all libraries, single library, individual program source within a library) Follow these steps: 1. In the project navigator, select the element for which you want to display the program

structure. 2. Select the menu Edit > Reference data > Display > Program structure.

The cross-reference tab is replaced by the program structure tab in the detail view.

Page 141: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.11 Reference data

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 141

4.11.2.1 Example: Program Structure tab in the detail view

Figure 4-29 Example of a program structure

4.11.2.2 Content of the program structure A tree structure appears, showing: • as base respectively

– the program organization units (programs, functions, function blocks) declared in the program source, or

– the execution system tasks used • below these, the subroutines referenced in this program organization unit or task.

Page 142: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.11 Reference data

SIMOTION MCC Motion Control Chart 142 Programming and Operating Manual, 03/2007

For structure of the entries, see table:

Table 4-22 Elements of the display for the program structure

Element Description Base (declared POU or task used))

List separated by a comma • Identifier of the program organization unit (POU) or task • Identifier of the program source in which the POU or task was declared, with

add-on [UNIT] • Minimum and maximum stack requirement (memory requirement of the POU

or task on the local data stack), in bytes [Min, Max] • Minimum and maximum overall stack requirement (memory requirement of

the POU or task on the local data stack including all called POUs), in bytes [Min, Max]

Referenced POU List separated by a comma: • Identifier of called POU • Optionally: Identifier of the program source / technology package in which the

POU was declared:

Add-on (UNIT): User-defined program source

Add-on (LIB): Library

Add-on (TP): System function from technology package • Only for function blocks: Identifier of instance • Only for function blocks: Identifier of program source in which the instance

was declared:

Add-on (UNIT): User-defined program source

Add-on (LIB): Library • Line of (compiled) source in which the POU is called; several lines are

separated by "|".

4.11.3 Code attributes You can find information on or the memory requirement of various data areas of the program sources under code attribute. When the cross-reference list has been successfully created, you can display the code attributes selectively for: • An individual program source (e.g. ST source file, MCC source file, LAD/FBD source) • All program sources of a SIMOTION device • All program sources and libraries of the project • Libraries (all libraries, single library, individual program source within a library) Follow these steps: 1. In the project navigator, select the element for which you want to display the code

attributes. 2. Select the Edit > Reference data > Display > Code attributes menu.

The Cross-references tab is now replaced by the Code attributes tab in the detail view.

Page 143: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.11 Reference data

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 143

4.11.3.1 Code attribute contents The following are displayed in a table for all selected program source files: • Identifier of program source file, • Memory requirement, in bytes, for the following data areas of the program source file:

– Dynamic data: All unit variables (retentive and non-retentive, in the interface and implementation sections),

– Retain data: Retentive unit variables in the interface and implementation section, – Interface data: Unit variables (retentive and non-retentive) in the interface section,

• Number of referenced sources.

Page 144: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.12 LAD/FBD/formula

SIMOTION MCC Motion Control Chart 144 Programming and Operating Manual, 03/2007

4.12 LAD/FBD/formula The creation language for a condition or variable assignment is either Ladder Diagram (LAD), Function Block Diagram (FBD), or Formula in accordance with IEC 61131-3. The language can be selected individually for the following commands: • Variable assignment • Wait for condition • IF program branching • WHILE loop with condition at start • UNTIL loop with condition at end • Synchronous start You can switch between the different programming languages. A calculation programmed in LAD or FBD can be expanded in Formula in accordance with IEC 61131-3. However, you can then only switch back to the LAD or FBD mode of representation if the expression can be displayed in these languages.

Note If you have not yet programmed in these languages, you can find a brief description of how to do so in Appendix B.

Insert variable You can insert variables from the detail view (Symbol Browser tab) in the appropriate input field using a drag-and-drop operation.

Page 145: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.12 LAD/FBD/formula

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 145

4.12.1 Ladder diagram (LAD) If you select the LAD language, an empty ladder diagram is initially opened. New elements are inserted using the context menu commands or the buttons on the toolbar. New elements are always inserted after the selected element. You can select individual elements using the cursor or the keyboard cursor keys. The selected element is displayed in blue. Selected elements can be copied, pasted, cut, or deleted using the context menu.

Input screen form for ladder diagram

Figure 4-30 Input screen form for ladder diagram

Page 146: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.12 LAD/FBD/formula

SIMOTION MCC Motion Control Chart 146 Programming and Operating Manual, 03/2007

4.12.1.1 Description of LAD elements

Description of normally open (NO) contact

NO contact Description Signal = 1 if the operand has signal status 1. The operand specifies the bit or

Boolean variable whose signal status is queried. Data types BOOL

Description of normally closed (NC) contact

NC contact Description Signal = 1 if the operand has signal status 0. The operand specifies the bit or

Boolean variable whose signal status is queried. Data types BOOL

Description of comparator

Comparison instructions Signal = 1 if the comparison of the two operands is true. Possible modes of comparison: = Equal <> Not equal to > greater than < less than >= greater than or equal to

Description

<= less than or equal to SINT, INT, DINT, REAL, LREAL, BOOL, BYTE SINT 8-bit integer comparator, Parameter: Byte INT 16-bit integer comparator, Parameter: Words DINT 32-bit integer comparator and time comparator,

Parameter: Double words and times REAL 32-bit floating-point comparator,

Parameter: Double words

Data types

LREAL 64-bit floating-point comparator, Parameter: 64-bit floating point values

Page 147: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.12 LAD/FBD/formula

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 147

4.12.1.2 Opens a branch

Procedure: Opens a branch

4.12.1.3 Closing a branch

Procedure: Closing a branch

4.12.2 Function block diagram (FBD) If you select the FBD language, an empty function block diagram is opened first. New elements are inserted using the context menu commands or the buttons on the toolbar. New elements are always inserted after the selected element. You can select individual elements using the cursor or the keyboard cursor keys. The selected element is displayed in blue. Selected elements can be copied, pasted, cut, or deleted using the context menu.

Page 148: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.12 LAD/FBD/formula

SIMOTION MCC Motion Control Chart 148 Programming and Operating Manual, 03/2007

Input screen form for function block diagram

Page 149: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.12 LAD/FBD/formula

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 149

4.12.2.1 Description of FBD elements

Description of an AND operation

AND operation Description The AND operation forms the signal states of two or more specified

operands at the inputs of an AND box. If the signal status of all operands is 1, the condition is fulfilled and the result of the operation is 1. If the signal status of one operand is 0, the condition is not fulfilled and the result of the operation is 0.

Data types BOOL

Description of an OR operation

OR operation Description The OR operation forms the signal states of two or more specified operands

at the inputs of an OR box. If the signal status of one operand is 1, the condition is fulfilled and the operation returns a result of 1. If the signal status of all operands is 0, the condition is not fulfilled and the result of the operation is 0.

Data types BOOL

Description of comparator

Comparison instructions Description See Description of LAD elements Data types See Description of LAD elements

Description of Add input

Add input Description An additional input is added to an AND or an OR operation. Data types ----

Description of Negate input

Negate input Description Signal is negated. Data types ----

Page 150: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.12 LAD/FBD/formula

SIMOTION MCC Motion Control Chart 150 Programming and Operating Manual, 03/2007

4.12.3 Formula A condition or value can be programmed in Formula language. You can move the operators you need from the Command Library tab in the project navigator to the input field using a drag-and-drop operation. The system variables are moved from the Symbol Browser tab in the detail view to the input field using a drag-and-drop operation (see figure).

Programming a condition in the Formula language

Page 151: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.13 Command library and system function

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 151

4.13 Command library and system function

4.13.1 Command library The command library is automatically displayed as a project navigator tab if you program the following commands: • Variable assignment • Wait for condition • System function call • Program structures, e.g., IF, WHILE, Synchronous Start, etc.

Figure 4-31 Command library tab of the project navigator

Note System functions and operators can be moved from the command library to many programming windows using a drag-and-drop operation. The command library stays open even when the programming window is closed.

Page 152: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.13 Command library and system function

SIMOTION MCC Motion Control Chart 152 Programming and Operating Manual, 03/2007

4.13.1.1 Using the command library Proceed as follows to insert operands or functions from the command library into a programming window: Move the entry from the command library to the entry field of the window using a drag-and-drop operation.

Figure 4-32 Inserting a command from the command library

Page 153: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.13 Command library and system function

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 153

4.13.1.2 User functions and function blocks User functions and function blocks are also easily inserted into a programming window: • Move the function from the project navigator to the entry field using a drag-and-drop

operation.

Figure 4-33 Inserting the name of a subroutine

4.13.2 Using the System function call command The System function call command is available on the MCC editor toolbar (Basic commands command list). This command enables you to use of any system functions and system function blocks in the MCC chart and to program their call conveniently. When the command is called, the programmed system function or system function block is executed. Once the system function or system function block is executed, the MCC chart resumes after the command.

System function The system function can be moved from the command library to the input field using a drag-and-drop operation or be entered directly.

Page 154: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.13 Command library and system function

SIMOTION MCC Motion Control Chart 154 Programming and Operating Manual, 03/2007

Return value In the case of a system function, you specify the variable containing the return value of the function.

Instance In the case of a system function block, you specify the instance. This instance has been declared as a variable beforehand (data type is the name of the system function block). See also Creating a function block instance.

Example of System function call

See also Overview of parameters for (Page 155)

Page 155: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.13 Command library and system function

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 155

4.13.2.1 Overview of parameters for You can set the following parameters:

Overview of parameters for System function call

Field/Button Explanation/instructions System function The desired system function can be selected from the command library.

You can either enter the system function in the field or move it from the project navigator (command library) to the field using a drag-and-drop operation.

Return value For a system function: Here, you enter the variable in which the return value is to be stored. The type of variable must match the return value type.

Type For a system function: The data type of the return value is displayed.

Instance For a system function block: Here, you enter the name of the system function block instance. The instance contains the memory of the function block in the form of instance data. Define the instance as VAR_GLOBAL in the declaration table of the MCC source file or VAR in the declaration table of the MCC chart.

List of transfer parameters Name The name of the transfer parameter is displayed here. On / Off The variable type of the transfer parameter is displayed here.

VAR_INPUT Input parameter (for system functions and system function blocks) VAR_IN_OUT In/out parameter (for system function blocks only) VAR_OUTPUT Output parameter (for system function blocks only)

Data type The data type of the transfer parameter is displayed here.

Page 156: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.13 Command library and system function

SIMOTION MCC Motion Control Chart 156 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Value Here, you can assign current variables or values to the transfer parameters:

• Input parameter (variable type VAR_IN):

Here, you enter a variable name or an expression. The assignment of system variables or I/O variables is permissible; type transformations are possible.

Optional input parameters are indicated by an entry in the Default Value column. If no value has been transferred to it, it is automatically assigned the default value

• In/out parameter (variable type VAR_IN_OUT – for system function blocks only):

Enter a variable name; the variable must be directly writable and readable. System variables of SIMOTION devices and technology objects are not permitted nor are I/O variables. The data type of the in/out parameter must correspond to that of the assigned variables; application of type transformation functions is not possible.

• Output parameter (variable type VAR_OUTPUT – for system function blocks only):

The assignment of an output parameter to a variable in this parameter screen form is optional; you can also access an output parameter after executing the function block.

When assigned in this parameter screen form: Enter a variable name. The data type of the output parameter must correspond to that of the assigned variables; the application of type transformation functions is not possible.

Default value Here, the preassigned value is displayed for optional input parameters. If no value has been transferred to an optional input parameter, it is automatically assigned the default value.

Page 157: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.14 MCC charts in libraries

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 157

4.14 MCC charts in libraries Libraries provide you with user-defined types, unit variables, functions, and function blocks for use from all SIMOTION devices. Libraries can be written to in all available programming languages. They can be used in all program source files (e.g., MCC source files, ST source files). In order to use a library in an MCC source file, you must link the library in the declaration table of the MCC source file (with specification of a name space, if necessary). You can obtain more details on inserting and managing libraries in the online help.

4.14.1 Using technology packages in libraries Libraries can also contain the following: • Commands that act on technology objects • Access to system variables of technology objects.

Notice Only variables of this data type (see Technology object data types) are permitted as technology objects.

You specify the SIMOTION device and technology package for which the library is compiled in the object properties of the library: 1. Select the library in the project navigator. 2. Select the Edit > Object Properties menu command. 3. Select the TPs/TOs tab. 4. Select the SIMOTION devices (including the version number) and the technology

packages for which the library is to be compiled.

Notice To compile a project without errors, observe the rules governing the selection of SIMOTION devices and technology packages in the following table.

Page 158: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.14 MCC charts in libraries

SIMOTION MCC Motion Control Chart 158 Programming and Operating Manual, 03/2007

Selection of devices and technology packages in a library

Selection Description Device-independent You must also select:

• The technology packages • The version number of the selected technology packages Pay attention to:

1. The library is compiled without reference to a SIMOTION device. For this reason, the following must not be used: • System functions and system variables of SIMOTION devices • Version-dependent system functions of the SIMOTION ST

programming language (see SIMOTION ST Programming Manual)

Additional MCC commands are not permitted.

1. 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.

2. 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 including version (multiple selection possible)

Only those technology packages are displayed that are available for all of the selected devices. Pay attention to:

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 MCC source file, the following is therefore checked: • Whether the library for the SIMOTION device (including version) that

contains the MCC source file to be imported has been compiled. • Whether the technology package that is used on the SIMOTION

device matches that of the library. Any inconsistencies will result in compilation errors.

Page 159: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.14 MCC charts in libraries

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 159

4.14.2 Compiling a library In libraries, you can use all MCC commands except for the ones listed in the table below. In addition, you are not allowed to access some variables; these variables are also listed in this table.

MCC commands and variable accesses not permitted in libraries

Prohibited commands In all libraries: • MCC basic commands:

• Set output • Reset output • Wait for signal

• MCC task command: • Determine TaskId

• MCC communication commands: • Incoming message • Outgoing message

• MCC single axis command: • Set virtual axis values

• ST system functions (when used in the System function call, Variable assignment or ST Zoom MCC commands): • Task control commands (up to kernel V3.0) • Commands for runtime measurement of tasks (up to kernel version V3.0) • Commands for message programming (up to kernel version V3.0)

For more information, refer to the SIMOTION ST Programming Manual. Additional commands, if the library was compiled on a device-independent basis: • MCC basic commands:

• Activate trace • Change operating mode

• MCC command for program structure: • Synchronous start

• MCC commands for communication: • Receive data • Send data • Remove connection using TCP/IP • Establish connection using TCP/IP

• System functions of SIMOTION devices (see list manuals for SIMOTION devices).

Page 160: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.14 MCC charts in libraries

SIMOTION MCC Motion Control Chart 160 Programming and Operating Manual, 03/2007

Prohibited variable access • Unit variables (retentive and non-retentive) • Global device variables (retentive and non-retentive) • I/O variables • Instances of the technology objects and their system variables • Variables of task names and configured messages (for name spaces _task and _alarm) • If the library is not device-dependent (i.e. compiled without reference to a SIMOTION device or

SIMOTION kernel version): • System variables of SIMOTION devices (see list manuals for SIMOTION devices) • Configuration data of technology objects (see Parameter Manual of configuration data for the

relevant SIMOTION technology package)

Compile a library as follows: Select the library in the project navigator. Select the SIMOTION devices and the technology packages for which the library is to be compiled (Edit > Object properties menu command, TPs/TOs tab) In the context menu, select Accept and compile.

Page 161: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.15 Print

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 161

4.15 Print The MCC source file or MCC chart displayed in the working window can be output to a printer. 1. Select the Project > Print menu command. 2. In the Print project window, select the print options (see table below):

– When printing an MCC source file: Select print options for this MCC source file and each MCC chart it contains.

– When printing an MCC chart: Select print options for this MCC chart.

3. Then, select: – Print if you want to output the result to the printer immediately – Print preview if you want to check the print result on the screen before printing

Print options for an MCC source file or MCC chart

Option Significance Printing a declaration table (MCC source file and MCC chart)

When this check box is selected, the declaration table of the MCC source file or the MCC chart is printed. In the Select column below, select: Default column widths The table will be printed with the default column widths. Scale column widths to screen The table is printed with the column widths that were set in the declaration table window

Print chart (MCC chart only)

When this check box is selected, the selected MCC chart will be printed. Depending on the selected zoom factor, the printout can have multiple pages.

Printing the index page (MCC chart only)

When this check box is selected, an index page displaying the entire MCC chart on one page and the page boundaries of the individual pages is also printed. If the printout of the MCC chart consists of several pages, this will make it easier to read.

Display numbers of adjoining pages (MCC chart only)

When this check box is selected, the number of the next page will be printed on the margin of each page of a multi-page MCC chart printout.

Page 162: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Programming in MCC 4.15 Print

SIMOTION MCC Motion Control Chart 162 Programming and Operating Manual, 03/2007

Option Significance Zoom (MCC chart only)

Select a zoom factor for the printout of the MCC chart: Scale graphics to page width The width of the MCC chart is scaled to the page width. Depending on the size, the chart may be divided vertically onto several pages. Scale graphics to page height The height of the MCC chart is scaled to the page height. Depending on the size, the chart may be divided horizontally onto several pages. Scale graphics to one page The height and width of the MCC chart are scaled to the page size. The chart is always presented on one page. Graphic at 100% The MCC chart will be printed in its original size. The chart can be divided onto several pages, both vertically and horizontally. Apply zoom factor from screen The MCC chart is printed with the zoom factor setting for its MCC editor window. The chart can be divided onto several pages, both vertically and horizontally.

Blank pages (MCC chart only)

If the printout of the MCC chart consists of several pages, blank pages can occur. In the Select column, select select which blank pages should be printed: Print all All blank pages are printed. Omit at end Blank pages at the end of a series are not printed. If the Index page option is selected, the non printed pages are marked with an X on the index page. Omit all All blank pages (even in the middle of a series) are not printed. If the Index page option is selected, the non printed pages are marked with an X on the index page.

Page 163: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 163

MCC commands 55.1 Basic commands

5.1.1 Wait time

5.1.1.1 Wait time

Execution of the task is halted for the programmed time period.

Figure 5-1 Parameter screen form: Wait time

Page 164: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 164 Programming and Operating Manual, 03/2007

5.1.1.2 Overview of parameters for Wait time You can set the following parameters:

Table 5-1 Overview of parameters for Wait time

Field/Button Explanation/instructions Parameters tab See Overview of parameters for Wait time - Parameters tab (Page 164) Expert tab See Overview of parameters for Wait time - Expert tab (Page 164)

5.1.1.3 Overview of parameters for Wait time - Parameters tab

Table 5-2 Overview of parameters for Wait time - Parameters tab

Field/Button Explanation/instructions Time Enter the wait time here as a value or variable of type TIME. Granularity is 1 ms. The

accuracy with which the time setting is applied is dependent on the clock grid in which the task is executed or, in the case of MotionTasks, on the interpolation cycle clock. If the wait time is 0, the task is continued without any interruption. T#0ms (default value) T#0d_0h_0m_0s_0ms

5.1.1.4 Overview of parameters for Wait time - Expert tab

Table 5-3 Overview of parameters for Wait time - Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). Return variable If you enter the name of a variable of the specified data type for each command step, you

can use this variable to find out the result of the command step. Data type DINT, the value is always equal to 0.

5.1.1.5 Relevant system functions for Wait time ST system function: _waitTime.

Page 165: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 165

5.1.2 Wait for axis

5.1.2.1 Wait for axis

Execution of the task is halted until the axis achieves the programmed condition. Possible conditions are: • Axis status: A status of the axis determined on the basis of system variables of the axis or

the associated synchronous object (in the case of a synchronous axis) • Comparison value : Comparison of a value of the axis (such as position, velocity) with a

specified value If both conditions are selected, they are combined by an AND operation. The statuses and values of the axis relate to the total motion. The condition is checked in the interpolator cycle clock. If the condition is fulfilled, the priority of the MotionTask is temporarily raised. The commands within the shaded area under the wait command are started in the next IPO cycle clock and executed with the highest priority. Once the commands in the shaded area have been executed, the priority of the MotionTask is reset.

Figure 5-2 Parameter screen form: Wait for axis

Notice This command may only be programmed for MotionTasks.

Page 166: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 166 Programming and Operating Manual, 03/2007

Note If you want to program a wait condition with axis statuses or axis values other than those provided in the selection lists: Use the Wait for condition command and the corresponding system variables of the axis (see SIMOTION Cam Technology Package, System Variables Pparameter Manual).

5.1.2.2 Overview of parameters for Wait for axis You can set the following parameters:

Table 5-4 Overview of parameters for Wait for axis

Field/Button Explanation/instructions Axis Here, select the axis whose status or value you want to check. You can select from:

• All axes that are configured on the device • All variables of the MCC chart with the following data types of technology objects (see

Data types of technology objects): driveAxis, posAxis, or followingAxis. Leading axis / encoder Visible for all synchronous axes.

Notice The Master axis/encoder selection is required only for synchronous axes with more than one synchronous object (superimposed synchronous motions). This input is ignored in the case of synchronous axes with only one synchronous object. By making this selection, you are indirectly selecting the synchronous object of the main motion or the superimposed motion.

Axis status Here, you select an axis status as the condition • Select this check box if you want to evaluate the axis status. • Select the axis status.

Different options are offered depending on the technology of the selected axis (see Axis status table (Page 167)).

Comparison value Here, you select comparison of an axis value as the condition. • Select this check box if you wish to compare an axis value. Possible axis values are

shown in the subsequent selection list. • Select the axis value that you want to compare.

Different options are offered depending on the technology of the selected axis. • Select the comparison operators (see Comparison operators for axis values table

(Page 168)). • Enter the comparison value.

Tolerance Only for comparisons for equality (=) or inequality (<>): Maximum absolute value of the permitted difference between the selected axis value and the programmed comparison value that will allow the equality condition to be satisfied.

Page 167: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 167

5.1.2.3 Axis status

Axis status Technology of the axis1 System variable and value Axis moving at constant velocity

D, P, F motionStateData.motionState = CONSTANT_MOVE

Axis in motion D, P, F motionStateData.motionCommand = IN_MOTION Axis homed P, F positioningState.homed = YES Axis at standstill (default value)

D, P, F motionStateData.motionState = STANDSTILL Standstill monitoring is activated

Axis synchronized G syncState = YES (synchronous object) Accelerating D, P, F motionStateData.motionState = ACCELERATING Motion is finished D, P, F motionStateData.motionCommand = MOTION_DONE

Axis is in the tolerance window and standstill monitoring is activated

Rotating D, P, F moveCommand.state <> INACTIVE The Start axis position-controlled or Speed specification command is active on the axis.

Synchronous operation active G state = GEARING (synchronous object) The Gearing on command is active on the axis.

Cam active G state = CAMMING (synchronous object) The Cam on command is active on the axis.

Emergency stop motion active D, P, F stopEmergencyCommand = ACTIVE Positioning P, F posCommand.state <> INACTIVE

The Position axis command is active on the axis. Simulation active D, P, F simulation = ACTIVE Decelerating D, P, F motionStateData.motionState = DECELERATING 1) Technology of the axis D: Speed-controlled axis (driveAxis) P:Positioning axis (posAxis) F:Synchronous axis (followingAxis)

Page 168: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 168 Programming and Operating Manual, 03/2007

5.1.2.4 Comparison operators for axis values

Operator Condition satisfied if: < (default value). Selected axis value is less than the programmed comparison value. <= Selected axis value is less than or equal to the programmed comparison value. <> For position values only:

The absolute value of the difference between the selected axis value and the programmed comparison value is greater than the specified tolerance.

= For position values only: The absolute value of the difference between the selected axis value and the programmed comparison value is less than or equal to the specified tolerance.

> Selected axis value is greater than the programmed comparison value. >= Selected axis value is greater than or equal to the programmed comparison value.

5.1.2.5 Relevant commands of the ST (Structured Text) programming language for Wait for axis • EXPRESSION / END_EXPRESSION for formulation of the condition • WAITFORCONDITION / END_WAITFORCONDITION

5.1.3 Wait for signal

5.1.3.1 Wait for signal

Task execution is halted until the signal status at a digital input or output (BOOL data type) satisfies the programmed condition: • Static 1 (TRUE) or 0 (FALSE) • Rising or falling edge The condition is checked in the interpolator cycle clock. If the condition is fulfilled, the priority of the MotionTask is temporarily raised. The commands within the shaded area under the wait command are started in the next IPO cycle clock and executed with the highest priority. Once the commands in the shaded area have been executed, the priority of the MotionTask is reset.

Page 169: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 169

Figure 5-3 Parameter screen form for Wait for signal

Notice This command may only be programmed for MotionTasks.

Note If you want to program a wait condition with I/O variables or process image accesses whose data type are not BOOL): Use the Wait for condition command.

5.1.3.2 Overview of parameters for Wait for signal You can set the following parameters:

Table 5-5 Overview of parameters for

Field/Button Explanation/instructions Input/output Here, you select the digital input or output to be evaluated for the wait condition.

You can select from the following: • I/O variables with data type BOOL • Symbolic accesses to the process image of the BackgroundTask with data type BOOL In addition, you can enter absolute process image accesses (data type BOOL).

Value Here, you can decide whether the condition evaluation is to be edge-triggered or level-triggered. Rising edge (default value) The condition is satisfied if the input changes from 0 (FALSE) to 1 (TRUE). Falling edge The condition is satisfied if the input changes from 1 (TRUE) to 0 (FALSE). Level 'FALSE' The condition is satisfied if the input is static at 0 (FALSE). Level 'TRUE' The condition is satisfied if the input is static at 1 (TRUE).

Page 170: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 170 Programming and Operating Manual, 03/2007

5.1.3.3 Relevant commands of the ST (Structured Text) programming language for Wait for signal • EXPRESSION / END_EXPRESSION for formulation of the condition • WAITFORCONDITION / END_WAITFORCONDITION

5.1.4 Wait for condition

5.1.4.1 Wait for condition

Execution of the task is halted until the programmed condition is fulfilled. If the condition is fulfilled, then the priority of the MotionTask is temporarily raised. The commands within the shaded area under the wait command are started in the next IPO cycle clock and executed with the highest priority. Once the commands in the shaded area have been executed, the priority of the MotionTask is reset. The condition can be composed of: • Unit variables of the same MCC source file • Global device variables • Constants • I/O variables and process image accesses (inputs) • Operators The expression must not contain: • Function calls • Local variables or variables imported from other MCC charts • Loops

Page 171: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 171

Figure 5-4 Parameter screen form: Wait for condition

Note The Wait command may only be programmed for MotionTasks. The condition is programmed in the ladder diagram (LAD), function block diagram (FBD), or Formula languages.

Page 172: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 172 Programming and Operating Manual, 03/2007

Example with Wait for condition Task: A conveyor belt is in operation with several feeders. An additional new feeder must now be installed and programmed. The packages will be moved onto the conveyor belt only if a package is present on the feeder and there is sufficient room for it on the conveyor belt.

Figure 5-5 Installing and programming a new feeder

Solution The conveyor belt is driven by axis_1 in position-controlled mode. The feeder unit is driven by axis_2. Two sensors are applied to input1 and input2. These monitor whether a package is on the feeder unit and whether there is sufficient room for it on the conveyor belt. If both are true, the feeder belt is moved (positioned relatively).

Page 173: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 173

Figure 5-6 Section of MCC chart with open parameter screen form for Wait for condition command;

if packages are on feeder belt, WHILE loop is executed (Posrel=True).

5.1.4.2 Relevant commands of the ST (Structured Text) programming language for Wait for condition

• EXPRESSION / END_EXPRESSION for formulation of the condition • WAITFORCONDITION / END_WAITFORCONDITION

Page 174: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 174 Programming and Operating Manual, 03/2007

5.1.5 Module

Several commands are grouped in a module (see Module creation (Page 66)).

5.1.6 Subroutine call

The Subroutine call command enables you to use user-defined functions and function blocks as well as library functions and library function blocks in the MCC chart and to program their call conveniently. When the command is called, the programmed function or function block is executed. Once the function or function block is executed, the MCC chart resumes after the command.

See also Inserting a subroutine call into the MCC chart and assigning parameters (Page 126)

5.1.7 System function call

The System function call command enables you to use any system functions and system function blocks in the MCC chart and to program their call conveniently. When the command is called, the programmed system function or system function block is executed. Once the system function or system function block is executed, the MCC chart resumes after the command.

See also Using the System function call command (Page 153)

Page 175: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 175

5.1.8 Set output

5.1.8.1 Set output

This command sets each bit of an output to 1.

Assigned values for Set output command according to data type

Assigned value Data type (decimal)

BOOL TRUE 1 BYTE (SINT, USINT) 16#FF –1 or 255 WORD (INT, UINT) 16#FFFF –1 or 65535 DWORD (DINT, UDINT) 16#FFFFFFFF –1 or 4294967295

If you wish to assign another value to the output, you must use the Variable assignment command.

Figure 5-7 Parameter screen form: Set output

5.1.8.2 Overview of parameters for Set output You can set the following parameters:

Table 5-6 Overview of parameters for Set output

Field/Button Explanation/instructions Output Here, you select which output is to have its bits set to 1.

You can select from the following (outputs only): I/O variables Symbolic accesses to the process image of the BackgroundTask In addition, you can enter absolute process image accesses (outputs). For information about absolute process image access, see Syntax for the identifier for absolute PI access.

Page 176: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 176 Programming and Operating Manual, 03/2007

5.1.8.3 Relevant commands of the ST (Structured Text) programming language for Set output Value assignment to output

5.1.9 Reset output

5.1.9.1 Reset output

This command sets each bit of an output to 0.

Table 5-7 Assigned values for Reset output command according to data type

Assigned value Data type (decimal)

BOOL FALSE 0 BYTE (SINT, USINT) 16#0 0 WORD (INT, UINT) 16#0 0 DWORD (DINT, UDINT) 16#0 0

If you wish to assign another value to the output, you must use the Variable assignment command.

Figure 5-8 Parameter screen form: Reset output parameter

Page 177: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 177

5.1.9.2 Overview of parameters for Reset output You can set the following parameters:

Table 5-8 Overview of parameters for Reset output

Field/Button Explanation/instructions Output Here, you select which output is to have its bits set to 0.

You can select from the following (outputs only): • I/O variables • Symbolic accesses to the process image of the BackgroundTask In addition, you can enter absolute process image accesses (outputs).

5.1.9.3 Relevant commands of the ST (Structured Text) programming language for Reset output Value assignment to output

5.1.10 Variable assignment

You can use this command to assign values to user or system variables.

5.1.11 ST zoom

You can use this command to insert one or more ST commands in the MCC chart. Enter the ST commands in the parameter screen form.

Note Use keystroke combination Ctrl+TAB to enter a tab in the box.

Page 178: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 178 Programming and Operating Manual, 03/2007

Example with ST zoom

Figure 5-9 Parameter screen form: ST zoom

Page 179: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 179

5.1.12 Activate simulation for object

5.1.12.1 Activate simulation for object

With this command, the specified technology objects (axes, output cams, measuring inputs, synchronous (following) objects, external encoders) are switched to simulation mode. The setpoint output for axes is suppressed. The output of output cams is not switched.

Figure 5-10 Parameter screen form: Activate simulation for object

5.1.12.2 Overview of parameters for Activate simulation for object You can set the following parameters:

Table 5-9 Overview of parameters for Activate simulation for object

Field/Button Explanation/instructions Parameters tab See Overview of parameters for Activate simulation for object - Parameters tab

(Page 180) Expert tab See Overview of parameters for Activate simulation for object - Expert tab (Page 180) Delay program execution Select the check box if execution of the subsequent command is to wait until this

command is finished. If the check box is not selected, the next command is executed immediately.

Page 180: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 180 Programming and Operating Manual, 03/2007

5.1.12.3 Overview of parameters for Activate simulation for object - Parameters tab

Table 5-10 Overview of parameters for Activate simulation for object - Parameters tab

Field/Button Explanation/instructions Technology object Here you select the technology objects that are to be switched to simulation mode. You

can select several objects simultaneously. The following are available: • All objects that are defined on the device • All variables with data types of technology objects declared in the MCC source file or

MCC chart (see Technology object data types).

5.1.12.4 Overview of parameters for Activate simulation for object - Expert tab

Table 5-11 Overview of parameters for Activate simulation for object - Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type for each command step, you

can use this variable to find out the result of the command step. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.1.12.5 Relevant system functions for Activate simulation for object Cam technology package: • _enableAxisSimulation for speed-controlled axes, positioning axes, synchronous axes,

and path axes • _enableCamTrackSimulation for output cam tracks • _enableFollowingObjectSimulation for synchronous objects • _enableMeasuringInputSimulation for measuring inputs • _enableOutputCamSimulation for output cams Path technology package: • _enablePathObjectSimulation for path objects

Page 181: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 181

5.1.13 Deactivate simulation for object

5.1.13.1 Deactivate simulation for object

This command switches the specified technology objects (axes, output cams, measuring inputs, synchronous (following) objects, external encoders) from simulation mode back to normal mode. The setpoint output for axes is activated and the output cam outputs are switched again.

Figure 5-11 Parameter screen form: Deactivate simulation for object

Additional information on using the command: • Overview of parameters for Deactivate simulation for object (Page 182) • Overview of parameters for Deactivate simulation for object - Parameters tab (Page 182) • Overview of parameters for Deactivate simulation for object - Expert tab (Page 182) • Relevant system functions for Deactivate simulation for object (Page 183)

Page 182: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 182 Programming and Operating Manual, 03/2007

5.1.13.2 Overview of parameters for Deactivate simulation for object

Table 5-12 Overview of parameters for Deactivate simulation for object

Field/Button Explanation/instructions Parameters tab See Overview of parameters for Deactivate simulation for object - Parameters tab

(Page 182) Expert tab See Overview of parameters for Deactivate simulation for object - Expert tab (Page 182) Delay program execution Select the check box if execution of the subsequent command is to wait until this

command is finished. If the check box is not selected, the next command is executed immediately.

5.1.13.3 Overview of parameters for Deactivate simulation for object - Parameters tab

Table 5-13 Overview of parameters for Deactivate simulation for object - Parameters tab

Field/Button Explanation/instructions Technology object Here, you select the technology objects that are to be switched from simulation mode

back to normal operation. You can select several objects simultaneously. The following are available: • All objects that are defined on the device • All variables with data types of technology objects declared in the MCC source file or

MCC chart (see Technology object data types).

5.1.13.4 Overview of parameters for Deactivate simulation for object - Expert tab

Table 5-14 Overview of parameters for Deactivate simulation for object - Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type for each command step, you

can use this variable to find out the result of the command step. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 183: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 183

5.1.13.5 Relevant system function for Deactivate simulation for object Cam technology package: • _disableAxisSimulation for speed-controlled axes, positioning axes, synchronous axes,

and path axes • _disableCamTrackSimulation for output cam track • _disableFollowingObjectSimulation for synchronous objects • _disableMeasuringInputSimulation for measuring inputs • _disableOutputCamSimulation for output cams Path technology package: • _disablePathObjectSimulation for path objects

5.1.14 Reset object

5.1.14.1 Reset object

This command restores a technology object to its initial state. You should use this command if an axis or a synchronous group is in an imprecisely defined state as the result of a programming or parameter assignment error.

Figure 5-12 Parameter screen form: Reset object

Page 184: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 184 Programming and Operating Manual, 03/2007

Additional information on using the command: • Overview of parameters for Reset object (Page 184) • Overview of parameters for Reset object - Parameters tab (Page 184) • Overview of parameters for Reset object - Expert tab (Page 184) • Relevant system functions for Reset object (Page 185)

5.1.14.2 Overview of parameters for Reset object

Table 5-15 Overview of parameters for Reset object

Field/Button Explanation/instructions Parameters tab See Overview of parameters for Reset object - Parameters tab (Page 184) Expert tab See Overview of parameters for Reset object - Expert tab (Page 184)

5.1.14.3 Overview of parameters for Reset object - Parameters tab

Table 5-16 Overview of parameters for Reset object - Parameters tab

Field/Button Explanation/instructions Technology object Here, you select the axes, cams, etc., to be reset. You can select several objects

simultaneously. The following are available: • All objects that are defined on the device • All variables with data types of technology objects declared in the MCC source file or

MCC chart (see Technology object data types).

5.1.14.4 Overview of parameters for Reset object - Expert tab

Table 5-17 Overview of parameters for Deactivate simulation for object - Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). Return variable If you enter the name of a variable of the specified data type for each command step, you

can use this variable to find out the result of the command step. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 185: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 185

5.1.14.5 Relevant system functions for Reset object Cam technology package: • _resetAxis for speed-controlled axes, positioning axes, synchronous axes, and path axes • _resetCam for cams • _resetCamTrack for output cam tracks • _resetExternalEncoder for external encoders • _resetFollowingObject for synchronous objects • _resetMeasuringInput for measuring inputs • _resetOutputCam for output cams Path technology package: • _resetPathObject for path objects Technology package Cam_EXT: • _resetAdditionObject for addition objects • _resetControllerObject for controller objects • _resetFixedGear for fixed gears • _resetFormulaObject for formula objects • _resetSensor for sensor objects TControl technology package: • _resetTController for temperature channels

Page 186: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 186 Programming and Operating Manual, 03/2007

5.1.15 Change operating mode

5.1.15.1 Change operating mode

You can use this command to place the SIMOTION device in STOP or STOP U mode.

Note To place the SIMOTION device into RUN mode again, activate the software switch in SIMOTION SCOUT or the mode selector on the SIMOTION device.

Figure 5-13 Parameter screen form: Change operating mode

5.1.15.2 Overview of parameters for Change operating mode You can set the following parameters:

Table 5-18 Overview of parameters for Change operating mode

Field/Button Explanation/instructions Operating state STOP

STOP mode is selected. • Technology objects inactive (enables deleted, no axis motion) • User program is not executed • Loading a user program is possible • All system services are active (communication, etc.) • All analog and digital outputs set to 0 STOP user program STOPU mode is selected. • Technology objects active • Technology objects can execute jobs for testing and commissioning functions. • Otherwise identical to STOP mode

Page 187: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 187

5.1.15.3 Relevant system functions for Change operating mode System function of SIMOTION device: _changeOperationMode

5.1.15.4 Return value for Change operating mode None.

5.1.16 Activate trace

This command enables you to log signal characteristics and axis status characteristics.

5.1.17 Comment block

You can use the comment block to structure the MCC chart and insert a comment anywhere within the program sequence. The size of the comment block is automatically adjusted to the size of the comment text. The block is displayed larger than normal command blocks in the chart.

Page 188: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.1 Basic commands

SIMOTION MCC Motion Control Chart 188 Programming and Operating Manual, 03/2007

Example with Comment block

Figure 5-14 Parameter screen form: Comment block

Page 189: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 189

5.2 Task commands

5.2.1 Start task

5.2.1.1 Start task

This command starts a MotionTask with initialization of data.

Notice If the task is already active, it is stopped and restarted with data initialization.

The task to be started can be selected as follows: • Using its name (as specified in the execution system)

In this form, the command can not be used in libraries. • Using a variable of data type StructTaskId

This variable contains the TaskId that you obtained using the TaskID function. In this form, the command can be used in libraries.

Figure 5-15 Parameter screen form: Start task

Note This command may only be programmed for MotionTasks.

Page 190: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart 190 Programming and Operating Manual, 03/2007

5.2.1.2 Call from the BackgroundTask This command may be issued only once in the BackgroundTask. Otherwise, the selected MotionTask would be started at the beginning every time the BackgroundTask was executed. To prevent this, you can query and evaluate the status of the MotionTask with the Task status command (see Example of use of the Task status command).

5.2.1.3 Overview of parameters for Start task You can set the following parameters:

Table 5-19 Overview of parameters for Start task

Field/Button Explanation/instructions Task Select the task to be started. You can select from:

• All MotionTasks (not in libraries) • All variables of data type StructTaskID declared in the MCC source file or MCC chart

5.2.1.4 Relevant system functions for Start task ST system functions: • _restartTask (if task is selected by name) • _restartTaskId (if task is selected by TaskId)

5.2.1.5 Return value for Start task For ST system function _restartTaskId only: The return value informs the user about the result of the command call (see description of the _restartTaskId function in the SIMOTION ST Programming Manual). Variable _MccRetDWORD with data type DWORD.

Page 191: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 191

5.2.2 Interrupt task

5.2.2.1 Interrupt task

The task is interrupted at its present position. This command does not stop any axis motions that have already been started from this task. Any active UserInterruptTask is stopped. If the condition for restarting this UserInterruptTask is true, it is not started nor is the fulfillment of the condition stored. The task can be resumed with the Continue task command. The task to be interrupted can be selected as follows: • Using its name (as specified in the execution system)

In this form, the command cannot be used in libraries. • Using a variable of data type StructTaskId

This variable contains the TaskId that you obtained using the TaskId function. In this form, the command can be used in libraries.

Figure 5-16 Parameter screen form: Interrupt task

Note The command can be programmed for MotionTasks, UserInterruptTasks, and TimerInterruptTasks.

Page 192: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart 192 Programming and Operating Manual, 03/2007

5.2.2.2 Overview of parameters for Interrupt task You can set the following parameters:

Table 5-20 Overview of parameters for Interrupt task

Field/Button Explanation/instructions Task Select the task to be interrupted. You can select from:

• All MotionTasks (not in libraries) • UserInterruptTasks and TimerInterruptTasks configured on the device (not in libraries) • All variables of data type StructTaskId declared in the MCC source file or MCC chart

5.2.2.3 Relevant system functions for Interrupt task ST system functions: • _suspendTask (if task is selected by name) • _suspendTaskId (if task is selected by TaskId)

5.2.2.4 Return value for Interrupt task For ST system function _suspendTaskId only: The return value informs the user about the result of the command call (see description of the _suspendTaskId function in the SIMOTION ST Programming Manual). Variable _MccRetDWORD with data type DWORD.

Page 193: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 193

5.2.3 Continue task

5.2.3.1 Continue task

This command continues a task that was interrupted with the Interrupt task command at the point it was interrupted. Interrupted motions are not automatically continued. Resumption of interrupted motions must be programmed explicitly. The task to be continued can be selected as follows: • Using its name (as specified in the execution system)

In this form, the command can not be used in libraries. • Using a variable of data type StructTaskId

This variable contains the TaskId that you obtained using the TaskId function. In this form, the command can be used in libraries.

Figure 5-17 Parameter screen form: Continue task

Note The command can be programmed for MotionTasks, UserInterruptTasks, and TimerInterruptTasks.

Page 194: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart 194 Programming and Operating Manual, 03/2007

5.2.3.2 Overview of parameters for Continue task You can set the following parameters:

Table 5-21 Parameter screen form for Continue task

Field/Button Explanation/instructions Task Select the task to be continued. You can select from:

• All MotionTasks (not in libraries) • UserInterruptTasks and TimerInterruptTasks configured on the device (not in libraries) • All variables of data type StructTaskID declared in the MCC source file or MCC chart

5.2.3.3 Relevant system functions for Continue task ST system functions: • _resumeTask (if task is selected by name) • _resumeTaskId (if task is selected by TaskId)

5.2.3.4 Return value for Continue task For ST system function _resumeTaskId only: The return value informs the user about the result of the command call (see description of the _resumeTaskId function in the SIMOTION ST Programming Manual). Variable _MccRetDWORD with data type DWORD.

Page 195: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 195

5.2.4 Reset task

5.2.4.1 Reset task

This command stops a MotionTask. The task can be restarted with the Start task command with data initialization. The task to be reset can be selected as follows: • Using its name (as specified in the execution system)

In this form, the command can not be used in libraries. • Using a variable of data type StructTaskId

This variable contains the TaskId that you obtained using the TaskId function. In this form, the command can be used in libraries.

Notice The Reset task and Start task commands cannot follow each other in direct succession. Instead, use only the Start task command.

Figure 5-18 Parameter screen form: Reset task

Note This command may only be programmed for MotionTasks.

Page 196: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart 196 Programming and Operating Manual, 03/2007

5.2.4.2 Overview of parameters for Reset task

Table 5-22 Overview of parameters for Reset task

Field/Button Explanation/instructions Task Select the task to be reset. You can select from:

• All MotionTasks (not in libraries) • All variables of data type StructTaskID declared in the MCC source file or MCC chart

5.2.4.3 Relevant system functions for Reset task ST system functions: • _resetTask (if task is selected by name) • _resetTaskId (if task is selected by TaskId)

5.2.4.4 Return value for Reset task For ST system function _resetTaskId only: The return value informs the user about the result of the command call (see description of the _resetTaskId function in the SIMOTION ST Programming Manual). Variable _MccRetDWORD with data type DWORD.

Page 197: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 197

5.2.5 Task status

5.2.5.1 Task status

This command returns the status of a task. The task can be selected as follows: • Using its name (as specified in the execution system)

In this form, the command can not be used in libraries. • Using a variable of data type StructTaskId

This variable contains the TaskId that you obtained using the TaskId function. In this form, the command can be used in libraries.

Figure 5-19 Parameter screen form: Task status

Note The command can be programmed for MotionTasks, UserInterruptTasks, and TimerInterruptTasks.

Page 198: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart 198 Programming and Operating Manual, 03/2007

5.2.5.2 Overview of parameters for Task status

Table 5-23 Parameter screen form for Task status

Field/Button Explanation/instructions Task Select the task whose current state is to be determined. You can select from:

• All MotionTasks (not in libraries) • UserInterruptTasks and TimerInterruptTasks configured on the device (not in libraries) • All variables of data type StructTaskID declared in the MCC source file or MCC chart

Return value Here, you enter the return variable of type DWORD in which the task status will be stored as the command result (see description of the _getStateOfTaskId function in the SIMOTION ST Programming Manual). This variable must be defined in a declaration table or the symbol browser.

Example of use of Task status command In the following example, the task status of a MotionTask is queried to decide whether it can be started. The relevant bits of the return value are evaluated for this. If the result is positive, the MotionTask is started.

Figure 5-20 Example of a query whether a Motion Task can be started

5.2.5.3 Relevant system functions for Task status ST system functions: • _getStateOfTask (if task is selected by name) • _getStateOfTaskId (if task is selected by TaskId)

Page 199: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.2 Task commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 199

5.2.6 Determine TaskId

5.2.6.1 Determine TaskId

This command generates a project-wide unique TaskId from the name of a task. This TaskId is assigned to a variable of data type StructTaskId. This function must not be used in libraries.

Figure 5-21 Parameter screen form: Determine TaskId

Note The command can be programmed for MotionTasks, UserInterruptTasks, and TimerInterruptTasks.

5.2.6.2 Overview of parameters for Determine TaskId You can set the following parameters:

Table 5-24 Overview of parameters for Determine TaskId

Field/Button Explanation/instructions Task Select the name of the task whose project-wide unique TaskId is to be determined. You can select from:

• All MotionTasks • UserInterruptTasks and TimerInterruptTasks configured on the device

Return value Here, you enter the return variable of type StructTaskId in which the TaskId will be stored. This variable must be defined in a declaration table or the symbol browser.

Page 200: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 200 Programming and Operating Manual, 03/2007

5.2.6.3 Relevant system functions for Determine TaskId ST system functions: _getTaskId.

5.3 Program structures

5.3.1 IF: Program branching

5.3.1.1 IF: Program branching

A specified condition causes the program flow to branch to the TRUE branch or FALSE branch. The program flow branches as follows: • Condition is fulfilled: Execution continues down the TRUE path. • Condition is not fulfilled: Execution continues down the FALSE path.

Figure 5-22 Example of a branch (IF) in a flowchart

Note The condition is programmed in the ladder diagram (LAD), function block diagram (FBD), or Formula languages.

Page 201: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 201

5.3.1.2 Note on inserting the IF statement The IF statement is normally inserted after the selected command. The two branches are empty. If two or more commands are selected, the IF statement is inserted before the selected commands. The selected commands are automatically shifted to the TRUE branch; see figure below.

Figure 5-23 Inserting the IF statement when several commands are selected

5.3.1.3 Note on deleting/cutting or copying an IF statement When you delete, cut, or copy an IF statement, the commands assigned in the branches are also deleted or copied. If the commands within the control structure are not to be deleted or cut when the structure is deleted or cut, you must copy them first and repaste them outside the control structure.

5.3.1.4 Relevant commands of the ST (Structured Text) programming language for IF: Program branching

IF / ELSE / END_IF

Page 202: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 202 Programming and Operating Manual, 03/2007

5.3.2 WHILE: Loop with condition at the start

5.3.2.1 WHILE: Loop with condition at the start

Commands programmed within the loop are executed as long as the loop condition is fulfilled. The condition is at the start of the loop. When the WHILE command is reached, program flow branches as follows: • Condition is fulfilled: Program runs through loop. • Condition is not fulfilled: Program continues.

Example of WHILE loop with condition at start

Figure 5-24 Example of repetition with query at beginning (WHILE) in the flowchart

Note The condition is programmed in the ladder diagram (LAD), function block diagram (FBD), or Formula languages. Refer to the notes regarding pasting, deleting, cutting, or copying of the IF statement; they apply analogously.

Page 203: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 203

5.3.2.2 Relevant commands of the ST (Structured Text) programming language for WHILE: Loop with condition at the start

WHILE /END_WHILE

5.3.3 FOR: Loop with fixed number of runs

5.3.3.1 FOR: Loop with fixed number of runs

The FOR loop repeats a program section for a fixed number of runs. Once the loop has been run the specified number of times, the program continues.

Figure 5-25 Parameter screen form: FOR statement

5.3.3.2 Overview of parameters for FOR: Loop with fixed number of runs You can set the following parameters:

Table 5-25 Overview of parameters for FOR loop with fixed number of runs

Field/Button Explanation/instructions Variable Enter the count variable for the FOR loop here.

The variable must be of type INT. The variable name can be entered or moved from the symbol browser using a drag-and-drop operation.

Start Enter the initial value of the count variable here. The count variable is set to the specified value at the first pass of the loop start. The initial value can be directly entered as a value or, alternatively, as a formula. Variables can be used. The expression is of type INT.

End Enter the final value of the count variable here. The loop is executed repeatedly until the count variable exceeds the specified final value. The value can be directly entered as a value or, alternatively, as a formula. Variables can be used. The expression is of type INT.

Increment Enter the increment here: The count variable is increased by the entered increment each time the loop is run. The value can be directly entered as a constant or, alternatively, as a formula. Variables can be used. The expression is of type INT.

Page 204: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 204 Programming and Operating Manual, 03/2007

Example of a FOR loop in a program

Figure 5-26 Example of a FOR loop in a program

Note Refer to the notes regarding pasting, deleting, cutting, or copying of the IF statement; they apply analogously.

Example of a FOR statement The program loop is to be executed 10 times. The variable must be defined and be of data type INT. The parameter screen form is configured as shown in the figure below.

Figure 5-27 Example of a FOR statement

Page 205: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 205

5.3.3.3 Relevant commands of the ST (Structured Text) programming language for FOR: Loop with fixed number of runs

FOR / END_FOR

5.3.4 UNTIL: Loop with condition at the end

5.3.4.1 UNTIL: Loop with condition at the end

The commands programmed within the loop are executed until the loop condition is fulfilled. The condition is programmed at the end of the loop. For this reason, the commands in the loop are executed at least once. When the UNTIL command is reached, program flow branches as follows: • Condition is not fulfilled: Program runs through loop. • Condition is fulfilled: Program continues.

Example of UNTIL loop with condition at end

Figure 5-28 Example of repetition with query at the end (UNTIL) in the flowchart

Page 206: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 206 Programming and Operating Manual, 03/2007

Note The condition is programmed in the ladder diagram (LAD), function block diagram (FBD), or Formula languages. Refer to the notes regarding pasting, deleting, cutting, or copying of the IF statement; they apply analogously.

5.3.4.2 Relevant commands of the ST (Structured Text) programming language for UNTIL: Loop with condition at the end

REPEAT / UNTIL / END_REPEAT

5.3.5 CASE: Multiple branching

5.3.5.1 CASE: Multiple branching

Depending on the value of a variable, several alternative program branches may be executed. The following variable data types are permitted: • General data type ANY_INT • Any enumeration data type

Example of CASE Multiple branching

Figure 5-29 Description of the variable and ELSE branches

Page 207: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 207

5.3.5.2 Inserting a branch in the CASE statement After insertion of this command, there are two program branches. To insert additional branches, proceed as follows: • To insert a branch in the first position (left):

Select the command, and select Insert branch from the context menu. • To insert additional branches:

Select the branch, and select Insert branch from the context menu. The branch is inserted on the right next to the selected branch.

5.3.5.3 Deleting a branch from the CASE statement To delete a branch, proceed as follows: 1. Delete all commands from the branch. 2. Select the branch. 3. Select Delete empty branch from the context menu.

5.3.5.4 Comparison constant in the CASE statement Overwrite the default ??? in every branch with a constant of the same data type as the variable. A value range can also be specified, for example, 1,2,3 or 4 to 10. It is not possible to overwrite the preassigned value in an ELSE branch.

Page 208: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 208 Programming and Operating Manual, 03/2007

5.3.5.5 Overview of parameters for CASE: Multiple branching You can set the following parameters:

Table 5-26 Overview of parameters for CASE multiple branching

Field/Button Explanation/instructions Variable Enter a variable of the following data types:

• General data type ANY_INT • Any enumeration data type The variable name can be entered or moved from the symbol browser using a drag-and-drop operation. The CASE branch whose label is consistent with the variable content is executed. If the content of the variable does not match any of the constants or constant ranges, then the ELSE branch is executed.

Note Refer to the notes regarding pasting, deleting, cutting, or copying of the IF statement; they apply analogously.

5.3.5.6 Relevant commands of the ST (Structured Text) programming language for CASE: Multiple branching

CASE / ELSE / END_CASE

5.3.6 Go to

5.3.6.1 Go to

You can program jumps within an MCC chart using the Go to command. A jump is defined as a jump label (Go to command) and a jump destination (Selection command), each with the same name. A circle symbol with a name marks the exit and entry point in each case. Several exit points with the same name can be programmed, but only one entry point. The following jumps are illegal: • Jumps to control structures • Jumps out of the shaded area after a Wait command

Page 209: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 209

After you have inserted a Go to command, you must enter the name of the jump destination. For this, double-click inside the circle.

Figure 5-30 Parameter screen form: Go to

5.3.6.2 Overview of parameters for Go to You can set the following parameters:

Table 5-27 Overview of parameters for Go to

Field/Button Explanation/instructions Jump destination ID Enter the name of the jump destination. The name is made up of the following:

• The first character is a letter or underscore symbol • The remaining characters are letters, underscore symbols, or digits It is irrelevant whether the letters are upper or lower case. The name must be identical to the newly assigned name for the jump label – see Selection command.

5.3.6.3 Relevant commands of the ST (Structured Text) programming language for Go to: GOTO

Page 210: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 210 Programming and Operating Manual, 03/2007

5.3.7 Selection

5.3.7.1 Selection

This command is used to identify the entry point for the Go To command. A jump is defined as a jump label (Go to command) and a jump destination (Selection command), each with the same name. A circle symbol with a name marks the exit and entry point in each case. Several exit points with the same name can be programmed, but only one entry point. The following jumps are illegal: • Jumps to control structures • Jumps out of the shaded area after a Wait command After you have inserted the Selection command, you must enter the name of the jump label. For this, double-click inside the circle.

Figure 5-31 Parameter screen form: Selection (jump label)

5.3.7.2 Overview of parameters for Selection You can set the following parameters:

Table 5-28 Overview of parameters for Selection

Field/Button Explanation/instructions Jump mark ID Enter the name of the jump label. The name is made up of the following:

• The first character is a letter or underscore symbol • The remaining characters are letters, underscore symbols, or digits It is irrelevant whether the letters are upper or lower case. The name must be identical to the newly assigned name for the jump destination – see Go to command.

5.3.7.3 Relevant commands of the ST (Structured Text) programming language for Selection: Definition of a jump label

Page 211: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 211

5.3.8 Return

5.3.8.1 Return

This command causes the MCC chart (program, function, function block) to end. When a function or a function block is ended, program execution continues in the higher-level MCC chart (or program organization unit) after the position where the function or function block was called.

Example of Return

Figure 5-32 Example of Return

5.3.8.2 Relevant commands of the ST (Structured Text) programming language for Return: RETURN

Page 212: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 212 Programming and Operating Manual, 03/2007

5.3.9 Exit

5.3.9.1 Exit

This command is permitted in the following program structures (loops): • WHILE loop with condition at start • FOR loop with fixed number of runs • UNTIL loop with condition at end It enables loop to be exited at any location regardless of whether or not the abort condition is satisfied. The program is continued at the end of the loop.

Example of Exit

Figure 5-33 Example of Exit

5.3.9.2 Relevant commands of the ST (Structured Text) programming language for Exit: EXIT

Page 213: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 213

5.3.10 Synchronous start

5.3.10.1 Synchronous start

You can use this command to start several commands simultaneously. The permissible commands are listed in Permissible commands. The next command is started when all existing commands in the branches have been completely executed. The section Permissible commands also specifies when a command is complete. There is no limit to the number of commands started simultaneously nor to the number of synchronous starts within an MCC chart. This command should only be used in MotionTasks.

Notice When you use the Synchronous Start command, 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. 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. For information about execution levels and tasks, see Execution levels and tasks in SIMOTION in the SIMOTION ST Programming Manual.

Page 214: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 214 Programming and Operating Manual, 03/2007

Example: Synchronous start of three commands

Figure 5-34 Synchronous start of three commands

5.3.10.2 Programming a condition You can program a condition for the synchronous start. TRUE is the default setting when the command is called. This causes immediate synchronous start. Programming a condition corresponds to the Wait for condition command. Consequently, you must note the following: The condition can be composed of: • Unit variables of the same MCC source file • Global device variables • Constants • I/O variables and process image accesses (inputs) • Operators The expression must not contain: • Function calls • Local variables or variables imported from other MCC source files • Loops

Note The condition is programmed in the ladder diagram (LAD), function block diagram (FBD), or Formula languages.

5.3.10.3 Checkbox If you select the Start command if condition is fulfilled check box, the commands in the branches are not executed until the programmed condition is satisfied.

Page 215: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 215

5.3.10.4 Insert branch After insertion of this command, there are two program branches. To insert additional branches, proceed as follows: • To insert a branch in the first position (left):

Select the command, and select Insert branch from the context menu. • To insert additional branches:

Select the branch and select Insert branch from the context menu. The branch is inserted to the right of the selected branch.

5.3.10.5 Deleting a branch To delete a branch, proceed as follows: 1. Delete all commands from the branch. 2. Select the branch. 3. Select Delete empty branch from the context menu.

5.3.10.6 Permissible commands The following table lists the commands permitted for the synchronous start.

Notice In the case of single axis commands and synchronous operation and cam commands, the synchronous start can only be guaranteed if the following two conditions are satisfied: The commands embedded in the synchronous start must act on different axes. The axes involved must be on the same ExecutionLevel (IPO or IPO_2).

The following table shows the permissible commands for a synchronous start with specification of timing for proper completion of commands; timing depends on whether an additional command is present on the relevant axis.

Page 216: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart 216 Programming and Operating Manual, 03/2007

Table 5-29 Permissible commands for a synchronous start with specification of timing for proper completion of commands; timing depends on whether an additional command is present on the relevant axis

Timing for proper completion of command Permissible command Another command is present No other command is present

Basic commands Subroutine call - - Set output - - Reset output - - Variable assignment - - Single axis commands Homed axis Motion is finished Motion is finished Start axis position-controlled • With time specification:

End of setpoint interpolation • Without time specification:

Infinite

• With time specification: Motion is finished

• Without time specification: Infinite

Speed preset • With time specification: End of setpoint interpolation

• Without time specification: Infinite

• With time specification: Standstill signal of axis

• Without time specification: Infinite

Position axis End of setpoint interpolation Motion is finished Time-dependent position profile End of setpoint interpolation Motion is finished Time-dependent velocity profile End of setpoint interpolation • Speed-controlled (axis:

Standstill signal of axis • Positioning axis or synchronous

axis: Motion is finished

Stop axis End of setpoint interpolation • Speed-controlled (axis: Standstill signal of axis

• Positioning axis or synchronous axis: Motion is finished

Commands for synchronous operation and camming Gearing on Infinite Infinite Gearing off End of setpoint interpolation End of setpoint interpolation Cam on • Cyclic cam

Infinite • Non-cyclic cam

End of setpoint interpolation

• Cyclic cam Infinite

• Non-cyclic cam End of setpoint interpolation

Cam off End of setpoint interpolation End of setpoint interpolation

Page 217: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.3 Program structures

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 217

5.3.10.7 Transition behavior All single axis commands and commands for synchronous operation and camming embedded in the synchronous start are programmed with the Substitute transition behavior. For the following commands, the Superimpose transition behavior can also be selected: • Start axis position-controlled • Speed preset • Position axis • Time-dependent position profile • Time-dependent velocity profile

5.3.10.8 Step enabling condition For each single axis command or command for synchronous operation and camming embedded in the synchronous start, the Delay program execution check box is selected. The user cannot change this setting. This indicates that once the synchronous start is executed, the MotionTask is placed into the waiting state until the last command enclosed within the synchronous start has been completed or aborted. The timing for proper completion of a command depends on whether another axis command is pending, and is indicated in the table above in the Permissible commands section.

5.3.10.9 Deleting/cutting or copying When you delete, cut, or copy the synchronous start command, any commands programmed in the branches are also deleted or copied.

5.3.10.10 Relevant system functions and commands of the ST (Structured Text) programming language for synchronous start

System functions of SIMOTION devices: • BEGIN_SYNC / END_SYNC • _disableScheduler / _enableScheduler • _startSyncCommands ST system function: • _getSyncCommandId • _waitTime ST commands: • EXPRESSION / END_EXPRESSION for formulation of the wait condition • WAITFORCONDITION / END_WAITFORCONDITION

Page 218: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 218 Programming and Operating Manual, 03/2007

5.4 Communication

5.4.1 Acknowledge technology object alarms

5.4.1.1 Acknowledge technology object alarms

This command acknowledges the pending technology alarms on one or more technology objects.

Figure 5-35 Parameter screen form: Acknowledge technology object alarms

5.4.1.2 Overview of parameters for Acknowledge technology object alarms

Table 5-30 Overview of parameters for Acknowledge technology object alarms

Field/Button Explanation/instructions Parameters tab See table below: Overview of parameters for Acknowledge technology object alarms -

Parameters tab Expert tab See table below: Overview of parameters for Acknowledge technology object alarms -

Parameters tab

Page 219: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 219

5.4.1.3 Overview of parameters for Acknowledge technology object alarms - Parameters tab

Table 5-31 Overview of parameters for Acknowledge technology object alarms - Parameters tab

Field/Button Explanation/instructions Technology object Here, you select the technology objects (axes, cams, etc.) whose alarms are to be

acknowledged. You can select several objects simultaneously. The following are available: • All objects that are defined on the device • All variables with data types of technology objects declared in the MCC source file or

MCC chart (see Technology object data types table). Acknowledge all alarms Select this check box if all alarms queued on the device are to be acknowledged.

5.4.1.4 Overview of parameters for Acknowledge technology object alarms - Expert tab

Table 5-32 Overview of parameters for Acknowledge technology object alarms - Expert tab

Field/Button Explanation/instructions Return variable If you enter the name of a variable of the specified data type for each command step, you

can use this variable to find out the result of the command step. DINT data type. • When the Acknowledge all alarms check box is selected: The return value is always 0. • When the Acknowledge all alarms check box is cleared: For a description, see Return

value for system functions of the Cam technology package.

5.4.1.5 Relevant system functions for Acknowledge technology object alarms When the Acknowledge all alarms check box is active: • System function of SIMOTION devices

– _resetTechnologicalErrors for resetting all objects When the Acknowledge all alarms check box is cleared: • Cam technology package:

– _resetAxisError for speed-controlled axes, positioning axes, synchronous axes, and path axes

– _resetCamError for cams – _resetCamTrackError for output cam tracks – _resetExternalEncoderError for external encoders – _resetFollowingObjectError for synchronous (following) objects – _resetMeasuringInputError for measuring inputs – _resetOutputCamError for output cams

Page 220: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 220 Programming and Operating Manual, 03/2007

• Path technology package: – _resetPathObjectError for path objects

• Technology package Cam_EXT: – _resetAdditionObjectError for addition objects – _resetControllerObjectError for controller objects – _resetFixedGearError for fixed gear – _resetFormulaObjectError for formula objects – _resetSensorError for sensor objects

• TControl technology package: – _resetTControllerError for temperature channels

Each with parameter errorResetMode = ALL_ERRORS (default) See also the Acknowledge all alarms field/button in the Overview of parameters for Acknowledge technology object alarms section.

5.4.2 Acknowledge specific technology object alarm

5.4.2.1 Acknowledge specific technology object alarm

The command acknowledges all alarms or a specific alarm at a technology object.

Figure 5-36 Parameter screen form: Acknowledge specific technology object alarm

Page 221: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 221

5.4.2.2 Overview of parameters for Acknowledge specific technology object alarm You can set the following parameters:

Table 5-33 Overview of parameters for Acknowledge specific technology object alarm

Field/Button Explanation/instructions Technology object Here, you select the technology objects (axes, cams, etc.) whose alarms are to be

acknowledged. You can select several objects simultaneously. The following are available: • All objects that are defined on the device • All variables with data types of technology objects declared in the MCC source file or

MCC chart (see Technology object data types table). Parameters tab See table below: Overview of parameters for Acknowledge specific technology object

alarm - Parameters tab Expert tab See table below: Overview of parameters for Acknowledge specific technology object

alarm - Parameters tab

5.4.2.3 Overview of parameters for Acknowledge specific technology object alarm - Parameters tab

Table 5-34 Overview of parameters for Acknowledge specific technology object alarm - Parameters tab

Field/Button Explanation/instructions Method of operation Select which alarms on the technology object are to be acknowledged:

Acknowledge all alarms All alarms on the technology object are acknowledged. Acknowledge a specific alarm The alarm specified in the "Alarm No." or "Alarm text" field is acknowledged.

Alarm number Enter the alarm number. The corresponding text is displayed in the alarm text field.

Alarm text Select the alarm text. The corresponding number of the alarm is displayed in the alarm number field.

5.4.2.4 Overview of parameters for Acknowledge specific technology object alarm - Expert tab

Table 5-35 Overview of parameters for Acknowledge specific technology object alarm - Expert tab

Field/Button Explanation/instructions Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 222: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 222 Programming and Operating Manual, 03/2007

5.4.2.5 Relevant system functions for Acknowledge specific technology object alarm Cam technology package: • _resetAxisError for speed-controlled axes, positioning axes, synchronous axes, and path

axes • _resetCamError for cams • _resetCamTrackError for output cam tracks • _resetExternalEncoderError for external encoders • _resetFollowingObjectError for synchronous (following) objects • _resetMeasuringInputError for measuring inputs • _resetOutputCamError for output cams Path technology package: • _resetPathObjectError for path objects Technology package Cam_EXT: • _resetAdditionObjectError for addition objects • _resetControllerObjectError for controller objects • _resetFixedGearError for fixed gear • _resetFormulaObjectError for formula objects • _resetSensorError for sensor objects TControl technology package: • _resetTControllerError for temperature channels Each with parameter errorResetMode = SPECIFIC_ERROR

5.4.3 Incoming message

5.4.3.1 Incoming message

This command notifies configured nodes that a message has arrived. Messages are configured beforehand in the message configuration (Target system > Message configuration menu command). The message is sent to all of the configured nodes. See the online help for information about message configuration. If the specified message is already present, then there is no change. The message is not set again.

Page 223: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 223

Figure 5-37 Parameter screen form: Incoming message

5.4.3.2 Overview of parameters for Incoming message You can set the following parameters:

Table 5-36 Overview of parameters for Incoming message

Field/Button Explanation/instructions Alarm Here, you select one of the configured messages. To configure new messages, select

Program -> Configure messages in the project navigator. Parameters tab See table below: Overview of parameters for Incoming message - Parameters tab Expert tab See table below: Overview of parameters for Incoming message - Parameters tab

Page 224: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 224 Programming and Operating Manual, 03/2007

5.4.3.3 Overview of parameters for Incoming message - Parameters tab

Table 5-37 Overview of parameters for Incoming message - Parameters tab

Field/Button Explanation/instructions Auxiliary value Enter an auxiliary value for the message. Integer numbers, numbers with decimal points,

and positive and negative values are permitted. Variables of type ANY_NUM or ANY_BIT can also be specified. Although any of the specified data types may be programmed in theory for the auxiliary value, they must match the type configured for the message.

Acknowledgment Here, you select whether the message can be acknowledged. Acknowledgeable message (default value) Acknowledgeable message: When the message arrives, the user must acknowledge it on the operator panel. Message not acknowledgeable Message not acknowledgeable: The message is visible until the program has issued an outgoing message.

5.4.3.4 Overview of parameters for Incoming message - Expert tab

Table 5-38 Overview of parameters for Incoming message - Expert tab

Field/Button Explanation/instructions Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DWORD; for a description, see _alarmSId and _alarmSqId functions in the SIMOTION ST Programming Manual.

5.4.3.5 Relevant system functions for Incoming message ST system function: • SIMOTION kernel V3.1 and higher:

– _alarmSId (for non-acknowledgeable message) – _alarmSqId (for acknowledgeable message)

• Up to SIMOTION kernel V3.0: – _alarmS (for non-acknowledgeable message) – _alarmSq (for acknowledgeable message)

each with parameter sig:= TRUE

Page 225: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 225

5.4.4 Outgoing message

5.4.4.1 Outgoing message

This command notifies configured stations that a message is no longer pending. The message itself is created in the message configuration (Target system > Message configuration menu command). Acknowledgeable messages can then be acknowledged on the OP. See the online help for information about message configuration.

Figure 5-38 Parameter screen form: Outgoing message

5.4.4.2 Overview of parameters for Outgoing message You can set the following parameters:

Table 5-39 Overview of parameters for Outgoing message

Field/Button Explanation/instructions Alarm Here, you select one of the configured messages. To configure new messages, select

Program -> Configure messages in the project navigator. Parameters tab See Overview of parameters for Outgoing message - Parameters tab Expert tab See Overview of parameters for Outgoing message - Expert tab

Page 226: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 226 Programming and Operating Manual, 03/2007

5.4.4.3 Overview of parameters for Outgoing message - Parameters tab

Table 5-40 Overview of parameters for Outgoing message - Parameters tab

Field/Button Explanation/instructions Auxiliary value Enter an auxiliary value for the message. Integer numbers, numbers with decimal points,

and positive and negative values are permitted. Variables of type ANY_NUM or ANY_BIT can also be specified. Although any of the specified data types may be programmed in theory for the auxiliary value, they must match the type configured for the message.

Acknowledgment Here, you select whether the message can be acknowledged. Acknowledgeable message (default value) Acknowledgeable message: If the message has been sent, the user must acknowledge it on the OP. Message not acknowledgeable Message not acknowledgeable: The message is visible until the program has issued an outgoing message.

5.4.4.4 Overview of parameters for Outgoing message - Expert tab

Table 5-41 Overview of parameters for Outgoing message - Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in the Overview of parameters for Expert tab table. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DWORD; for a description, see _alarmSId and _alarmSqId functions in the SIMOTION ST Programming Manual.

5.4.4.5 Relevant system functions for Outgoing message ST system function: • SIMOTION kernel V3.1 and higher:

– _alarmSId (for non-acknowledgeable message) – _alarmSqId (for acknowledgeable message)

• Up to SIMOTION kernel V3.0: – _alarmS (for non-acknowledgeable message) – _alarmSq (for acknowledgeable message)

each with parameter sig:= FALSE

Page 227: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 227

5.4.5 Establish connection using TCP/IP

5.4.5.1 Establish connection using TCP/IP

Before you can use the TCP/P protocol of the Send data or Receive data commands, you must establish the TCP/IP connection for both communication partners: 1. You specify one communications partner as the server.

After the call, the command waits for a connection request at the specified port. 2. You specify the other communications partner as the client and specify the server it is to

access. After the command is called, a connection to the server addressed by the IP address and port number is established.

The connection is maintained until it is terminated by the Remove connection using TCP/IP command.

Figure 5-39 Parameter screen form: Establish connection using TCP/IP

Page 228: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 228 Programming and Operating Manual, 03/2007

5.4.5.2 Overview of parameters for Establish connection using TCP/IP You can set the following parameters:

Table 5-42 Overview of parameters for Establish connection using TCP/IP

Field/Button Explanation/instructions Page Select whether the SIMOTION device is to act as a server or client in the TCP/IP

connection. The parameter dialog box changes according to the selected value. Server The SIMOTION device acts as a server in the TCP/IP connection. Client The SIMOTION device acts as a client in the TCP/IP connection.

Parameters for Page = Server See Overview of parameters for Establish connection using TCP/IP - Parameters for

server Page = Server See Overview of parameters for Establish connection using TCP/IP - Parameters for clientDelay program execution Select the check box if execution of the subsequent command is to wait until this

command is finished. If the check box is not selected, the next command is executed immediately.

Table 5-43 Overview of parameters for Establish connection using TCP/IP - Parameters for server

Field/Button Explanation/instructions Port number Here, you enter the number of the port where the command waits for a connection

request. Max. number of parallel connection requests

Here, you enter the maximum number of parallel connection requests.

Return variable Here, you enter the return variable of data type StructRetTcpOpenServer in which the error message and connection parameters are stored. This variable must be defined in a declaration table or the symbol browser.

Variable for new connection ID Here, you enter a variable of data type DINT. It contains the new connection ID. The value is identical with the connection Id component of the return variable.

Table 5-44 Overview of parameters for Establish connection using TCP/IP - Parameters for client

Field/Button Explanation/instructions Port number Here, you enter the port number of the client. IP address of server Here, you enter the IP address of the server. Port number of the server Here, you enter the port number of the server. Return variable Here, you enter the return variable of data type StructRetTcpOpenClient in which the error

message and connection parameters are stored. This variable must be defined in a declaration table or the symbol browser.

Variable for new connection ID Here, you enter a variable of data type DINT. It contains the new connection ID. The value is identical with the connection Id component of the return variable.

Page 229: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 229

5.4.5.3 Relevant system functions for Establish connection using TCP/IP System function of SIMOTION devices: • _tcpOpenServer, if Page = Server is selected. • _tcpOpenClient, if Page = Client is selected.

5.4.5.4 Return value for Establish connection using TCP/IP The return value informs the user about the result of the command call and contains important connection parameters. You must declare the return variable as a variable of the following data types in a declaration table or the symbol browser and specify it when assigning the command parameters. • StructRetTcpOpenServer, if Page = Server is selected. • StructRetTcpOpenClient, if Page = Client is selected. The following table lists the meaning of the individual elements of these data types.

Table 5-45 Structure of the return value (TYPE StructRetTcpOpenServer)

Parameter (data type) Meaning/values Values functionResult (DINT)

Error code < 16#8000: if command execution is okay >= 16#8000: if an error has occurred See description for _tcpOpenServer command in the list manuals for the SIMOTION devices.

connectionId (DINT)

New connection ID

clientAddress (ARRAY [0..3] OF USINT)

IP address of the connecting client

clientPort (UINT)

Port number of the connecting client

Table 5-46 Structure of the return value (TYPE StructRetTcpOpenClient)

Parameter (data type) Meaning/values Values functionResult (DINT)

Error code < 16#8000: if command execution is okay >= 16#8000: if an error has occurred See description for _tcpOpenClient command in the list manuals for the SIMOTION devices.

connectionId (DINT)

New connection ID

Page 230: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 230 Programming and Operating Manual, 03/2007

5.4.6 Remove connection using TCP/IP

5.4.6.1 Remove connection using TCP/IP

This command is used to cancel a TCP/IP connection.

Figure 5-40 Parameter screen form: Remove connection using TCP/IP

Page 231: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 231

5.4.6.2 Overview of parameters for Remove connection using TCP/IP You can set the following parameters:

Table 5-47 Overview of parameters for Remove connection using TCP/IP

Field/Button Explanation/instructions Page Select whether you want to cancel an existing server connection or client connection.

The parameter dialog box changes according to the selected value. Server A server connection is canceled. Client A client connection is canceled.

Port number Only when Page = Server is selected. Here, you enter the number of the port where the command waits for a connection request.

Connection ID: Only when Page = Client is selected. Here, you enter a variable of data type DINT that contains the connection ID of the connection to be closed.

Return variable Enter the return variable of data type DINT in which the error message will be stored. This variable must be defined in a declaration table or the symbol browser. < 16#8000: if command execution is okay >= 16#8000: if an error has occurred See description for _tcpCloseServer and _tcpCloseConnection functions in the list manuals for the SIMOTION devices.

Delay program execution Select the check box if execution of the subsequent command is to wait until this command is finished. If the check box is not selected, the next command is executed immediately.

5.4.6.3 Relevant system functions for Remove connection using TCP/IP System function of SIMOTION devices: _tcpCloseServer, if Page = Server is selected. _tcpCloseConnection, if Page = Client is selected.

Page 232: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 232 Programming and Operating Manual, 03/2007

5.4.7 Send data

5.4.7.1 Send data

This command sends data to a communications partner (such as a SIMATIC S7 station) using various protocols. • XSend/XReceive protocol

The connection to the communications partner is established via PROFIBUS or MPI and does not have to be configured. SIMOTION devices can send a maximum of 200 bytes in one unit; the actual useful data length is dependent on the communications partner.

• UDP protocol The connection is established via Ethernet with the UDP protocol. SIMOTION devices can send a maximum of 1400 bytes in one unit; the actual useful data length is dependent on the communications partner.

• TCP/IP protocol The connection is established via Ethernet with the TCP/IP protocol. You must have configured the TCP/IP connection beforehand. Use the Establish connection using TCP/IP command. SIMOTION devices can send a maximum of 4096 bytes in one unit; the actual useful data length is dependent on the communications partner.

Page 233: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 233

Figure 5-41 Parameter screen form: Send data

Page 234: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 234 Programming and Operating Manual, 03/2007

5.4.7.2 Overview of parameters for Send data You can set the following parameters:

Table 5-48 Overview of parameters for Send data

Field/Button Explanation/instructions Log You can choose between the different protocols here. The parameter dialog box changes,

accordingly. XSend/XReceive The connection is established via PROFIBUS or MPI. UDP The connection is established via Ethernet, and the UDP protocol is selected. TCP/IP The TCP/IP protocol is selected. You must have configured the TCP/IP connection beforehand. Use the Establish connection using TCP/IP command.

Parameters tab • For Protocol = Xsend/XReceive

See Overview of parameters for Send data - Parameters tab for Protocol = Xsend/XReceive

• For Protocol = UDP

See Overview of parameters for Send data - Parameters tab for Protocol = UDP • For Protocol = TCP/IP

See Overview of parameters for Send data - Parameters tab for Protocol = TCP/IP Expert tab See Overview of parameters for Send data - Expert tab Delay program execution Only when Protocol = Xsend/XReceive or Protocol = TCP/IP is selected.

Select the check box if you wish to delay execution of the following command until the current command has been completed. If the check box is not selected, the next command is executed immediately. If Protocol = UDP is selected, the next command is immediately processed.

Page 235: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 235

5.4.7.3 Overview of parameters for Send data - Parameters tab

Table 5-49 Overview of parameters for Send data - Parameters tab for Protocol = Xsend/XReceive

Field/Button Explanation/instructions Job identifier Enter the job identifier here. The data type is UDINT. Return variable Enter the return variable of data type DINT in which the error message will be stored. This

variable must be defined in a declaration table or the symbol browser. < 16#8000: if command execution is okay >= 16#8000: if an error has occurred See description for _Xsend function in the list manuals for the SIMOTION devices.

Communications partner Here, you select the communications partner to which you wish to send data. Specify address directly This setting enables you to enter the communications partner's address directly. Use this selection if the communications partner is not defined in the project (for example, SIMATIC S7 stations). Select device from hardware configuration (default value) This setting enables you to select a SIMOTION device from the current hardware configuration. This setting can not be used in libraries.

Device This selection is only active if Select device from hardware configuration is selected in the "Communications partner" selection field. Here, you select the receiving device. You can choose from all SIMOTION devices that can be reached directly by means of a PROFIBUS or MPI subnet.

Connection of transmitting CPU

This selection is only active if Select device from hardware configuration is selected in the "Communications partner" selection field. Here, you select the connection of the transmitting SIMOTION device. Once the receiving device (communications partner) is selected, the PROFIBUS or MPI connection of the transmitting SIMOTION device is offered.

Destination address of communications partner

This selection is active only if Specify address directly is active in the "Communications partner" list. Here, you enter the name of the variable in which the destination address of the communications partner is stored. You define the variable in a declaration table as StructXSendDestAddr (Xsend/Xreceive protocol).

Continue connection Here, decide whether the connection should remain after data transfer. Select "Disconnecting" if the device in question is communicating with a large number of nodes. Disconnecting (default value) The connection is discontinued after the data transmission. Connection remains active The connection remains active after the data transmission.

Back up Enter the communication data here. You can enter up to 200 values. The data type must be BYTE; furthermore, variables of type BYTE can be entered.

Page 236: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 236 Programming and Operating Manual, 03/2007

Table 5-50 Overview of parameters for Send data - Parameters tab for Protocol = UDP

Field/Button Explanation/instructions Port number of sender Here, you enter the port number of the transmitting SIMOTION device. IP address of receiver Here, you enter the IP address of the receiver. Port number of receiver Here, you enter the port number of the receiver. Socket lifetime Here, decide whether the connection should remain after data transfer. Select Disconnect

socket, if the selected device communicates with many nodes. Socket remains (default value) The connection remains active after the data transmission. Close socket The connection is discontinued after the data transmission.

Back up Enter the communication data here. You can enter up to 1400 values. The data type must be BYTE; furthermore, variables of type BYTE can be entered.

Table 5-51 Overview of parameters for Send data – Parameters tab for Protocol = TCP/IP

Field/Button Explanation/instructions Connection ID Here, you enter the connection ID.

This value was obtained when the TCP/IP connection was established with the Establish connection using TCP/IP command.

Back up Enter the communication data here. You can enter up to 4096 values. The data type must be BYTE; furthermore, variables of type BYTE can be entered.

5.4.7.4 Overview of parameters for Send data - Expert tab

Table 5-52 Overview of parameters for Send data – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in the Overview of parameters for Expert tab table. CommandID variable Only when Protocol = Xsend/XReceive is selected

If you enter the name of a variable of data type CommandIdType, you can track the command status with this variable.

Return variable Only when Protocol = UDP or Protocol = TCP/IP is selected If you enter the name of a variable of the data type DINT, you can use this variable to find out the result of the command call. < 16#8000: if command execution is okay >= 16#8000: if an error has occurred See description for _udpSend and _tcpSend functions in the list manuals for the SIMOTION devices.

Page 237: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 237

5.4.7.5 Querying the command status for Send data with XSend/XReceive protocol When the XSend/XReceive protocol is used, you can query the status of the command on the basis of the CommandID variable using the _GetStateOfXCommand system function (see list manuals for SIMOTION devices). This is required, in particular, if the Delay program execution parameter is deactivated. In this way you can avoid an overflow of the send buffer due to multiple calls of the command. ST commands can be programmed using the ST zoom, for example. You cannot query the command status in the UDP or TCP/IP protocols.

5.4.7.6 Structure of destination address of the communications partner, when address is entered directly (XSend/XReceive protocol)

When you enter the destination address of the communications partner directly in the XSend/XReceive protocol, you must declare a variable of data type StructXSendDestAddr in a declaration table or in the symbol browser. The following table lists the meaning of the individual elements of these data types.

Table 5-53 Structure of destination address of the communications partner, when address is entered directly (TYPE StructXSendDestAddr – XSend/XReceive protocol)

Parameter (data type) Meaning/values Values C230-2, C240: 1 for X8

2 for X9 P350: 1 for X101

2 for X102 D410 1 for X21

deviceId (USINT)

Point of the connection

D4x5: 1 for X126 2 for X136

remoteSubnetIdLength (USINT) Length of the subnet dialog box 0 for MPI, PROFIBUS remoteStaddrLength (USINT) Length of station address (station

number) of destination system. 1 for MPI, PROFIBUS

nextStaddrLength (USINT)

Length of the router address 0 for MPI, PROFIBUS

remoteSubnetId (ARRAY [0..5] OF USINT)

Subnet mask (irrelevant for MPI, PROFIBUS)

remoteStaddr (ARRAY [0..5] OF USINT)

Station address of target system (actual target address)

Station number for MPI, PROFIBUS: e.g.: remoteStaddr[0] = 25

nextStaddr (ARRAY [0..5] OF USINT)

Router address (irrelevant for MPI, PROFIBUS)

Page 238: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 238 Programming and Operating Manual, 03/2007

5.4.7.7 Relevant system functions for Send data System function of SIMOTION devices: • _Xsend, if Protocol = Xsend/XReceive is selected • _udpSend, if Protocol = UDP is selected • _tcpSend, if Protocol = TCP/IP is selected

Overview of parameters for Send data (Xsend- Xreceive protocol), _XSend

Table 5-54 Parameters (MCC Send data command compared to _XSend system function)

Parameters of the MCC Send data command

Parameters of the _XSend system function

Log - Delay program execution nextCommand Parameters tab Job identifier messageld Return variable - Communications partner - Device - Connection of transmitting CPU - Destination address of communications partner address Continue connection communicationmode Back up datalength, data Expert tab CommandID variable commandId

Overview of parameters for Send data (TCP/IP protocol), _tcpSend

Table 5-55 Parameters (MCC Send data command compared to _tcpSend system function)

Parameters of the MCC Send data command

Parameters of the _tcpSend system function

Log - Delay program execution nextCommand Parameters tab Connection ID connectionId Back up dataLength, data Expert tab Return variable -

Page 239: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 239

Overview of parameters for Send data (TCP/IP protocol), _udpSend

Table 5-56 Parameters (MCC Send data command compared to _udpSend system function)

Parameters of the MCC Send data command

Parameters of the _udpSend system function

Log - Delay program execution nextCommand Parameters tab PortNumber of sender sourcePort IP address of receiver destinationAddress Port number of receiver destinationPort Back up dataLength, data Expert tab Return variable -

5.4.8 Receive data

5.4.8.1 Receive data

This command is used to receive data from a communications partner (such as a SIMATIC S7 station) using various protocols. • XSend/XReceive protocol

The connection to the communications partner is established via PROFIBUS or MPI and does not have to be configured. SIMOTION devices can receive a maximum of 200 bytes in one unit; the actual useful data length is dependent on the communications partner.

• UDP protocol The connection is established via Ethernet with the UDP protocol. SIMOTION devices can receive a maximum of 1400 bytes in one unit; the actual useful data length is dependent on the communications partner.

• TCP/IP protocol The connection is established via Ethernet with the TCP/IP protocol. You must have configured the TCP/IP connection beforehand. Use the Establish connection using TCP/IP command. SIMOTION devices can receive a maximum of 4096 bytes in one unit; the actual useful data length is dependent on the communications partner.

Page 240: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 240 Programming and Operating Manual, 03/2007

Figure 5-42 Parameter screen form: Receive data

5.4.8.2 Overview of parameters for Receive data You can set the following parameters:

Table 5-57 Overview of parameters for Receive data

Field/Button Explanation/instructions Log You can choose between the different protocols here. The parameter dialog box changes,

accordingly. XSend/XReceive The connection is established via PROFIBUS or MPI. UDP The connection is established via Ethernet, and the UDP protocol is selected. TCP/IP The TCP/IP protocol is selected. You must have configured the TCP/IP connection beforehand. Use the Establish connection using TCP/IP command.

Parameters tab • For Protocol = Xsend/XReceive

See Overview of parameters for Receive data - Parameters tab for Protocol = Xsend/XReceive

• For Protocol = UDP

See Overview of parameters for Receive data - Parameters tab for Protocol = UDP • For Protocol = TCP/IP

See Overview of parameters for Receive data - Parameters tab for Protocol = TCP/IP Expert tab See Overview of parameters for Receive data - Expert tab

Page 241: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 241

Field/Button Explanation/instructions Delay program execution Only when Protocol = XSend/XReceive or Protocol = TCP/IP is selected.

• Select the check box if execution of the subsequent command is to wait until this command is finished.

If the check box is not selected, the next command is executed immediately. Only when Protocol = UDP is selected • Select the check box if you wish the system to delay execution of the following

command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart.

If command has been completed or aborted The next command is executed after the current command has been completed or aborted.

Abort The active command is aborted if the port number is the same as that of the previous call of the command.

5.4.8.3 Overview of parameters for Receive data - Parameters tab

Table 5-58 Overview of parameters for Receive data – Parameters tab for Protocol = XSend/XReceive

Field/Button Explanation/instructions Job identifier Enter the job identifier here. The data type is UDINT. Return variable Here, you enter the return variable of type StructRetXReceive in which the data, length,

and error message are stored. This variable must be defined in a declaration table or the symbol browser.

Table 5-59 Overview of parameters for Receive data - Parameters tab for Protocol = UDP

Field/Button Explanation/instructions Return variable Here, you enter the return variable of type StructRetUdpReceive in which the connection

parameters, length, and error message are stored. This variable must be defined in a declaration table or the symbol browser.

Port number of receiver Here, you enter the port number of the receiver. Socket lifetime Here, decide whether the connection should remain after data transfer. Select Disconnect

socket, if the selected device communicates with many nodes. Socket remains (default value) The connection remains active after the data transmission. Close socket The connection is discontinued after the data transmission.

Received useful data bytes Here, you enter the variable of data type ARRAY[0..1399] OF BYTE in which the received useful data are stored. The number of bytes of received useful data is available in the dataLength component of the return variable.

Page 242: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 242 Programming and Operating Manual, 03/2007

Table 5-60 Overview of parameters for Receive data – Parameters tab for Protocol = TCP/IP

Field/Button Explanation/instructions Return variable Here, you enter the return variable of type StructRetTcpReceive in which the connection

parameters, length, and error message are stored. This variable must be defined in a declaration table or the symbol browser.

Connection ID Here, you enter the connection ID. This value was obtained when the TCP/IP connection was established with the Establish connection using TCP/IP command.

Received useful data bytes Here, you enter the variable of data type ARRAY[0..4095] OF BYTE in which the received useful data are stored. The number of bytes of received useful data is available in the dataLength component of the return variable.

5.4.8.4 Overview of parameters for Receive data - Expert tab

Table 5-61 Overview of parameters for Receive data – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in the Overview of parameters for Expert tab table. CommandID variable Only when Protocol = Xsend/XReceive is selected

If you enter the name of a variable of data type CommandIdType, you can track the command status with this variable.

5.4.8.5 Querying the command status for Receive data with XSend/XReceive protocol When the XSend/XReceive protocol is used, you can query the status of the command on the basis of the CommandID variable using the _GetStateOfXCommand system function (see list manuals for SIMOTION devices). This is required, in particular, if the Delay program execution parameter is deactivated. In this way you can avoid an overflow of the send buffer due to multiple calls of the command. ST commands can be programmed using the ST zoom, for example. You cannot query the command status in the UDP or TCP/IP protocols.

5.4.8.6 Relevant system functions for Receive data System function of SIMOTION devices: • _Xreceive, if Protocol = Xsend/XReceive is selected • _udpReceive, if Protocol = UDP is selected • _tcpReceive, if Protocol = TCP/IP is selected

Page 243: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 243

Overview of parameters for Receive data (Xsend- Xreceive protocol), _XReceive

Table 5-62 Parameters (MCC Receive data command compared to _XReceive system function)

Parameters of the MCC Receive data command

Parameters of the _XReceive system function

Log - Delay program execution nextCommand Parameters tab Job identifier messageld Return variable - Expert tab CommandID variable commandId

Overview of parameters for Receive data (TCP/IP protocol), _tcpReceive

Table 5-63 Parameters (MCC Receive data command compared to _tcpReceive system function)

Parameters of the MCC Receive data command

Parameters of the _tcpReceive system function

Log - Delay program execution nextCommand Parameters tab Return variable - Connection ID connectionId Received useful data bytes receiveVariable Expert tab Return variable -

Overview of parameters for Receive data (UDP protocol), _udpReceive

Table 5-64 Parameters (MCC Receive data command compared to _udpReceive system function)

Parameters of the MCC Receive data command

Parameters of the _udpReceive system function

Log - Delay program execution nextCommand Parameters tab Return variable - Port number of receiver port Socket lifetime communicationMode Received useful data bytes receiveVariable Expert tab Return variable -

Page 244: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.4 Communication

SIMOTION MCC Motion Control Chart 244 Programming and Operating Manual, 03/2007

5.4.8.7 Return value for Receive data The return value informs the user about the result of the command call and contains important connection parameters. You must declare the return variable as a variable of the following data types in a declaration table or the symbol browser and specify it when assigning the command parameters. • StructRetXReceive, if Protocol = Xsend/XReceive is selected • StructRetUdpReceive, if Protocol = UDP is selected • StructRetTcpReceive, if Protocol = TCP/IP is selected The following table lists the meaning of the individual elements of these data types.

Table 5-65 Structure of return value (TYPE StructRetXReceive)

Parameter (data type) Meaning/values Values functionResult (DINT)

Error code < 16#8000: if command execution is okay >= 16#8000: if an error has occurred See description for _Xreceive command in the list manuals for the SIMOTION devices.

dataLength (UDINT)

Length of received data packet

data (ARRAY [0..199] OF BYTE)

Received data

Table 5-66 Structure of the return value (TYPE StructRetUdpReceive)

Parameter (data type) Meaning/values Values functionResult (DINT)

Error code < 16#8000: if command execution is okay >= 16#8000: if an error has occurred See description for the _udpReceive command in the parameter manuals for the SIMOTION devices.

sourceAddress (ARRAY [0..3] OF USINT)

IP address of transmitter

sourcePort (UINT)

Port number of transmitter

dataLength (UDINT)

Length of received data packet

Page 245: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 245

Table 5-67 Structure of the return value (TYPE StructRetTcpReceive)

Parameter (data type) Meaning/values Values functionResult (DINT)

Error code < 16#8000: if command execution is okay >= 16#8000: if an error has occurred See description for the _tcpReceive command in the parameter manuals for the SIMOTION devices.

dataLength (UDINT)

Length of received data packet

5.5 Single axis commands

5.5.1 Home axis

For a positioning axis or synchronous (following) axis, the displayed or input position values refer to the coordinate system of the axis. The coordinate system of the axis must be aligned to the real physical position of the axis. If you are using an absolute measuring system, the alignment need only be done once during commissioning. When commissioning is completed, the position value will be known when the machine is switched on. With an incremental measuring system, the alignment must be repeated each time the machine is switched on. The alignment is achieved via homing.

Note Traversing commands with relative position specification can always be executed. The axis can configured to indicate whether traversing commands with absolute position specification can also be executed on a non-homed axis. Configuration data: TypeOfAxis.homing.referencingNecessary.

Page 246: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 246 Programming and Operating Manual, 03/2007

Figure 5-43 Parameter screen form: Home axis

5.5.1.1 Overview of parameters for Home axis

Table 5-68 Overview of parameters for Home axis

Field/Button Explanation/instructions Axis In Axis, select which axis is to be homed. The list contains:

• All positioning and synchronous axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): posAxis or followingAxis.

Parameters tab See Overview of parameters for Home axis – Parameters tab (Page 247) Dynamics tab See Overview of parameters for Home axis – Dynamic response tab (Page 248) Expert tab See Overview of parameters for Home axis – Expert tab (Page 249) Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue.

Delay program execution Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied. If the check box is not selected, the next command is executed immediately. Select the condition that has to be satisfied before the system continues execution of the following command in the MCC chart.

Page 247: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 247

5.5.1.2 Overview of parameters for Home axis – Parameters tab

Table 5-69 Overview of parameters for Home axis – Parameters tab

Field/Button Explanation/instructions Homing type Select among the permitted homing types:

Active homing (default value) Homing occurs by means of a separate traversing motion of the axis. The homing mode is specified when you configure the axis during the commissioning phase. Passive homing The homing command itself does not trigger any active traversing motion of the axis. Rather, homing occurs during the next axis motion. The homing mode is specified when you configure the axis during the commissioning phase. Required settings: For Home axis: Clear the Delay program execution check box. For the subsequent command: Select Attach as the transition behavior from the active command. Setting the current position value The value of the home position coordinate is assigned to the current position (actual value) of the axis. There is no active traversing motion. Direct relative homing The value of the home position coordinate is added to the current position (actual value) of the axis. There is no active traversing motion. Absolute encoder adjustment Absolute encoder adjustment is only possible if the axis was configured as an absolute encoder or a cyclic absolute encoder during commissioning. During absolute encoder adjustment, the offset between the machine zero mark and the encoder zero mark is determined. In general, you only have to repeat the adjustment if: • The offset value is lost, for example, due to battery supply failure • After separation of the mechanical connection between encoder and load, the

connection could not be reproduced exactly Home position coordinate Not when homing type = absolute encoder adjustment.

Coordinates of the home position in the reference system of the axis. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Preassigned value (default value) See Selection list (combo box) table. System variable for preassigned value: userDefaultHoming.homingPosition

Page 248: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 248 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Homing approach velocity Only when homing type = Active homing.

Velocity at which the axis approaches the homing output cam (only with homing mode With homing output cam and encoder zero mark or Encoder zero mark only) Enter the value in the editable selection list (see Editable selection list (editable combo box)). Current Last programmed Preassigned value (default value) See Selection list (combo box) table. System variable for preassigned value: userDefaultHoming.homingApproachVelocity

5.5.1.3 Overview of parameters for Home axis – Dynamic response tab

Table 5-70 Overview of parameters for Home axis – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in the Overview of parameters for

Dynamic response tab table. The parameters in the Dynamic response tab are evaluated only with homing type Active homing.

Velocity profile In this field, you define the transitions between the individual motion phases. System variable for preassigned value: userDefaultDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. System variable for preassigned value: userDefaultDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. System variable for preassigned value: userDefaultDynamics.negativeAccel

Jerk The entered value limits the change in the acceleration or deceleration at the start and end of the respective phase. System variables for preassigned value: userDefaultDynamics.positiveAccelStartJerk userDefaultDynamics.positiveAccelEndJerk userDefaultDynamics.negativeAccelStartJerk userDefaultDynamics.negativeAccelEndJerk

Page 249: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 249

5.5.1.4 Overview of parameters for Home axis – Expert tab

Table 5-71 Overview of parameters for Home axis – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in the Overview of parameters for Expert tab table. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of axis

configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.5.1.5 Relevant system functions for Home axis Cam technology package: • _homing

Overview of parameters for Home axis / _homing

Table 5-72 Parameters (MCC Home axis command compared to _homing system function)

Parameters of the MCC Home axis command

Parameters of the _homing system function

Axis axis Transition behavior mergeMode Delay program execution nextCommand Parameters tab Homing type homingmode Home position coordinates homepositiontype, homeposition Homing approach velocity velocitytype, velocity Dynamics tab Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 250: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 250 Programming and Operating Manual, 03/2007

5.5.1.6 Referencing mode Various homing modes are possible for Active homing and Passive homing homing types. See table below. You specify the homing modes separately for each encoder system when configuring the axis.

Table 5-73 Homing mode for active and passive homing

Description Referencing mode Active homing Passive homing

Homing occurs by means of a separate traversing motion of the axis. Configuration data for homing mode: TypeOfAxis.NumberOfEncoders. Encoder_x.IncHomingEncoder. homingMode.

The homing command itself does not trigger any active traversing motion of the axis. Rather, homing occurs during the next axis motion. Configuration data for homing mode: TypeOfAxis.NumberOfEncoders. Encoder_x.IncHomingEncoder. passiveHomingMode.

With homing output cam and encoder zero mark

The homing command initiates axis motion towards the homing output cam. After the homing output cam is crossed, the axis moves to the next zero mark of the measuring system. Once the first zero mark is detected, the measuring system is synchronized. The axis is then moved by the amount of the home position offset. The axis is then at the home position. The position value is set to the value indicated in the home position coordinates.

After the homing output cam is detected, the next zero mark of the measuring system is active for synchronization. Once the first zero mark is detected after the homing output cam, synchronization takes place. The position value of the axis is set to the value indicated in the home position coordinates.

External zero mark only The homing command initiates axis motion towards the external zero mark (e.g., homing output cam). Once the external zero mark is crossed, the measuring system is synchronized to the edge of the external zero mark. The axis is then moved by the amount of the home position offset. The axis is then at the home position. The position value is set to the value indicated in the home position coordinates.

Once the external zero mark (e.g., homing output cam) has been detected, synchronization with the edge takes place. The position value of the axis is set to the value indicated in the home position coordinates.

Page 251: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 251

Description Encoder zero mark only The homing command initiates an axis

motion towards the zero mark of the encoder. When the zero mark is crossed, the measuring system of the axis is synchronized to this zero mark. The axis is then moved by the amount of the home position offset. The axis is then at the home position. The position value is set to the value indicated in the home position coordinates.

Once the zero mark is detected, synchronization occurs. The position value of the axis is set to the value indicated in the home position coordinates.

5.5.1.7 Home position offset If you do not wish the axis to be positioned on the synchronization point after homing, but traversed further by a defined distance, then you must enter a home position offset. The home position is then calculated from the position of the zero mark and the amount of the home position offset.

Page 252: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 252 Programming and Operating Manual, 03/2007

5.5.2 Switch axis enable

You use this command to switch the enables on an axis with an electric drive (for axes with a hydraulic drive, you use the Switch QF-axis enable function). The force/pressure control can also be enabled or disabled on axes with force/pressure control.

Figure 5-44 Parameter screen form: Switch axis enable

The following conditions must be satisfied in order to execute motion commands on the axis: 1. Drive enable issued 2. Pulse enabled (power unit enabled) 3. Additional conditions for positioning axes and synchronous axes only: Position controller

enable is issued 4. Follow-up operation cancelled Until all conditions are satisfied, the axis remains in follow-up mode (see Follow-up mode for various axis technologies). The current status of enables can be accessed via system variables, which are specified in the description of the respective parameter.

Page 253: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 253

Table 5-74 Follow-up mode for various axis technologies

Drive axis Positioning axis Synchronous axis

Notice Motion commands for the axis cannot be executed in follow-up mode. The following applies to position control:

Position control is cancelled. The actual position value continues to be measured. The position setpoint is corrected to the current actual position value. Note Once follow-up mode is cancelled, homing of the axis does not have to be repeated.

Current status for a real axis, indicating whether motion commands can be executed: System variable: control.

5.5.2.1 Overview of parameters for Switch axis enable

Table 5-75 Overview of parameters for Switch axis enable

Field/Button Explanation/instructions Axis In Axis, select the axis for which the axis enable is to be switched.

The list contains: All axes with an electric drive that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator. All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Switch axis enable - Parameters tab Expert tab See Overview of parameters for Switch axis enable - Expert tab Delay program execution Select the check box if you wish the system to delay execution of the following command

in the MCC chart until the command has been completed. If the check box is not selected, the next command is executed immediately.

Page 254: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 254 Programming and Operating Manual, 03/2007

5.5.2.2 Overview of parameters for Switch axis enable – Parameters tab

Table 5-76 Overview of parameters for Switch axis enable – Parameters tab

Field/Button Explanation/instructions Switch position controller enable

For positioning and synchronous axes only: Select the check box if the position controller enable is to be switched. If the check box is selected: • The Switch enables individually according to PROFIdrive profiles check box is cleared. • The Switch drive enable and Switch pulse enable check boxes are selected. If the check box is not selected, the current status of the position controller enable is not changed. Current status of position controller enable for a real axis: System variable: servoMonitorings.controlState.

Switch enables individually according to PROFIdrive profiles

Select the check box if you want to be able to switch enables individually in accordance with the PROFIdrive profile. If the check box is selected: • Seven check boxes are displayed for setting and deleting the individual bits of control

word 1 (STW1) in accordance with PROFIdrive (see Meaning of bits of control word 1 (STW1) in accordance with PROFIdrive). • Select the check box if you want to assign the corresponding enable. • Clear the check box if you want to remove the corresponding enable.

All enables must be assigned for normal operation of the drive. The Switch drive enable and Switch pulse enable check boxes are masked. If the check box is cleared, the Switch drive enable and Switch pulse enable check boxes are displayed.

Switch drive enable Only if the Switch enables individually according to PROFIdrive profiles check box is cleared. Select the check box if the drive enable is to be switched. If the check box is not selected, the current status of the drive enable is not changed. Current status of drive enable for a real axis: System variable: actorMonitorings.driveState.

Switch pulse enable Only if the Switch enables individually according to PROFIdrive profiles check box is cleared. Select the check box if the pulse enable (power enable) is to be switched. If the check box is not selected, the current status of the pulse enable is not changed. Current status of pulse enable for a real axis: System variable: actorMonitorings.power.

Follow-up mode Here, you decide whether the axis is to be switched out of follow-up mode (see Follow-up mode for various axis technologies). Do not follow up setpoint (default value) Follow-up mode is disabled. Motion commands for the axis can be executed. Follow up setpoint Follow-up mode is enabled. Motion commands for the axis cannot be executed. Current status for a real axis, indicating whether motion commands can be executed: System variable: control.

Set pressure controller enable

For axes with force/pressure control only. Select the check box if you want to enable force/pressure control. If the check box is not selected, force/pressure control is disabled.

Page 255: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 255

5.5.2.3 Overview of parameters for Switch axis enable – Expert tab

Table 5-77 Overview of parameters for Switch axis enable – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of axis

configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.5.2.4 Meaning of bits of control word 1 (STW1) in accordance with PROFIdrive The following table indicates the meaning of the bits of control word 1 (STW1) for speed-controlled drives in accordance with PROFIdrive.

Table 5-78 Meaning of bits of control word 1 (STW1) in accordance with PROFIdrive

Significance Bit STW1

Name of check box Check box selected (enable assigned)

Check box cleared (enable removed)

0 ON ON OFF (OFF1) 1 No Coast Stop No coasting down Coasting down (OFF2) 2 No Coast Stop No quick stop Quick stop (OFF3) 3 Enable Operation Enable operation Disable operation 4 Enable Ramp Generator Enables the ramp-function

generator Disable ramp-function generator

5 Unfreeze Ramp Generator Resume ramp-function generator Freeze ramp-function generator 6 Enable setpoint Enable setpoint Disable setpoint

Page 256: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 256 Programming and Operating Manual, 03/2007

5.5.2.5 Relevant system function for Switch axis enable Cam technology package: • _enableAxis

Overview of parameters for Switch axis enable / _enableAxis

Table 5-79 Parameters (MCC Switch axis enable command compared to _enableAxis system function)

Parameters of the MCC Switch axis enable command

Parameters of the _enableAxis system function

Axis axis Delay program execution nextCommand Parameters tab Switch position controller enable enableMode, servoControlMode Switch enables individually according to PROFIdrive profiles enableMode, stwbitset Switch drive enable enableMode Switch pulse enable enableMode Follow-up mode servoCommandToActualMode Set pressure controller enable forcecontrolMode Expert tab CommandID variable commandId Return variable –

Page 257: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 257

5.5.3 Switch QF axis enable

You use this command to switch the enables on an axis with a hydraulic drive (for axes with an electric drive, you use the Switch axis enable function). The force/pressure control can also be enabled or disabled on axes with force/pressure control.

Figure 5-45 Parameter screen form: Switch QF axis enable

The following conditions must be satisfied in order to execute motion commands on the axis: 1. If the Q-valve (actuator for volumetric flow) is assigned to multiple axes: Access to the Q-

valve is ensured 2. Enable for the Q-valve is issued 3. Additional conditions for axes with force/pressure control by means of a pressure control

valve (F-valve, actuator for force/pressure control): – If the pressure control valve is assigned to multiple axes: Access to the pressure

control valve is ensured – Enable for the pressure control valve is issued

4. Additional conditions for positioning axes and synchronous axes only: Position controller enable is issued

5. Follow-up operation cancelled Until all conditions are satisfied, the axis remains in follow-up mode (see Follow-up mode for various axis technologies).

Page 258: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 258 Programming and Operating Manual, 03/2007

The current status of enables can be accessed via system variables, which are specified in the description of the respective parameter (see Overview of parameters for Switch QF axis enable).

5.5.3.1 Overview of parameters for Switch QF axis enable

Table 5-80 Overview of parameters for Switch QF axis enable

Field/Button Explanation/instructions Axis In Axis, select the axis for which the axis enable is to be switched.

The list contains: All axes with a hydraulic drive that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator. All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Switch QF axis enable - Parameters tab QF_Parameters tab See Overview of parameters for Switch QF axis enable - Parameters tab Expert tab See Overview of parameters for Switch QF axis enable - Expert tab Delay program execution Select the check box if you wish the system to delay execution of the following

command in the MCC chart until the command has been completed. If the check box is not selected, the next command is executed immediately.

5.5.3.2 Overview of parameters for Switch QF axis enable – Parameters tab

Table 5-81 Overview of parameters for Switch QF axis enable – Parameters tab

Field/Button Explanation/instructions Switch position controller enable For positioning and synchronous axes only:

Select the check box if the position controller enable is to be switched. If the check box is not selected, the position controller enable is removed. Current status of position controller enable for a real axis: System variable: servoMonitorings.controlState.

Set pressure controller enable For axes with force/pressure control only. Select the check box if you want to enable force/pressure control. If the check box is not selected, force/pressure control is disabled.

Page 259: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 259

Field/Button Explanation/instructions Follow-up mode Here, you decide whether the axis is to be switched out of follow-up mode (see

Follow-up mode for various axis technologies). Do not follow up setpoint (default value) Follow-up mode is disabled. Motion commands for the axis can be executed. Follow up setpoint Follow-up mode is enabled. Motion commands for the axis cannot be executed. Current status for a real axis, indicating whether motion commands can be executed: System variable: control.

5.5.3.3 Overview of parameters for Switch QF axis enable – QF_Parameters tab

Table 5-82 Overview of parameters for Switch QF axis enable – QF_Parameters tab

Field/Button Explanation/instructions Access to Q-valve If the Q-valve (actuator for volumetric flow) is assigned to multiple axes:

Here, you select whether or not the axis has access to the Q-valve. No change in access (default value) There are no changes in access to the Q-valve Request valve access Access to the Q-valve is requested. Access is blocked for other axes. Enable valve access Access to the Q-valve is enabled. Another axis can access the Q-valve. Current status for access to the Q-valve for a real axis: System variable: actorMonitoring.qOutputState.

Set Q-valve enable Here, you select the enables for the Q-valve. Set enable Enable for the Q-valve is set Remove enable Enable for the Q-valve is removed No change in enables (default value) The current enable for the Q-valve is not changed Current status of enable for the Q-valve for a real axis: Systemvariable actorMonitoring.driveState.

Up rate limit value The rise of the manipulated variable is limited: • During a transition from or to a substitute value (requesting or enabling access

to the Q-valve). • During a characteristic change Enter the value in the editable selection list. Default System variable for preassigned value: userDefaultQFAxis.maxDerivative.QOutput

Page 260: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 260 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Access to pressure control valve If the pressure control valve (F-valve, actuator for force/pressure control) is

assigned to multiple axes: Here, you select whether or not the axis has access to the pressure control valve. No change in access (default value) There are no changes in access to the pressure control valve Request valve access Access to the pressure control valve is requested. Access is blocked for other axes. Enable valve access Access to the pressure control valve is enabled. Another axis can access the pressure control valve. Current status for access to the pressure control valve for a real axis: System variable: actorMonitoring.fOutputState.

Set pressure control valve enable Here, you select the enables for the pressure control valve. Set enable Enable for the pressure control valve is set Remove enable Enable for the pressure control valve is removed No change in enables (default value) The current enable for the pressure control valve is not changed Current status of enable for the pressure control valve for a real axis: Systemvariable actorMonitoring.fOutputEnable.

Up rate limit value The rise of the manipulated variable is limited: During a transition from or to a substitute value (requesting or enabling access to the pressure control valve). During a characteristic change Enter the value in the editable selection list. Default System variable for preassigned value: userDefaultQFAxis.maxDerivative.FOutput

5.5.3.4 Overview of parameters for Switch QF axis enable – Expert tab

Table 5-83 Overview of parameters for Switch QF axis enable – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of

axis configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this

variable to find out the result of the command call.

Page 261: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 261

5.5.3.5 Relevant system function for Switch QF axis enable Cam technology package: • _enableQFAxis

Overview of parameters for Switch QF axis enable / _enableQFAxis

Table 5-84 Parameters (MCC Switch QF axis enable command compared to _enableQFAxis system function)

Parameters of the MCC Switch QF axis enable command

Parameters of the _enableQFAxis system function

Axis axis Delay program execution nextCommand Parameters tab Switch position controller enable controlMode Set pressure controller enable forcecontrolMode Follow-up mode commandToActualMode QF_Parameters tab Access to Q-valve qoutput Set Q-valve enable qoutputenable Up rate limit value qoutputmaxderivative Access to pressure control valve foutput Set pressure control valve enable foutputenable Up rate limit value foutputmaxderivative Expert tab CommandID variable commandId Return variable –

Page 262: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 262 Programming and Operating Manual, 03/2007

5.5.4 Remove axis enable

You use this command to remove the enables from an axis with an electric drive (for axes with a hydraulic drive, you use the Remove QF axis enable function). The force/pressure control can also be disabled or enabled on axes with force/pressure control.

Figure 5-46 Parameter screen form: Remove axis enable

The following conditions must be satisfied in order to execute motion commands on the axis: 1. Drive enable issued 2. Pulse enabled (power unit enabled) 3. Additional conditions for positioning axes and synchronous axes only: Position controller

enable is issued 4. Follow-up operation cancelled Until all conditions are satisfied, the axis remains in follow-up mode (see Follow-up mode for various axis technologies). The current status of enables can be accessed via system variables, which are specified in the description of the respective parameter (see Overview of parameters for Remove axis enable).

Page 263: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 263

5.5.4.1 Overview of parameters for Remove axis enable

Table 5-85 Overview of parameters for Remove axis enable

Field/Button Explanation/instructions Axis In Axis, select the axis for which the command is to be programmed.

The list contains: All axes with an electric drive that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator. All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Remove axis enable - Parameters tab Expert tab See Overview of parameters for Remove axis enable - Expert tab Delay program execution Select the check box if you wish the system to delay execution of the following command

in the MCC chart until the command has been completed. If the check box is not selected, the next command is executed immediately.

5.5.4.2 Overview of parameters for Remove axis enable – Parameters tab

Table 5-86 Overview of parameters for Remove axis enable – Parameters tab

Field/Button Explanation/instructions Disable position controller For positioning and synchronous axes only:

Select the check box if the position controller enable is to be removed. If the check box is selected: The Switch enables individually according to PROFIdrive profiles check box is cleared. The Remove drive enable and Remove pulse enable check boxes are selected. If the check box is not selected, the current status of the position controller enable is not changed. Current status of position controller enable for a real axis: System variable: servoMonitorings.controlState.

Switch enables individually according to PROFIdrive profiles

Select the check box if you want to be able to switch enables individually in accordance with the PROFIdrive profile. If the check box is selected: Seven check boxes are displayed for setting and deleting the individual bits of control word 1 (STW1) in accordance with PROFIdrive (see Meaning of bits of control word 1 (STW 1) in accordance with PROFIdrive). Select the check box if you want to assign the corresponding enable. Clear the check box if you want to remove the corresponding enable. All enables must be assigned for normal operation of the drive. The Remove drive enable and Remove pulse enable check boxes are masked. If the check box is cleared, the Remove drive enable and Remove pulse enable check boxes are displayed.

Page 264: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 264 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Disable drive Only if the Switch enables individually according to PROFIdrive profiles check box is

cleared. Select the check box if the drive enable is to be removed. If the check box is not selected, the current status of the drive enable is not changed. Current status of drive enable for a real axis: System variable: actorMonitorings.driveState.

Disable pulse Only if the Switch enables individually according to PROFIdrive profiles check box is cleared. Select the check box if the pulse enable (power enable) is to be removed. If the check box is not selected, the current status of the pulse enable is not changed. Current status of drive enable for a real axis: System variable: actorMonitorings.power.

Follow-up mode Here, you decide whether the axis is to be switched into follow-up mode (see Follow-up mode for various axis technologies). Follow up setpoint (default value) Follow-up mode is enabled. Motion commands for the axis cannot be executed. Do not follow up setpoint Follow-up mode is disabled. Motion commands for the axis can be executed. Current status for a real axis, indicating whether motion commands can be executed: System variable: control.

Remove position controller enable

For axes with force/pressure control only. Select the check box if you want to disable force/pressure control. If the check box is not selected, force/pressure control is enabled.

5.5.4.3 Overview of parameters for Remove axis enable – Expert tab

Table 5-87 Overview of parameters for Remove axis enable – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of axis

configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call.

Page 265: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 265

5.5.4.4 Relevant system function for Remove axis enable Cam technology package: • _disableAxis

Overview of parameters for Remove axis enable / _disableAxis

Table 5-88 Parameters (MCC Remove axis enable command compared to _disableAxis system function)

Parameters of the MCC Remove axis enable command

Parameters of the _disableAxis system function

Axis axis Delay program execution nextCommand Parameters tab Disable position controller disableMode, servoControlMode Switch enables individually according to PROFIdrive profiles disableMode, stwbitset Disable drive disableMode Disable pulse disableMode Follow-up mode servoCommandToActualMode Remove position controller enable forcecontrolMode Expert tab CommandID variable commandId Return variable –

Page 266: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 266 Programming and Operating Manual, 03/2007

5.5.5 Remove QF axis enable

You use this command to remove the enables from an axis with a hydraulic drive (for axes with an electric drive, you use the Remove axis enable function). The force/pressure control can also be enabled or disabled on axes with force/pressure control.

Figure 5-47 Parameter screen form: Remove QF axis enable

The following conditions must be satisfied in order to execute motion commands on the axis: 1. If the Q-valve (actuator for volumetric flow) is assigned to multiple axes: Access to the Q-

valve is ensured 2. Enable for the Q-valve is issued 3. Additional conditions for axes with force/pressure control by means of a pressure control

valve (F-valve, actuator for force/pressure control): – If the pressure control valve is assigned to multiple axes: Access to the pressure

control valve is ensured – Enable for the pressure control valve is issued

4. Additional conditions for positioning axes and synchronous axes: Position controller enable is issued

5. Follow-up operation cancelled

Page 267: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 267

Until all conditions are satisfied, the axis remains in follow-up mode (see Follow-up mode for various axis technologies). The current status of enables can be accessed via system variables, which are specified in the description of the respective parameter (see Overview of parameters for Remove QF axis enable).

5.5.5.1 Overview of parameters for Remove QF axis enable

Table 5-89 Overview of parameters for Remove QF axis enable

Field/Button Explanation/instructions Axis In Axis, select the axis for which the axis enable is to be switched.

The list contains: • All axes with a hydraulic drive that are defined on the relevant device. The axis is

defined in the AXES folder in the project navigator. • All variables with the following data types of technology objects declared in the

MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Remove QF axis enable - Parameters tab QF_Parameters tab See Overview of parameters for Remove QF axis enable - QF_Parameters tab Expert tab See Overview of parameters for Remove QF axis enable - Expert tab Delay program execution Select the check box if you wish the system to delay execution of the following

command in the MCC chart until the command has been completed. If the check box is not selected, the next command is executed immediately.

Page 268: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 268 Programming and Operating Manual, 03/2007

5.5.5.2 Overview of parameters for Remove QF axis enable – Parameters tab

Table 5-90 Overview of parameters for Remove QF axis enable – Parameters tab

Field/Button Explanation/instructions Disable position controller For positioning and synchronous axes only:

Select the check box if the position controller enable is to be removed. If the check box is not selected, the position controller enable is switched. Current status of position controller enable for a real axis: System variable: servoMonitorings.controlState.

Remove position controller enable

For axes with force/pressure control only. Select the check box if you want to disable force/pressure control. If the check box is not selected, force/pressure control is enabled.

Follow-up mode Here, you decide whether the axis is to be switched into follow-up mode (see Follow-up mode for various axis technologies). Follow up setpoint (default value) Follow-up mode is enabled. Motion commands for the axis cannot be executed. Do not follow up setpoint Follow-up mode is disabled. Motion commands for the axis can be executed. Current status for a real axis, indicating whether motion commands can be executed: System variable: control.

5.5.5.3 Overview of parameters for Remove QF axis enable – QF_Parameters tab

Table 5-91 Overview of parameters for Remove QF axis enable – QF_Parameters tab

Field/Button Explanation/instructions Access to Q-valve If the Q-valve (actuator for volumetric flow) is assigned to multiple axes:

Here, you select whether or not the axis enables access to the Q-valve. No change in access (default value) There are no changes in access to the Q-valve Enable valve access (default value) Access to the Q-valve is enabled. Another axis can access the Q-valve. Current status for access to the Q-valve for a real axis: Systemvariable actorMonitoring.qOutputState

Set Q-valve enable Here, you select whether the enables for the Q-valve are removed. Remove enable Enable for the Q-valve is removed No change in enables (default value) The current enable for the Q-valve is not changed Current status of enable for the Q-valve for a real axis: Systemvariable actorMonitoring.driveState.

Page 269: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 269

Field/Button Explanation/instructions Substitute value for the Q-valve is set

Here, you select whether a substitute value is to be set for the Q-valve. The substitute value is applied if no axis has access to the Q-valve. Set substitute value You enter the substitute value in the subsequent input field. No change in the substitute value (default value) Substitute value is not changed.

Substitute value Here, you enter the substitute value for the Q-valve. Up rate limit value The rise of the manipulated variable is limited:

• During a transition from or to a substitute value (requesting or enabling access to the Q-valve).

• During a characteristic change Enter the value in the editable selection list. Default System variable for preassigned value: userDefaultQFAxis.maxDerivative.QOutput

Access to pressure control valve

If the pressure control valve (F-valve, F-actuator) is assigned to multiple axes: Here, you select whether or not the axis enables access to the pressure control valve. No change in access (default value) There are no changes in access to the pressure control valve Enable valve access Access to the pressure control valve is enabled. Another axis can access the pressure control valve. Current status for access to the pressure control valve for a real axis: System variable: actorMonitoring.fOutputState.

Set pressure control valve enable

Here, you select whether the enables for the pressure control valve are removed. Remove enable Enable for the pressure control valve is removed No change in enables (default value) The current enable for the pressure control valve is not changed Current status of enable for the pressure control valve for a real axis: Systemvariable actorMonitoring.fOutputEnable.

Substitute value for pressure control valve enable

Here, you select whether a substitute value is to be set for the pressure control valve. The substitute value is applied if no axis has access to the pressure control valve. Set substitute value You enter the substitute value in the subsequent input field. No change in the substitute value (default value) Substitute value is not changed

Substitute value Here, you enter the substitute value for the pressure control valve. Up rate limit value The rise of the manipulated variable is limited:

During a transition from or to a substitute value (requesting or enabling access to the pressure control valve). During a characteristic change Enter the value in the editable selection list. Default System variable for preassigned value: userDefaultQFAxis.maxDerivative.FOutput

Page 270: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 270 Programming and Operating Manual, 03/2007

5.5.5.4 Overview of parameters for Remove QF axis enable – Expert tab

Table 5-92 Overview of parameters for Remove QF axis enable – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of axis

configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call.

5.5.5.5 Relevant system function for Remove QF axis enable Cam technology package: • _disableQFAxis

Overview of parameters for Remove QF axis enable / _disableQFAxis

Table 5-93 Parameters (MCC Remove QF axis enable command compared to _disableQFAxis system function)

Parameters of the MCC Remove QF axis enable command

Parameters of the _disableQFAxis system function

Axis axis Delay program execution nextCommand Parameters tab Disable position controller controlMode Remove position controller enable forcecontrolMode Follow-up mode commandToActualMode QF-Parameters tab Access to Q-valve qoutput Set Q-valve enable qoutputenable Substitute value for the Q-valve is set qoutputvaluesetmode Substitute value qoutputvalue Up rate limit value qoutputmaxderivativetype, qoutputmaxderivative Access to pressure control valve foutput Set pressure control valve enable foutputenable Substitute value for pressure control valve enable foutputvaluesetmode Substitute value foutputvalue Up rate limit value foutputmaxderivativetype, foutputmaxderivative Expert tab CommandID variable commandId Return variable –

Page 271: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 271

5.5.6 Start axis position-controlled

The command starts a positioning or synchronous (following) axis in position-controlled mode. The axis is accelerated or decelerated to the programmed velocity. Once this velocity is reached, it is held constant. When the constant motion phase is limited (Constant traversing time parameter in the Dynamic response tab), the axis is decelerated to the set velocity of 0 once the specified time has elapsed.

Figure 5-48 Parameter screen form: Start axis position-controlled

Page 272: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 272 Programming and Operating Manual, 03/2007

5.5.6.1 Overview of parameters for Start axis position-controlled

Table 5-94 Overview of parameters for Start axis position-controlled

Field/Button Explanation/instructions Axis In Axis, select the axis for which the command is to be programmed. The list contains:

All positioning and synchronous axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator. All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): posAxis or followingAxis.

Parameters tab See Overview of parameters for Start axis position-controlled - Parameters tab Dynamics tab See Overview of parameters for Start axis position-controlled - Dynamic response tab Expert tab See Overview of parameters for Start axis position-controlled - Expert tab Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue.

Delay program execution Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied. If the check box is not selected, the next command is executed immediately. Select the condition that has to be satisfied before the system continues execution of the following command in the MCC chart.

5.5.6.2 Overview of parameters for Start axis position-controlled – Parameters tab

Table 5-95 Overview of parameters for Start axis position-controlled – Parameters tab

Field/Button Explanation/instructions Velocity Velocity value during the constant velocity phase.

Enter the value in the editable selection list (see Editable selection list (editable combo box)). Resulting velocity An existing acceleration or deceleration motion of the axis is ended, taking into account the jerk parameters in the Dynamics tab. The axis continues at the resulting velocity. Current Last programmed speed Preassigned value (default value) System variable for preassigned value: userDefaultDynamics.velocity

Page 273: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 273

Field/Button Explanation/instructions Direction Select the direction of motion here.

From velocity sign Direction is obtained from the sign of the velocity. Negative Negative direction Positive Positive direction Last programmed direction Preassigned value (default value) System variable for preassigned value: userDefaultDynamics.direction

5.5.6.3 Overview of parameters for Start axis position-controlled – Dynamic response tab

Table 5-96 Overview of parameters for Start axis position-controlled – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Velocity profile In this field, you define the transitions between the individual motion phases.

System variable for preassigned value: userDefaultDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefaultDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variable for preassigned value: userDefaultDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefaultDynamics.positiveAccelStartJerk userDefaultDynamics.positiveAccelEndJerk userDefaultDynamics.negativeAccelStartJerk userDefaultDynamics.negativeAccelEndJerk

Constant traversing time A time limit can be programmed for the command. To so so, select the check box and enter the time duration of the constant motion phase.

5.5.6.4 Overview of parameters for Start axis position-controlled – Expert tab

Table 5-97 Overview of parameters for Start axis position-controlled – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call.

Page 274: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 274 Programming and Operating Manual, 03/2007

5.5.6.5 Relevant system function for Start axis position-controlled Cam technology package: • _move

Overview of parameters for Start axis position-controlled / _move

Table 5-98 Parameters (MCC Start axis position-controlled command compared to _move system function)

Parameters of the MCC Start axis position-controlled command

Parameters of the _move system function

movingMode = POSITION_CONTROLLED Axis axis Transition behavior mergemode Delay program execution nextCommand Parameters tab Velocity velocitytype, velocity Direction direction Dynamics tab Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Constant traversing time movetimeouttype, movetimeout Expert tab CommandID variable commandId Return variable –

Page 275: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 275

5.5.7 Speed preset

This command starts an axis in speed-controlled mode. The axis is accelerated or decelerated to the programmed rotational speed (velocity). Once this speed is reached, it is held constant. When the constant motion phase is limited (Constant traversing time parameter in the Dynamic response tab), the axis is decelerated to the set speed of 0 once the specified time has elapsed.

Figure 5-49 Parameter screen form: Speed specification

Page 276: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 276 Programming and Operating Manual, 03/2007

5.5.7.1 Overview of parameters for speed specification

Table 5-99 Overview of parameters for speed specification

Field/Button Explanation/instructions Axis In Axis, select which axis the command is being programmed for. The list contains:

• All axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Speed specification - Parameters tab Dynamics tab See Overview of parameters for Speed specification - Dynamic response tab Expert tab See Overview of parameters for Speed specification - Expert tab Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied. If the check box is not selected, the next command is executed immediately. Select the condition that has to be satisfied before the system continues execution of the following command in the MCC chart. See also Delay program execution (step enabling condition)

speed Speed value during a constant speed phase. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Resulting velocity An existing acceleration or deceleration motion of the axis is ended, taking into account the jerk parameters in the Dynamics tab. The axis continues at the resulting velocity. The programmed transition behavior must be "Substitute". Current Last programmed speed Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userDefaultDynamics.velocity See also Overview of parameters for the Dynamic response tab.

Direction Select the direction of rotation. From speed sign Direction is obtained from the speed sign. Positive Positive direction Negative Negative direction Last programmed direction Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userDefaultDynamics.direction

Page 277: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 277

5.5.7.2 Overview of parameters for Speed specification – Parameters tab

Table 5-100 Overview of parameters for Speed specification – Parameters tab

Field/Button Explanation/instructions speed Speed value during the constant speed phase.

Enter the value in the editable selection list (see the Input fields and selection listssection). Resulting velocity An existing acceleration or deceleration motion of the axis is ended, taking into account the jerk parameters in the Dynamic response tab. The axis continues at the resulting velocity. The programmed transition behavior must be "Substitute". Current Last programmed speed Preassigned value (default value) See the Frequently selected options in combo boxes table in the Selection list (combo box) section. System variable for preassignment: userDefaultDynamics.velocity See also Dynamic response tab in the Input fields and selection lists section and the Overview of parameters for the Dynamic response tab table included in this section.

Direction Select the direction of rotation. From speed sign Direction is obtained from speed sign. Positive Positive direction Negative Negative direction Last programmed direction Preassigned value (default value) See the Frequently selection options in combo boxes table in the Selection list (combo box) section. System variable for preassignment: userDefaultDynamics.direction

Page 278: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 278 Programming and Operating Manual, 03/2007

5.5.7.3 Overview of parameters for Speed specification – Dynamic response tab

Table 5-101 Overview of parameters for Speed specification – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Velocity profile In this field, you define the transitions between the individual motion phases.

System variable for preassigned value: userDefaultDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefaultDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variable for preassigned value: userDefaultDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and end of

the respective phase. System variables for preassigned value: userDefaultDynamics.positiveAccelStartJerk userDefaultDynamics.positiveAccelEndJerk userDefaultDynamics.negativeAccelStartJerk userDefaultDynamics.negativeAccelEndJerk

Constant traversing time A time limit can be programmed for the command. To so so, select the check box and enter the time duration of the constant motion phase.

5.5.7.4 Overview of parameters for Speed specification – Expert tab

Table 5-102 Overview of parameters for Speed specification – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the command

status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to find

out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 279: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 279

5.5.7.5 Relevant system function for speed specification Cam technology package: • _move

Overview of parameters for speed specification / _move

Table 5-103 Parameters (MCC Speed specification command compared to _move system function)

Parameters of the MCC Speed specification command

Parameters of the _move system function

movingMode = SPEED_CONTROLLED Axis axis Transition behavior mergemode Delay program execution nextCommand Parameters tab speed velocitytype, velocity Direction direction Dynamics tab Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Constant traversing time movetimeouttype, movetimeout Expert tab CommandID variable commandId Return variable –

Page 280: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 280 Programming and Operating Manual, 03/2007

5.5.8 Switch on torque limitation

This command is used to enable torque limiting in parallel to the motion. The torque limiting acts immediately.

Figure 5-50 Parameter screen form: Switch on torque limitation

Page 281: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 281

5.5.8.1 Overview of parameters for Switch on torque limitation

Table 5-104 Overview of parameters for Switch on torque limitation

Field/Button Explanation/instructions Axis In Axis, select which axis the command is being programmed for. The list contains:

All axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator. All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Switch on torque limitation - Parameters tab Expert tab See Overview of parameters for Switch on torque limitation - Expert tab Delay program execution Select the check box if you wish the system to delay execution of the following command

in the MCC chart until the selected condition has been satisfied. If the check box is not selected, the next command is executed immediately. Select the condition that has to be satisfied before the system continues execution of the following command in the MCC chart. If command has been completed or aborted The next command is executed after the current command has been completed or aborted. As soon as the torque is limited The next command is executed as soon as limiting is initiated. As soon as torque limiting is disabled The next command is executed as soon as limiting is disabled.

5.5.8.2 Overview of parameters for Switch on torque limitation – Parameters tab

Table 5-105 Overview of parameters for Switch on torque limitation – Parameters tab

Field/Button Explanation/instructions Clamping value Value to which the torque is limited.

Enter the value in the editable selection list (see Editable selection list (editable combo box)). Current Last programmed torque Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userDefaultTorqueLimiting.torqueLimit.

Page 282: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 282 Programming and Operating Manual, 03/2007

5.5.8.3 Overview of parameters for Switch on torque limitation – Expert tab

Table 5-106 Overview of parameters for Switch on torque limitation – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.5.8.4 Relevant system function for Switch on torque limitation Cam technology package: • _enableTorqueLimiting

Overview of parameters for Switch on torque limiting / _enableTorqueLimiting

Table 5-107 Parameters (MCC Switch on torque limiting command compared to _enableTorqueLimiting system function)

Parameters of the MCC Switch on torque limiting command

Parameters of the _enableTorqueLimiting system function

Axis axis Delay program execution nextCommand Parameters tab Clamping value torquelimittype, torquelimit, torquelimitunit Expert tab CommandID variable commandId Return variable –

Page 283: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 283

5.5.9 Deactivate torque limitation

This command is used to disable torque limiting that is superimposed on motion commands.

Figure 5-51 Parameter screen form: Switch off torque limitation

5.5.9.1 Overview of parameters for Switch off torque limitation

Table 5-108 Overview of parameters for Switch off torque limitation

Field/Button Explanation/instructions Axis In Axis, select which axis the command is being programmed for. The list contains:

All axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator. All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

CommandID variable Enter the name of a variable of data type CommandIdType here. With the help of this variable, you can, for example, trace back the status of the command. Variables of data type CommandIdType declared in the MCC source file or MCC chart are provided for selection. If you leave the CommandID variable field empty, the CommandID is not assigned to any variables; this means that you cannot access the CommandID (standard). See also Overview of parameters for the Expert tab.

Page 284: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 284 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Delay program execution Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied. If the check box is not selected, the next command is executed immediately. Select the condition that has to be satisfied before the system continues execution of the following command in the MCC chart. If command has been completed or aborted The next command is executed after the current command has been completed or aborted.

5.5.9.2 Relevant system function for Switch off torque limitation Cam technology package: • _disableTorqueLimiting

Overview of parameters for switch off torque limitation / _disableTorqueLimiting

Table 5-109 Parameters (MCC Switch off torque limitation command compared to _disableTorqueLimiting system function)

Parameters of the MCC Switch off torque limiting command

Parameters of the _disableTorqueLimiting system function

Axis axis CommandID variable commandId Return variable – Delay program execution nextCommand

Page 285: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 285

5.5.10 Position axis

This command moves the defined axis (rotary axis, modulo axis, or linear axis) to a position. The position value entered can be absolute or relative. Modulo axes can also be positioned via the "shortest path". The programmed position must lie within the software limit switches.

Figure 5-52 Parameter screen form: Position axis

Page 286: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 286 Programming and Operating Manual, 03/2007

5.5.10.1 Parameter screen form: Position axis

Table 5-110 Parameter screen form: Position axis

Field/Button Explanation/instructions Axis In Axis, select which axis is to travel to a target position. The list contains:

All positioning and synchronous axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator. All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): posAxis or followingAxis.

Parameters tab See Overview of parameters for Position axis - Parameters tab Dynamic response tab See Overview of parameters for Position axis - Dynamic response tab Expert tab See Overview of parameters for Position axis - Expert tab Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition).

5.5.10.2 Overview of parameters for Position axis – Parameters tab

Table 5-111 Overview of parameters for Position axis – Parameters tab

Field/Button Explanation/instructions Position The meaning depends on the following type parameter:

"Absolute" type: End position of the motion "Relative" type: Distance traversed during the motion, starting from the current axis position. Enter the value as a signed floating-point number.

Type Here, you specify the meaning of the programmed position in more detail (see above). Absolute(default value) The programmed position value is the end position of the motion. Relative The value entered in Position generates the traversing distance of the motion, starting from the current axis position.

Page 287: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 287

Field/Button Explanation/instructions Direction Select the direction of the motion. The direction of the motion must be specified in the

following cases: • Type of motion (see above) is relative (for all axes). • Type of motion (see above) is absolute and the axis is a modulo rotary axis. If a positive or negative direction is programmed, the direction has a higher priority than the position. The position is approached as an absolute value, a negative absolute value, or as a function of sign. The velocity sign is determined by the specified direction. Positive The direction of motion for the command is in the positive axis direction. With relative motion, the sign of the position is ignored. Negative The direction of motion for the command is in the negative axis direction. With relative motion, the sign of the position is ignored. From position (for relative type only) The direction of motion is determined by the position sign. Shortest path (for absolute and modulo rotary axis only) The direction of motion for the present command is the direction in which the programmed target position can be reached via the shortest path. Last direction set in the program See Selection list (combo box).

Velocity Velocity value during the constant velocity phase. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Current Last programmed velocity Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userDefaultDynamics.velocity See also Overview of parameters for the Dynamic response tab.

Page 288: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 288 Programming and Operating Manual, 03/2007

5.5.10.3 Overview of parameters for Position axis – Dynamic response tab

Table 5-112 Overview of parameters for Position axis – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Velocity profile In this field, you define the transitions between the individual motion phases.

System variable for preassigned value: userDefaultDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefaultDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variable for preassigned value: userDefaultDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefaultDynamics.positiveAccelStartJerk userDefaultDynamics.positiveAccelEndJerk userDefaultDynamics.negativeAccelStartJerk userDefaultDynamics.negativeAccelEndJerk

5.5.10.4 Overview of parameters for Position axis – Expert tab

Table 5-113 Overview of parameters for Position axis – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of axis

configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT, for a description, see Return value for the system functions of the technology packages (Page 82).

Page 289: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 289

5.5.10.5 Example of positioning An axis must travel at a velocity of 100 mm/s to the position at 1,000 mm. The position controller enable must be set for the axis before it can be positioned. The pulse and drive enables must also be set.

Figure 5-53 Example of positioning

5.5.10.6 Relevant system functions for Position axis Cam technology package: • _pos

Overview of parameters for Position axis / _pos

Table 5-114 Parameters (MCC Position axis command compared to _pos system function)

Parameters of the MCC Position axis command

Parameters of the _pos system function

Axis axis Transition behavior mergemode Delay program execution nextCommand Parameters tab Position position Type positioningMode Direction direction Velocity velocitytype, velocity Dynamics tab Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Page 290: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 290 Programming and Operating Manual, 03/2007

Parameters of the MCC Position axis command

Parameters of the _pos system function

Expert tab CommandID variable commandId Return variable –

5.5.11 Travel to fixed endstop

This command activates • Monitoring of "Travel to fixed endstop" in parallel to an axis motion activated by a motion

command • Retention of a clamping torque after reaching the fixed endstop This process is also referred to as "clamping". The method for detecting that the endstop is reached--evaluation of the following error or axis torque--is specified during configuration. This command can also be used to switch over the clamping torque during active clamping.

Figure 5-54 Parameter screen form: Travel to fixed endstop

Page 291: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 291

5.5.11.1 Overview of parameters for Travel to fixed endstop

Table 5-115 Overview of parameters for Travel to fixed endstop

Field/Button Explanation/instructions Axis In Axis, select which axis the command is being programmed for. The list contains:

• All positioning and synchronous axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): posAxis or followingAxis.

Parameters tab See Overview of parameters for Travel to fixed endstop - Parameters tab Expert tab See Overview of parameters for Travel to fixed endstop - Expert tab Delay program execution Select the check box if you wish the system to delay execution of the following command

in the MCC chart until the selected condition has been satisfied. If the check box is not selected, the next command is executed immediately. Select the condition that has to be satisfied before the system continues execution of the following command in the MCC chart. If command has been completed or aborted The next command is executed after the current command has been completed or aborted. If clamping value is reached The next command is executed as soon as the clamping value is reached.

5.5.11.2 Overview of parameters for Travel to fixed endstop – Parameters tab

Table 5-116 Overview of parameters for Travel to fixed endstop – Parameters tab

Field/Button Explanation/instructions Clamping value Value to which the torque is limited.

Enter the value in the editable selection list (see Editable selection list (editable combo box)). Current Last programmed torque Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefaultClamping.ClampingValue.

Page 292: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 292 Programming and Operating Manual, 03/2007

5.5.11.3 Overview of parameters for Travel to fixed endstop – Expert tab

Table 5-117 Overview of parameters for Travel to fixed endstop – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.5.11.4 Relevant system function for Travel to fixed endstop Cam technology package: • _enableMovingToEndStop

Overview of parameters for Travel to fixed endstop / _enableMovingToEndStop

Table 5-118 Parameters (MCC Travel to fixed endstop command compared to _enableMovingToEndStop)

Parameters of the MCC Travel to fixed endstop command

Parameters of the _enableMovingToEndStop system function

Axis axis Delay program execution nextCommand Parameters tab Clamping value clampingvaluetype, clampingvalue, torquelimitunit Expert tab CommandID variable commandId Return variable –

Page 293: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 293

5.5.12 Remove fixed endstop

This command is used to deactivate monitoring of "Move to fixed endstop" in parallel to an axis motion activated by a motion command and to discontinue retention of a clamping torque after reaching the fixed endstop. The axis is placed in position-controlled mode.

Figure 5-55 Parameter screen form: Remove fixed endstop

Page 294: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 294 Programming and Operating Manual, 03/2007

5.5.12.1 Overview of parameters for Remove fixed endstop

Table 5-119 Overview of parameters for Remove fixed endstop

Field/Button Explanation/instructions Axis In Axis, select which axis the command is being programmed for. The list contains:

• All positioning and synchronous axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): posAxis or followingAxis.

CommandID variable Enter the name of a variable of data type CommandIdType here. With the help of this variable, you can, for example, trace back the status of the command. Variables of data type CommandIdType declared in the MCC source file or MCC chart are provided for selection. If you leave the CommandID variable field empty, the CommandID is not assigned to any variables; this means that you cannot access the CommandID (standard). See also Overview of parameters for the Expert tab.

Return variable If you enter the name of a variable of the specified data type, you can use this variable to find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Delay program execution Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied. If the check box is not selected, the next command is executed immediately. Select the condition that has to be satisfied before the system continues execution of the following command in the MCC chart. If command has been completed or aborted The next command is executed only after the current command has been completed or aborted.

5.5.12.2 Relevant system function for Remove fixed endstop Cam technology package: • _disableMovingToEndStop

Overview of parameters for Remove fixed endstop / _disableMovingToEndStop

Table 5-120 Parameters (MCC Remove fixed endstop command compared to _disableMovingToEndStop system function)

Parameters of the MCC Remove fixed endstop

Parameters of the _disableMovingToEndStop system function

Axis axis CommandID variable commandId Return variable – Delay program execution nextCommand

Page 295: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 295

5.5.13 Time-dependent position profile

With this command, the axis moves along a position profile preset by a cam. The definition range (x-axis) of the cam is interpreted as time, the value range (y-axis) as the corresponding position. The profile is traversed from a selectable starting time to the end of the cam.

Figure 5-56 Parameter screen form: Time-dependent position profile

5.5.13.1 Overview of parameters for Time-dependent position profile

Table 5-121 Overview of parameters for Time-dependent position profile

Field/Button Explanation/instructions Axis In Axis, select the axis that is to move along the position profile. The list contains:

• All positioning and synchronous axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): posAxis or followingAxis.

Profile tab See Overview of parameters for Time-dependent position profile - Profile tab Dynamic response tab See Overview of parameters for Time-dependent position profile - Dynamic response tab Expert tab See Overview of parameters for Time-dependent position profile - Expert tab

Page 296: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 296 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition).

5.5.13.2 Overview of parameters for Time-dependent position profile – Profile tab

Table 5-122 Overview of parameters for Time-dependent position profile – Profile tab

Field/Button Explanation/instructions Profile Here, you select the cam that describes the time-dependent position profile. The following

are available: • All cams that are defined on the relevant device. The cams are defined in the CAMS

folder in the project navigator. • All variables with the following data type of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): camType.. Start time Here you define the start time within the cam for profile execution.

If you enter 0.0, the profile is executed from the starting point of the cam. Enter the value as a floating-point number.

Type Here you can decide how the positions defined by the cam are approached: Absolute(default value) The y-values of the cam represent absolute position values. Relative The y-values of the cam represent relative references to the current axis position.

Page 297: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 297

5.5.13.3 Overview of parameters for Time-dependent position profile – Dynamic response tab

Table 5-123 Overview of parameters for Time-dependent position profile – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Just like all the parameters in the Dynamics tab, this parameter is only evaluated while approaching and exiting the profile.

Velocity The entered value acts during the constant velocity phase. System variable for preassigned value: userDefaultDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. System variable for preassigned value: userDefaultDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. System variable for preassigned value: userDefaultDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. System variable for preassigned value: userDefaultDynamics.negativeAccel

Jerk The entered value limits the change in the acceleration or deceleration at the start and end of the respective phase. System variables for preassigned value: userDefaultDynamics.positiveAccelStartJerk userDefaultDynamics.positiveAccelEndJerk userDefaultDynamics.negativeAccelStartJerk userDefaultDynamics.negativeAccelEndJerk

5.5.13.4 Overview of parameters for Time-dependent position profile – Expert tab

Table 5-124 Overview of parameters for Time-dependent position profile – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 298: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 298 Programming and Operating Manual, 03/2007

5.5.13.5 Relevant system function for Time-dependent position profile Cam technology package: • _runTimeLockedPositionProfile

Overview of parameters for Time-dependent position profile / _runTimeLockedPositionProfile

Table 5-125 Parameters (MCC Time-dependent position profile command compared to _runTimeLockedPositionProfile system function)

Parameters of the MCC Time-dependent position profile command

Parameters of the _runTimeLockedPositionProfile system function

Axis axis Transition behavior mergemode Delay program execution nextCommand Profile tab Profile profile Start time starttime Type profiledatamode Dynamics tab Velocity velocitytype, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 299: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 299

5.5.14 Time-dependent velocity profile

With this command, the axis moves along a velocity profile preset by a cam. The definition range (x-axis) of the cam is interpreted as time, the value range (y-axis) as the corresponding velocity. The profile is traversed from a selectable starting time to the end of the cam.

Figure 5-57 Parameter screen form: Time-dependent velocity profile

Page 300: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 300 Programming and Operating Manual, 03/2007

5.5.14.1 Overview of parameters for Time-dependent velocity profile

Table 5-126 Overview of parameters for Time-dependent velocity profile

Field/Button Explanation/instructions Axis In Axis, select the axis that is to move along the velocity profile. The list contains:

• All axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Profile tab See Overview of parameters for Time-dependent velocity profile - Profile tab Dynamic response tab See Overview of parameters for Time-dependent velocity profile - Dynamic response tab Expert tab See Overview of parameters for Time-dependent velocity profile - Expert tab Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied. If the check box is not selected, the next command is executed immediately. Select the condition that has to be satisfied before the system continues execution of the following command in the MCC chart. See also Delay program execution (step enabling condition)

5.5.14.2 Overview of parameters for Time-dependent velocity profile – Profile tab

Table 5-127 Overview of parameters for Time-dependent velocity profile – Profile tab

Field/Button Explanation/instructions Profile Here, you select the cam that describes the time-dependent velocity profile. The following

are available: • All cams that are defined on the relevant device. The cams are defined in the CAMS

folder in the project navigator. • All variables with the following data type of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): camType. Start time Here you define the start time within the cam for profile execution.

If you enter 0.0, the profile is executed from the starting point of the cam. Enter the value as a floating-point number.

Type Here, you determine whether the motion should be performed in a speed-controlled or position-controlled mode. Position-controlled(default value) Motion is position-controlled. Speed-controlled Motion is speed-controlled.

Page 301: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 301

5.5.14.3 Overview of parameters for Time-dependent velocity profile – Dynamic response tab

Table 5-128 Overview of parameters for Time-dependent velocity profile – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Just like all the parameters in the Dynamics tab, this parameter is only evaluated while approaching and exiting the profile.

Velocity profile In this field, you define the transitions between the individual motion phases. System variable for preassigned value: userDefaultDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. System variable for preassigned value: userDefaultDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. System variable for preassigned value: userDefaultDynamics.negativeAccel

Jerk The entered value limits the change in the acceleration or deceleration at the start and end of the respective phase. System variables for preassigned value: userDefaultDynamics.positiveAccelStartJerk userDefaultDynamics.positiveAccelEndJerk userDefaultDynamics.negativeAccelStartJerk userDefaultDynamics.negativeAccelEndJerk

5.5.14.4 Overview of parameters for Time-dependent velocity profile – Expert tab

Table 5-129 Overview of parameters for Time-dependent velocity profile – Expert tab

Field/Button Explanation/instructions This tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 302: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 302 Programming and Operating Manual, 03/2007

5.5.14.5 Relevant system function for Time-dependent velocity profile Cam technology package: • _runTimeLockedVelocityProfile

Overview of parameters for Time-dependent velocity profile / _runTimeLockedVelocityProfile

Table 5-130 Parameters (MCC Time-dependent velocity profile command compared to _runTimeLockedVelocityProfile system function)

Parameters of the MCC Time-dependent velocity profile command

Parameters of the _runTimeLockedVelocityProfile system function

Axis axis Transition behavior mergemode Delay program execution nextCommand Profile tab Profile profile Start time starttime Type movingmode Dynamics tab Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

5.5.15 Stop axis

This command stops the motion of an axis and is effective for all single axis motions. The motion can be stopped with Normal stop or Quick stop. • Normal stop: This command acts on all single axis motions (positioning and speed

motions), but not on synchronous motions. • Quick stop: This command also acts on synchronous motions. In addition, the axis is

disabled with respect to further motion commands; this state can be cancelled with the commands Remove axis enable or Reset object.

Page 303: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 303

Figure 5-58 Parameter screen form: Stop axis

5.5.15.1 Overview of parameters for Stop axis

Table 5-131 Overview of parameters for Stop axis

Field/Button Explanation/instructions Axis In Axis, select which axis is to be stopped. The list contains:

• All axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Stop axis - Parameters tab Dynamic response tab See Overview of parameters for Stop axis - Dynamic response tab Expert tab See Overview of parameters for Stop axis - Expert tab Delay program execution • Select the check box if you wish the system to delay execution of the following

command in the MCC chart until the selected condition has been satisfied. • If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition).

Page 304: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 304 Programming and Operating Manual, 03/2007

5.5.15.2 Overview of parameters for Stop axis – Parameters tab

Table 5-132 Overview of parameters for Stop axis – Parameters tab

Field/Button Explanation/instructions Stop mode Select a stop mode here. Only those motions that have been stopped in "normal stop without abort"

mode can be continued with the Continue motion command. No other motions can be continued. In the case of a quick stop, the axis is disabled with respect to further motion commands; this state can be cancelled with the commands Remove axis enable or Reset object. Normal stop without abort (default value) The motion specified in the Selection field is stopped with the programmed dynamic response parameters (Dynamic response tab – see Overview of parameters for Stop axis - Dynamic response tab. It can be continued with the Continue motion command. No other commands for the axis may be programmed between the stop command and the continue command. The command does not act on synchronous motions. Normal stop with abort The motion specified in the Selection field is stopped with the programmed dynamic response parameters (Dynamic response tab – see Overview of parameters for Stop axis - Dynamic response tab. The motion cannot be continued. The command does not act on synchronous motions. Quick stop at maximum deceleration The motion is stopped according to interpolation using the maximum dynamic values on the axis. It cannot be continued. Quick stop within defined period The motion can be brought to a standstill in the programmed time. You program the time in the Time for deceleration parameter in the Dynamics tab. The motion cannot be continued. Quick stop with actual value-related emergency stop ramp The motion is stopped using the emergency stop ramp in the controller. This is set during configuration. The motion cannot be continued. Quick stop with dynamic response parameters The motion is stopped with the programmed dynamic response parameters (Dynamics tab – see Overview of parameters for Stop axis - Dynamic response tab). The motion cannot be continued.

Selection Select whether you want to stop the motion as a whole, only the basic motion, or only the superimposed motion. This parameter can only be selected for the following stop modes: • Normal stop without abort (default value) • Normal stop with abort All motions (default value) All motions of the programmed axis are stopped. Basic motion The basic motion is stopped. Superimposed motion The superimposed motion is stopped.

Page 305: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 305

Field/Button Explanation/instructions Traversing mode Position-controlled

For positioning and synchronous axes only: Axis is switched from the current traversing mode (for example, speed control, force control, or torque control) to position control, and stopped. Speed-controlled Axis is switched from the current traversing mode (for example, position control, force control, or torque control) to speed control, and stopped. The speed ramp takes effect immediately; an existing following error does not have to be removed first. If position-controlled motions are stopped in speed-controlled mode, the axis is disabled with respect to further motion commands; this state can be cancelled with the commands Remove axis enable or Reset object. Last set traversing mode (default value) Axis is switched from the current traversing mode (for example, position control, speed control, force control, or torque control) to the last set traversing mode (position or speed control), and stopped.

5.5.15.3 Overview of parameters for Stop axis – Dynamic response tab

Table 5-133 Overview of parameters for Stop axis – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Velocity profile In this field, you define the transitions between the individual motion phases.

System variable for preassigned value: userDefaultDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefaultDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variable for preassigned value: userDefaultDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefaultDynamics.positiveAccelStartJerk userDefaultDynamics.positiveAccelEndJerk userDefaultDynamics.negativeAccelStartJerk userDefaultDynamics.negativeAccelEndJerk

Time for deceleration The entered value determines the duration of the braking operation in the Quick stop within defined period stop mode. System variable for preassigned value: userDefaultDynamics.stopTime

Page 306: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 306 Programming and Operating Manual, 03/2007

5.5.15.4 Overview of parameters for Stop axis – Expert tab

Table 5-134 Overview of parameters for Stop axis – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.5.15.5 Relevant system functions for Stop axis Cam technology package: • _stop (for Normal stop without /with abort stop mode) • _stopEmergency (for Quick stop stop mode)

Overview of parameters for Stop axis, _stop, _stopEmergency

Table 5-135 Parameters (MCC Stop axis command compared to _stop, _stopEmergency system functions)

Parameters of the MCC Stop axis command

Parameters of the _stop, _stopEmergency system functions

Axis axis Delay program execution nextCommand Parameters tab Stop mode stoppmode, stopdrivemode Selection stopspecification Traversing mode movingmode Dynamics tab Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Time for deceleration stoptimetype, stoptime Expert tab CommandID variable commandId Return variable –

Page 307: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 307

5.5.16 Continue motion

This command continues a motion that has been stopped. The following motions can be continued: • All speed-controlled motions that were brought to a standstill using the Normal stop

without abort stop mode • All position-controlled motions that were brought to a standstill using the Normal stop

without abort stop mode (and not in speed-controlled mode) The axis must not receive any new motion commands between interruption and continuation of the interrupted motion.

Figure 5-59 Parameter screen form: Continue motion

5.5.16.1 Overview of parameters for Continue motion

Table 5-136 Overview of parameters for Continue motion

Field/Button Explanation/instructions Axis In Axis, select which axis for which motion is to be continued. The list contains:

• All axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Continue motion - Parameters tab Expert tab See Overview of parameters for Continue motion - Expert tab

Page 308: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 308 Programming and Operating Manual, 03/2007

5.5.16.2 Overview of parameters for Continue motion - Parameters tab

Table 5-137 Overview of parameters for Continue motion - Parameters tab

Field/Button Explanation/instructions Selection Here, select which axis motion component is to be continued.

All motions (default value) All motions of the programmed axis are continued. Basic motion The basic motion is continued. Superimposed motion The superimposed motion is continued.

5.5.16.3 Overview of parameters for Continue motion - Expert tab

Table 5-138 Overview of parameters for Continue motion - Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.5.16.4 Relevant system function for Continue motion Cam technology package: • _continue

Overview of parameters for Continue motion, _continue

Table 5-139 Parameters (MCC Continue motion command compared to _continue system function)

Parameters of the MCC Continue motion command

Parameters of the _continue system function

Axis axis Parameters tab Selection continuespecification Expert tab Return variable –

Page 309: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 309

5.5.17 Online correction

The correction value you enter for overriding velocity and acceleration acts on currently active commands and all following commands.

Figure 5-60 Parameter screen form: Online correction

5.5.17.1 Overview of parameters for Online correction

Table 5-140 Overview of parameters for Online correction

Field/Button Explanation/instructions Axis Select the axes for which you wish to program an override. The list contains:

• All axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Velocity override • Select this check box if you want to program a velocity override. • Enter the override factor here. The current velocity value is corrected by the

specified percentage value.

Units: Percentage

Range of values: 0 - 200

The value acts on all presently active commands as well as on all of the subsequent commands.

Page 310: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 310 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Acceleration override • Select this check box if you want to program an acceleration override.

• Enter the override factor here. The current acceleration value is corrected by the specified percentage value.

Units: Percentage

Range of values: 1 - 1000

The value acts on all presently active commands as well as on all of the subsequent commands.

5.5.17.2 Relevant system function for Online correction System variable for speed-controlled (drive) axis, positioning axis, and synchronous (following) axis technology objects: • override. Adjusts the velocity and acceleration override to correct the current velocity and acceleration by the specified percentage:

Axis Velocity override Achse.override.velocity Acceleration override Achse.override,acceleration

5.5.18 Set axis parameter

This command changes the preassigned parameters (USERDEFAULT) for the specified axis. The programmed axis parameters go into effect when the relevant parameter is set to the preassigned value in a subsequent motion command. The USERDEFAULT value settings take effect again after: • Power On • Reset object command with selected Initialize system variables check box

Page 311: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 311

Figure 5-61 Parameter screen form: Set axis parameter

5.5.18.1 Overview of parameters for Set axis parameter

Table 5-141 Overview of parameters for Set axis parameter

Field/Button Explanation/instructions Axis In Axis, select the configured axis for which you wish to set one or more new preassigned

values. The list contains: • All axes that are defined on the relevant device. The axis is defined in the AXES folder

in the project navigator. • All variables with the following data types of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

speed For speed-controlled axes only Preassigned value for the speed during the constant speed phase. System variable: userDefaultDynamics.velocity • Select this check box if you want to alter the preassigned value for the speed. • Enter the preassigned value (see input field). See also Overview of parameters for the Dynamic response tab.

Velocity For positioning and synchronous axes only Preassigned value for the velocity during the constant velocity phase. System variable: userDefaultDynamics.velocity • Select this check box if you want to alter the preassigned value for the velocity. • Enter the preassigned value (see input field). See also Overview of parameters for the Dynamic response tab.

Page 312: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 312 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Velocity profile Preassigned value for the velocity profile

System variable: userDefaultDynamics.profile The velocity profile is used to specify the transitions between the individual motion phases. The velocity profile influences the motion transitions as follows: • At the start and end of the acceleration phase, the transition to the constant

acceleration or constant velocity phase • At the start and end of the deceleration phase, the transition to the constant

deceleration or constant velocity phase Proceed as follows to change the preassigned value for the velocity profile: • Select the check box. • Select the preassigned value.

Smooth A velocity profile with smooth acceleration characteristic takes effect for this command. Application: Velocity profile with controllable jerk characteristic

Trapezoidal (default value) A trapezoidal velocity profile takes effect for this command. Acceleration and deceleration can be specified.

See also Overview of parameters for the Dynamic response tab. Acceleration Preassigned value for the acceleration during the constant acceleration phase.

System variable for preassigned value: userDefaultDynamics.positiveAccel • Select this check box if you want to alter the preassigned value for the acceleration. • Enter the preassigned value (see input field). See also Overview of parameters for the Dynamic response tab.

Deceleration Preassigned value for the deceleration during the constant deceleration phase. System variable: userDefaultDynamics.negativeAccel • Select this check box if you want to alter the preassigned value for the deceleration. • Enter the preassigned value (see input field). See also Overview of parameters for the Dynamic response tab.

Jerk Preassigned value for the change in acceleration or deceleration • At acceleration start

System variable: userDefaultDynamics.positiveAccelStartJerk • At acceleration end

System variable: userDefaultDynamics.positiveAccelEndJerk • At deceleration start

System variable: userDefaultDynamics.negativeAccelStartJerk • At deceleration end

System variable: userDefaultDynamics.negativeAccelEndJerk To change the preassigned value for jerk, proceed as follows: • Select the relevant check box. • Enter the preassigned value (see input field). See also Overview of parameters for the Dynamic response tab.

Page 313: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 313

Field/Button Explanation/instructions Time for deceleration Preassigned value for the duration of the braking operation for a quick stop within a

defined period (see Stop axis). System variable: userDefaultDynamics.stopTime • Select the check box if you want to alter the preassigned value for the duration of the

braking operation. • Enter the preassigned value (see input field). See also Overview of parameters for the Dynamic response tab.

5.5.18.2 Example of Set axis parameter

Figure 5-62 Example of Set axis parameter

Page 314: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 314 Programming and Operating Manual, 03/2007

5.5.18.3 Relevant system function for Set axis parameter System variable for speed-controlled (drive) axis, positioning axis, and synchronous (following) axis technology objects: • userDefaultDynamics Adjusts the default parameters of the specified axis:

Axis Velocity Achse.userdefaultdynamics.velocity Velocity profile Achse.userdefaultdynamics.profil Time for deceleration Achse.userdefaultdynamics.stopTime Acceleration Achse.userdefaultdynamics.positiveaccel Deceleration Achse.userdefaultdynamics.negativeaccel Jerk at start of acceleration Achse.userdefaultdynamics.positiveaccelstartjerk Jerk at end of acceleration phase Achse.userdefaultdynamics.positiveaccelendjerk Jerk at start of deceleration Achse.userdefaultdynamics.negativeaccelstartjerk Jerk at end of deceleration phase Achse.userdefaultdynamics.negativeaccelandjerk

Page 315: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 315

5.5.19 Set virtual axis values

Use the command Set virtual axis values in order to transfer the values of position, velocity and acceleration of a real leading axis or an encoder to a virtual axis. The axis can then, for example, be programmed using a positioning command. The axis values of the virtual axis are set only when the master axis is moving. If the command is executed when the master axis is stationary, the axis values are not set until the master axis is next started.

Figure 5-63 Parameter screen form: Set virtual axis values

5.5.19.1 Overview of parameters for Set virtual axis values

Table 5-142 Overview of parameters for Set virtual axis values

Field/Button Explanation/instructions Virtual axis Here, select the axis to be synchronized. All of the virtual axes of the device that have

positioning or synchronous operation functionality are displayed. Parameters tab See Overview of parameters for Set virtual axis values - Parameters tab Expert tab See Overview of parameters for Set virtual axis values - Expert tab Delay program execution Select the check box if you wish to delay execution of the following command until the

current command has been completed. If the check box is not selected, the next command is executed immediately.

Page 316: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 316 Programming and Operating Manual, 03/2007

5.5.19.2 Overview of parameters for Set virtual axis values – Parameters tab

Table 5-143 Overview of parameters for Set virtual axis values – Parameters tab

Field/Button Explanation/instructions Leading axis / encoder Here, select the axis for which the position, velocity, or acceleration is to be transferred to

the virtual axis. The list contains: • All positioning and synchronous (following) axes and external encoders that are

defined on the relevant device. • All variables with the following data types of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): posAxis, followingAxis, or externalEncoderType.

Reference Here, decide whether the virtual axis is to be synchronized to the setpoints or actual values of the master axis. Setpoint The setpoints of the master axis are accepted for the virtual axis. Actual value(default value) The actual values of the master axis are accepted for the virtual axis.

5.5.19.3 Overview of parameters for Set virtual axis values – Expert tab

Table 5-144 Overview of parameters for Set virtual axis values – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 317: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 317

5.5.19.4 Relevant system function for Set virtual axis values Cam technology package: • _redefinePosition

with parameter redefineSpecification := VIRTUAL_AXIS.

Overview of parameters for Set virtual axis values, _redefinePosition

Table 5-145 Parameters (MCC Set virtual axis values command compared to _redefinePosition system function)

Parameters of the MCC Set virtual axis values command

Parameters of the _redefinePosition system function

Virtual axis axis Delay program execution nextCommand Parameters tab Leading axis / encoder Reference Leitachse/Geber.positioningstate.commandposition,

Leitachse/Geber.motionstatedata.commandvelocity, Leitachse/Geber.positioningstate.actualposition; Leitachse/Geber.motionstatedata.actualvelocity

Expert tab CommandID variable commandID Return variable –

Page 318: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 318 Programming and Operating Manual, 03/2007

5.5.20 Delete command queue

The command queue is a memory for motion commands that have been issued by the program, but are not yet active. Commands that have not yet been executed can be deleted from the command queue. This command allows commands for an axis to be selectively deleted after the axis has been stopped or the motion sequence has been modified.

Figure 5-64 Parameter screen form: Delete command queue

5.5.20.1 Overview of parameters for Delete command queue

Table 5-146 Overview of parameters for Delete command queue

Field/Button Explanation/instructions Axis In Axis, select the axis for which the command is to be programmed. The list contains:

• All axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Return variable If you enter the name of a variable of the specified data type, you can use this variable to find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 319: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 319

5.5.20.2 Example of Delete command queue

Figure 5-65 Example of a command queue

5.5.20.3 Relevant system function for Delete command queue Cam technology package: • _resetMotionBuffer

Overview of parameters for Delete command queue, _resetMotionBuffer

Table 5-147 Parameters (MCC Delete command queue command compared to _resetMotionBuffer system function)

Parameters of the MCC Delete command queue command

Parameters of the _resetMotionBuffer system function

Axis axis Return variable –

Page 320: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 320 Programming and Operating Manual, 03/2007

5.5.21 Switch parameter set

Using this command, you can switch over the active controller data set. Several data sets can be assigned to one Axis technology object, e.g., for multiple measuring systems/encoders. You can switch among multiple measuring systems/encoders, for example, by switching data sets. All configured measuring systems are internally active, and the measured values are updated cyclically.

Figure 5-66 Parameter screen form: Switch parameter set

Page 321: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 321

5.5.21.1 Overview of parameters for Switch parameter set

Table 5-148 Overview of parameters for Switch parameter set

Field/Button Explanation/instructions Axis Here, select the axis for which the controller data set is to be switched over. The list

contains: • All axes that are defined on the relevant device. The axis is defined in the AXES folder

in the project navigator. • All variables with the following data types of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): driveAxis, posAxis, or followingAxis.

Parameters tab See Overview of parameters for Set virtual axis values - Parameters tab Expert tab See Overview of parameters for Set virtual axis values - Expert tab Delay program execution Select the check box if you wish to delay execution of the following command until the

current command has been completed. If the check box is not selected, the next command is executed immediately.

5.5.21.2 Overview of parameters for Switch parameter set – Parameters tab

Table 5-149 Overview of parameters for Switch parameter set – Parameters tab

Field/Button Explanation/instructions Number of the parameter set Here, select the number of the parameter set that is to be activated. Numbers 1 to 31 are

listed. The value can be entered directly or by means of a variable or a calculation formula. Use a drag-and-drop operation to move variables from the symbol browser. Use a drag-and-drop operation to move commands from the command library.

5.5.21.3 Overview of parameters for Switch parameter set – Expert tab

Table 5-150 Overview of parameters for Set virtual axis values – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 322: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.5 Single axis commands

SIMOTION MCC Motion Control Chart 322 Programming and Operating Manual, 03/2007

5.5.21.4 Relevant system function for Switch parameter set Cam technology package: • _setAxisDataSetActive

Overview of parameters for Switch parameter set, _setAxisDataSetActive

Table 5-151 Parameters (MCC Switch parameter set command compared to _setAxisDataSetActive system function)

Parameters of the MCC Switch parameter set command

Parameters of the _setAxisDataSetActive system function

Axis axis Delay program execution nextCommand Parameters tab Number of the parameter set datasetnumber Expert tab CommandID variable commandID Return variable –

Page 323: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 323

5.6 Commands for external encoders, measuring inputs and output cams

5.6.1 External encoder on

This command enables the external encoder for recording measured values.

Figure 5-67 Parameter screen form: External encoder on

Page 324: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 324 Programming and Operating Manual, 03/2007

5.6.1.1 Overview of parameters for External encoder on

Table 5-152 Overview of parameters for External encoder on

Field/Button Explanation/instructions Encoder Here, you select the external encoder. The list contains:

• All encoders that are defined on the relevant device. An external encoder is defined in the EXTERNAL ENCODERS folder in the project navigator.

• All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types): externalEncoderType.

CommandID variable Enter the name of a variable of data type CommandIdType here. With the help of this variable, you can, for example, trace back the status of the command. Variables of data type CommandIdType declared in the MCC source file or MCC chart are provided for selection. If you leave the CommandID variable field empty, the CommandID is not assigned to any variables; this means that you cannot access the CommandID (standard). See also Overview of parameters for the Expert tab.

Return variable If you enter the name of a variable of the specified data type, you can use this variable to find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Delay program execution Select the check box if you wish to delay execution of the following command until the current command has been completed. If the check box is not selected, the next command is executed immediately.

5.6.1.2 Relevant system function for External encoder on Cam technology package: • _enableExternalEncoder

Overview of parameters for External encoder on / _enableExternalEncoder

Table 5-153 Parameters (MCC External encoder on command compared to _enableExternalEncoder system function)

Parameters of the MCC External encoder on command

Parameters of the _enableExternalEncoder system function

Encoder externalEncoder CommandID variable commandId Return variable – Delay program execution nextCommand

Page 325: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 325

5.6.2 External encoder off

This command disables the external encoder for recording measured values.

Figure 5-68 Parameter screen form: External encoder off

5.6.2.1 Overview of parameters for External encoder off

Table 5-154 Overview of parameters for External encoder off

Field/Button Explanation/instructions Encoder Here, you select the external encoder. The list contains:

• All encoders that are defined on the relevant device. An external encoder is defined in the EXTERNAL ENCODERS folder in the project navigator.

• All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types): externalEncoderType.

CommandID variable Enter the name of a variable of data type CommandIdType here. With the help of this variable, you can, for example, trace back the status of the command. Variables of data type CommandIdType declared in the MCC source file or MCC chart are provided for selection. If you leave the CommandID variable field empty, the CommandID is not assigned to any variables; this means that you cannot access the CommandID (standard). See also Overview of parameters for the Expert tab.

Page 326: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 326 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Delay program execution Select the check box if you wish to delay execution of the following command until the current command has been completed. If the check box is not selected, the next command is executed immediately.

5.6.2.2 Relevant system function for External encoder off Cam technology package: • _disableExternalEncoder

Overview of parameters for External encoder off / _disableExternalEncoder

Table 5-155 Parameters (MCC External encoder off command compared to _disableExternalEncoder system function)

Parameters of the MCC External encoder off command

Parameters of the _disableExternalEncoder system function

Encoder externalEncoder CommandID variable commandId Return variable – Delay program execution nextCommand

Page 327: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 327

5.6.3 Synchronize external encoder

This command homes the measuring system.

Figure 5-69 Parameter screen form: Synchronize external encoder

5.6.3.1 Overview of parameters for Synchronize external encoder

Table 5-156 Overview of parameters for Synchronize external encoder

Field/Button Explanation/instructions Encoder Select the external encoder to be synchronized in this field. The list contains:

• All encoders that are defined on the relevant device. An external encoder is defined in the EXTERNAL ENCODERS folder in the project navigator.

• All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types): externalEncoderType.

Parameters tab See Overview of parameters for Synchronize external encoder - Parameters tab Expert tab See Overview of parameters for Synchronize external encoder - Expert tab Delay program execution Select the check box if you wish to delay execution of the following command until the

current command has been completed. If the check box is not selected, the next command is executed immediately.

Page 328: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 328 Programming and Operating Manual, 03/2007

5.6.3.2 Overview of parameters for Synchronize external encoder – Parameters tab

Table 5-157 Overview of parameters for Synchronize external encoder – Parameters tab

Field/Button Explanation/instructions Homing type Here, you select the homing type.

Setting the current position value (default value) The home position coordinates are directly set to the current axis coordinates. The current axis position is assigned to the value of the home coordinates. There is no active traversing motion. Homing with the next zero mark The next time that the axis moves, the first available zero mark is searched for and the measuring system is synchronized to this zero mark. There is no active traversing motion as a result of the homing command. Absolute encoder adjustment This selection is available only for absolute value encoders, that is, only for encoders that have been configured as type "absolute value encoder" or "absolute value encoder, cyclic absolute".

Reference point coordinate Coordinates of the home position in the reference system of the axis. Enter the value in the editable selection list (see Editable selection list (combo box)). Last programmed home position coordinate Preassigned value (default value) See Selection list (combo box) System variables for preassigned value: userDefaultHoming.homePosition

5.6.3.3 Overview of parameters for Synchronize external encoder – Expert tab

Table 5-158 Overview of parameters for Synchronize external encoder – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of

encoder configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable

to find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 329: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 329

5.6.3.4 Relevant system function for Synchronize external encoder Cam technology package: • _synchronizeExternalEncoder

Overview of parameters for Synchronize external encoder / _synchronizeExternalEncoder

Table 5-159 Parameter (MCC Synchronize external encoder command compared to _synchronizeExternalEncoder system function)

Parameters of the MCC Synchronize external encoder command

Parameters of the _synchronizeExternalEncoder system function

Encoder externalEncoder CommandID variable commandId Delay program execution nextCommand Parameters tab Homing type synchronizingMode Reference point coordinate syncPositionType, syncPosition Expert tab CommandID variable commandId Dialog box adaptation – Return variable –

Page 330: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 330 Programming and Operating Manual, 03/2007

5.6.4 Encoder monitoring on

This command enables encoder monitoring. At least two encoder systems must be configured for one axis for this purpose. The difference between the two encoder systems is monitored; an alarm is generated when the maximum permissible difference is exceeded.

Figure 5-70 Encoder monitoring on

5.6.4.1 Overview of parameters for Encoder monitoring on

Table 5-160 Overview of parameters for Encoder monitoring on

Field/Button Explanation/instructions Axis Here, you select the axis for which encoder monitoring is to be enabled.

At least two encoder systems must have been configured for the selected axis during commissioning (configuration data TypeOfAxis.NumberOfEncoders.numberOfEncoders > 1).

Parameters tab See Overview of parameters for Encoder monitoring on - Parameters tab Expert tab See Overview of parameters for Encoder monitoring on - Expert tab

Page 331: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 331

5.6.4.2 Overview of parameters for Encoder monitoring on – Parameters tab

Table 5-161 Overview of parameters for Encoder monitoring on – Parameters tab

Field/Button Explanation/instructions Reference measuring system

Select the reference measuring system from the encoder systems configured for the axis.

Measuring system 2 Select the second measuring system from the remaining encoder systems configured for the axis.

Maximum permissible difference

Maximum permissible difference between the two encoder systems. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: sensormonitoring.MaximalSensorDifference

5.6.4.3 Overview of parameters for Encoder monitoring on – Expert tab

Table 5-162 Overview of parameters for Encoder monitoring on – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of encoder

configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 332: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 332 Programming and Operating Manual, 03/2007

5.6.4.4 Relevant system function for Encoder monitoring on Cam technology package: • _enableMonitoringOfEncoderDifference

Overview of parameters for Encoder monitoring on / _enableMonitoringOfEncoderDifference

Table 5-163 Parameters (MCC Encoder monitoring on command compared to _enableMonitoringOfEncoderDifference system function)

Parameters of the MCC Encoder monitoring on command

Parameters of the _enableMonitoringOfEncoderDifference system functions

Axis externalEncoder Parameters tab Reference measuring system referenceencodertype, referenceEncoder, encoder Measuring system 2 – Maximum permissible difference maximalencoderdifferencetype, maximalencoderdifference Expert tab Dialog box adaptation – Return variable –

Page 333: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 333

5.6.5 Encoder monitoring off

This command disables encoder monitoring.

Figure 5-71 Parameter screen form: Encoder monitoring off

5.6.5.1 Overview of parameters for Encoder monitoring off

Table 5-164 Overview of parameters for Encoder monitoring off

Field/Button Explanation/instructions Axis Here, you select the axis for which encoder monitoring is to be disabled.

At least two encoder systems must have been configured for the selected axis during commissioning (configuration data TypeOfAxis.NumberOfEncoders.numberOfEncoders > 1).

Return variable If you enter the name of a variable of the specified data type, you can use this variable to find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 334: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 334 Programming and Operating Manual, 03/2007

5.6.5.2 Relevant system function for Encoder monitoring off Cam technology package: • _disableMonitoringOfEncoderDifference

Overview of parameters for Encoder monitoring off / _disableMonitoringOfEncoderDifference

Table 5-165 Parameters (MCC Encoder monitoring off command compared to _disableMonitoringOfEncoderDifference system function)

Parameters of the MCC Encoder monitoring off command

Parameters of the _disableMonitoringOfEncoderDifference system function

Axis axis Return variable –

5.6.6 Activate measuring input

This command activates a measuring input for an axis or external encoder. A change in the signal (edge) at the configured measuring input (e.g., on the SIMOTION device or drive) causes the current position value to be saved. You can select how often the measurement is performed: • One-time: The measuring process must be reactivated for each new measurement. • The measuring accuracy depends on the accuracy of the hardware used. It lies in the

range of microseconds. • Cyclic: The measurement is made cyclically in the configured processing cycle clock of

the Measuring Input technology object. Up to two edges can be detected and measured in each processing cycle clock. Cyclic measurement is only supported by the TM17 High Feature, the C240 (inputs B1-B4) and the D4xx (onboard measuring inputs). The measured values must be read out by the user program before they are overwritten by a new measurement, i.e., if possible, in the SynchronousTask that corresponds to the processing cycle clock of the Measuring Input technology object.

For both types, you can also specify: • The triggering edge of the input signal (e.g., rising, falling, both) • A measuring range in which the measured value will be acquired If the measurement is successful, the measurement result is available in the system variables below in the next cycle clock: 1. The measured values are stored in system variables measuredValue1 and

measuredValue2 (for meaning, see the table below).

Page 335: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 335

2. With one-time measuring, system variable state has the value TRIGGER_OCCURRED. 3. With cyclic measuring, system variables counterMeasuredValue1 and

counterMeasuredValue2 are incremented by 1 on each measurement result. New results can be traced immediately and can also be read from non-IPO-synchronous tasks. The only time these counters are set to 0 is in the event of a system startup or technology object reset.

Table 5-166 Content of system variables measuredValue1 and measuredValue2 according to the measurement and the triggering edge

Measurement Trigger measuredValue1 measuredValue2 One edge (rising or falling)

Measured value 1 once-only

Two edges 1st measured value chronologically1

2nd measured value chronologically

One edge (rising or falling)

1st measured value chronologically2

2nd measured value chronologically34

Cyclic

Two edges Measured value at 1st rising edge2

Measured value at 1st falling edge4

1. In addition, system variable 'state' has the value TRIGGER_OCCURRED. 2. In addition, system variable counterMeasuredValue1 is incremented by 1.

3. With 2 measured values in the same processing cycle clock.

4. In addition, system variable counterMeasuredValue2 is incremented by 1.

With one-time measuring, the command is active until the measurement result is received or the command is terminated by the Deactivate measuring input command. The command is active until it is terminated by the Deactivate measuring input command.

Page 336: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 336 Programming and Operating Manual, 03/2007

Figure 5-72 Parameter screen form: Activate measuring input

5.6.6.1 Overview of parameters for Activate measuring input

Table 5-167 Overview of parameters for Activate measuring input

Field/Button Explanation/instructions Axis/encoder Here, you select the axis or external encoder for which the actual value is to be

measured using a measuring input. The list contains: • All positioning and synchronous (following) axes and external encoders that are

defined on the relevant device.

The measuring inputs associated with the selected axis or external encoder are automatically identified and displayed in the Measuring input field for selection, as appropriate.

• <Reference>

You select this entry if the measuring input is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type measuringInput (references to measuring inputs) are available for selection in the Measuring input field.

Notice You cannot select references to an axis or external encoder (variables of data type posAxis, followingAxis, or external Encoder). There is no assignment for the reference to the associated measuring inputs. Instead, select the reference to the measuring input directly (variable of data type measuringInputType).

Page 337: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 337

Field/Button Explanation/instructions Measuring input Here, the permissible measuring inputs are displayed according to the selected

Axis/Encoder, where they are available for selection, as appropriate: • A positioning or synchronous axis or external encoder defined on the the device

was selected as the axis/encoder:

The measuring inputs associated with the selected axis/encoder are available for selection.

If you wish to create a new measuring input, click the Create measuring input button and enter a new name. The measuring input is created for the technology object that has been selected in the Axis/Encoder field (not for variables).

The configuration can be changed in the project navigator under the respective axis or external encoder in the MEASURING INPUTS folder.

• <Reference> was selected as the axis/encoder:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: measuringInputType

These variables are references to measuring inputs. Parameters tab See Overview of parameters for Activate measuring input - Parameters tab Expert tab See Overview of parameters for Activate measuring input - Expert tab Delay program execution Only if the Activate cyclic measuring check box is not selected.

• Select the check box if you wish to delay execution of the following command until the current command has been completed. If the check box is not selected, the next command is executed immediately.

If the Activate cyclic measuring check box is selected, the next command is always executed immediately.

5.6.6.2 Overview of parameters for Activate measuring input – Parameters tab

Table 5-168 Overview of parameters for Activate measuring input – Parameters tab

Field/Button Explanation/instructions Activate cyclic measuring (SIMOTION kernel V4.0 and higher)

Select this check box if the actual values are to be acquired cyclically. If the check box is not selected, the actual value is acquired one time.

Edge for cyclic measuring (SIMOTION kernel V4.0 and higher)

Only if the Activate cyclic measuring check box is selected. Here, you select whether the actual position is to be measured at a rising or falling edge of the measuring input. All edges The actual position is measured at both edges of the measuring input. Rising edges only The actual position is measured only at a rising edge of the measuring input. Falling edges only The actual position is measured only at a falling edge of the measuring input. Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userDefault.measuredEdgeCyclicMode

Page 338: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 338 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Edge Only if the Activate cyclic measuring check box is not selected.

Here, you select whether the actual position is to be measured at a rising or falling edge of the measuring input. Falling edge The actual position is measured at the falling edge of the measuring input. Both The actual position is measured at both edges of the measuring input. Both (starting at rising edge) The actual position is measured at both edges of the measuring input; the first measurement takes place at a rising edge. Both (starting at falling edge) The actual position is measured at both edges of the measuring input; the first measurement takes place at a falling edge. Rising edge The actual position is measured at the rising edge of the measuring input. Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userDefault.measuredEdge

Activate measuring range Select whether the measuring input is only to be active within a certain measuring range. Measurement in specified area Measured value acquisition only takes place in the range specified by the Start of measuring range and End of measuring range fields. Measurement without specified range Measured value acquisition takes place without range limitation; the Start of measuring range and End of measuring range fields are not visible. Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userDefault.measuringRangeMode

Start-of-scale value of measuring range

Enter the starting point of the measuring range in the editable selection list. Preassigned value (default value) Last programmed See Selection list (combo box) System variable for preassigned value: userDefault.measuringRangeStartPosition

Full-scale value of measuring range Enter the end point of the measuring range in the editable selection list. Preassigned value (default value) Last programmed See Selection list (combo box) System variable for preassigned value: userDefault.measuringRangeEndPosition

Page 339: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 339

5.6.6.3 Overview of parameters for Activate measuring input – Expert tab

Table 5-169 Overview of parameters for Activate measuring input – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this

variable to find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.6.6.4 Relevant system functions for Activate measuring input Cam technology package • _enableMeasuringInput, if the Activate cyclic measuring check box is not selected. • _enableMeasuringInputCyclic, if the Activate cyclic measuring check box is selected.

Overview of parameters for Activate measuring input / _enableMeasuringInput, _enableMeasuringInputCyclic

Table 5-170 Parameters (MCC Activate measuring input command compared to _enableMeasuringInput, _enableMeasuringInputCyclic system functions)

Parameters of the MCC Activate measuring input command

Parameters of the _enableMeasuringInput, _enableMeasuringInputCyclic system functions

Axis/encoder – Measuring input measuringInput Parameters tab Activate cyclic measuring Call of _enablemeasuringinput or

_enablemeasuringinputcyclic system function Edge for cyclic measuring measuredEdgeMode Activate measuring range measuringRangeMode Start-of-scale value of measuring range measuringRangeStartPositionType,

measuringRangeStartPosition Full-scale value of measuring range measuringRangeEndPositionType,

measuringRangeEndPosition Expert tab CommandID variable commandId Return variable –

Page 340: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 340 Programming and Operating Manual, 03/2007

5.6.7 Deactivate measuring input

This command disables a measuring input on an axis or external encoder. Measured value acquisition is disabled.

Figure 5-73 Parameter screen form: Deactivate measuring input

Page 341: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 341

5.6.7.1 Overview of parameters for Deactivate measuring input

Table 5-171 Overview of parameters for Deactivate measuring input

Field/Button Explanation/instructions Axis/encoder Here, you select the axis or external encoder for which the actual value acquisition via a

measuring input is to be ended. The list contains: All positioning and synchronous (following) axes and external encoders that are defined on the relevant device. The measuring inputs associated with the selected axis or external encoder are automatically identified and displayed in the Measuring input field for selection, as appropriate. <Reference> You select this entry if the measuring input is not defined on the device but rather is specified as a reference (variable). All variables declared in the MCC source file or MCC chart with data type measuringInput (references to measuring inputs) are available for selection in the Measuring input field. Notice You cannot select references to an axis or external encoder (variables of data type posAxis, followingAxis, or external Encoder). There is no assignment for the reference to the associated measuring inputs. Instead, select the reference to the measuring input directly (variable of data type measuringInputType).

Parameters tab See Overview of parameters for Deactivate measuring input - Parameters tab Expert tab See Overview of parameters for Deactivate measuring input - Expert tab

5.6.7.2 Overview of parameters for Deactivate measuring input – Parameters tab

Table 5-172 Overview of parameters for Deactivate measuring input – Parameters tab

Field/Button Explanation/instructions Measuring input Here, the permissible measuring inputs are displayed according to the selected

Axis/Encoder, where they are available for selection, as appropriate: A positioning or synchronous axis or external encoder defined on the the device was selected as the axis/encoder: The measuring inputs associated with the selected axis/encoder are available for selection. <Reference> was selected as the axis/encoder: All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: measuringInputType These variables are references to measuring inputs.

Page 342: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 342 Programming and Operating Manual, 03/2007

5.6.7.3 Overview of parameters for Deactivate measuring input – Expert tab

Table 5-173 Overview of parameters for Deactivate measuring input – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.6.7.4 Relevant system functions for Deactivate measuring input Cam technology package: • _disableMeasuringInput

Overview of parameters for Deactivate measuring input / _disableMeasuringInput

Table 5-174 Parameters (MCC Deactivate measuring input command compared to _disableMeasuringInput system function)

Parameters of the MCC Deactivate measuring input command

Parameters of the _disableMeasuringInput system function

Axis/encoder externalEncoder Parameters tab Measuring input referenceencodertype, referenceEncoder, encoder Expert tab Return variable –

Page 343: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 343

5.6.8 Shift measuring system

This command redefines the actual position. It affects the programming, system variable, and display. You can choose whether to set either a new actual value or a new setpoint.

Note The command is not associated with a motion. Actual value and setpoint can also be altered by a defined amount while the axis is in motion (in the case of type relative). Relative motions are not affected.

Figure 5-74 Parameter screen form: Shift measuring system

Page 344: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 344 Programming and Operating Manual, 03/2007

5.6.8.1 Overview of parameters for Shift measuring system

Table 5-175 Overview of parameters for Shift measuring system

Field/Button Explanation/instructions Axis • Here, select the axis for which the position is to be reset. The list contains:

• All positioning and synchronous axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): posAxis or followingAxis.

Set actual value tab

See Overview of parameters for Shift measuring system - Set actual value tab

Expert tab

See Overview of parameters for Shift measuring system - Expert tab

Delay program execution

Select the check box if you wish to delay execution of the following command until the current command has been completed. If the check box is not selected, the next command is executed immediately.

5.6.8.2 Overview of parameters for Shift measuring system – Set actual value tab

Table 5-176 Overview of parameters for Shift measuring system – Set actual value tab

Field/Button Explanation/instructions Position Here, you enter the new position value. Type Here, you select the position type.

Absolute / actual value reference The programmed position is set as a new actual value, and the setpoint is corrected, taking into account the following error, and set. Absolute/setpoint reference (default value) The programmed position is set as a new setpoint, and the actual value is corrected, taking into account the following error, and set. Absolute/setpoint reference of superimposed coordinate system For superimposed motions: The programmed position is set as a new setpoint of the superimposed motion, and the actual value is corrected, taking into account the following error, and set. Absolute/setpoint reference of basic coordinate system For superimposed motions: The programmed position is set as the new setpoint of the main motion, and the actual value is corrected, taking into account the following error, and set. Relative The programmed position is added to the current setpoint, actual value.

Page 345: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 345

5.6.8.3 Overview of parameters for Shift measuring system – Expert tab

Table 5-177 Overview of parameters for Shift measuring system – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.6.8.4 Relevant system function for Shift measuring system Cam technology package: • _redefinePosition

Overview of parameters for Shift measuring system / _redefinePosition

Table 5-178 Parameters (MCC Shift measuring system command compared to _redefinePosition system function)

Parameters of the MCC Shift measuring system command

Parameters of the _redefinePosition system function

Axis axis Delay program execution nextCommand Set actual value tab Position position Type redefineSpecification, redefineMode Expert tab CommandID variable commandId Return variable –

Page 346: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 346 Programming and Operating Manual, 03/2007

5.6.9 Synchronize measuring system

This command synchronizes two measuring systems or returns the difference between the specified measuring systems.

Figure 5-75 Parameter screen form: Synchronize measuring system

5.6.9.1 Overview of parameters for Synchronize measuring system

Table 5-179 Overview of parameters for Synchronize measuring system

Field/Button Explanation/instructions Axis Select the axis whose measuring system is to be switched over. The list contains:

• All positioning and synchronous axes that are defined on the relevant device. The axis is defined in the AXES folder in the project navigator.

• All variables with the following data types of technology objects declared in the MCC source file or MCC chart (see Technology object data types): posAxis or followingAxis.

Parameters tab See Overview of parameters for Synchronize measuring system - Parameters tab Expert tab See Overview of parameters for Synchronize measuring system - Expert tab Delay program execution Select the check box if you wish to delay execution of the following command until the

current command has been completed. If the check box is not selected, the next command is executed immediately.

Page 347: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 347

5.6.9.2 Overview of parameters for Synchronize measuring system – Parameters tab

Table 5-180 Overview of parameters for Synchronize measuring system – Parameters tab

Field/Button Explanation/instructions Number of the measuring system to be synchronized

Measuring system to be selected; possible values are 1 to 8. 1 (default value) Measuring system 1

Use current measuring system as reference

Select this check box if the current measuring system is to be used as a reference measuring system.

Reference measuring system Here, you select the reference measuring system if you do not wish to use the current measuring system. You can enter a value between 1 and 8. This field is shaded by default; it is activated only if you clear the check box Use current measuring system as reference. 1 (default value) Measuring system 1

Synchronize measuring systems

Select this check box if the measuring systems are to be synchronized with one another.

Read difference between measuring systems

Select this check box if you want the difference between the two measuring systems to be stored in a variable.

Differential variable In this field, a variable of type LREAL can be specified to contain the difference between measuring systems once the command is executed. This field is only visible, if the "Read difference between measuring systems" check box is selected.

5.6.9.3 Overview of parameters for Synchronize measuring system – Expert tab

Table 5-181 Overview of parameters for Synchronize measuring system – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call and to manage the received data. Data type DINT, for a description see table below.

Table 5-182 Structure of the return value (TYPE StructRetEncoderValue)

Parameter / data type Meaning/values Values functionResult (DINT)

Error code 0: if command execution is okay <> 0: if an error has occurred See Return value for system functions of the Cam technology package.

encoderDifference (LREAL)

Difference of specified measuring systems

Page 348: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 348 Programming and Operating Manual, 03/2007

5.6.9.4 Relevant system function for Synchronize measuring system Cam technology package: • _setAndGetEncoderValue Based on the Read difference between measuring systems check box, the value from _MccRetStructRetEncoderValue.encoderDifference is copied to the differential variable.

Overview of parameters for Synchronize measuring system / _setAndGetEncoderValue

Table 5-183 Parameters (MCC Synchronize measuring system command compared to _setAndGetEncoderValue system function)

Parameters of the MCC Synchronize measuring system command

Parameters of the _setAndGetEncoderValue system function

Axis axis Delay program execution nextCommand Parameters tab Number of the measuring system to be synchronized encoder Use current measuring system as reference referenceEncoderType Reference measuring system referenceEncoderType, referenceEncoder Synchronize measuring systems mode Read difference between measuring systems – Differential variable – Expert tab CommandID variable commandId Return variable –

Page 349: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 349

5.6.10 Switch output cam on

This command can be used to assign parameters for an output cam and then to switch it on. An output cam generates position-dependent switching signals for positioning or synchronous axes or external encoders. The output cam types below are available. You specify the type during configuration of the output cam: • Position-based cam

The switching signal occurs between the starting position and end position of the output cam.

• Time-based output cam The switching signal is supplied for a specified time period after the starting position is reached.

• Unidirectional output cam The switching signal occurs when the axis reaches the starting position; it can only be reset by switching off the output cam.

Position-based and time-based cams can also be assigned as counter cams. The switching signal is available in system variable state and, if configured accordingly, also on a digital output. The output cam can be switched off: • With the commands

– Switch output cam off (Page 358) or – Switch output cam signal (Page 361),

• By switching on the same output cam again with different parameters, if necessary The parameter dialog box displays different parameters depending on the axis type and the configured output cam type. Below are the parameter dialog boxes for a rotary axis and a linear axis showing the settings for different output cam types.

Page 350: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 350 Programming and Operating Manual, 03/2007

Figure 5-76 Parameter screen form: Switch output cam on for rotary axis with uni-directional output

cam

Figure 5-77 Parameter screen form: Switch output cam on for rotary axis with position-based cam

Page 351: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 351

Figure 5-78 Parameter screen form: Switch output cam on for rotary axis with time-based cam

Figure 5-79 Parameter screen form: Switch output cam on for linear axis with uni-directional output

cam

Page 352: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 352 Programming and Operating Manual, 03/2007

Figure 5-80 Parameter screen form: Switch output cam on for linear axis with position-based cam

Figure 5-81 Parameter screen form: Switch output cam on for linear axis with time-based cam

Page 353: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 353

5.6.10.1 Overview of parameters for Switch output cam on

Table 5-184 Overview of parameters for Switch output cam on

Field/Button Explanation/instructions Axis/encoder Here, you select the axis or external encoder to which the output cam to be activated is

associated. The list contains: • All positioning, synchronous (following), and path axes and external encoders that are

defined on the relevant device.

The output cams associated with the selected axis or external encoder are automatically identified and displayed in the Output cam field for selection, as appropriate.

• <Reference>

You select this entry if the output cam is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type outputCamType (references to output cams) are available for selection in the Output cam field.

Notice You cannot select references to an axis or external encoder (variables of data type posAxis, followingAxis, pathAxis, or external Encoder). There is no assignment for the reference to the associated output cams. Instead, select the reference to the output cam directly (variable of data type outputCamType).

Output cam Here, the permissible output cams are displayed according to the selected Axis/Encoder, where they are available for selection, as appropriate: • A positioning, synchronous, or path axis or external encoder defined on the the device was

selected as the axis/encoder:

The output cams associated with the selected axis/encoder are available for selection.

If you wish to create a new output cam, click the Create output cam button and enter a new name. The output cam is created for the technology object that has been selected in the Axis/Encoder field (not for variables).

The configuration can be changed in the project navigator under the respective axis or external encoder in the OUTPUT CAMS folder.

• <Reference> was selected as the axis/encoder:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: outputCamType.

These variables are references to output cams. Parameters tab See Overview of parameters for Switch output cam on - Parameters tab (Page 354) Expert tab See Overview of parameters for Switch output cam on - Expert tab (Page 356)

Page 354: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 354 Programming and Operating Manual, 03/2007

5.6.10.2 Overview of parameters for Switch output cam on – Parameters tab

Table 5-185 Overview of parameters for Switch output cam on – Parameters tab

Field/Button Explanation/instructions Starting position With position-based cams: switching signal is activated between the starting position and end

position. With time-based cams and unidirectional output cams: Position at which the switching signal is activated. Enter the value in the editable selection list (see Editable selection list (editable combo box) (Page 72)). The meaning is dependent on the Add switching positions check box. • Check box cleared: The entered value represents an absolute position. • Check box selected: The entered value is relative and is added to the last programmed

starting position. Last programmed position Preassigned value (default value) See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.switchOnPosition

End position For position-based cams only: switching signal is activated between the starting position and end position. Enter the value in the editable selection list (see Editable selection list (editable combo box) (Page 72)). The meaning is dependent on the Add switching positions check box. • Check box cleared: The entered value represents an absolute position. • Check box selected: The entered value is relative and is added to the last programmed end

position. Last programmed position Preassigned value (default value) See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.switchOffPosition

Add switching positions Select the check box, if you want the entered values for the start position and the end position to be regarded as relative positions. The values are then added to the last programmed position each time. If this check box is cleared, the entered values for the start position and the end position are regarded as absolute positions.

ON duration ON duration for time-based cams. Once the axis has crossed the starting position, the switching signal of a time-based cam remains enabled for the programmed ON duration. Enter the value in the editable selection list (see Editable selection list (editable combo box) (Page 72)). Last programmed ON duration Preassigned value (default value) See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.switchOnDuration

Page 355: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 355

Field/Button Explanation/instructions Activation time The activation time shifts the switch-on instant of the output cam.

Method of operation: • Negative value: Output cam activation is moved up. For example, this allows you to

compensate for delay times of digital outputs and connected switching elements. • Positive value: Output cam activation is delayed. Enter the value in the editable selection list (see Editable selection list (editable combo box) (Page 72)). Last programmed Preassignment (default value) See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.activationTime.

Deactivation time The deactivation time shifts the switch-off instant of the output cam. Method of operation: • Negative value: Output cam deactivation is moved up. For example, this allows you to

compensate for delay times of digital outputs and connected switching elements. • Positive value: Output cam deactivation is delayed. Enter the value in the editable selection list (see Editable selection list (editable combo box) (Page 72)). Last programmed Preassignment (default value) See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.deactivationTime.

Hysteresis The hysteresis defines a filter range around the switching position. The output signal is not switched if the axis moves in the hysteresis range around the switching position. This avoids flickering switching status changes. Enter the value in the editable selection list (see Editable selection list (editable combo box) (Page 72)). Last programmed hysteresis Preassigned value (default value) See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.noSwitchingRange

Effective direction Here, select the current effective direction. The output cam only switches when the motion direction and effective direction are identical. Enter the value in the editable selection list (see Editable selection list (editable combo box) (Page 72)). Both directions The output cam switches in both axis directions. Positive The output cam switches when axis direction is positive. Negative The output cam switches when axis direction is negative. Last programmed effective direction Preassigned value (default value) See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.forceDirection.

Page 356: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 356 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Invert Here, you choose whether or not the switching state of the output of the output cam is to be

inverted. Do not invert (default value) The output of the output cam is not inverted Invert The output of the output cam is inverted Maintain current switching state The current setting for inverting the output of the output cam is kept.

Set output cam counter Select this check box if the output cam is to be configured as a counter cam. If the check box is cleared, the status of the counter cam remains unchanged. For a counter cam, it can be specified whether the output cam is to be output every time it switches or every nth time it switches. Every counter cam has a counter start value and a current counter value. The current counter value for the output cam is reduced by 1 every time the output cam switches. • If the current counter value reaches 0, the output cam is output (system variable 'state' and

output of output cam). At the same time, the current counter value is reset to the counter start value.

• If the current counter value does not reach 0, the output of the output cam is suppressed. The current counter value and the counter start value both have a preassigned value of 1; the current values can be queried with system variables counterCamData.actualValue and counterCamData.startValue. These values are not reset by the system, e.g., with the Switch output cam off command.

Current counter value Only if the Set output cam counter check box is selected: Here, you enter the current counter value as an integer.

Counter start value Only if the Set output cam counter check box is selected: Here, you enter the counter start value as an integer.

5.6.10.3 Overview of parameters for Switch output cam on – Expert tab

Table 5-186 Overview of parameters for Switch output cam on – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). TO properties Here, you can adapt the parameter screen form as needed to reflect the effects of axis/encoder

or software output cam configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable to find

out the result of the command call. Data type DINT, for a description, see Return value for the system functions of the technology packages (Page 82).

Page 357: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 357

5.6.10.4 Relevant system functions for Switch output cam on Cam technology package: • _enableOutputCam • _setOutputCamCounter (if assigned as a counter cam) Based on the Set output cam counter check box, the _setOutputCamCounter function is called first.

Overview of parameters for Switch output cam on / _enableOutputCam, _setOutputCamCounter

Table 5-187 Parameters (MCC Switch output cam on command compared to _enableOutputCam and _setOutputCamCounter system functions)

Parameters of the MCC Switch output cam on command

Parameters of the _enableOutputCam and _setOutputCamCounter system functions

Axis/encoder – Output cam outputCam Parameters tab Starting position switchOnPosition End position switchOffValue Add switching positions switchOnPositionType, switchOffValueType ON duration activationTime Activation time activationTimeType, activationTime Deactivation time deactivationTimeType, deactivationTime Hysteresis noSwitchingRangeType, noSwitchingRange Effective direction forceDirection Invert invertOutput Set output cam counter Call of _setOutputCamCounter system function Current counter value actualValue Counter start value startValueMode, startValue Expert tab Return variable –

Page 358: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 358 Programming and Operating Manual, 03/2007

5.6.11 Switch output cam off

This command is used to switch off an output cam that was switched on with the Switch output cam on command.

Figure 5-82 Parameter screen form: Switch output cam off

Page 359: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 359

5.6.11.1 Overview of parameters for Switch output cam off

Table 5-188 Overview of parameters for Switch output cam off

Field/Button Explanation/instructions Axis/encoder Here, you select the axis or external encoder to which the output cam to be deactivated is

associated. The list contains: • All positioning, synchronous (following), and path axes and external encoders that are

defined on the relevant device.

The output cams associated with the selected axis or external encoder are automatically identified and displayed in the Output cam field for selection, as appropriate.

• <Reference>

You select this entry if the output cam is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type outputCamType (references to output cams) are available for selection in the Output cam field.

Notice You cannot select references to an axis or external encoder (variables of data type posAxis, followingAxis, pathAxis, or external Encoder). There is no assignment for the reference to the associated output cams. Instead, select the reference to the output cam directly (variable of data type outputCamType).

Output cam Here, the permissible output cams are displayed according to the selected Axis/Encoder, where they are available for selection, as appropriate: • A positioning, synchronous, or path axis or external encoder defined on the the device

was selected as the axis/encoder:

The output cams associated with the selected axis/encoder are available for selection. • <Reference> was selected as the axis/encoder:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: outputCamType.

These variables are references to output cams. Parameters tab See Overview of parameters for Switch output cam off - Parameters tab (Page 359) Expert tab See Overview of parameters for Switch output cam off - Expert tab (Page 360)

5.6.11.2 Overview of parameters for Switch output cam off – Parameters tab

Table 5-189 Overview of parameters for Switch output cam off – Parameters tab

Field/Button Explanation/instructions Output cam permanently On Select this check box if you wish the output cam to remain ON permanently after it is

disabled. If the check box is not selected, the output of the output cam is reset when you disable the output cam.

Page 360: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 360 Programming and Operating Manual, 03/2007

5.6.11.3 Overview of parameters for Switch output cam off – Expert tab

Table 5-190 Overview of parameters for Switch output cam off – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.6.11.4 Relevant system functions for Switch output cam off Cam technology package: • _disableOutputCam, if the Output cam permanently On check box is not selected. • _setOutputCamState, if the Output cam permanently On check box is selected.

Overview of parameters for Switch output cam off / _disableOutputCam, _setOutputCamState

Table 5-191 Parameters (MCC Switch output cam off command compared to _disableOutputCam and _setOutputCamState system functions)

Parameters of the MCC Switch output cam off command

Parameters of the _disableOutputCam and _setOutputCamState system functions

Axis/encoder – Output cam outputCam Parameters tab Output cam permanently On Call of _disableOutputCam or _setOutputCamState system

function Expert tab Return variable –

Page 361: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 361

5.6.12 Switch output cam signal

This function is available in SIMOTION Kernel Version 4.1 and higher. This command allows you to switch an output cam and set its switching signal to the specified value. This output cam signal is available in system variable state and, if configured accordingly, also on a digital output. This terminates any current output cam processing that was started, for example, with the "Switch output cam on (Page 349) " command. If the output cam was configured as a high-speed output cam on the relevant devices (e.g., SIMOTION D4xx, C240, TM15, TM17 High Feature), the following also applies: • You can switch the assigned digital output at specific times during the configured

processing cycle clock of the output cam. • The time offset specified in the command is added to the system-dependent output delay

of the output cam signal (tOutput system variable). The resulting time offset (programmed time offset + value of tOutput system variable) must be smaller than the duration of the processing cycle clock.

Notice During a processing cycle clock, the output cam signal can only be switched on and switched off one time. If an attempt is made to switch the output cam on or off more than once during a processing cycle clock, the values of the last effective command apply.

If the output cam is not configured as a high-speed output cam (output cam without time stamp, e.g., digital outputs on the SIMOTION C230-2 device), a programmed time offset is ignored. The tOutput system variable is assigned the value 0.0.

Page 362: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 362 Programming and Operating Manual, 03/2007

Figure 5-83 Parameter screen form: Switch output cam signal

5.6.12.1 Overview of parameters for Switch output cam signal

Table 5-192 Overview of parameters for Switch output cam signal

Field/Button Explanation/instructions Axis/encoder Here, you select the axis or external encoder to which the output cam to be switched on is

associated. The list contains: • All positioning, synchronous (following), and path axes and external encoders that are

defined on the relevant device.

The output cams associated with the selected axis or external encoder are automatically identified and displayed in the Output cam field for selection, as appropriate.

• <Reference>

You select this entry if the output cam is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type outputCamType (references to output cams) are available for selection in the Output cam field.

Notice You cannot select references to an axis or external encoder (variables of data type posAxis, followingAxis, pathAxis, or external Encoder). There is no assignment for the reference to the associated output cams. Instead, select the reference to the output cam directly (variable of data type outputCamType).

Page 363: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 363

Field/Button Explanation/instructions Output cam Here, the permissible output cams are displayed according to the selected Axis/Encoder,

where they are available for selection, as appropriate: • A positioning, synchronous, or path axis or external encoder defined on the the device

was selected as the axis/encoder:

The output cams associated with the selected axis/encoder are available for selection. • <Reference> was selected as the axis/encoder:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: outputCamType.

These variables are references to output cams. Parameters tab See Overview of parameters for Switch output cam signal - Parameters tab (Page 363) Expert tab See Overview of parameters for Switch output cam signal - Expert tab (Page 364)

5.6.12.2 Overview of parameters for Switch output cam signal – Parameters tab

Table 5-193 Overview of parameters for Switch output cam off – Parameters tab

Field/Button Explanation/instructions Time offset This parameter is only evaluated if the output cam was configured as a high-speed output

cam on the corresponding hardware (e. g., SIMOTION devices D4xx, C240, TM15, TM17 High Feature). Here, you specify the time offset with which you can switch the assigned digital output at specific times during the configured processing cycle clock of the output cam. The specified time offset is added to the system-dependent output delay of the output cam signal (tOutput system variable). The resulting time offset (programmed time offset + value of tOutput system variable) must be smaller than the duration of the processing cycle clock. Enter the value as a signed floating-point number. See Input field (Page 71). Notice During a processing cycle clock, the output cam signal can only be switched on one time and/or switched off one time. If an attempt is made to switch the output cam on or off more than once during a processing cycle clock, the values of the last effective command apply.

Output cam status How to select the output cam signal (switching signal of the output cam): Output cam on The output cam signal is switched on. Output cam off The output cam signal is switched off.

Page 364: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 364 Programming and Operating Manual, 03/2007

5.6.12.3 Overview of parameters for Switch output cam signal – Expert tab

Table 5-194 Overview of parameters for Switch output cam signal – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT, for a description, see Return value for the system functions of the technology packages (Page 82).

5.6.12.4 Relevant system functions for Switch output cam signal Cam technology package: • _setOutputCamState

Overview of parameters for Switch output cam signal / _setOutputCamState

Table 5-195 Parameters (MCC Switch output cam signal command compared to _setOutputCamState system function)

Parameters of the MCC Switch output cam signal

Parameters of the _setOutputCamState system functions

Axis/encoder – Output cam outputCam Parameters tab Time offset timeOffset Output cam status stateType Expert tab Return variable –

Page 365: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 365

5.6.13 Output cam track On

This command is used to assign parameters for an output cam tack and then to switch it on. An output cam track provides the switching signal of multiple output cams of the same type (single output cams) in system variable state. If configured accordingly, the switching signal is also available on a digital output. The output cam types below are available for single output cams. You specify the type during configuration of the output cam: • Position-based cam

The switching signal occurs between the starting position and end position of a single output cam.

• Time-based output cam The switching signal is supplied for a specified time period after the starting position of a single cam is reached.

• Time-based cam with maximum ON length The switching signal is supplied for a specified time period after the starting position of a single cam is reached. A maximum ON length can also be defined. It limits the duration of the switching signal to the time it takes to cover this distance

The output cam track can be switched off: • With the Output cam track Off command • By switching on the same output cam track again with different parameters, if necessary Different screen forms are displayed depending on the axis type.

Page 366: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 366 Programming and Operating Manual, 03/2007

Figure 5-84 Parameter screen form: Output cam track On for a rotary axis

Page 367: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 367

Figure 5-85 Parameter screen form: Output cam track On for a linear axis

Page 368: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 368 Programming and Operating Manual, 03/2007

5.6.13.1 Overview of parameters for Output cam track On

Table 5-196 Overview of parameters for Output cam track On

Field/Button Explanation/instructions Axis/encoder Here, you select the axis or external encoder to which the output cam track to be

activated is associated. The list contains: • All positioning and synchronous (following) axes and external encoders that are

defined on the relevant device.

The output cam tracks associated with the selected axis or external encoder are automatically identified and displayed in the Output cam track field for selection, as appropriate.

• <Reference>

You select this entry if the output cam track is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type _camTrackType (references to output cam tracks) are available for selection in the Output cam track field.

Notice You cannot select references to an axis or external encoder (variables of data type posAxis, followingAxis, or external Encoder). There is no assignment for the reference to the associated output cam tracks. Instead, select the reference to the output cam track directly (variable of data type _camTrackType).

Cam track (camTrackType) Here, the permissible output cam tracks are displayed according to the selected Axis/Encoder, where they are available for selection, as appropriate: • A positioning or synchronous axis or external encoder defined on the the device was

selected as the axis/encoder:

The output cam tracks associated with the selected axis/encoder are available for selection.

If you wish to create a new output cam track, click the Create output cam track button and enter a new name. The output cam track is created for the technology object that has been selected in the Axis/Encoder field (not for variables).

The configuration can be changed in the project navigator under the respective axis or external encoder in the OUTPUT CAMS folder.

• <Reference> was selected as the axis/encoder:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: _camTrackType.

These variables are references to output cam tracks. Parameters tab See Overview of parameters for Output cam track On - Parameters tab Expert tab See Overview of parameters for Output cam track On - Expert tab

Page 369: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 369

Field/Button Explanation/instructions Delay program execution • Select the check box if you wish the system to delay execution of the following

command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart.

At output cam track end The next command is executed if the output cam track processing is finished.

When output cam track is activated The next command is executed as soon as the output cam track is activated.

5.6.13.2 Overview of parameters for Output cam track On – Parameters tab

Table 5-197 Overview of parameters for Output cam track On – Parameters tab

Field/Button Explanation/instructions Track length Here, you define the length of the output cam track. The individual output cams are

mapped onto the output cam track by converting their position values to modulo values with respect to the track length. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Last programmed Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.camTrackLength.

Axis reference position Here, you specify how the output cam track is mapped onto the axis, i.e., the axis position starting from which the output cam track is to be output. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Last programmed Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.axisReferencePosition.

Activation time The activation time shifts the switch-on instant of the single output cam. Method of operation: Negative value: Single output cam activation is moved up. For example, this allows you to compensate for delay times of digital outputs and connected switching elements. Positive value: Single output cam activation is delayed. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Last programmed Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.activationTime

Page 370: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 370 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Deactivation time The deactivation time shifts the switch-off instant of the single output cam.

Method of operation: Negative value: Single output cam deactivation is moved up. For example, this allows you to compensate for delay times of digital outputs and connected switching elements. Positive value: Single output cam deactivation is delayed. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Last programmed Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.deactivationTime.

Hysteresis The hysteresis defines a filter range around the switching position. The output signal is not switched if the axis moves in the hysteresis range around the switching position. This avoids flickering switching status changes. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Last programmed Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.hysteresisRange.

Activation mode Non-cyclical output cam track activation The output cam track is mapped starting from the axis reference position, output once, and terminated automatically after it is exited. Cyclical output cam track activation The track length of the output cam track starting from the axis reference position is mapped and cyclically continued/repeated. Last programmed Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.activationMode.

Start mode The start mode is used to define when the cam track should become effective after activation or the process for switching between output cam tracks. With next track cycle The output cam track processing takes effect at the first cam cycle, i.e., as soon as the first single cam switches the new track. Up to that point, a time-based cam of the previous output cam track will be output. Immediately The output cam track processing takes effect immediately. If an output cam track is already active, it is aborted. Immediately when output cam output is inactive The output cam track processing takes effect as soon as there are no more active single output cams of the previous output cam track. An active single output cam of the previous cam track will be output completely. Last programmed Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.startMode.

Page 371: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 371

5.6.13.3 Overview of parameters for Output cam track On – Expert tab

Table 5-198 Overview of parameters for Output cam track On – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Dialog box adaptation Here, you can adapt the parameter dialog box as needed to reflect the effects of

axis/encoder or output cam track configuration data or system variables. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.6.13.4 Relevant system function for Output cam track On Cam technology package: • _enableCamTrack

Overview of parameters for Output cam track On / _enableCamTrack

Table 5-199 Parameters (MCC Output cam track On command compared to _enableCamTrack system functions)

Parameters of the MCC Output cam track On command

Parameters of the _enableCamTrack system functions

Axis/encoder – Cam track (camTrackType) camtrack Delay program execution nextCommand Parameters tab Track length camtrackLengthType, camtrackLength Axis reference position axisReferencePosition Activation time activationTimeType, activationTime Deactivation time deactivationTimeType, deactivationTime Hysteresis hysteresisRangeType, hysteresisRange Activation mode activationMode Start mode startMode Expert tab CommandID variable commandId Dialog box adaptation – Return variable –

Page 372: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 372 Programming and Operating Manual, 03/2007

5.6.14 Output cam track Off

This command is used to switch off an output cam track that was switched on with the Output cam track On command.

Figure 5-86 Parameter screen form: Output cam track Off

Page 373: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 373

5.6.14.1 Overview of parameters for Output cam track Off

Table 5-200 Overview of parameters for Output cam track Off

Field/Button Explanation/instructions Axis/encoder Here, you select the axis or external encoder to which the output cam track to be

deactivated is associated. The list contains: All positioning and synchronous (following) axes and external encoders that are defined on the relevant device. The output cam tracks associated with the selected axis or external encoder are automatically identified and displayed in the Measuring input field for selection, as appropriate. <Reference> You select this entry if the output cam track is not defined on the device but rather is specified as a reference (variable). All variables declared in the MCC source file or MCC chart with data type _camTrackType (references to output cam tracks) are available for selection in the Output cam track field. Notice You cannot select references to an axis or external encoder (variables of data type posAxis, followingAxis, or external Encoder). There is no assignment for the reference to the associated output cam tracks. Instead, select the reference to the output cam track directly (variable of data type _camTrackType).

Cam track (camTrackType) Here, the permissible output cam tracks are displayed according to the selected Axis/Encoder and are available for selection, as appropriate: A positioning or synchronous axis or external encoder defined on the the device was selected as the axis/encoder: The output cam tracks associated with the selected axis/encoder are available for selection. <Reference> was selected as the axis/encoder: All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: _camTrackType. These variables are references to output cam tracks.

Parameters tab See Overview of parameters for Output cam track Off - Parameters tab Expert tab See Overview of parameters for Output cam track Off - Expert tab Delay program execution Select the check box if you wish to delay execution of the following command until the

current command has been completed. If the check box is not selected, the next command is executed immediately.

Page 374: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart 374 Programming and Operating Manual, 03/2007

5.6.14.2 Overview of parameters for Output cam track Off – Parameters tab

Table 5-201 Overview of parameters for Output cam track Off – Parameters tab

Field/Button Explanation/instructions Stop mode The stop mode is used to define the behavior of the output cam track on deactivation.

Immediately The output cam track processing is deactivated immediately. Any active single cam of the output cam track is aborted. Immediately when output cam output is inactive The output cam track processing is deactivated as soon as there are no more active single output cams of the output cam track. An active single output cam will be output completely. At end of output cam track The output cam track processing is deactivated as soon as the last single cam of the track switches. Up to that point, a time-based cam will be output. The stop mode is used to define when the cam track should become effective after activation, or how tracks should be changed. Last programmed Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.startMode.

5.6.14.3 Overview of parameters for Output cam track Off – Expert tab

Table 5-202 Overview of parameters for Output cam track Off – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 375: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.6 Commands for external encoders, measuring inputs and output cams

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 375

5.6.14.4 Relevant system function for Output cam track Off Cam technology package: • _disableCamTrack

Overview of parameters for Output cam track Off / _disableCamTrack

Table 5-203 Parameters (MCC Output cam track Off command compared to _disableCamTrack system functions)

Parameters of the MCC Output cam track Off command

Parameters of the _disableCamTrack system function

Axis/encoder – Cam track (camTrackType) camtrack Delay program execution nextCommand Parameters tab Stop mode stopMode Expert tab CommandID variable commandId Return variable –

Page 376: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 376 Programming and Operating Manual, 03/2007

5.7 Commands for synchronous operation and camming

5.7.1 Gearing on

Gearing is characterized by a constant gear ratio between a master setpoint (position value of a leading axis or external encoder) and a slave value (position value of a following axis). Gearing is thus in positional synchronism. This transmission ratio (gear ratio) can be specified as the ratio of two integers (numerator/denominator) or as a decimal number. An offset in the zero point (a phase displacement) can also be specified. When gearing is started, the slave value is synchronized to the master setpoint with the programmed synchronization settings. The master setpoint can be defined in the command; the slave value can be modified later with the Switch master setpoint.

Figure 5-87 Parameter screen form: Gearing on

Active gearing can be offset both on the side of the master setpoint and on the side of the slave value. The Set offset on the gearing command is used for this purpose.

Page 377: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 377

Gearing can be ended: • With the Gearing on command • By starting another synchronous operation on the same synchronous object, e.g., with

another Gearing on command • With a canceling single axis command on the slave axis

Notice The Stop axis command will only terminate the synchronous operation if Quick stop... was selected as the Stop mode.

5.7.1.1 Overview of parameters for Gearing on

Table 5-204 Overview of parameters for Gearing on

Field/Button Explanation/instructions Following axis Here, you select the axis to be synchronized. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be synchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects. Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Following axis and are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as a slave axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as a slave axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects.

Page 378: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 378 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Parameters tab See Overview of parameters for Gearing on – Parameters tab (Page 379) Synchronization tab See Overview of parameters for Gearing on – Synchronization tab (Page 381) Dynamic response tab See Overview of parameters for Gearing on – Dynamic response tab (Page 386) Expert tab See Overview of parameters for Gearing on – Expert tab (Page 387) Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of the

following command in the MCC chart. See also Delay program execution (step enabling condition).

Example: See Example of Gearing on (Page 388)

See also Overview of parameters for Gearing on – Parameters tab (Page 379) Overview of parameters for Gearing on – Synchronization tab (Page 381) Overview of parameters for Gearing on – Dynamic response tab (Page 386) Overview of parameters for Gearing on – Expert tab (Page 387) Example of Gearing on (Page 388)

Page 379: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 379

5.7.1.2 Overview of parameters for Gearing on – Parameters tab

Table 5-205 Overview of parameters for Gearing on – Parameters tab

Field/Button Explanation/instructions Reset master value Select this check box if you want to set the master setpoint of the synchronous relationship

(default) If check box is cleared, a previous master setpoint setting is retained.

Leading axis / encoder An entry is required in this field only if the Reset master value check box is selected. Here, you select the axis or external encoder that generates the master setpoint in the synchronous relationship. You can select from: • All positioning and synchronous (following) axes and external encoders that are available

on the device or a DP master. • All variables with the following data types of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): posAxis, followingAxis, or externalEncoderType.

The master setpoint remains assigned to the synchronous object until a change occurs. Gear direction Here, you select the effective direction of the gearing.

From sign of gear ratio (default value) The effective direction of gearing is defined by the sign of the gear ratio. Opposite direction The following axis moves in the opposite direction from the leading axis. Same direction The following axis moves in the same direction as the leading axis. Opposite current gearing direction The gearing direction opposes the current gearing direction. Current direction Last programmed direction Preassigned value See Selection list (combo box) System variable for preassigned value: userDefault.gearingSettings.direction

Gear ratio type The gear ratio is the ratio between the distances covered by the slave axis (= numerator) and the master axis (= denominator), each expressed in the configured units. Here, you select whether the gear ratio is specified as a fraction (numerator/denominator) or as a floating-point number. Fraction (numerator / denominator) The ratio is specified as a fraction Floating-point number The ratio is specified as a floating-point number Last programmed Preassigned value See Selection list (combo box) System variable for preassigned value: userDefault.gearingSettings.defineMode

Page 380: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 380 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Gear ratio type

Here you select which values are used for the gear ratio Value entry The values are entered directly in the parameter dialog box: • In the Gear ratio numerator/denominator fields, or • in the Gear ratio field) Last programmed value Preassigned value See Selection list (combo box) System variables for preassigned value: • userDefault.gearingSettings.numerator and userDefault.gearingSettings.denominator

or • userDefault.gearingSettings.ratio

Gear ratio numerator Here, you enter the numerator of the gear ratio as an integer. The unit configured for the following axis is displayed for your information.

Gear ratio denominator Here, you enter the denominator of the gear ratio as an integer. The unit configured for the leading axis is displayed for your information.

Gear ratio Enter the gear ratio as a floating-point number here. Reference point Here, you select the reference point for gearing.

Gearing takes place relative to axis zero (default value) Absolute gearing: The linear coupling of the slave value to the master setpoint refers each time to the axis zero point of the axes involved. Any offset between the master setpoint and the slave value at the start of gearing is compensated for during synchronization. For some of the choices, an offset can be specified in the Start of synchronization field of the Synchronization tab (see Overview of parameters for Gearing on - Synchronization tab). This value is retained as a constant phase shift between slave value and master setpoint after conclusion of the synchronization operation. Otherwise, the phase shift is equal to 0. Gearing relative to start position Relative gearing: The linear coupling of the slave value to the master setpoint refers each time to the position value of the axes involved at the start of gearing. Any offset between the master setpoint and the slave value at the start of gearing is not compensated for during synchronization. This offset is retained as a constant phase shift between slave value and master setpoint after conclusion of the synchronization operation. In addition, for some of the choices, an offset can be specified in the Start of synchronization field of the Synchronization tab (see Overview of parameters for Gearing on - Synchronization tab). This value acts as a constant phase shift between slave value and master setpoint after conclusion of the synchronization operation. Last programmed reference point Preassigned value See Selection list (combo box) System variable for preassigned value: userDefault.syncProfile.syncProfileReference

Page 381: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 381

5.7.1.3 Overview of parameters for Gearing on – Synchronization tab

Table 5-206 Overview of parameters for Gearing on – Synchronization

Field/Button Explanation/instructions Synchronization reference

Here, you select the reference for the synchronization operation. Leading axis Length-related synchronization: Synchronization occurs (depending on the master axis motion) within a defined range of the master setpoint (Synchronization length). • Advantage: Synchronization occurs within an assignable range of the master setpoint. • Disadvantage: The dynamic response of synchronization is dependent on the change in

the master setpoint (velocity). The dynamic response limits of the slave axis are not taken into account.

Time Time-related synchronization: Synchronization occurs on the basis of specified dynamic response values. Program the relevant values in the Dynamic response tab (see Overview of parameters for Gearing on - Dynamic response tab). • Advantage: The synchronization operation always takes place with the specified dynamic

response values. • Disadvantage: The master setpoint range in which synchronization occurs cannot be

predicted. Last programmed reference Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.syncProfile.syncProfileReference

Page 382: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 382 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Start of synchronization Here, you select when synchronization of gearing begins. Additional specifications are required

for many of the choices; these are indicated in the description. at leading axis position The gear is enabled at a programmed leading axis position. Entries are required in the following fields: • Reference point of leading axis position • Leading axis position Synchronization occurs with respect to the following values: • Master setpoint = last programmed leading axis position • Slave value: depending on the selection in Reference point (see Overview of parameters

for Gearing On – Parameters tab): • For gearing, relative to axis zero (default value): • Slave value = gear ratio * position of leading axis • For gearing, relative to start position: • Slave value = current slave value

at master axis position with offset The gear is enabled at a programmed leading axis position. An offset for the following axis is additionally programmed. Entries are required in the following fields: • Offset • Reference point of leading axis position • Leading axis position Synchronization occurs with respect to the following values: • Master setpoint = last programmed leading axis position • Slave value: see description in the Offset field: Synchronize immediately The gear is enabled immediately Synchronization occurs with respect to the following values: • Master setpoint = current master setpoint • Slave value: depending on the selection in Reference point (see Overview of parameters

for Gearing On – Parameters tab): • For gearing, relative to axis zero (default value): • Slave value = gear ratio * current master setpoint • For gearing, relative to start position: • Slave value = current slave value

... (Continued in next row of table)

Page 383: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 383

Field/Button Explanation/instructions Start of synchronization (continued)

... Synchronize immediately with offset The gear is enabled immediately An offset for the following axis is additionally programmed. An entry is required in the following field: • Offset Synchronization occurs with respect to the following values: • Master setpoint = current master setpoint • Slave value: see description in the Offset field: Start immediately and synchronously to master position This choice is available only for time synchronization reference. It is intended for use with modulo axes that are synchronized over several cycles (of the master and slave axes). The gear is enabled immediately The slave axis synchronizes in such a way that the synchronism is achieved at the specified master position (master setpoint). The selection in Reference point (see Overview of parameters for Gearing on – Parameters tab) is ignored; absolute gearing is started in every case. Synchronization occurs with respect to the following values: • Master setpoint = last programmed leading axis position • Slave value = gear ratio * position of leading axis Following axis position The gear is enabled at a programmed following axis position. Entries are required in the following fields: • Reference point of leading axis position • Following axis position Synchronization occurs with respect to the following values: • Master setpoint: depending on the selection in Reference point (see Overview of

parameters for Gearing On – Parameters tab): • For gearing, relative to axis zero (default value): • Master setpoint = position of leading axis / gear ratio • For gearing, relative to start position: • Master setpoint = current master setpoint

• Slave value = last programmed following axis position Last programmed start of synchronization Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userdefault.gearingSettings.synchronizingMode

Page 384: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 384 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Offset An entry is required in this field if you have selected the following in the Start of

synchronization field: • at master axis position with offset • Synchronize immediately with offset Here, you enter a value that is used to calculate the offset of the slave axis for linear coupling between the master axis and slave axis. Depending on the selection in Reference point (see Overview of parameters for Gearing On – Parameters tab), the entered value has the following meaning: • For gearing, relative to axis zero (default value):

Slave value relative to which synchronization occurs • For gearing, relative to start position:

Additional offset to any offset between the slave axis and master axis Depending on the selection in Reference point (see Overview of parameters for Gearing on – Parameters tab), the slave value relative to which synchronization occurs is thus: • For gearing, relative to axis zero (default value):

Slave value = programmed offset • For gearing, relative to start position:

Slave value = current slave value + programmed offset Reference point of leading axis position

An entry is required in this field if you have selected the following in the Start of synchronization field: • at leading axis position • at master axis position with offset • Following axis position Here, you select how the programmed position (see the Following axis position or Leading axis position field) acts relative to the selected synchronization profile. Synchronize before synchronization position Synchronization is finished at the programmed position. Symmetrical This choice is available only for leading axis synchronization reference. Synchronization occurs in such a way that the programmed position is located symmetrically within the synchronization length. At the programmed position, the master axis has covered half the distance that is required for synchronization. Synchronize from synchronization position Synchronization starts at the programmed position. Last programmed reference point of leading axis position Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.syncProfile.syncPositionReference

Synchronization length An entry is required in this field if you have selected the following in the Synchronization reference field: • Leading axis Enter the synchronization length in the editable selection list. Last programmed synchronization length Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.syncProfile.syncLength

Page 385: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 385

Field/Button Explanation/instructions Following axis position An entry is required in this field if you have selected the following in the Start of

synchronization field: • Following axis position Here, you enter the slave axis position in the editable selection list. Last programmed following axis position Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.gearingSettings.syncPositionSlave

Leading axis position An entry is required in this field if you have selected the following in the Start of synchronization field: • at leading axis position • at master axis position with offset Here, you enter the master axis position in the editable selection list. Last programmed leading axis position Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.gearingSettings.syncPositionMaster

Behavior during leading synchronization (SIMOTION kernel V3.2 and higher)

An entry can be made in this field if you have selected the following: • In the Start of synchronization field:

• at leading axis position • at master axis position with offset • Synchronize immediately • Synchronize immediately with offset • Following axis position

• In the Reference point of leading axis position field (if available): • Synchronize from synchronization position

Here, you select whether the acceleration or deceleration of the master value is to be taken into account in synchronization calculations (expanded look ahead): Standard (default value) No expanded look ahead. Expanded look ahead Expanded look ahead is active: Acceleration or deceleration of master setpoint is taken into account in synchronization calculations Important: Expanded look ahead requires a lot of computation time.

Page 386: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 386 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Synchronization direction (SIMOTION kernel V3.1 and higher)

Here, you select the motion direction in which the following axis is to be synchronized. Retain system behavior Synchronization occurs over the shortest path without direction specification. In the case of moving axes, a check is made to determine whether the current motion direction can be maintained. Maintain direction of following axis Synchronization takes place in the direction of motion of the following axis. Positive Synchronization occurs in the positive motion direction. Negative Synchronization occurs in the negative motion direction. Shortest path Synchronization occurs over the shortest path without direction specification. Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userdefault.gearingSettings.synchronizingDirection

5.7.1.4 Overview of parameters for Gearing on – Dynamic response tab

Table 5-207 Overview of parameters for Gearing on – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. The parameters in the Dynamics tab are evaluated only for time synchronization reference.

Velocity The entered value acts during the constant velocity phase. System variable for preassigned value: userDefault.syncDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. System variable for preassigned value: userDefault.syncDynamics.profile Notice A constant velocity profile only takes effect if configuration data syncingMotion.smoothAbsoluteSynchronization = YES is set. When syncingMotion.smoothAbsoluteSynchronization = NO (default), a trapezoidal velocity profile is always active.

Acceleration The entered value acts during the constant acceleration phase. System variable for preassigned value: userDefault.syncDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. System variable for preassigned value: userDefault.syncDynamics.negativeAccel

Page 387: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 387

Field/Button Explanation/instructions Jerk The entered value limits the change in the acceleration or deceleration at the start and end of

the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk, userDefault.syncDynamics.positiveAccelEndJerk, userDefault.syncDynamics.negativeAccelStartJerk, userDefault.syncDynamics.negativeAccelEndJerk

5.7.1.5 Overview of parameters for Gearing on – Expert tab

Table 5-208 Overview of parameters for Gearing on – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the command

status with this variable. Return variable If you enter the name of a variable of the specified data type for each command step, you can

use this variable to find out the result of the command step. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 388: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 388 Programming and Operating Manual, 03/2007

5.7.1.6 Example of Gearing on An axis (rotaryAxis_1) is to rotate at a velocity of 360 degrees/s. A second axis (synchronous axis) is to rotate in synchronism using a gear ratio. The synchronous axis that is to be coupled with rotaryAxis_1 by means of a gear ratio must be assigned as a synchronous axis in SIMOTION SCOUT.

Figure 5-88 Example: MCC chart for gearing

5.7.1.7 Relevant system functions for Gearing on Cam technology package: • _enableGearing • _setMaster If the Reset master value check box is selected, the _setMaster system function is called first before _enableGearing.

Page 389: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 389

Overview of parameters for Gearing on / _enableGearing, _setMaster

Table 5-209 Parameters (MCC Gearing on command compared to _enableGearing and _setMaster system functions)

Parameters of the MCC Gearing on command

Parameters of the _enableGearing and _setMaster system functions

Following axis – Synchronous operation followingObject Transition behavior mergeMode Delay program execution nextCommand Parameters tab Reset master value Call of _setMaster system function

• Up to SIMOTION kernel Version V4.0 with parameter transientBehavior = DIRECT

• SIMOTION kernel Version V4.1 and higher with parameter transientBehavior = WITH_NEXT_SYNCHRONIZING

Leading axis / encoder master (system function _setMaster) Gear direction direction Gear ratio type gearingMode Gear ratio type gearingRatioType Gear ratio numerator gearingNumerator Gear ratio denominator gearingDenominator Gear ratio gearingRatio Reference point gearingType Synchronization tab Synchronization reference synchronizingMode Start of synchronization syncProfileReference Offset syncPositionSlave Reference point of leading axis position syncPositionReference Synchronization length syncLengthType Following axis position syncPositionSlaveType, syncPositionSlave Leading axis position syncPositionMasterType, syncPositionMaster Behavior during leading synchronization synchronizingWithLookAhead Synchronization direction synchronizingDirection Dynamics tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 390: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 390 Programming and Operating Manual, 03/2007

5.7.2 Gearing off

This command enables you to terminate gearing that was started with the Gearing on command. Desynchronization occurs with the programmed desynchronization settings.

Figure 5-89 Parameter screen form: Gearing off

Page 391: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 391

5.7.2.1 Overview of parameters for Gearing off

Table 5-210 Overview of parameters for Gearing off

Field/Button Explanation/instructions Following axis Here, you select the axis to be desynchronized. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference> • You select this entry if the axis to be desynchronized is not defined on the device but

rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects. Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Following axis and are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as a slave axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as a slave axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects. Desynchronization tab See Overview of parameters for Gearing off – Desynchronization tab Dynamic response tab See Overview of parameters for Gearing off – Dynamic response tab Expert tab See Overview of parameters for Gearing off – Expert tab Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition)

Page 392: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 392 Programming and Operating Manual, 03/2007

5.7.2.2 Overview of parameters for Gearing off – Desynchronization tab

Table 5-211 Overview of parameters for Gearing off – Desynchronization tab

Field/Button Explanation/instructions Synchronization reference Here you select the reference for the desynchronization operation.

Leading axis Length-related synchronization: Synchronization occurs (depending on the master axis motion) within a defined range of the master setpoint (Desynchronization length). • Advantage: Synchronization occurs within an assignable range of the master setpoint. • Disadvantage: The dynamic response of synchronization is dependent on the change

in the master setpoint (velocity). The dynamic response limits of the slave axis are not taken into account.

Time Time-related synchronization: Synchronization occurs on the basis of specified dynamic response values. Program the relevant values in the Dynamic response tab (see Overview of parameters for Gearing off - Dynamic response tab). • Advantage: The synchronization operation always takes place with the specified

dynamic response values. • Disadvantage: The master setpoint range in which synchronization occurs cannot be

predicted. Last programmed reference Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.syncProfile.syncProfileReference

Desynchronization position Here, you select when desynchronization of gearing begins. Additional specifications are required for some of the choices; these are indicated in the description. At leading axis value Gearing is disabled at a programmed master axis position. Entries are required in the following fields: • Reference point of desynchronization position • Leading axis position Desynchronize immediately Gearing is disabled immediately At following axis value Gearing is disabled at a programmed slave axis position. Entries are required in the following fields: • Reference point of desynchronization position • Following axis position Last programmed start of desynchronization Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userdefault.gearingSettings.syncOffMode

Page 393: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 393

Field/Button Explanation/instructions Reference point of desynchronization position

An entry is required in this field if you have selected the following in the Desynchronization position field: • At leading axis value • At following axis value Here, you select how the programmed position (see the Following axis position or Leading axis field) acts relative to the selected desynchronization profile. Stop before desynchronization position Synchronization is finished at the programmed position. Symmetrical This choice is available only for leading axis synchronization reference. Desynchronization occurs in such a way that the programmed position is located symmetrically within the desynchronization length. At the programmed position, the master axis has covered half the distance that is required for synchronization. Stop from desynchronization position Desynchronization starts at the programmed position. Last programmed reference point of leading axis position Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.syncProfile.syncOffPositionReference

Desynchronization length An entry is required in this field if you have selected the following in the Synchronization reference field: • Leading axis Enter the desynchronization length in the editable selection list. Last programmed desynchronization length Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.syncProfile.syncOffLength

Following axis position An entry is required in this field if you have selected the following in the Desynchronization position field: • At following axis value Here, you enter the slave axis position in the editable selection list. Default See Selection list (combo box) System variable for preassigned value: userdefault.syncOffPositions.Slave

Leading axis position An entry is required in this field if you have selected the following in the Desynchronization position field: • At leading axis value Here, you enter the master axis position in the editable selection list. Default See Selection list (combo box) System variable for preassigned value: userdefault.syncOffPositions.Master

Page 394: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 394 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Synchronization direction Here, you select the motion direction in which the following axis is to be desynchronized.

Retain system behavior Synchronization occurs over the shortest path without direction specification. In the case of moving axes, a check is made to determine whether the current motion direction can be maintained. Maintain direction of following axis Synchronization takes place in the direction of motion of the following axis. Positive Synchronization occurs in the positive motion direction. Negative Synchronization occurs in the negative motion direction. Shortest path Synchronization occurs over the shortest path without direction specification. Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userdefault.gearingSettings.synchronizingDirection

5.7.2.3 Overview of parameters for Gearing off – Dynamic response tab

Table 5-212 Overview of parameters for Gearing off – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. The parameters in the Dynamics tab are evaluated only for time synchronization reference.

Velocity The entered value acts during the constant velocity phase. System variables for preassigned value: userDefault.syncDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. System variables for preassigned value: userDefault.syncDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. System variable for preassigned value: userDefault.syncDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. System variable for preassigned value: userDefault.syncDynamics.negativeAccel

Jerk The entered value limits the change in the acceleration or deceleration at the start and end of the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk userDefault.syncDynamics.positiveAccelEndJerk userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

Page 395: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 395

5.7.2.4 Overview of parameters for Gearing off – Expert tab

Table 5-213 Overview of parameters for Gearing off – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.7.2.5 Relevant system function for Gearing off Cam technology package: • _disableGearing

Overview of parameters for Gearing off / _disableGearing

Table 5-214 Parameters (MCC Gearing off command compared to _disableGearing system functions)

Parameters of the MCC Gearing off command

Parameters of the _disableGearing system function

Following axis – Synchronous operation followingObject Transition behavior mergeMode Delay program execution nextCommand Desynchronization tab Synchronization reference syncProfileReference Desynchronization position syncOffMode Reference point of desynchronization position syncOffPositionReference Desynchronization length syncLengthType Following axis position syncOffPositionSlaveType, syncOffPositionSlave Leading axis position syncOffPositionMasterType, syncOffPositionMaster Synchronization direction synchronizingDirection Dynamics tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel

Page 396: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 396 Programming and Operating Manual, 03/2007

Parameters of the MCC Gearing off command

Parameters of the _disableGearing system function

Jerk positiveAccelStartJerkType, positiveAccelStartJerk, positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

5.7.3 Set offset on the gearing

This command causes an offset in the master axis or slave axis range during the gearing operation. You can assign when the programmed offset is to take effect (as well as other properties). • For the active gearing command

and/or • For subsequent gearing commands Offsets that act on the active gearing command and offsets that are stored and applied to subsequent gearing commands can be read from the gearingAdjustment system variable.

Page 397: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 397

Figure 5-90 Parameter screen form: Set offset on the gearing

5.7.3.1 Overview of parameters for Set offset on the gearing

Table 5-215 Overview of parameters for Set offset on the gearing

Field/Button Explanation/instructions Axis Here, you select the axis for which gearing is to be offset. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be synchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects. Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Page 398: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 398 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Axis and

are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as an axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as the axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects. Parameters tab See Overview of parameters for Set offset on the gearing – Parameters tab Dynamic response tab See Overview of parameters for Set offset on the gearing – Dynamic response tab Expert tab See Overview of parameters for Set offset on the gearing – Expert tab Effect Here, you select which commands the offset will act on.

On active command (default value) The offset acts on the active gearing command and remains active until this command is replaced or desynchronized using the Gearing off command. The offset value is stored in system variables gearingAdjustment.master.offset or gearingAdjustment.slave.offset (depending on the range). on following commands The active gearing command is executed; the offset is stored and in effect for subsequent Gearing off commands. The offset value is stored in system variables gearingAdjustment.defaultValueMaster.offset or gearingAdjustment.defaultValueSlave.offset (depending on the range). On active command and following commands The offset acts on the current gearing command and on all subsequent Gearing on commands. The offset value is stored in system variables gearingAdjustment.master.offset and gearingAdjustment.defaultValueMaster.offset or gearingAdjustment.slave.offset and gearingAdjustment.defaultValueSlave.offset (depending on the range).

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of the

following command in the MCC chart.

Page 399: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 399

5.7.3.2 Overview of parameters for Set offset on the gearing – Parameters tab

Table 5-216 Overview of parameters for Set offset on the gearing – Parameters tab

Field/Button Explanation/instructions Area Here, you select whether the master axis or slave axis range will be offset.

Master range (default value) The master axis range is offset. slave range The slave axis range is offset.

Offset Offset for the selected range. Enter the value as a signed floating-point number.

Mode Select the type of offset. Absolute(default value) The offset is applied as an absolute value. Relative The offset is relative to the corresponding value in the gearingAdjustments system variable.

5.7.3.3 Overview of parameters for Set offset on the gearing – Dynamic response tab

Table 5-217 Overview of parameters for Set offset on the gearing – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Velocity The entered value acts during the constant velocity phase.

System variables for preassigned value: userDefault.syncDynamics.velocity Velocity profile In this field, you define the transitions between the individual motion phases.

System variables for preassigned value: userDefault.syncDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefault.syncDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variables for preassigned value: userDefault.syncDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and end

of the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk userDefault.syncDynamics.positiveAccelEndJerk userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

Page 400: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 400 Programming and Operating Manual, 03/2007

5.7.3.4 Overview of parameters for Set offset on the gearing – Expert tab

Table 5-218 Overview of parameters for Set offset on the gearing – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package

5.7.3.5 Relevant system function for Set offset on the gearing Cam technology package: • _setGearingOffset

Overview of parameters for Set offset on the gearing / _setGearingOffset

Table 5-219 Parameters (MCC Set gearing on the offset command compared to _setGearingOffset system function)

Parameters of the MCC Set offset on the gearing command

Parameters of the _setGearingOffset system function

Axis – Synchronous operation followingObject Effect activationMode Delay program execution nextCommand Parameters tab Area offsetRange Offset offsetValue Mode offsetMode Dynamics tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 401: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 401

5.7.4 Synchronous velocity operation on

A synchronous velocity operation is characterized by a constant gear ratio between a master setpoint (velocity of a leading axis or external encoder) and a slave value (velocity of a following axis). Unlike gearing, the synchronous velocity operation is not in positional synchronism. When the synchronous velocity operation is started, the slave value is synchronized to the master setpoint with the programmed dynamic response settings. The gear ratio is specified as a decimal number. The master setpoint can be defined in the command; the slave value can be modified later with the Switch master setpoint.

Figure 5-91 Parameter screen form: Synchronous velocity operation on

The synchronous velocity operation can be terminated: • With the Synchronous velocity operation Off command • By starting another synchronous operation on the same synchronous object, e.g., with

another Synchronous velocity operation on command • With a canceling single axis command on the slave axis

Page 402: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 402 Programming and Operating Manual, 03/2007

Notice The Stop axis command will only terminate the synchronous velocity operation if Quick stop... was selected as the Stop mode.

5.7.4.1 Overview of Synchronous velocity operation on

Table 5-220 Overview of Synchronous velocity operation on

Field/Button Explanation/instructions Following axis Here, you select the axis to be synchronized. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be synchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects. Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Following axis and are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as a slave axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as a slave axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects. Parameters tab See Overview of parameters for Synchronous velocity operation on - Parameters tab Dynamic response tab See Overview of parameters for Synchronous velocity operation on - Dynamic response

tab Expert tab See Overview of parameters for Synchronous velocity operation on - Expert tab

Page 403: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 403

Field/Button Explanation/instructions Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition).

5.7.4.2 Overview of parameters for Synchronous velocity operation on – Parameters tab

Table 5-221 Overview of parameters for Synchronous velocity operation on – Parameters tab

Field/Button Explanation/instructions Reset master value Select this check box if you want to set the master setpoint of the velocity relationship

(default) If check box is cleared, a previous master setpoint setting is retained.

Leading axis / encoder An entry is required in this field only if the Reset master value check box is selected. Here, you select the axis or external encoder that generates the master setpoint in the velocity relationship. You can select from: • All positioning and synchronous (following) axes and external encoders that are

available on the device or a DP master. • All variables with the following data types of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): posAxis, followingAxis, or externalEncoderType.

The master setpoint remains assigned to the velocity object until a change occurs. Gear direction Here, you select the effective direction of the gearing.

From sign of gear ratio (default value) The effective direction of gearing is defined by the sign of the gear ratio. Opposite direction The following axis moves in the opposite direction from the leading axis. Same direction The following axis moves in the same direction as the leading axis. Opposite current gearing direction The gearing direction opposes the current gearing direction. Current direction Last programmed direction Preassigned value See Selection list (combo box) System variable for preassigned value: userDefault.gearingSettings.direction

Page 404: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 404 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Gear ratio type Here you select which values are used for the gear ratio

Value entry The values are entered directly in the parameter dialog box (in the gear ratio field) Last programmed value Preassigned value See Selection list (combo box) System variables for preassigned value: userDefault.gearingSettings.ratio

Gear ratio Enter the gear ratio as a floating-point number here.

5.7.4.3 Overview of parameters for Synchronous velocity operation on – Dynamic response tab

Table 5-222 Overview of parameters for Synchronous velocity operation on – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Velocity profile In this field, you define the transitions between the individual motion phases.

System variable for preassigned value: userDefault.syncDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefault.syncDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variable for preassigned value: userDefault.syncDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk userDefault.syncDynamics.positiveAccelEndJerk userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

5.7.4.4 Overview of parameters for Synchronous velocity operation on – Expert tab

Table 5-223 Overview of parameters for Synchronous velocity operation on – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type for each command step, you

can use this variable to find out the result of the command step. Data type DINT; for a description, see Return value for system functions of the Cam technology package

Page 405: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 405

5.7.4.5 Example of Synchronous velocity operation on An axis (rotaryAxis_1) is to rotate at a velocity of 360 degrees/s. A second axis (synchronous axis) is to rotate in synchronism using a gear ratio. The synchronous axis that is to be coupled with rotaryAxis_1 by means of a gear ratio must be assigned as a synchronous axis in SIMOTION SCOUT.

Figure 5-92 Example: MCC chart for velocity gearing

5.7.4.6 Relevant system functions for Synchronous velocity operation on Cam technology package: • _enableVelocityGearing • _setMaster

Page 406: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 406 Programming and Operating Manual, 03/2007

Overview of parameters for Synchronous velocity operation on / _enableVelocityGearing, _setMaster

Table 5-224 Parameters (MCC Synchronous velocity operation on command compared to _enableVelocityGearing and _setMaster system functions)

Parameters of the MCC Synchronous velocity operation on command

Parameters of the _enableVelocityGearing and _setMaster system functions

Following axis – Synchronous operation followingObject Transition behavior mergeMode Delay program execution nextCommand Parameters tab Reset master value Call of _setMaster system function

• Up to SIMOTION kernel Version V4.0 with parameter transientBehavior = DIRECT

• SIMOTION kernel Version V4.1 and higher with parameter transientBehavior = WITH_NEXT_SYNCHRONIZING

Leading axis / encoder master (system function _setMaster) Gear direction direction Gear ratio type gearingRatioType Gear ratio gearingRatio Dynamics tab Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 407: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 407

5.7.5 Synchronous velocity operation off

This command enables you to terminate gearing that was started with the Synchronous velocity operation on command. Desynchronization occurs with the programmed dynamic response settings.

Figure 5-93 Parameter screen form: Synchronous velocity operation off

Page 408: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 408 Programming and Operating Manual, 03/2007

5.7.5.1 Overview of parameters for Synchronous velocity operation off

Table 5-225 Overview of parameters for Synchronous velocity operation off

Field/Button Explanation/instructions Following axis Here, you select the axis to be desynchronized. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be desynchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects. Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Following axis and are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as a slave axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as a slave axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects. Dynamic response tab See Overview of parameters for Synchronous velocity operation off - Dynamic response

tab Expert tab See Overview of parameters for Synchronous velocity operation off - Expert tab Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition).

Page 409: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 409

5.7.5.2 Overview of parameters for Synchronous velocity operation off – Dynamic response tab

Table 5-226 Overview of parameters for Synchronous velocity operation off – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab Velocity profile In this field, you define the transitions between the individual motion phases.

System variables for preassigned value: userDefault.syncDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefault.syncDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variable for preassigned value: userDefault.syncDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk userDefault.syncDynamics.positiveAccelEndJerk userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

5.7.5.3 Overview of parameters for Synchronous velocity operation off – Expert tab

Table 5-227 Overview of parameters for Synchronous velocity operation off – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 410: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 410 Programming and Operating Manual, 03/2007

5.7.5.4 Relevant system function for Synchronous velocity operation off Cam technology package: • _disableVelocityGearing

Overview of parameters for Synchronous velocity gearing off / _disableVelocityGearing

Table 5-228 Parameters (MCC Synchronous velocity operation off command compared to _disableVelocityGearing system function)

Parameters of the MCC Synchronous velocity operation off command

Parameters of the _disableVelocityGearing system function

Following axis – Synchronous operation followingObject Transition behavior mergeMode Delay program execution nextCommand Dynamics tab Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 411: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 411

5.7.6 Cam on

Camming is characterized by a variable gear ratio between a master setpoint (position value of a leading axis or external encoder) and a slave value (position value of a following axis). Camming is thus in positional synchronism. The variable transmission ratio is described by a cam (transfer function). You can adapt the camming functionality to your requirements using various programmable axis evaluations and cam execution modes. When camming is started, the slave value is synchronized to the master setpoint with the programmed synchronization settings. It is also possible to switch to another cam at the end of an active cam. The master setpoint can be defined in the command; the slave value can be modified later with the Switch master setpoint.

Figure 5-94 Parameter screen form: Cam on

Active camming can be scaled and offset both on the side of the master setpoint and on the side of the slave value. This enables a cam to be adjusted individually in its definition and value range. The following commands are used for this purpose. • Set scaling on camming and • Set offset on camming In addition, the cam itself can be scaled and offset with the Parameterize cam command.

Page 412: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 412 Programming and Operating Manual, 03/2007

Camming can be terminated: • With the Cam off command • By starting another synchronous operation on the same synchronous object, e.g., with

another Cam on command • With a canceling single axis command on the slave axis

Notice The Stop axis command will only terminate the synchronous operation if Quick stop... was selected as the Stop mode.

5.7.6.1 Overview of parameters for Cam on

Table 5-229 Overview of parameters for Cam on

Field/Button Explanation/instructions Following axis Here, you select the axis to be synchronized. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be synchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects.Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Following axis and are available for selection, as appropriate: A synchronous axis defined on the device has been selected as a slave axis: The synchronous object associated with the selected slave axis is displayed If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object. <Reference> has been selected as a slave axis: All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType. These variables are references to synchronous objects.

Page 413: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 413

Field/Button Explanation/instructions Parameters tab See Overview of parameters for Cam on - Parameters tab Synchronization tab See Overview of parameters for Cam on - Synchronization tab Dynamic response tab See Overview of parameters for Cam on - Dynamic response tab Expert tab See Overview of parameters for Cam on - Expert tab Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution

of the following command in the MCC chart. See also Delay program execution (step enabling condition).

5.7.6.2 Overview of parameters for Cam on – Parameters tab

Table 5-230 Overview of parameters for Cam on – Parameters tab

Field/Button Explanation/instructions Reset master value Select this check box if you want to set the master setpoint of the synchronous

relationship (default) If check box is cleared, a previous master setpoint setting is retained.

Leading axis / encoder An entry is required in this field only if the Reset master value check box is selected. Here, you select the axis or external encoder that generates the master setpoint in the synchronous relationship. You can select from: • All positioning and synchronous (following) axes and external encoders that are

available on the device or a DP master. • All variables with the following data types of technology objects declared in the

MCC source file or MCC chart (see Technology object data types): posAxis, followingAxis, or externalEncoderType.

The master setpoint remains assigned to the synchronous object until a change occurs.

Cam Here, select the cam that describes the synchronous relationship. The following are available: • All cams that are defined on the relevant device. The cams are defined in the

CAMS folder in the project navigator. • All variables with the following data type of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): camType. Notice In the latter case, you must set up the relationships (links) between the cam and the synchronous object of the slave axis in the project navigator. The MCC Editor does this for standard cases.

Page 414: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 414 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Cam direction Here, you select the direction in which the cam is moved when master setpoints are

increasing. Positive The cam is executed in the same direction as the change in the master setpoint. If the change in the master setpoint is positive, the cam is executed in the direction of increasing definition range values (to the right). If the change in the master setpoint is negative, the cam is executed in the direction of decreasing definition range values (to the left). Negative The cam is executed in the opposite direction as the change in the master setpoint. If the change in the master setpoint is positive, the cam is executed in the direction of decreasing definition range values (to the left). If the change in the master setpoint is negative, the cam is executed in the direction of increasing definition range values (to the right). Last programmed direction Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userdefault.cammingSettings.direction

Evaluation of the leading axis Here, you select whether the master setpoint behaves absolutely or relatively with respect to the cam. Absolute The master setpoint is applied as an absolute value in the definition range of the cam. Relative The master setpoint is applied as a relative value (relative to the starting point of camming) in the definition range of the cam. Last programmed value Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.cammingSettings.masterMode

Evaluation of the following axis Here, you select whether the slave value behaves absolutely or relatively with respect to the cam. Absolute The slave value can be calculated as an absolute value from the value range of the cam. If the cam is processed cyclically (see the Cam processing field), the slave value begins with the initial value at each new cam cycle. Relative The slave value can be calculated as a relative value (relative to the starting point of camming) from the value range of the cam. If the cam is processed cyclically (see the Cam processing field), the slave value continues with the end value of the previous cam cycle at each new cam cycle. Last programmed value Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userDefault.cammingSettings.slaveMode

Page 415: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 415

Field/Button Explanation/instructions Processing the cam Here, you select whether the cam is to be processed cyclically.

Cyclic machining The master setpoints are calculated modulo to the cam length. If the master setpoint reaches the end point of the definition range of the cam, the cam continues to be processed with the start value. Non-cyclic processing The master setpoints are limited to the definition range of the cam; the cam is executed once in the definition range. If the master setpoint reaches the starting point or end point of the definition range of the cam, the cam is no longer processed. When the master setpoints are passed through again in the same direction (modulo axis), the slave values do not change. Last programmed cam mode Preassignment (default value) See Selection list (combo box) System variable for preassigned value: userdefault.CammingSettings.cammingMode

5.7.6.3 Overview of parameters for Cam on – Synchronization tab

Table 5-231 Overview of parameters for Cam on – Synchronization tab

Field/Button Explanation/instructions Synchronization reference Here, you select the reference for the synchronization operation.

Leading axis Length-related synchronization: Synchronization occurs (depending on the master axis motion) within a defined range of the master setpoint (Synchronization length). • Advantage: Synchronization occurs within an assignable range of the master

setpoint. • Disadvantage: The dynamic response of synchronization is dependent on the

change in the master setpoint (velocity). The dynamic response limits of the slave axis are not taken into account.

Time Time-related synchronization: Synchronization occurs on the basis of specified dynamic response values. Program the relevant values in the Dynamic response tab (see Overview of parameters for Cam on - Dynamic response tab). • Advantage: The synchronization operation always takes place with the specified

dynamic response values. • Disadvantage: The master setpoint range in which synchronization occurs cannot

be predicted. Last programmed reference Preassigned value See Selection list (combo box) System variable for preassigned value: userdefault.syncProfile.syncProfileReference

Page 416: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 416 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Start of synchronization Here, you select when synchronization of the cam begins. Additional specifications are

required for many of the choices; these are indicated in the description. at leading axis position Camming is enabled at a programmed master axis position. Entries are required in the following fields: • Reference point of leading axis position • Leading axis position Synchronization occurs with respect to the following values: • Master setpoint = last programmed leading axis position • Slave value: depending on the selection in Evaluation of the following axis (see

Overview of parameters for Cam On – Parameters tab):

For Absolute:

Slave value is calculated with the cam from the programmed leading axis position, taking into account:

Evaluation of the leading axis

Processing the cam

Any offset to cam starting point

For Relative: Slave value = current slave value at master axis position with offset Camming is enabled at a programmed master axis position. An offset for the following axis is additionally programmed. Entries are required in the following fields: • Offset • Reference point of leading axis position • Leading axis position Synchronization occurs with respect to the following values: • Master setpoint = last programmed leading axis position • Slave value: depending on the selection in Evaluation of the following axis (see

Overview of parameters for Cam On – Parameters tab):

For Absolute:

Slave value = calculated slave value + programmed offset

The calculated slave value is determined the same way as for the At leading axis position selection.

For Relative:

Slave value = current slave value + programmed offset Synchronize immediately Camming is enabled immediately. Synchronization occurs with respect to the following values: • Master setpoint = current master setpoint • Slave value: depending on the selection in Evaluation of the following axis (see

Overview of parameters for Cam On – Parameters tab):

For Absolute:

Slave value is calculated with the cam from the current master setpoint, taking into account:

Evaluation of the leading axis

Processing the cam

Any offset to cam starting point

For Relative:

Slave value = current slave value Synchronize immediately with offset Camming is enabled immediately. An offset for the following axis is additionally

Page 417: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 417

Field/Button Explanation/instructions Offset An entry is required in this field if you have selected the following in the Start of

synchronization field: • at master axis position with offset • Synchronize immediately with offset Here, you enter an offset that will be added to the calculated or current slave axis position.

Reference point of leading axis position

An entry is required in this field if you have selected the following in the Start of synchronization field: • at leading axis position • at master axis position with offset • At end of cam cycle Here, you select how the programmed position (see the Leading axis position field) acts relative to the selected synchronization profile. Synchronize before synchronization position Synchronization is finished at the programmed position. Symmetrical This choice is available only for leading axis synchronization reference. Synchronization occurs in such a way that the programmed position is located symmetrically within the synchronization length. At the programmed position, the master axis has covered half the distance that is required for synchronization. Synchronize from synchronization position Synchronization starts at the programmed position. Last programmed reference point of leading axis position Preassigned value See Selection list (combo box). System variable for preassigned value: userdefault.syncProfile.syncPositionReference

Synchronization length An entry is required in this field if you have selected the following in the Synchronization reference field: • Leading axis The synchronization length is the master setpoint range in which synchronization occurs. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Last programmed synchronization length Preassigned value See Selection list (combo box). System variable for preassigned value: userdefault.syncProfile.syncLength

Offset in relation to cam starting point

An entry is required in this field if you have selected the following in the Evaluation of the leading axis field (see Overview of parameters for Cam on – Parameters tab): • Relative The offset to the cam starting point specifies the starting point of the cam within its definition range. Enter the value in the editable selection list (see Editable selection list (editable combo box)). Last programmed starting point Preassignment (default value) See Selection list (combo box). System variable for preassigned value: userdefault.cammingSettings.camStartPosition

Page 418: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 418 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Following axis position Here, you enter the slave axis position in the editable selection list.

Last programmed following axis position Preassigned value See Selection list (combo box). System variable for preassigned value: userdefault.cammingSettings.syncPositionSlave

Leading axis position An entry is required in this field if you have selected the following in the Start of synchronization field: • at leading axis position • at master axis position with offset Here, you enter the master axis position in the editable selection list. Last programmed leading axis position Preassigned value See Selection list (combo box). System variable for preassigned value: userdefault.cammingSettings.syncPositionMaster

Synchronization direction Here, you select the motion direction in which the following axis is to be synchronized. Retain system behavior Synchronization occurs over the shortest path without direction specification. In the case of moving axes, a check is made to determine whether the current motion direction can be maintained. Maintain direction of following axis Synchronization takes place in the direction of motion of the following axis. Positive Synchronization occurs in the positive motion direction. Negative Synchronization occurs in the negative motion direction. Shortest path Synchronization occurs over the shortest path without direction specification. Preassigned value (default value) See Selection list (combo box) System variable for preassigned value: userdefault.cammingSettings.synchronizingDirection

Page 419: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 419

5.7.6.4 Overview of parameters for Cam on – Dynamic response tab

Table 5-232 Overview of parameters for Cam on – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for

Dynamic response tab. The parameters in the Dynamic response tab are evaluated only for time synchronization reference.

Velocity The entered value acts during the constant velocity phase. System variable for preassigned value: userDefault.syncDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. System variable for preassigned value: userDefault.syncDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. System variable for preassigned value: userDefault.syncDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. System variable for preassigned value: userDefault.syncDynamics.negativeAccel

Jerk The entered value limits the change in the acceleration or deceleration at the start and end of the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk userDefault.syncDynamics.positiveAccelEndJerk userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

5.7.6.5 Overview of parameters for Cam on – Expert tab

Table 5-233 Overview of parameters for Cam on – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type for each command step,

you can use this variable to find out the result of the command step. Data type DINT; for a description, see Return value for system functions of the Cam technology package

Page 420: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 420 Programming and Operating Manual, 03/2007

5.7.6.6 Example of Cam on An axis (rotaryAxis_1) is to rotate at a velocity of 360 degrees/s. A second axis (synchronous axis) is to be coupled to rotary axis_1 by means of a cam. The cam must be created and parameterized in SIMOTION SCOUT. The synchronous axis that is to be coupled with rotary axis_1 by means of a cam must be assigned as a synchronous axis in SIMOTION SCOUT.

Figure 5-95 Example: MCC chart for a camming operation

Page 421: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 421

5.7.6.7 Relevant system functions for Cam on Cam technology package: • _enableCamming • _setMaster If the "Reset master value" check box is selected, the _setMaster system function is called first before _enableCamming.

Overview of parameters for Cam on / _enableCamming, _setMaster

Table 5-234 Parameters (MCC Cam on command compared to _enableCamming and _setMaster system functions)

Parameters of the MCC Cam on command

Parameters of the _enableCamming and _setMaster system functions

Following axis – Synchronous operation followingObject Transition behavior mergeMode Delay program execution nextCommand Parameters tab Reset master value Call of _setMaster system function

• Up to SIMOTION kernel Version V4.0 with parameter transientBehavior = DIRECT

• SIMOTION kernel Version V4.1 and higher with parameter transientBehavior = WITH_NEXT_SYNCHRONIZING

Leading axis / encoder master (system function _setMaster) Cam cam Cam direction direction Evaluation of the leading axis masterMode Evaluation of the following axis slaveRatioType Processing the cam cammingModer Synchronization tab Synchronization reference synchronizingMode Start of synchronization syncProfileReference Offset syncPositionSlave Reference point of leading axis position syncPositionReference Synchronization length syncLengthType Offset in relation to cam starting point camStartPositionMasterType, camStartPositionMaster Following axis position syncPositionSlaveType, syncPositionSlave Leading axis position syncPositionMasterType, syncPositionMaster Synchronization direction synchronizingDirection Dynamic response tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel

Page 422: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 422 Programming and Operating Manual, 03/2007

Parameters of the MCC Cam on command

Parameters of the _enableCamming and _setMaster system functions

Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

5.7.7 Cam off

This command enables you to terminate camming that was started with the Cam on command. Desynchronization occurs with the programmed desynchronization settings.

Figure 5-96 Parameter screen form: Cam off

Page 423: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 423

5.7.7.1 Overview of parameters for Cam off

Table 5-235 Overview of parameters for Cam off

Field/Button Explanation/instructions Following axis Here, you select the axis to be desynchronized. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be desynchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects.Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Following axis and are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as a slave axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as a slave axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects. Desynchronization tab See Overview of parameters for Cam off - Desynchronization tab Dynamic response tab See Overview of parameters for Cam off - Dynamic response tab Expert tab See Overview of parameters for Cam off - Expert tab Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axis. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution

of the following command in the MCC chart. See also Delay program execution (step enabling condition).

Page 424: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 424 Programming and Operating Manual, 03/2007

5.7.7.2 Overview of parameters for Cam off – Desynchronization tab

Table 5-236 Overview of parameters for Cam off – Desynchronization tab

Field/Button Explanation/instructions Synchronization reference Here you select the reference for the desynchronization operation.

Leading axis Length-related synchronization: Synchronization occurs (depending on the master axis motion) within a defined range of the master setpoint (Desynchronization length). • Advantage: Synchronization occurs within an assignable range of the master

setpoint. • Disadvantage: The dynamic response of synchronization is dependent on the

change in the master setpoint (velocity). The dynamic response limits of the slave axis are not taken into account.

Time Time-related synchronization: Synchronization occurs on the basis of specified dynamic response values. Program the relevant values in the Dynamic response tab (see Overview of parameters for Cam off - Dynamic response tab). • Advantage: The synchronization operation always takes place with the specified

dynamic response values. • Disadvantage: The master setpoint range in which synchronization occurs cannot

be predicted. Last programmed reference Preassigned value See Selection list (combo box). System variable for preassigned value: userdefault.syncProfile.syncProfileReference

Desynchronization position Here, you select when desynchronization of camming begins. Additional specifications are required for some of the choices; these are indicated in the description. At leading axis value Camming is disabled at a programmed master axis position. Entries are required in the following fields: • Reference point of desynchronization position • Leading axis position Desynchronize immediately Camming is disabled immediately. At following axis value Camming is disabled at a programmed slave axis position. Entries are required in the following fields: • Reference point of desynchronization position • Following axis position At end of cam cycle Camming is disabled if the slave value reaches the end of the cam or the cam cycle. An entry is required in the following field: • Reference point of desynchronization position Last programmed start of desynchronization Preassigned value (default value) See Selection list (combo box). System variable for preassigned value: userdefault.cammingSettings.syncOffMode

Page 425: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 425

Field/Button Explanation/instructions Reference point of desynchronization position

An entry is required in this field if you have selected the following in the Desynchronization position field: • At leading axis value • At following axis value • At end of cam cycle Here, you select how the programmed position (see the Following axis position or Leading axis field) acts relative to the selected desynchronization profile. Stop before desynchronization position Synchronization is finished at the programmed position. Symmetrical This choice is available only for leading axis synchronization reference. Desynchronization occurs in such a way that the programmed position is located symmetrically within the desynchronization length. At the programmed position, the master axis has covered half the distance that is required for synchronization. Stop from desynchronization position Desynchronization starts at the programmed position. Last programmed reference point of leading axis position Preassigned value See Selection list (combo box). System variable for preassigned value: userdefault.syncProfile.syncOffPositionReference

Desynchronization length An entry is required in this field if you have selected the following in the Synchronization reference field: • Leading axis Enter the synchronization length in the editable selection list. Last programmed desynchronization length Preassigned value See Selection list (combo box). System variable for preassigned value: userdefault.syncProfile.syncOffLength

Following axis position An entry is required in this field if you have selected the following in the Desynchronization position field: • At following axis value Here, you enter the slave axis position in the editable selection list. Default See selection list (combo box). System variable for preassigned value: userdefault.syncOffPositions.Slave

Leading axis position An entry is required in this field if you have selected the following in the Desynchronization position field: • At leading axis value Here, you enter the master axis position in the editable selection list. Default See selection list (combo box). System variable for preassigned value: userdefault.syncOffPositions.Master

Page 426: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 426 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Synchronization direction Here, you select the motion direction in which the following axis is to be

desynchronized. Retain system behavior Synchronization occurs over the shortest path without direction specification. In the case of moving axes, a check is made to determine whether the current motion direction can be maintained. Maintain direction of following axis Synchronization takes place in the direction of motion of the following axis. Positive Synchronization occurs in the positive motion direction. Negative Synchronization occurs in the negative motion direction. Shortest path Synchronization occurs over the shortest path without direction specification. Preassigned value (default value) See selection list (combo box). System variable for preassigned value: userdefault.cammingSettings.synchronizingDirection

5.7.7.3 Overview of parameters for Cam off – Dynamic response tab

Table 5-237 Overview of parameters for Cam off – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for

Dynamic response tab. The parameters in the Dynamic response tab are evaluated only for time synchronization reference.

Velocity The entered value acts during the constant velocity phase. System variables for preassigned value: userDefault.syncDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. System variables for preassigned value: userDefault.syncDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. System variable for preassigned value: userDefault.syncDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. System variables for preassigned value: userDefault.syncDynamics.negativeAccel

Jerk The entered value limits the change in the acceleration or deceleration at the start and end of the respective phase. System variables for preassigned value: userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

Page 427: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 427

5.7.7.4 Overview of parameters for Cam Off – Expert tab

Table 5-238 Overview of parameters for Cam Off – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable

to find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.7.7.5 Relevant system function for Cam off Cam technology package: • _disableCamming

Overview of parameters for Cam off / _disableCamming

Table 5-239 Parameters (MCC Cam off command compared to _disableCamming system functions)

Parameters of the MCC Cam off command

Parameters of the _disableCamming system function

Following axis – Synchronous operation followingObject Transition behavior mergeMode Delay program execution nextCommand Desynchronization tab Synchronization reference syncProfileReference Desynchronization position syncOffMode Reference point of desynchronization position syncOffPositionReference Desynchronization length syncOffLengthType, syncOffLength Following axis position syncOffPositionSlaveType, syncOffPositionSlave Leading axis position syncOffPositionMasterType, syncOffPositionMaster Synchronization direction synchronizingDirection Dynamic response tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel

Page 428: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 428 Programming and Operating Manual, 03/2007

Parameters of the MCC Cam off command

Parameters of the _disableCamming system function

Jerk positiveAccelStartJerkType, positiveAccelStartJerk, positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

5.7.8 Set scaling on camming

This command causes scaling of the leading axis or following axis range of the associated cam during camming. You can use parameters to specify things such as: • Timing for when scaling becomes effective (immediately/next cam cycle) • Effectiveness on the active camming command and/or subsequent camming commands Scaling operations that act on the active camming command as well as scaling operations that are stored and act on subsequent commands can be read from the cammingAdjustment system variable.

Figure 5-97 Parameter screen form: Set scaling on camming

Page 429: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 429

5.7.8.1 Overview of parameters for Set scaling on camming

Table 5-240 Overview of parameters for Set scaling on camming

Field/Button Explanation/instructions Axis Here, you select the axis for which the cam is to be scaled. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be synchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects. Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Axis and are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as an axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as the axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects. Parameters tab See Overview of parameters for Set scaling on camming – Parameters tab Dynamic response tab See Overview of parameters for Set scaling on camming – Dynamic response tab Expert tab See Overview of parameters for Set scaling on camming – Expert tab

Page 430: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 430 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Effect Here you select the commands on which scaling is active.

On active command (default value) Scaling acts on the active camming command and remains active until this command is replaced or desynchronized using the Cam off command. The scaling factor is stored (depending on the cam range) in system variable cammingAdjustment.master.scale or cammingAdjustment.slave.scale. on following commands The active camming command is executed; the scaling is stored and used for the following Cam on commands. The scaling factor is stored (depending on the cam range) in system variable cammingAdjustment.defaultValueMaster.scale or cammingAdjustment.defaultValueSlave.scale. On active command and following commands The scaling acts on the current camming command and on all following Cam on commands. The scaling factor is stored (depending on the cam range) in system variables cammingAdjustment.master.scale and cammingAdjustment.defaultValueMaster.scale, or cammingAdjustment.slave.scale and cammingAdjustment.defaultValueSlave.scale.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition).

5.7.8.2 Overview of parameters for Set scaling on camming – Parameters tab

Table 5-241 Overview of parameters for Set scaling on camming – Parameters tab

Field/Button Explanation/instructions Area Here, you select whether the leading axis or following axis range of the cam is to be

scaled. Master range (default value) The leading axis range of the cam is scaled. slave range The following axis range of the cam is scaled.

Offset Scaling factor for the selected range. Enter the value as a signed floating-point number.

Instant in time Here, you select when the scaling takes effect. Immediately (default value) The scaling of the selected range goes into effect immediately. At next cycle The scaling of the selected range goes into effect at the next cam cycle (only for cyclic cam).

Page 431: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 431

5.7.8.3 Overview of parameters for Set scaling on camming – Dynamic response tab

Table 5-242 Overview of parameters for Set scaling on camming – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Velocity The entered value acts during the constant velocity phase.

System variables for preassigned value: userDefault.syncDynamics.velocity Velocity profile In this field, you define the transitions between the individual motion phases.

System variables for preassigned value: userDefault.syncDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefault.syncDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variables for preassigned value: userDefault.syncDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk userDefault.syncDynamics.positiveAccelEndJerk userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

5.7.8.4 Overview of parameters for Set scaling on camming – Expert tab

Table 5-243 Overview of parameters for Set scaling on camming – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 432: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 432 Programming and Operating Manual, 03/2007

5.7.8.5 Relevant system function for Set scaling on camming Cam technology package: • _setCammingScale

Overview of parameters for Set scaling on camming / _setCammingScale

Table 5-244 Parameters (MCC Set scaling on camming command compared to _setCammingScale system function)

Parameters of the MCC Set scaling on camming command

Parameters of the _setCammingScale function

Axis – Synchronous operation followingObject Effect activationMode Delay program execution nextCommand Parameters tab Area scalingRange Offset scaleValue Instant in time scaleSpecification Dynamic response tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 433: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 433

5.7.9 Set offset on camming

This command causes an offset of the leading axis or following axis range of the associated cam during camming. You can use parameters to specify things such as: • Timing for when the offset takes effect (immediately/next cam cycle) • Effectiveness on the active camming command and/or subsequent camming commands Offsets that act on the active camming command as well as scaling operations that are stored and act on subsequent commands can be read from the cammingAdjustment system variable.

Figure 5-98 Parameter screen form: Set offset on camming

Page 434: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 434 Programming and Operating Manual, 03/2007

5.7.9.1 Overview of parameters for Set offset on camming

Table 5-245 Overview of parameters for Set offset on camming

Field/Button Explanation/instructions Axis Here, you select the axis for which the cam is to be offset. The following are available:

• All synchronous axes that are defined on the relevant device. The axes are defined in the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be synchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects. Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous objects are displayed according to the selected Axis and are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as an axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as the axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects. Parameters tab See Overview of parameters for Set offset on camming – Parameters tab Dynamic response tab See Overview of parameters for Set offset on camming – Dynamic response tab Expert tab See Overview of parameters for Set offset on camming – Expert tab

Page 435: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 435

Field/Button Explanation/instructions Effect Here, you select which commands the offset will act on.

On active command (default value) The offset acts on the active camming command and remains active until this command is replaced or desynchronized using the Cam off command. The offset value is stored in system variable cammingAdjustment.master.offset or cammingAdjustment.slave.offset (depending on the range of the cam). on following commands The active camming command is executed; the offset is stored and used for the following Cam on commands. The offset value is stored (depending on the cam range) in system variable cammingAdjustment.defaultValueMaster.offset or cammingAdjustment.defaultValueSlave.offset. On active command and following commands The offset acts on the current camming command and on all following Cam on commands. The offset value is stored in system variables cammingAdjustment.master.offset and cammingAdjustment.defaultValueMaster.offset or cammingAdjustment.slave.offset and cammingAdjustment.defaultValueSlave.offset (depending on the range of the cam).

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition)

5.7.9.2 Overview of parameters for Set offset on camming – Parameters tab

Table 5-246 Overview of parameters for Set offset on camming – Parameters tab

Field/Button Explanation/instructions Area Here, you select whether the leading axis or following axis range of the cam will be offset.

Master range (default value) The leading axis range of the cam is offset. slave range The following axis range of the cam is offset.

Offset Offset for the selected range. Enter the value as a signed floating-point number.

Mode Select the type of offset. Absolute(default value) The offset is applied as an absolute value. Relative The offset is relative to the corresponding value in the cammingAdjustments system variable.

Page 436: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 436 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Instant in time Here, you select when the offset takes effect

Immediately (default value) The offset of the selected range goes into effect immediately. At next cycle The offset of the selected range goes into effect at the next cam cycle (for cyclic cam only).

5.7.9.3 Overview of parameters for Set offset on camming – Dynamic response tab

Table 5-247 Overview of parameters for Set offset on camming – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. Velocity The entered value acts during the constant velocity phase.

System variables for preassigned value: userDefault.syncDynamics.velocity Velocity profile In this field, you define the transitions between the individual motion phases.

System variables for preassigned value: userDefault.syncDynamics.profile Acceleration The entered value acts during the constant acceleration phase.

System variable for preassigned value: userDefault.syncDynamics.positiveAccel Deceleration The entered value acts during the constant deceleration phase.

System variables for preassigned value: userDefault.syncDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk userDefault.syncDynamics.positiveAccelEndJerk userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

5.7.9.4 Overview of parameters for Set offset on camming – Expert tab

Table 5-248 Overview of parameters for Set offset on camming – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 437: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 437

5.7.9.5 Relevant system function for Set offset on camming Cam technology package: • _setCammingOffset

Overview of parameters for Set offset on camming / _setCammingOffset

Table 5-249 Parameters (MCC Set offset on camming command compared to _setCammingOffset system function)

Parameters of the MCC Set offset on camming command

Parameters of the _setCammingOffset system function

Axis – Synchronous operation followingObject Effect activationMode Delay program execution nextCommand Parameters tab Area offsetRange Offset offsetValue Mode offsetMode Instant in time offsetSpecification Dynamic response tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 438: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 438 Programming and Operating Manual, 03/2007

5.7.10 Parameterize cam

This command enables a defined electronic cam to be scaled and/or offset. The master and slave axes can be offset and scaled independently of one another. Scaling takes place over the complete cam or within a range defined by the starting and end points. Scaling of the complete cam is referred to below as basic scaling; scaling of a range is referred to as range scaling. The definition range and value range each have one basic scaling and two range scalings. For basic scaling, the zero point of the coordinate axis becomes the scaling point, while for range scaling the starting point of the specified scaling range is used. This command enables simultaneous specification of one offset and/or basic scaling plus one range scaling each for the master and slave axes.

Figure 5-99 Parameter screen form for Parameterize cam – Tab: Offset

Page 439: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 439

Figure 5-100 Parameter screen form for Parameterize cam – Tab: Basic scaling

Figure 5-101 Parameter screen form for Parameterize cam – Tab: Range scaling

Page 440: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 440 Programming and Operating Manual, 03/2007

5.7.10.1 Overview of parameters for Parameterize cam

Table 5-250 Overview of parameters for Parameterize cam

Field/Button Explanation/instructions Cam Here, you select the cam to be offset or scaled. The following are available:

• All cams that are defined on the relevant device. The cams are defined in the CAMS folder in the project navigator.

• All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types): camType.

Offset tab See Overview of parameters for Parameterize cam – Offset tab Basic scaling tab See Overview of parameters for Parameterize cam – Basic scaling tab Range scaling tab See Overview of parameters for Parameterize cam – Range scaling tab Expert tab See Overview of parameters for Parameterize cam – Expert tab

5.7.10.2 Overview of parameters for Parameterize cam – Offset tab

Table 5-251 Overview of parameters for Parameterize cam – Offset tab

Field/Button Explanation/instructions Following axis offset Select this check box if you want to program an offset for the slave axis.

Enter the offset for the slave axis here. Leading axis offset Select this check box if you want to program an offset for the master axis.

Enter the master axis offset in this box. Calculation Here, you select whether the newly programmed offset is applied absolutely or is added to

the previously active offset. Absolute(default value) The programmed value is applied absolutely. Relative The programmed value is applied relatively.

Page 441: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 441

5.7.10.3 Overview of parameters for Parameterize cam – Basic scaling tab

Table 5-252 Overview of parameters for Parameterize cam – Basic scaling tab

Field/Button Explanation/instructions Following axis scaling factor Select this check box if you wish to program a scaling factor for the complete slave axis

range. Here, you enter a scaling factor that is valid for the slave axis, independent of the range. Using the range scaling, you can also activate scaling factors for individual ranges. These are superimposed over the complete scaling.

Leading axis scaling factor Select this check box if you want to program a scaling factor for the complete range of the master axis. Here, you enter a scaling factor that is valid for the master axis, independent of the range. Using the range scaling, you can also activate scaling factors for individual ranges. These are superimposed over the complete scaling.

5.7.10.4 Overview of parameters for Parameterize cam – Range scaling tab

Table 5-253 Overview of parameters for Parameterize cam – Range scaling tab

Field/Button Explanation/instructions Number of cam range Here, you select the number of the scaling range (1 or 2). If you select the same number for

a subsequent command, you can overwrite the previously programmed values. Following axis Select this check box in order to program a scaling factor in a specific range of the slave

axis. Start of range (following axis)

Here, you enter the slave axis position at which scaling starts.

End of range (following axis)

Here, you enter the slave axis position at which scaling ends.

Scaling factor (following axis)

Here, you enter the scaling factor for the slave axis. This is effective within the specified range.

Leading axis Select this check box to program a scaling factor in a specific range of the master axis. Start of range (leading axis) Here, you enter the position of the master axis at which scaling begins. End of range (leading axis) Here, you enter the position of the master axis at which scaling ends. Scaling factor (leading axis) Here, you enter the scaling factor for the master axis. This is effective within the specified

range.

Page 442: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 442 Programming and Operating Manual, 03/2007

5.7.10.5 Overview of parameters for Parameterize cam – Expert tab

Table 5-254 Overview of parameters for Parameterize cam – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab. Return variable If you enter the name of a variable of the specified data type for each command step, you

can use this variable to find out the result of the command step. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

5.7.10.6 Relevant system functions for Parameterize cam Cam technology package: • _setCamOffset • _setCamScale

Overview of parameters for Parameterize cam / _setCamOffset, _setCamScale

Table 5-255 Parameters (MCC Parameterize cam command compared to _setCamOffset and _setCamScale system functions)

Parameters of the MCC Parameterize cam command

Parameters of the _setCammingOffset and _setCamScale system functions

Cam cam Offset tab Following axis offset Call of system function _setCamOffset.

offsetRange, offset Leading axis offset Call of system function _setCamOffset.

offsetRange, offset Calculation offsetMode Basic scaling tab Following axis scaling factor Call of system function setCamScale.

scalingRange, scalingSpecification, scaleValue Leading axis scaling factor Call of system function setCamScale.

scalingRange, scalingSpecification, scaleValue Range scaling tab Number of cam range specificRangeNumber Following axis Call of system function setCamScale Start of range (following axis) specificRangeStartPointType, specificRangeStartPoint End of range (following axis) specificRangeEndPointType, specificRangeEndPoint Scaling factor (following axis) scalingRange, scalingSpecification, scaleValue Leading axis Call of system function setCamScale Start of range (leading axis) specificRangeStartPointType, specificRangeStartPoint End of range (leading axis) specificRangeEndPointType, specificRangeEndPoint

Page 443: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 443

Parameters of the MCC Parameterize cam command

Parameters of the _setCammingOffset and _setCamScale system functions

Scaling factor (leading axis) scalingRange, scalingSpecification, scaleValue Expert tab Return variable –

5.7.11 Switch master setpoint

This command switches the master setpoint for an existing synchronous relationship. Switchover is possible when synchronous operation is active.

Figure 5-102 Parameter screen form: Switch master setpoint

Page 444: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 444 Programming and Operating Manual, 03/2007

5.7.11.1 Overview of parameters for Switch master setpoint

Table 5-256 Overview of parameters for Switch master setpoint

Field/Button Explanation/instructions Following axis Here, you select the axis for which the master setpoint is to be switched. The following

are available: • All synchronous axes that are defined on the relevant device. The axes are defined in

the AXES folder in the project navigator.

The synchronous objects associated with the selected synchronous axis are automatically identified and displayed in the Synchronous operation field for selection, as appropriate.

• <Reference>

You select this entry if the axis to be synchronized is not defined on the device but rather is specified as a reference (variable).

All variables declared in the MCC source file or MCC chart with data type followingObjectType (references to synchronous objects) are available for selection in the Gearing field.

Notice You cannot select any references to a synchronous axis (variable of followingAxis data type). There is no assignment for the reference to the associated synchronous objects. Instead, select the reference to the synchronous object directly (variable of data type followingObjectType)

Synchronous operation Here, the permissible synchronous (following) objects are displayed according to the selected following axis, where they are available for selection, as appropriate: • A synchronous axis defined on the device has been selected as a slave axis:

The synchronous object associated with the selected slave axis is displayed

If more than one synchronous object is available (e.g., superimposed synchronous object), you can select the synchronous object.

• <Reference> has been selected as a slave axis:

All variables with the following data type of technology objects declared in the MCC source file or MCC chart (see Technology object data types) are available for selection: followingObjectType.

These variables are references to synchronous objects. Parameters tab See Overview of parameters for Switch master setpoint – Parameters tab Dynamic response tab See Overview of parameters for Switch master setpoint – Dynamic response tab Expert tab See Overview of parameters for Switch master setpoint – Expert tab Delay program execution • Select the check box if you wish the system to delay execution of the following

command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition).

Page 445: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 445

5.7.11.2 Overview of parameters for Switch master setpoint – Parameters tab

Table 5-257 Overview of parameters for Switch master setpoint – Parameters tab

Field/Button Explanation/instructions Master value Here, you select the axis or external encoder that generates the master setpoint in the

synchronous relationship. You can select from: • All positioning, synchronous (following), and path axes and external encoders that are

available on the device or a DP master. • All variables with the following data types of technology objects declared in the MCC

source file or MCC chart (see Technology object data types): posAxis, followingAxis, pathAxis or externalEncoderType.

The master setpoint remains assigned to the synchronous object until a change occurs. Transition behavior Here, you choose how the switchover to the selected master setpoint is to occur.

direct Selected master setpoint is active immediately with next synchronization Selected master setpoint is active the next time the following axis is synchronized. With programmed dynamic response values The transition to the selected master setpoint takes place with the values set in the Dynamic response tab (see Overview of parameters for Switch master setpoint – Dynamic response tab).

5.7.11.3 Overview of parameters for Switch master setpoint – Dynamic response tab

Table 5-258 Overview of parameters for Switch master setpoint – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab. The parameters in the Dynamic response tab are evaluated only for transition behavior with programmed dynamic response values.

Velocity The entered value acts during the constant velocity phase. System variables for preassigned value: userDefault.syncDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. System variables for preassigned value: userDefault.syncDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. System variable for preassigned value: userDefault.syncDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. System variables for preassigned value: userDefault.syncDynamics.negativeAccel

Page 446: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart 446 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefault.syncDynamics.positiveAccelStartJerk userDefault.syncDynamics.positiveAccelEndJerk userDefault.syncDynamics.negativeAccelStartJerk userDefault.syncDynamics.negativeAccelEndJerk

5.7.11.4 Overview of parameters for Switch master setpoint – Expert tab

Table 5-259 Overview of parameters for Switch master setpoint – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of

parameters for Expert tab. CommandID variable If you enter the name of a variable of data type

CommandIdType, you can track the command status with this variable.

Return variable If you enter the name of a variable of the specified data type, you can use this variable to find out the result of the command call. Data type DINT; for a description, see Return value for system functions of the Cam technology package.

Page 447: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.7 Commands for synchronous operation and camming

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 447

5.7.11.5 Relevant system function for Switch master setpoint Cam technology package: • _setMaster

Overview of parameters for Switch master setpoint / _setMaster

Table 5-260 Parameters (MCC Switch master setpoint command compared to _setMaster system function)

Parameters of the MCC Switch master value command

Parameters of the _setMaster system function

Following axis – Synchronous operation followingObject Delay program execution nextCommand Parameters tab Master value master Transition behavior transientBehavior Dynamic response tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 448: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 448 Programming and Operating Manual, 03/2007

5.8 Commands for path interpolation In Version V4.1 and higher of the SIMOTION kernel, SIMOTION provides path interpolation functions. This functionality enables up to 3 path axes to travel along specified paths. In addition, a positioning axis can be traversed synchronously with the path. The Path object technology object (data type _pathObjectType) provides this functionality. • With the Path object technology object, the following additional technology objects are

interconnected during configuration: – At least two and up to three axes with the path interpolation technology (path axes -

data type _pathAxis) – Optionally, one positioning axis (data type posAxis, followingAxis or _pathAxis) that is

traversed synchronously with the path motion. It is thus possible to output the current length of the path motion on an axis, for example.

– Optionally, one cam (data type camType) in order to specify a special velocity profile for the path motion.

• In addition, the motion inputs (MotionIn) of positioning axes can be interconnected with the three motion outputs (MotionOut) of the TO path object. This enables outputting of the three coordinates of the basic coordinate system on axes.

• The path motions are always programmed in a right-handed, rectangular (Cartesian) coordinate system in accordance with DIN 66217 (basic coordinate system).

• Adaptation of machine kinematics (i.e. axis coordinate system) to the basic coordinate system is done by means of kinematics transformations. You specify this when configuring the TO path object.

The following applies to the path motion: • The paths can comprise individual path segments. • These individual segments can be the following 2-dimensional or 3-dimensional motions

(interpolations): – Linear motion: Traverse path linearly (Page 449) command – Circular motion: Traverse path circularly (Page 457) command – Polynomial motion: command Traverse path using polynomials (Page 467)

• Blending is used to link individual segments in series to form one complete motion with no intermediary stop.

Page 449: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 449

5.8.1 Traverse path linearly

This function is available in SIMOTION kernel Version 4.1 and higher. This command moves the path axes interconnected with the specified path object on a straight line to an end point. The motion can be carried out in: • Three dimensions • Two dimensions in one of the main Cartesian planes The end point entered can be absolute or relative.

Figure 5-103 Parameter screen form: Traverse path linearly

See also the SIMOTION Motion Control Function Manual, Technology object, Path interpolation.

Page 450: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 450 Programming and Operating Manual, 03/2007

5.8.1.1 Overview of parameters for Traverse path linearly

Table 5-261 Overview of parameters for Traverse path linearly

Field/Button Explanation/instructions Path object In Path object, select the path object whose assigned path axes are to be traversed to the

end point. The list contains: • All path objects that are defined on the relevant device. The path objects are defined

in the PATH OBJECTS folder in the project navigator. • All variables with the following data type of a technology object declared in the MCC

source file or MCC chart (see Technology object data types (Page 95)): _pathObjectType.

Parameters tab See Overview of parameters for Traverse path linearly - Parameters tab (Page 450) Dynamic response tab See Overview of parameters for Traverse path linearly - Dynamic response tab

(Page 452) Synchronous axis tab See Overview of parameters for Traverse path linearly - Path-synchronous motion tab

(Page 454) Expert tab See Overview of parameters for Traverse path linearly - Expert tab (Page 455) Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the path object or on the axes involved. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command (Page 78).

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition) (Page 79).

5.8.1.2 Overview of parameters for Traverse path linearly – Parameters tab

Table 5-262 Overview of parameters for Traverse path linearly – Parameters tab

Field/Button Explanation/instructions Path plane Here, you select whether the motion is to be carried out in three dimensions (3D) or two

dimensions (2D). X-Y-Z Three-dimensional motion X-Y main plane Y-Z main plane Z-X main plane Two-dimensional motion in the selected main plane of the basic (Cartesian) coordinate system. The target coordinate located outside the selected plane is ignored. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.plane

Page 451: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 451

Field/Button Explanation/instructions Mode The meaning of the subsequently programmed target coordinates is defined in more

detail here. Absolute The programmed target coordinates refer to the zero point of the basic coordinate system. Relative The programmed target coordinates refer to the path position within the basic coordinate system when the path command is executed (point in time of change). Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.mode

Target coordinates X, Y, Z

The end point of the motion is specified here. The meaning depends on the Mode parameter (see above): • Absolute mode: Absolute coordinates with respect to the zero point of the basic

coordinate system. • Relative mode: Relative coordinates with respect to the path position within the basic

coordinate system when the path command is executed (point in time of change). Enter the values as signed floating-point numbers. See Input field (Page 71)

Blending This parameter is evaluated only for: • Attach transition behavior or • Attach transition behavior and discard pending command. With blending, the path segment programmed with this command can be linked to the previous path segment to form one complete path with no stop. At the transition, the system provides for a constant path velocity and a constant path acceleration. Active with dynamic response adaptation The dynamic response limit values of the individual path axes are also applied in the blending area. For this reason, the path velocity is nearly reduced to zero at transitions of path segments during which the pitches or curvatures are not applied smoothly. Active without dynamic response adaptation In the blending area, path interpolation takes into account only the scalar dynamic response limit values of the path (path velocity, path acceleration and jerk). The dynamic response limit values specific to the axes are first taken into account during movement of the individual path axes. For this reason, deviations from the path, specific to the axes, can occur at transitions of path segments during which the pitches or curvatures are not applied smoothly. Inactive The motion programmed with this command does not begin until the setpoint interpolation of the previous command is complete and its motion has reached the target coordinates. The path velocity and path acceleration are therefore zero at the transition. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.blending.mode

Page 452: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 452 Programming and Operating Manual, 03/2007

5.8.1.3 Overview of parameters for Traverse path linearly – Dynamic response tab

Table 5-263 Overview of parameters for Traverse path linearly – Dynamic response tab

Field/Button Explanation/instructions Here, you specify the dynamic response of the path motion.

In standard cases, you define the dynamic response by means of a velocity profile with the associated values for the velocity. Acceleration, deceleration, and jerk. A detailed description of these parameters is provided in Overview of parameters – Dynamic response tab (Page 73). Optionally, you can select a special velocity profile that is described by a cam.

Velocity The entered value acts during the constant velocity phase. This parameter is evaluated only when Special velocity profile = No. System variable for preassigned value: userDefault.pathDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. The parameter is evaluated only in the following cases: • When Special velocity profile = No • When Special velocity profile = Yes and when accelerating to the velocity specified in

the special velocity profile. System variable for preassigned value: userDefault.pathDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. The parameter is evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variable for preassigned value: userDefault.pathDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. The parameter is evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variable for preassigned value: userDefault.pathDynamics.negativeAccel

Jerk The entered value limits the change in the acceleration or deceleration at the start and end of the respective phase. The parameters are evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variables for preassigned value: userDefault.pathDynamics.positiveAccelStartJerk userDefault.pathDynamics.positiveAccelEndJerk userDefault.pathDynamics.negativeAccelStartJerk userDefault.pathDynamics.negativeAccelEndJerk

Page 453: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 453

Field/Button Explanation/instructions Dynamic response adaptation Here, you select whether the dynamic response limit values are to be taken into account

during path interpolation. Inactive The dynamic response limit values of the individual path axes are not taken into account during path interpolation. However, they remain active, and an error is triggered if they are exceeded. This setting should only be selected if it is ensured by other means (e.g., an appropriate specific velocity profile) that the limit values will not be exceeded. Maximum axial dynamic response values without segmentation The dynamic response limit value of the individual path axes for velocity and acceleration are taken into account during path interpolation. If a positioning axis is configured for the path-synchronous motion, its dynamic response limit values are also included. Path velocity and path acceleration are adapted for the entire path motion if necessary. Maximum axial dynamic response values with segmentation The dynamic response limit value of the individual path axes for velocity and acceleration are taken into account during path interpolation. If a positioning axis is configured for the path-synchronous motion, its dynamic response limit values are also included. The path motion is divided up into individual segments, as determined by the system, if necessary. Within each segment, the path velocity and the path acceleration are adapted to the maximum axial dynamic response limit values. Preassignment See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.dynamicAdaption

Specific velocity profile Here, you select whether the path dynamic response is specified with the velocity profile defined above or with a velocity profile that is defined by a cam. No(default value) The path dynamic response is specified with the velocity profile defined above with the parameters: velocity profile, velocity, acceleration, deceleration, and jerk. Yes The path dynamic response is specified with a velocity profile that is defined by a cam.

Cam This field is only visible when Special velocity profile = Yes. Here, you select the cam which defines the velocity profile. The following are available: • All cams that are defined on the relevant device. The cams are defined in the CAMS

folder in the project navigator. • All variables with the following data type of technology objects declared in the MCC

source file or MCC chart (see Technology object data types (Page 95)): camType. The Profile position at start of path and Profile position at end of path parameters are used to select an area within the definition range of the cam (x axis) that is mapped by scaling to the length of the programmed path. The value range (y axis) is interpreted as the velocity in the unit configured on the path object.

Profile position at start of path Profile position at end of path

These two values determine the area within the definition range of the cam (x axis) that is mapped by scaling to the length of the programmed path. Enter the values as signed floating-point numbers. See Input field (Page 71)

Page 454: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 454 Programming and Operating Manual, 03/2007

5.8.1.4 Overview of parameters for Traverse path linearly – Path-synchronous motion tab

Table 5-264 Overview of parameters for Traverse path linearly – Path-synchronous motion tab

Field/Button Explanation/instructions Here, you specify values for the motion of the additional positioning axis that is assigned

to the path object and is traversed synchronously with the path motion. Mode of path-synchronous motion

Here, you specify how the axis for path-synchronous motion should be traversed with the path motion: Absolute The programmed Position of path-synchronous motion is the end point of the path-synchronous motion. Relative The programmed Position of path-synchronous motion is the traversing distance of the path-synchronous motion. Output path length The path length (i.e. the distance covered by the path motion) is outputted linearly, beginning from zero, as the path-synchronous motion. Output path length added The path length (i.e. the distance covered by the path motion) added to the existing value at the beginning of the path motion is outputted as the path-synchronous motion. Preassignment See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.w.mode

Direction of synchronous path motion

Select the direction of the path-synchronous motion. The direction must be specified in the following cases: • The Mode of path-synchronous motion is relative • The axis for the path-synchronous motion is a modulo axis. Positive The direction of motion is the positive direction of the axis. With relative motion, the sign of the position is ignored. Negative The direction of motion is the negative direction of the axis. With relative motion, the sign of the position is ignored. From position The direction of motion is determined by the sign of the Position of path-synchronous motion. Shortest path • With relative Mode of path-synchronous motion: The direction of motion is determined

by the sign of the Position of path-synchronous motion. • For modulo axes: The direction of motion is the direction in which the programmed

target position can be reached via the shortest path. Preassignment See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.w.direction

Page 455: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 455

Field/Button Explanation/instructions Position of path-synchronous motion

This parameter is evaluated only for the following settings for Mode of path-synchronous motion and has different meanings: • Absolute: End point of the path-synchronous motion. • Relative: Traversing distance of the path-synchronous motion. Enter the values as signed floating-point numbers. See Input field (Page 71)

5.8.1.5 Overview of parameters for Traverse path linearly – Expert tab

Table 5-265 Overview of parameters for Traverse path linearly – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT, for a description, see Return value for the system functions of the technology packages (Page 82).

Page 456: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 456 Programming and Operating Manual, 03/2007

5.8.1.6 Relevant system function for Traverse path linearly Path technology package: • _movePathLinear

Overview of parameters for Traverse path linearly / _movePathLinear

Table 5-266 Parameters (MCC Traverse path linearly command compared to _movePathLinear system function)

Parameters of the MCC Traverse path linearly command

Parameters of the _movePathLinear system function

Path object pathObject Transition behavior mergeMode Delay program execution nextCommand Parameters tab Path plane pathPlane Mode pathMode Target coordinate X x Target coordinate Y y Target coordinate Z z Blending blendingMode Dynamic response tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Dynamic response adaptation dynamicAdaption Specific velocity profile specificVelocityProfile Cam profileReference Profile position at start of path profileStartPosition Profile position at end of path profileEndPosition Synchronous axis tab Synchronous axis mode wMode Synchronous axis direction wDirection Synchronous axis position w Expert tab CommandID variable commandId Return variable –

Page 457: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 457

5.8.2 Traverse path circularly

This function is available in SIMOTION kernel Version 4.1 and higher. This command moves the path axes interconnected with the specified path object on an arc to an end point. You can define the arc as follows: • With the end point of the motion and the radius and orientation of the arc (enables only

two-dimensional motion in one of the main Cartesian planes) • With the center and angle of the arc (enables only two-dimensional motion in one of the

main Cartesian planes) • With the intermediate and endpoint of the motion (enables three-dimensional or two-

dimensional motion in one of the main Cartesian planes) The center, intermediate point, and end point can be specified as absolute or relative.

Figure 5-104 Parameter screen form: Traverse path circularly

See also the SIMOTION Motion Control Function Manual, Technology object, Path interpolation.

Page 458: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 458 Programming and Operating Manual, 03/2007

5.8.2.1 Overview of parameters for Traverse path circularly

Table 5-267 Overview of parameters for Traverse path circularly

Field/Button Explanation/instructions Path object In Path object, select the path object whose assigned path axes are to be traversed to the

end point. The list contains: • All path objects that are defined on the relevant device. The path objects are defined

in the PATH OBJECTS folder in the project navigator. • All variables with the following data type of a technology object declared in the MCC

source file or MCC chart (see Technology object data types (Page 95)): _pathObjectType.

Parameters tab See Overview of parameters for Traverse path circularly - Parameters tab (Page 458) Dynamic response tab See Overview of parameters for Traverse path circularly - Dynamic response tab

(Page 462) Synchronous axis tab See Overview of parameters for Traverse path circularly - Path-synchronous motion tab

(Page 464) Expert tab See Overview of parameters for Traverse path circularly - Expert tab (Page 465) Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the path object or on the axes involved. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command (Page 78).

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition) (Page 79).

5.8.2.2 Overview of parameters for Traverse path circularly – Parameters tab

Table 5-268 Overview of parameters for Traverse path circularly – Parameters tab

Field/Button Explanation/instructions Path plane Here, you select whether the motion is to be carried out in three dimensions (3D) or two

dimensions (2D). X-Y-Z Three-dimensional motion X-Y main plane Y-Z main plane Z-X main plane Two-dimensional motion in the selected main plane of the basic (Cartesian) coordinate system. The target coordinate located outside the selected plane is ignored. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.plane

Page 459: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 459

Field/Button Explanation/instructions Mode This parameter is evaluated only for:

• Circle specified using radius, end point, and orientation • Circle specified using intermediate and end point The meaning of the subsequently programmed target coordinates is defined in more detail here. Absolute The programmed target coordinates refer to the zero point of the basic coordinate system. Relative The programmed target coordinates refer to the path position within the basic coordinate system when the path command is executed (point in time of change). Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.mode

Target coordinates X, Y, Z

These parameters are evaluated only for: • Circle specified using radius, end point, and orientation • Circle specified using intermediate and end point The end point of the motion is specified here. The meaning depends on the Mode parameter (see above): • Absolute mode: Absolute coordinates with respect to the zero point of the basic

coordinate system. • Relative mode: Relative coordinates with respect to the path position within the basic

coordinate system when the path command is executed (point in time of change). Enter the values as signed floating-point numbers. See Input field (Page 71)

Page 460: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 460 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Blending This parameter is evaluated only for:

• Attach transition behavior or • Attach transition behavior and discard pending command. With blending, the path segment programmed with this command can be linked to the previous path segment to form one complete path with no stop. At the transition, the system provides for a constant path velocity and a constant path acceleration. Active with dynamic response adaptation The dynamic response limit values of the individual path axes are also applied in the blending area. For this reason, the path velocity is nearly reduced to zero at transitions of path segments during which the pitches or curvatures are not applied smoothly. Active without dynamic response adaptation In the blending area, path interpolation takes into account only the scalar dynamic response limit values of the path (path velocity, path acceleration and jerk). The dynamic response limit values specific to the axes are first taken into account during movement of the individual path axes. For this reason, deviations from the path, specific to the axes, can occur at transitions of path segments during which the pitches or curvatures are not applied smoothly. Inactive The motion programmed with this command does not begin until the setpoint interpolation of the previous command is complete and its motion has reached the target coordinates. The path velocity and path acceleration are therefore zero at the transition. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.blending.mode

Circle specified via Here, you select the characteristic values specifying the arc to be traversed. Radius, end point, and orientation Only 2D interpolation is possible in the main plane of the coordinate system selected in the Path plane parameter. The end point specified with the target coordinates is approached on an arc starting from the current position. You define the arc with its radius and circular orientation. Note that for the circular orientation, in addition to the direction of rotation, you must specify whether traversing is to be performed along the large or small arc. Center and angle Only 2D interpolation is possible in the main plane of the coordinate system selected in the Path plane parameter. Starting from the current position, an arc is traversed. You define this arc by its center coordinates, the angle, and the circular orientation. Intermediate and end point 2D and 3D interpolation is possible. The end point specified with the target coordinates is approached on an arc starting from the current position. You define the arc using an intermediate point that you specify with its intermediate point coordinates. With 3D interpolation, you define the path plane through the current position at the beginning of the path, the intermediate point and the end point. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.circularType

Page 461: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 461

Field/Button Explanation/instructions Circular orientation This parameter is evaluated only for:

• Circle specified using radius, end point, and orientation • Circle specified using center and angle Here, you enter the orientation of the arc. Positive(default value) Positive direction of rotation in the selected main plane. For circle specification using radius, end point, and orientation, the angle traveled is less than or equal to 180 . Negative Negative direction of rotation in the selected main plane. For circle specification using radius, end point, and orientation, the angle traveled is less than or equal to 180 . Positive on large arc Positive direction of rotation in the selected main plane. For circle specification using radius, end point, and orientation, the angle traveled is greater than or equal to 180 . Negative on large arc Negative direction of rotation in the selected main plane. For circle specification using radius, end point, and orientation, the angle traveled is greater than or equal to 180 .

Intermediate point mode This parameter is evaluated only for: • Circle specified using center and angle • Circle specified using intermediate and end point The meaning of the subsequently programmed center and intermediate point coordinates is defined in more detail here. Absolute The programmed center and intermediate point coordinates refer to the zero point of the basic coordinate system. Relative The programmed center and intermediate coordinates refer to the path position within the basic coordinate system when the path command is executed (point in time of change). As end point coordinate The setting from the Mode parameter is taken for the programmed center and intermediate point coordinates. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.ijkMode

Center coordinates Center point coordinates I, J, K

These parameters are evaluated only for: • Circle specified using center and angle • Circle specified using intermediate and end point Here, you specify the center of the arc and the intermediate point of the circular motion. The meaning depends on the Intermediate point mode parameter (see above): • Intermediate point absolute mode: Absolute coordinates with respect to the zero point

of the basic coordinate system. • Intermediate point relative mode: Relative coordinates with respect to the path

position within the basic coordinate system when the path command is executed (point in time of change).

Enter the values as signed floating-point numbers. See Input field (Page 71)

Page 462: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 462 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Angle The parameter is evaluated only for circle specification with center point and angle:

Here, you specify the angle of rotation of arc I Enter the value as a signed floating-point number. See Input field (Page 71)

Radius The parameter is evaluated only for circle specification with radius, end point, and orientation: Here, you specify the radius of the arc. Enter the value as a signed floating-point number. See Input field (Page 71)

5.8.2.3 Overview of parameters for Traverse path circularly – Dynamic response tab

Table 5-269 Overview of parameters for Traverse path circularly – Dynamic response tab

Field/Button Explanation/instructions Here, you specify the dynamic response of the path motion.

In standard cases, you define the dynamic response by means of a velocity profile with the associated values for the velocity. Acceleration, deceleration, and jerk. A detailed description of these parameters is provided in Overview of parameters – Dynamic response tab (Page 73). Optionally, you can select a special velocity profile that is described by a cam.

Velocity The entered value acts during the constant velocity phase. This parameter is evaluated only when Special velocity profile = No. System variable for preassigned value: userDefault.pathDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. The parameter is evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variable for preassigned value: userDefault.pathDynamics.profile

Acceleration The entered value acts during the constant acceleration phase. The parameter is evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variable for preassigned value: userDefault.pathDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. The parameter is evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variable for preassigned value: userDefault.pathDynamics.negativeAccel

Page 463: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 463

Field/Button Explanation/instructions Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. The parameters are evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variables for preassigned value: userDefault.pathDynamics.positiveAccelStartJerk userDefault.pathDynamics.positiveAccelEndJerk userDefault.pathDynamics.negativeAccelStartJerk userDefault.pathDynamics.negativeAccelEndJerk

Dynamic response adaptation Here, you select whether the dynamic response limit values are to be taken into account during path interpolation. Inactive The dynamic response limit values of the individual path axes are not taken into account during path interpolation. However, they remain active, and an error is triggered if they are exceeded. This setting should only be selected if it is ensured by other means (e.g., an appropriate specific velocity profile) that the limit values will not be exceeded. Maximum axial dynamic response values without segmentation The dynamic response limit value of the individual path axes for velocity and acceleration are taken into account during path interpolation. If a positioning axis is configured for the path-synchronous motion, its dynamic response limit values are also included. Path velocity and path acceleration are adapted for the entire path motion if necessary. Maximum axial dynamic response values with segmentation The dynamic response limit value of the individual path axes for velocity and acceleration are taken into account during path interpolation. If a positioning axis is configured for the path-synchronous motion, its dynamic response limit values are also included. The path motion is divided up into individual segments, as determined by the system, if necessary. Within each segment, the path velocity and the path acceleration are adapted to the maximum axial dynamic response limit values. Preassignment See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.dynamicAdaption

Specific velocity profile Here, you select whether the path dynamic response is specified with the velocity profile defined above or with a velocity profile that is defined by a cam. No(default value) The path dynamic response is specified with the velocity profile defined above with the parameters: velocity profile, velocity, acceleration, deceleration, and jerk. Yes The path dynamic response is specified with a velocity profile that is defined by a cam.

Page 464: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 464 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Cam This field is only visible when Special velocity profile = Yes.

Here, you select the cam which defines the velocity profile. The following are available: • All cams that are defined on the relevant device. The cams are defined in the CAMS

folder in the project navigator. • All variables with the following data type of technology objects declared in the MCC

source file or MCC chart (see Technology object data types (Page 95)): camType. The Profile position at start of path and Profile position at end of path parameters are used to select an area within the definition range of the cam (x axis) that is mapped by scaling to the length of the programmed path. The value range (y axis) is interpreted as the velocity in the unit configured on the path object.

Profile position at start of path Profile position at end of path

These two values determine the area within the definition range of the cam (x axis) that is mapped by scaling to the length of the programmed path. Enter the values as signed floating-point numbers. See Input field (Page 71)

5.8.2.4 Overview of parameters for Traverse path circularly – Path-synchronous motion tab

Table 5-270 Overview of parameters for Traverse path circularly – Path-synchronous motion tab

Field/Button Explanation/instructions Here, you define values the motion of the additional positioning axis that is assigned to

the path object and is traversed synchronously with the path motion. Mode of path-synchronous motion

Here, you specify how the axis for path-synchronous motion should be traversed with the path motion: Absolute The programmed Position of path-synchronous motion is the end point of the path-synchronous motion. Relative The programmed Position of path-synchronous motion is the traversing distance of the path-synchronous motion. Output path length The path length (i.e. the distance covered by the path motion) is outputted linearly, beginning from zero, as the path-synchronous motion. Output path length added The path length (i.e. the distance covered by the path motion) added to the existing value at the beginning of the path motion is outputted as the path-synchronous motion. Preassignment See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.w.mode

Page 465: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 465

Field/Button Explanation/instructions Direction of synchronous path motion

Select the direction of the path-synchronous motion. The direction must be specified in the following cases: • The Mode of path-synchronous motion is relative • The axis for the path-synchronous motion is a modulo axis. Positive The direction of motion is the positive direction of the axis. With relative motion, the sign of the position is ignored. Negative The direction of motion is the negative direction of the axis. With relative motion, the sign of the position is ignored. From position The direction of motion is determined by the sign of the Position of path-synchronous motion. Shortest path • With relative Mode of path-synchronous motion: The direction of motion is determined

by the sign of the Position of path-synchronous motion. • For modulo axes: The direction of motion is the direction in which the programmed

target position can be reached via the shortest path. Preassignment See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.w.direction

Position of path-synchronous motion

This parameter is evaluated only for the following settings for Mode of path-synchronous motion and has different meanings: • Absolute: End point of the path-synchronous motion. • Relative: Traversing distance of the path-synchronous motion. Enter the values as signed floating-point numbers. See Input field (Page 71)

5.8.2.5 Overview of parameters for Traverse path circularly – Expert tab

Table 5-271 Overview of parameters for Traverse path circularly – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT, for a description, see Return value for the system functions of the technology packages (Page 82).

Page 466: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 466 Programming and Operating Manual, 03/2007

5.8.2.6 Relevant system function for Traverse path circularly Path technology package: • _movePathCircular

Overview of parameters for Traverse path circularly / _movePathCircular

Table 5-272 Parameters (MCC Traverse path circularly command compared to _movePathCircular system function)

Parameters of the MCC Traverse path circularly command

Parameters of the _movePathCircular system function

Path object pathObject Transition behavior mergeMode Delay program execution nextCommand Parameters tab Path plane pathPlane Mode pathMode Target coordinate X x Target coordinate Y y Target coordinate Z z Blending blendingMode Circle specified via circularType Circular orientation circleDirection Intermediate point mode ijkMode Center/intermediate point coordinate I i Center/intermediate point coordinate J j Center/intermediate point coordinate K k Angle arc Radius radius Dynamic response tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel Jerk positiveAccelStartJerkType, positiveAccelStartJerk,

positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Dynamic response adaptation dynamicAdaption Specific velocity profile specificVelocityProfile Cam profileReference Profile position at start of path profileStartPosition Profile position at end of path profileEndPosition Synchronous axis tab Synchronous axis mode wMode

Page 467: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 467

Parameters of the MCC Traverse path circularly command

Parameters of the _movePathCircular system function

Synchronous axis direction wDirection Synchronous axis position w Expert tab CommandID variable commandId Return variable –

5.8.3 Traverse path using polynomials

This function is available in SIMOTION kernel Version 4.1 and higher. This command moves the path axes interconnected with the specified path object on a path described by a fifth order polynomial. P(q)= a0 + a1q + a2q2 + a3q3 + a4q4 +a5q5, where q ∈ [0, 1]. Here the polynomial coefficients a0 to a5 are three-dimensional vectors. You may specify these in the following ways: • By calculation from geometric data

In this case you specify the following values: – Starting point (current position) and end point (target coordinates) – First geometric derivative (tangential vector) and second geometric derivative

(curvature vector) at the starting point – First geometric derivative (tangential vector) and second geometric derivative

(curvature vector) at the end point. You can select how the first and second geometric derivatives are specified at the starting point: – With explicit specification of values – By accepting the corresponding values at the end point of the previous path command The polynomial coefficients a0 to a5 are calculated from this geometric data. System functions are available for performing a geometric analysis of paths (e.g. determining the geometric derivatives at specified points).

• By direct specification of the polynomial coefficients In this case you specify the following values: – The starting point (current position) corresponds to P(0). – The end point (target coordinates) corresponds to P(1). – The polynomial coefficients a2, a3, a4 and a5.

Page 468: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 468 Programming and Operating Manual, 03/2007

The polynomial coefficients a0 and a1 are calculated from this data: – a0 = P(0) – a1 = P(1) - P(0) - a2 - a3 - a4 -a5.

The end point entered can be absolute or relative.

Figure 5-105 Parameter screen form: Traverse path using polynomials

See also the SIMOTION Motion Control Function Manual, Technology object, Path interpolation.

Page 469: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 469

5.8.3.1 Overview of parameters for Traverse path using polynomials

Table 5-273 Overview of parameters for Traverse path using polynomials

Field/Button Explanation/instructions Path object In Path object, select the path object whose assigned path axes are to be traversed to the

end point. The list contains: • All path objects that are defined on the relevant device. The path objects are defined

in the PATH OBJECTS folder in the project navigator. • All variables with the following data type of a technology object declared in the MCC

source file or MCC chart (see Technology object data types (Page 95)): _pathObjectType.

Parameters tab See Overview of parameters for Traverse path using polynomials - Parameters tab (Page 469)

Dynamic response tab See Overview of parameters for Traverse path using polynomials - Dynamic response tab (Page 472)

Synchronous axis tab See Overview of parameters for Traverse path using polynomials - Path-synchronous motion tab (Page 475)

Expert tab See Overview of parameters for Traverse path using polynomials - Expert tab (Page 476) Transition behavior Here, you program the transition behavior between the programmed command and the

command currently active on the axes involved. The selected behavior determines the position of the command in the command queue. See also Transition behavior from the currently active motion command (Page 78).

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition) (Page 79).

5.8.3.2 Overview of parameters for Traverse path using polynomials – Parameters tab

Table 5-274 Overview of parameters for Traverse path using polynomials – Parameters tab

Field/Button Explanation/instructions Path plane Here, you select whether the motion is to be carried out in three dimensions (3D) or two

dimensions (2D). X-Y-Z Three-dimensional motion X-Y main plane Y-Z main plane Z-X main plane Two-dimensional motion in the selected main plane of the basic (Cartesian) coordinate system. The target coordinate located outside the selected plane is ignored. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.plane

Page 470: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 470 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Mode The meaning of the subsequently programmed target coordinates is defined in more

detail here. Absolute The programmed target coordinates refer to the zero point of the basic coordinate system. Relative The programmed target coordinates refer to the path position within the basic coordinate system when the path command is executed (point in time of change). current axis position and specify the (straight) traversing path. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.mode

Target coordinates X, Y, Z

The end point of the motion is specified here. The meaning depends on the Mode parameter (see above): • Absolute mode: Absolute coordinates with respect to the zero point of the basic

coordinate system. • Relative mode: Relative coordinates with respect to the path position within the basic

coordinate system when the path command is executed (point in time of change). Enter the values as signed floating-point numbers. See Input field (Page 71)

Blending This parameter is evaluated only for: • Attach transition behavior or • Attach transition behavior and discard pending command. With blending, the path segment programmed with this command can be linked to the previous path segment to form one complete path with no stop. At the transition, the system provides for a constant path velocity and a constant path acceleration. Active with dynamic response adaptation Path interpolation takes into account the dynamic response limit values of the individual path axes in the blending area as well. For this reason, the path velocity is nearly reduced to zero at transitions of path segments during which the pitches or curvatures are not applied smoothly. Active without dynamic response adaptation In the blending area, path interpolation takes into account only the scalar dynamic response limit values of the path (path velocity, path acceleration and jerk). The dynamic response limit values specific to the axes are first taken into account during movement of the individual path axes. For this reason, deviations from the path, specific to the axes, can occur at transitions of path segments during which the pitches or curvatures are not applied smoothly. Inactive The motion programmed with this command does not begin until the setpoint interpolation of the previous command is complete and its motion has reached the target coordinates. The path velocity and path acceleration are therefore zero at the transition. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.blending.mode

Page 471: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 471

Field/Button Explanation/instructions Polynomial specified via Here you select how the fifth order polynomial that describes the motion path is specified.

Explicit specification of starting point data The polynomial is calculated from geometric data. Specify explicitly: • Starting point (current position) and end point (target coordinates) • First geometric derivative (tangential vector) and second geometric derivative

(curvature vector) at the starting point • First geometric derivative (tangential vector) and second geometric derivative

(curvature vector) at the end point. System functions are available for performing a geometric analysis of paths (e.g. determining the geometric derivatives at specified points). Attach continuously The polynomial is calculated from geometric data. Specify explicitly: • Starting point (current position) and end point (target coordinates) • First geometric derivative (tangential vector) and second geometric derivative

(curvature vector) at the end point. The first geometric derivative (tangential vector) and the second geometric derivative (curvature vector) at the starting point (current position) are set equal to the geometric derivatives at the end point of the previous path command. If the geometric derivatives cannot be determined in the start point (if no current motion is available), the command is not executed and error message 50002 "Calculation of the geometry element not possible, reason 3" is outputted. System functions are available for performing a geometric analysis of paths (e.g. determining the geometric derivatives at specified points). Direct specification of the polynomial coefficients Specify the polynomial coefficients explicitly through the following values: • Starting point P(0) (current position). • End point P(1) (target coordinates). • Polynomial coefficients a2, a3, a4 and a5. The polynomial coefficients a0 and a1 are calculated from this data: • a0 = P(0) • a1 = P(1) - P(0) - a2 - a3 - a4 -a5. Preassigned value (default value) See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.polynomialMode

First geometric derivative at the starting point X, Y, Z

This parameter is evaluated only with polynomial specification via explicit specification of the starting point data. Here, you specify the first geometric derivative (tangential vector) at the starting point (current position). Enter the values as signed floating-point numbers. See Input field (Page 71)

Second geometric derivative at the starting point X, Y, Z

This parameter is evaluated only with polynomial specification via explicit specification of the starting point data. Here, you specify the second geometric derivative (curvature vector) at the starting point (current position). Enter the values as signed floating-point numbers. See Input field (Page 71)

Page 472: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 472 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions First geometric derivative at the end point X, Y, Z

This parameter is evaluated only with polynomial specification via explicit specification of the starting point data and attach continuously. Here, you specify the first geometric derivative (tangential vector) at the end point (target coordinates). Enter the values as signed floating-point numbers. See Input field (Page 71)

Second geometric derivative at the end point X, Y, Z

This parameter is evaluated only with polynomial specification via explicit specification of the starting point data and Attach continuously. Here, you specify the second geometric derivative (curvature vector) at the end point (target coordinates). Enter the values as signed floating-point numbers. See Input field (Page 71)

Coefficient a2 X, Y, Z Coefficient a3 X, Y, Z Coefficient a4 X, Y, Z Coefficient a5 X, Y, Z

These parameters are evaluated only with polynomial specification via direct specification of the polynomial coefficients. Here you specify the coefficients a2, a3, a4 and a5 of the fifth order polynomial. Enter the values as signed floating-point numbers. See Input field (Page 71)

5.8.3.3 Overview of parameters for Traverse path using polynomials – Dynamic response tab

Table 5-275 Overview of parameters for Traverse path using polynomials – Dynamic response tab

Field/Button Explanation/instructions Here, you specify the dynamic response of the path motion.

In standard cases, you define the dynamic response by means of a velocity profile with the associated values for the velocity. Acceleration, deceleration, and jerk. A detailed description of these parameters is provided in Overview of parameters – Dynamic response tab (Page 73). Optionally, you can select a special velocity profile that is described by a cam.

Velocity The entered value acts during the constant velocity phase. This parameter is evaluated only when Special velocity profile = No. System variable for preassigned value: userDefault.pathDynamics.velocity

Velocity profile In this field, you define the transitions between the individual motion phases. The parameter is evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variable for preassigned value: userDefault.pathDynamics.profile

Page 473: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 473

Field/Button Explanation/instructions Acceleration The entered value acts during the constant acceleration phase.

The parameter is evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variable for preassigned value: userDefault.pathDynamics.positiveAccel

Deceleration The entered value acts during the constant deceleration phase. The parameter is evaluated only in the following cases: • When Special velocity profile = No • If Special velocity profile = Yes and when accelerating to the velocity specified in the

special velocity profile. System variable for preassigned value: userDefault.pathDynamics.negativeAccel

Jerk The entered value limits the change in the acceleration or deceleration at the start and end of the respective phase. The parameters are evaluated only in the following cases: • When Special velocity profile = No • When Special velocity profile = Yes and when accelerating to the velocity specified in

the special velocity profile. System variables for preassigned value: userDefault.pathDynamics.positiveAccelStartJerk userDefault.pathDynamics.positiveAccelEndJerk userDefault.pathDynamics.negativeAccelStartJerk userDefault.pathDynamics.negativeAccelEndJerk

Dynamic response adaptation Here, you select whether the dynamic response limit values are to be taken into account during path interpolation. Inactive The dynamic response limit values of the individual path axes are not taken into account during path interpolation. However, they remain active, and an error is triggered if they are exceeded. This setting should only be selected if it is ensured by other means (e.g., an appropriate specific velocity profile) that the limit values will not be exceeded. Maximum axial dynamic response values without segmentation The dynamic response limit value of the individual path axes for velocity and acceleration are taken into account during path interpolation. If a positioning axis is configured for the path-synchronous motion, its dynamic response values are also included. Path velocity and path acceleration are adapted for the entire path motion if necessary. Maximum axial dynamic response values with segmentation The dynamic response limit value of the individual path axes for velocity and acceleration are taken into account during path interpolation. If a positioning axis is configured for the path-synchronous motion, its dynamic response values are also included. The path motion is divided up into individual segments, as determined by the system, if necessary. Within each segment, the path velocity and the path acceleration are adapted to the maximum axial dynamic response values. Preassignment See Selection list (combo box) (Page 71). System variable for preassigned value: userDefault.path.dynamicAdaption

Page 474: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 474 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Specific velocity profile Here, you select whether the path dynamic response is specified with the velocity profile

defined above or with a velocity profile that is defined by a cam. No(default value) The path dynamic response is specified with the velocity profile defined above with the parameters: velocity profile, velocity, acceleration, deceleration, and jerk. Yes The path dynamic response is specified with a velocity profile that is defined by a cam.

Cam This field is only visible when Special velocity profile = Yes. Here, you select the cam which defines the velocity profile. The following are available: • All cams that are defined on the relevant device. The cams are defined in the CAMS

folder in the project navigator. • All variables with the following data type of technology objects declared in the MCC

source file or MCC chart (see Technology object data types (Page 95)): camType. The Profile position at start of path and Profile position at end of path parameters are used to select an area within the definition range of the cam (x axis) that is mapped by scaling to the length of the programmed path. The value range (y axis) is interpreted as the velocity in the unit configured on the path object.

Profile position at start of path Profile position at end of path

These two values determine the area within the definition range of the cam (x axis) that is mapped by scaling to the length of the programmed path. Enter the values as signed floating-point numbers. See Input field (Page 71)

Page 475: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 475

5.8.3.4 Overview of parameters for Traverse path using polynomials – Path-synchronous motion tab

Table 5-276 Overview of parameters for Traverse path using polynomials – Path-synchronous motion tab

Field/Button Explanation/instructions Here, you define values the motion of the additional positioning axis that is assigned to

the path object and is traversed synchronously with the path motion. Mode of path-synchronous motion

Here, you specify how the axis for path-synchronous motion should be traversed with the path motion: Absolute The programmed Position of path-synchronous motion is the end point of the path-synchronous motion. Relative The programmed Position of path-synchronous motion is the traversing distance of the path-synchronous motion. Output path length The path length (i.e. the distance covered by the path motion) is outputted linearly, beginning from zero, as the path-synchronous motion. Output path length added The path length (i.e. the distance covered by the path motion) added to the existing value at the beginning of the path motion is outputted as the path-synchronous motion. Preassignment See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.w.mode

Direction of synchronous path motion

Select the direction of the path-synchronous motion. The direction must be specified in the following cases: • The Mode of path-synchronous motion is relative • The axis for the path-synchronous motion is a modulo axis. Positive The direction of motion is the positive direction of the axis. With relative motion, the sign of the position is ignored. Negative The direction of motion is the negative direction of the axis. With relative motion, the sign of the position is ignored. From position The direction of motion is determined by the sign of the Position of path-synchronous motion. Shortest path • With relative Mode of path-synchronous motion: The direction of motion is determined

by the sign of the Position of path-synchronous motion. • For modulo axes: The direction of motion is the direction in which the programmed

target position can be reached via the shortest path. Preassignment See Selection list (combo box) (Page 71) System variable for preassigned value: userDefault.w.direction

Page 476: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 476 Programming and Operating Manual, 03/2007

Field/Button Explanation/instructions Position of path-synchronous motion

This parameter is evaluated only for the following settings for Mode of path-synchronous motion and has different meanings: • Absolute: End point of the path-synchronous motion. • Relative: Traversing distance of the path-synchronous motion. Enter the values as signed floating-point numbers. See Input field (Page 71)

5.8.3.5 Overview of parameters for Traverse path using polynomials – Expert tab

Table 5-277 Overview of parameters for Traverse path using polynomials – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT, for a description, see Return value for the system functions of the technology packages (Page 82).

5.8.3.6 Relevant system function for Traverse path using polynomials Path technology package: • _movePathPolynomial

Overview of parameters for Traverse path using polynomials / _movePathPolynomial

Table 5-278 Parameters (MCC Traverse path using polynomials command compared to _movePathPolynomial system function)

Parameters of the MCC Traverse path using polynomials command

Parameters of the _movePathPolynomial system function

Path object pathObject Transition behavior mergeMode Delay program execution nextCommand Parameters tab Path plane pathPlane Mode pathMode Target coordinate X x Target coordinate Y y Target coordinate Z z Blending blendingMode

Page 477: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 477

Parameters of the MCC Traverse path using polynomials command

Parameters of the _movePathPolynomial system function

Polynomial specified via polynomialMode First derivative at starting point X vector1x First derivative at starting point Y vector1y First derivative at starting point Z vector1z Second derivative at starting point X vector2x Second derivative at starting point Y vector2y Second derivative at starting point Z vector2z First derivative at end point X Dependent on Polynomial specified via parameter:

• With Explicit specification of starting point data: vector3x • With Attach continuously: vector1x

First derivative at end point Y Dependent on Polynomial specified via parameter: • With Explicit specification of starting point data: vector3y • With Attach continuously: vector1y

First derivative at end point Z Dependent on Polynomial specified via parameter: • With Explicit specification of starting point data: vector3z • With Attach continuously: vector1z

Second derivative at end point X Dependent on Polynomial specified via parameter: • With Explicit specification of starting point data: vector4x • With Attach continuously: vector2x

Second derivative at end point Y Dependent on Polynomial specified via parameter: • With Explicit specification of starting point data: vector4y • With Attach continuously: vector2y

Second derivative at end point Z Dependent on Polynomial specified via parameter: • Explicit specification of starting point data: vector4z • Attach continuously: vector2z

Coefficient a2 X vector1x Coefficient a2 Y vector1y Coefficient a2 Z vector1z Coefficient a3 X vector2x Coefficient a3 Y vector2y Coefficient a3 Z vector2z Coefficient a4 X vector3x Coefficient a4 Y vector3y Coefficient a4 Z vector3z Coefficient a5 X vector4x Coefficient a5 Y vector4y Coefficient a5 Z vector4z Dynamic response tab Velocity velocityType, velocity Velocity profile velocityProfile Acceleration positiveAccelType, positiveAccel Deceleration negativeAccelType, negativeAccel

Page 478: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 478 Programming and Operating Manual, 03/2007

Parameters of the MCC Traverse path using polynomials command

Parameters of the _movePathPolynomial system function

Jerk positiveAccelStartJerkType, positiveAccelStartJerk, positiveAccelEndJerkType, positiveAccelEndJerk, negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Dynamic response adaptation dynamicAdaption Specific velocity profile specificVelocityProfile Cam profileReference Profile position at start of path profileStartPosition Profile position at end of path profileEndPosition Synchronous axis tab Synchronous axis mode wMode Synchronous axis direction wDirection Synchronous axis position w Expert tab CommandID variable commandId Return variable –

Page 479: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 479

5.8.4 Stop path motion

This function is available in SIMOTION kernel Version 4.1 and higher. This command stops the current path motion (including the path-synchronous motion) with the programmed dynamic response parameters (deceleration ramp). You can choose whether the motion is aborted: • Stop without abort: The motion can be resumed with the Continue path motion

(Page 483) command. • Stop with abort: The motion cannot be continued. The last calculated positions of each path axis and the synchronous axis (setpoint values) are stored in the abortPosition system variable.

Figure 5-106 Parameter screen form: Stop path motion

See also the SIMOTION Motion Control Function Manual, Technology object, Path interpolation.

Page 480: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 480 Programming and Operating Manual, 03/2007

5.8.4.1 Overview of parameters for Stop path motion

Table 5-279 Overview of parameters for Stop path motion

Field/Button Explanation/instructions Path object In Path object, select the path object whose assigned axes (path axes and synchronous

axis) are to be stopped. The list contains: • All path objects that are defined on the relevant device. The path objects are defined

in the PATH OBJECTS folder in the project navigator. • All variables with the following data type of a technology object declared in the MCC

source file or MCC chart (see Technology object data types (Page 95)): _pathObjectType.

Parameters tab See Overview of parameters for Stop path motion - Parameters tab (Page 480) Dynamic response tab See Overview of parameters for Stop path motion - Dynamic response tab (Page 481) Expert tab See Overview of parameters for Stop path motion - Expert tab (Page 481) Stop behavior Specifies when the command takes effect relative to the motion.

Stop path immediately The active path motion is substituted immediately. All motion commands still pending in the command buffer are deleted. Stop at the end of the path command. Not relevant.

Delay program execution • Select the check box if you wish the system to delay execution of the following command in the MCC chart until the selected condition has been satisfied.

If the check box is not selected, the next command is executed immediately. • Select the condition that has to be satisfied before the system continues execution of

the following command in the MCC chart. See also Delay program execution (step enabling condition) (Page 79).

5.8.4.2 Overview of parameters for Stop path motion – Parameters tab

Table 5-280 Overview of parameters for Stop path motion – Parameters tab

Field/Button Explanation/instructions Stop mode Select a stop mode here. The path motion is stopped with the programmed dynamic

response parameters (Dynamic response tab (Page 481)). The last calculated positions (setpoint values) of the path axes and the synchronous axis assigned to the path object are stored in the abortPosition system variable. Stop without abort (default value) The motion can be continued with the Continue path motion command. Stop with abort The motion cannot be continued.

Page 481: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 481

5.8.4.3 Overview of parameters for Stop path motion – Dynamic response tab

Table 5-281 Overview of parameters for Stop path motion – Dynamic response tab

Field/Button Explanation/instructions The Dynamic response tab is described in detail in Overview of parameters for Dynamic

response tab (Page 73). Velocity profile In this field, you define the transitions between the individual motion phases.

System variable for preassigned value: userDefault.pathDynamics.profile Deceleration The entered value acts during the constant deceleration phase.

System variable for preassigned value: userDefault.pathDynamics.negativeAccel Jerk The entered value limits the change in the acceleration or deceleration at the start and

end of the respective phase. System variables for preassigned value: userDefault.pathDynamics.positiveAccelEndJerk userDefault.pathDynamics.negativeAccelStartJerk userDefault.pathDynamics.negativeAccelEndJerk

5.8.4.4 Overview of parameters for Stop path motion – Expert tab

Table 5-282 Overview of parameters for Stop path motion – Expert tab

Field/Button Explanation/instructions The Expert tab is described in detail in Overview of parameters for Expert tab (Page 75). CommandID variable If you enter the name of a variable of data type CommandIdType, you can track the

command status with this variable. Return variable If you enter the name of a variable of the specified data type, you can use this variable to

find out the result of the command call. Data type DINT, for a description, see Return value for the system functions of the technology packages (Page 82).

Page 482: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 482 Programming and Operating Manual, 03/2007

5.8.4.5 Relevant system functions for Stop path motion Path technology package: • _stopPath

Overview of parameters for Stop path motion / _stopPath

Table 5-283 Parameters (MCC Stop path motion command compared to _stopPath system function)

Parameters of the MCC Stop path motion command

Parameters of the _stopPath system function

Path object pathObject Stop behavior mergeMode Delay program execution nextCommand Parameters tab Stop mode stopMode Dynamic response tab Velocity profile velocityProfile Deceleration negativeAccelType, negativeAccel Jerk positiveAccelEndJerkType, positiveAccelEndJerk,

negativeAccelStartJerkType, negativeAccelStartJerk, negativeAccelEndJerkType, negativeAccelEndJerk

Expert tab CommandID variable commandId Return variable –

Page 483: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 483

5.8.5 Continue path motion

This function is available in SIMOTION kernel Version 4.1 and higher. This command continues a path motion that has been stopped. It is only possible to continue path motions that were stopped with the Stop without abort stop mode. During the time between the interruption and the continuation, the path object and all axes (path axes and axes for path-synchronous motion) assigned to it are not permitted to receive any new motion commands. The dynamic response parameters of the interrupted command are used when the motion is continued.

Figure 5-107 Parameter screen form: Continue path motion

See also the SIMOTION Motion Control Function Manual, Technology object, Path interpolation.

Page 484: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

MCC commands 5.8 Commands for path interpolation

SIMOTION MCC Motion Control Chart 484 Programming and Operating Manual, 03/2007

5.8.5.1 Overview of parameters: Continue path motion

Table 5-284 Overview of parameters: Continue path motion

Field/Button Explanation/instructions Path object In Path object, select the path object for which the motion of the assigned axes (path

axes and synchronous axis) is to be continued. The list contains: • All path objects that are defined on the relevant device. The path objects are defined

in the PATH OBJECTS folder in the project navigator. • All variables with the following data type of a technology object declared in the MCC

source file or MCC chart (see Technology object data types (Page 95)): _pathObjectType.

CommandID variable Enter the name of a variable of data type CommandIdType here. With the help of this variable, you can, for example, trace back the status of the command. Variables of data type CommandIdType declared in the MCC source file or MCC chart are provided for selection. If you leave the CommandID variable field empty, the CommandID is not assigned to any variables; this means that you cannot access the CommandID (standard). See also Overview of parameters for the Expert tab (Page 75).

Return variable If you enter the name of a variable of the specified data type, you can use this variable to find out the result of the command call. Data type DINT, for a description, see Return value for the system functions of the technology packages (Page 82).

Delay program execution Select the check box if you wish to delay execution of the following command until the current command has been completed. If the check box is not selected, the next command is executed immediately.

5.8.5.2 Relevant system function for Continue path motion Path technology package: • _continuePath

Overview of parameters for Continue path motion, _continuePath

Table 5-285 Parameters (MCC Continue path motion command compared to _continuePath system function)

Parameters of the MCC Continue path motion command

Parameters of the _continuePath system function

Path object pathObject CommandID variable commandId Return variable – Delay program execution nextCommand

Page 485: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007, xxx 485

Commissioning (software) 66.1 Assigning programs to a task and downloading them to the target

system

6.1.1 Assigning programs to a task Programs must be assigned to a task before they can be downloaded to the target system (the SIMOTION device). Various tasks are made available by SIMOTION, each with different priorities or system responses (e.g. during initialization). The Execution levels and tasks in SIMOTION table contains a brief description of the available tasks. For further information, refer to the SIMOTION Motion Control Basic Functions Description of Functions.

Note Programs need only be assigned to a task once; this assignment is retained if the program is recompiled.

Assigning programs to a task: 1. In the project navigator double-click the EXECUTION SYSTEM object below the required

SIMOTION device. The window for configuring the execution system is displayed. See figure below.

2. Select the required task (e.g. MotionTask_1) from the left pane. 3. Select the Program assignment tab. 4. Select the program to be assigned from the Programs list. 5. Click the >> button. 6. Select the Task Configuration tab, and specify any other required settings for the task

there.

Page 486: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Commissioning (software) 6.1 Assigning programs to a task and downloading them to the target system

SIMOTION MCC Motion Control Chart 486 Programming and Operating Manual, 03/2007

Figure 6-1 Configure execution system

Figure 6-2 Assigning a program to a motion task

Page 487: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Commissioning (software) 6.1 Assigning programs to a task and downloading them to the target system

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 487

6.1.1.1 Execution levels and tasks in SIMOTION

Execution level Description Time-controlled Cyclic tasks, automatically restarted once assigned programs have

been executed. • SynchronousTasks Tasks are started periodically, synchronous with specified system cycle

clock. • ServoSynchronousTask: Synchronous with position-control cycle

clock • IPOsynchronousTask: Synchronous with interpolator cycle clock

IPO • IPOsynchronousTask_2: Synchronous with interpolator cycle clock

IPO_2 • PWMsynchronousTask: Synchronous with PWM cycle clock

(for TControl technology package) • InputSynchronousTask_1: Synchronous with Input1 cycle clock

(for TControl technology package) • InputSynchronousTask_2: Synchronous with Input2 cycle clock

(for TControl technology package) • PostControlTask_1: Synchronous with Control1 cycle clock

(for TControl technology package) • PostControlTask_2: Synchronous with Control2 cycle clock

(for TControl technology package) • TimerInterruptTasks Tasks are started periodically in a fixed time frame. This time frame

must be a multiple of interpolator cycle clock IPO. Interrupts Sequential tasks, executed once after start and then terminated. • SystemInterruptTasks Started when a system event occurs:

• ExecutionFaultTask: Error processing a program • PeripheralFaultTask: Error on I/O • TechnologicalFaultTask: Error on the technology object • TimeFaultBackgroundTask: BackgroundTask timeout • TimeFaultTask: TimerInterruptTask timeout

• UserInterruptTasks Tasks are started when a user-defined event occurs. Round robin MotionTasks and BackgroundTasks share the free time remaining after

execution of the higher-priority system and user tasks. The proportion of the two levels can be assigned.

• MotionTasks Sequential tasks, executed once after start and then terminated. Start takes place: • Explicitly via a task control command in a program assigned to

another task. • Automatically when RUN mode is attained if the corresponding

attribute was set during task configuration. The priority of a MotionTask can be temporarily increased using the Wait for... functions.

• BackgroundTask Cyclic task, restarted automatically once the assigned programs have been executed; task cycle time depends on runtime.

StartupTask Task is executed once when there is a transition from STOP or STOP U mode to RUN mode. SystemInterruptTasks are started by their triggering system event.

Page 488: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Commissioning (software) 6.1 Assigning programs to a task and downloading them to the target system

SIMOTION MCC Motion Control Chart 488 Programming and Operating Manual, 03/2007

Execution level Description ShutdownTask Task is executed once when there is a transition from RUN mode to

STOP or STOP U mode. STOP or STOP U mode is reached by: • Activating the operating mode switch • Calling the relevant system function, for example, MCC Change

operating mode command • Occurrence of a fault with the appropriate error response SystemInterruptTasks and PeripheralFaultTasks are started by their triggering system event.

For information on behavior of sequential and cyclic tasks: • During initialization of local program variables: see Variable type and timing of variable

initialization. • In the event of execution errors in the program, see SIMOTION ST Programming Manual. For information about access options for the process image and I/O variables: See Important features of direct access and process image access.

6.1.1.2 Task start sequence When the StartupTask is completed, RUN mode is reached. The following tasks are then started: • SynchronousTasks • TimerInterruptTasks • BackgroundTask • MotionTasks with startup attribute.

Note The sequence in which these tasks are first started after RUN mode has been reached does not conform to the task priorities.

Page 489: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Commissioning (software) 6.1 Assigning programs to a task and downloading them to the target system

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 489

Figure 6-3 Task configuration for a MotionTask

6.1.2 Downloading programs to the target system The program has to be downloaded into the target system, together with the technology objects etc., before being executed. Follow the steps outlined below: 1. Check the project for consistency: Select the Project > Consistency check menu

command. 2. Compile the project from scratch again, taking account of all dependencies: Select the

Project > Save and compile all menu command. 3. Go online with the target system: Select the Project > Connect to target system menu

command. 4. Download the project to the target system: Select the Project > Download to target device

menu command.

Note For information about variable initialization, consult the Variable type and timing of variable initialization table.

Page 490: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Commissioning (software) 6.1 Assigning programs to a task and downloading them to the target system

SIMOTION MCC Motion Control Chart 490 Programming and Operating Manual, 03/2007

Page 491: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 491

Error Handling and Program Test 77.1 Modes for program testing

7.1.1 Modes of the SIMOTION devices Various SIMOTION device modes are available for program testing. How to select the mode of a SIMOTION device: 1. Highlight the SIMOTION device in the project navigator. 2. Select Test mode from the context menu. 3. Select the required mode (see table) and confirm with OK. If you have selected debug mode, you are prompted for further inputs. See also section: Important information on debug mode.

Table 7-1 Modes of a SIMOTION device

Setting Meaning Process mode Program execution on the SIMOTION device is optimized for maximum

system performance. The following diagnostic functions are available: • Monitoring variables in the symbol browser or a watch table • Program status • Trace tool with measuring functions for drives and function generator

(see online help) For system performance optimization reasons, the following restrictions apply: • For program status:

• As of version V4.0 of the SIMOTION kernel:

No more than one program source (e.g. ST source, MCC source, LAD/FBD source) can be monitored per task.

• Up to version V3.2 of the SIMOTION kernel:

No more than one program source (e.g. ST source, MCC source, LAD/FBD source) can be monitored.

• For trace:

No more than one trace on each SIMOTION device.

Page 492: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.1 Modes for program testing

SIMOTION MCC Motion Control Chart 492 Programming and Operating Manual, 03/2007

Setting Meaning Test mode The diagnostic functions (see Process mode) are available to the full

extent: • For program status:

• As of Version V4.1 of the SIMOTION Kernel:

Several program sources (e.g. ST sources, MCC sources, LAD/FBD sources) can be monitored per task.

• Up to Version V4.0 of the SIMOTION Kernel:

No more than one program source (e.g. ST source, MCC source, LAD/FBD source) can be monitored per task.

• For trace:

No more than four traces on each SIMOTION device. Note Runtime and memory utilization increase as the use of diagnostic functions increases.

Debug mode This mode is available in SIMOTION kernel V3.2 and higher. In addition to the diagnostic functions of the test mode, you can use the following functions: • Breakpoints

No more than one SIMOTION device of the project can be switched to debug mode.

Please note the following notes for the debug mode.

7.1.2 Important information for the debug mode

Warning You must observe the appropriate safety regulations. Use the debug mode only with the life-sign monitoring function activated with a suitably short monitoring time! Otherwise, if problems occur in the communication link between the PC and the SIMOTION device, the axis may start moving in an uncontrollable manner. The function is released exclusively for commissioning, diagnostic and service purposes. The function should generally only be used by authorized technicians. The safety shutdowns of the higher-level control have no effect. The "Emergency stop with space bar" function is not guaranteed in all operating modes. Therefore, there must be an EMERGENCY STOP circuit in the hardware. The appropriate measures must be taken by the user.

Page 493: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.1 Modes for program testing

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 493

Accept safety notes After selecting the debug mode, you must accept the safety notes. You can also parameterize the life-sign monitoring and the emergency stop. Proceed as follows: 1. Click the Settings button.

The Emergency stop parameterization window opens. 2. Read there, as described in the following section, the safety notes and parameterize the

life-sign monitoring and the emergency stop.

Parameterizing the life-sign monitoring and the emergency stop In the Emergency stop parameterization window, proceed as described here: 1. Read the warning! 2. Click the Safety notes button to open the window with the detailed safety notes. 3. Do not make any changes to the defaults for life-sign monitoring.

Changes should only be made in special circumstances and in observance of all danger warnings.

4. Click Accept to confirm you have read the safety notes and have correctly parameterized the life-sign monitoring.

Notice Pressing the spacebar is interpreted as an emergency stop signal in debug mode. Emergency stop is always triggered when switching to another Windows application.

Page 494: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.2 Monitoring variables in the symbol browser and watch tables

SIMOTION MCC Motion Control Chart 494 Programming and Operating Manual, 03/2007

7.2 Monitoring variables in the symbol browser and watch tables

7.2.1 Symbol browser

Features In the symbol browser, you can view and, if necessary, change the name, data type, and variable values. In particular, you can: see the following variables: • Unit variables and static variables of a program or function block • System variables of a SIMOTION device or a technology object • I/O variables or global device variables. For these variables, you can: • View a snapshot of the variable values • Monitor variable values as they change • Change (modify) variable values However, the symbol browser can only display/modify the variable values if the project has been loaded in the target system and a connection to the target system has been established.

Using the symbol browser Prerequisites • Make sure that a connection to the target system has been established and a project has

been downloaded to the target system. • You can run the user program, but you do not have to. If the program is not run, you only

see the initial values of the variables. The procedure depends on the memory area in which the variables to be monitored are stored.

Variables in the user memory of the unit You can use the symbol browser to monitor the variables contained in the user memory of the unit, e.g. • Unit variables of the interface section of a program source file (unit), • Unit variables of the implementation section of a program source file (unit), • Static variables of the function blocks whose instances are declared as unit variables. Follow these steps: 1. Select the program source file in the project navigator. 2. In the detail view, click the Symbol browser tab.

You see in the symbol browser all variables contained in the user memory of the unit.

Page 495: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.2 Monitoring variables in the symbol browser and watch tables

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 495

Variables in the user memory of the task You can use the symbol browser to monitor the variables contained in the user memory of the associated task, e.g. • Static variables of the programs, • Static variables of the function blocks whose instances are declared as static variables of

programs. Follow these steps: 1. In the project navigator of SIMOTION SCOUT, select the EXECUTION SYSTEM element

in the subtree of the SIMOTION device. 2. In the detail view, click the Symbol browser tab.

The symbol browser shows all tasks with the assigned programs. The variables contained in the user memory of the task are listed below.

Note You can monitor temporary variables (together with unit variables and static variables) with Status Program (see Program status (Page 502)).

System variables and global device variables You can also monitor the following variables in the symbol browser: • System variables of SIMOTION devices • System variables of technology objects • I/O variables • Global device variables Follow these steps: 1. Select the appropriate element in the SIMOTION SCOUT project navigator. 2. In the detail view, click the Symbol browser tab.

The corresponding variables are displayed in the symbol browser.

Status and controlling variables In the Status value column, the current variable values are displayed and periodically updated. You can change the value of one or several variables. Proceed as follows for the variables to be changed: 1. Enter a value in the Control value column. 2. Activate the check box in this column 3. Click the Immediate control button. The values you entered are written to the selected variables.

Page 496: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.2 Monitoring variables in the symbol browser and watch tables

SIMOTION MCC Motion Control Chart 496 Programming and Operating Manual, 03/2007

Notice Note when you change the values of several variables: The values are written sequentially to the variables. It can take several milliseconds until the next value is written. The variables are changed from top to bottom in the symbol browser. There is therefore no guarantee of consistency.

Fix the display of the symbol browser You can fix the display of the symbol browser for the active object: • To do so, click the Retain display icon in the right upper corner of the symbol browser.

The displayed symbol changes to . The variables of this object are still displayed and updated in the symbol browser even if another object is selected in the project navigator.

• To remove the display, click the icon again. The displayed symbol changes back to .

7.2.2 Watch tables

Characteristics With the symbol browser you see only the variables of an object within the project. With program status you see only the variables in certain MCC commands. With watch tables, in contrast, you can monitor selected variables from different sources as a group (e.g. program sources, technology objects, SINAMICS drives - even on different devices). You can see the data type of the variables in offline mode. You can view and modify the value of the variables in online mode.

Creating a watch table Procedure for creating a watch table and assigning variables: 1. In the project navigator, select the Monitor folder. 2. Select Insert > Watch table to create a watch table, and enter the name of the watch

table. A watch table with this name appears in the Monitor folder. 3. In the project navigator, click the object from which you want to move variables to the

watch table. 4. In the symbol browser, select the corresponding variable line by clicking its number in the

left column. 5. From the context menu, select the item Move variable to watch table and the appropriate

watch table, e.g. Watch table_1.

Page 497: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.2 Monitoring variables in the symbol browser and watch tables

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 497

6. If you click the watch table, you will see in the detail view of the Watch table tab that the selected variable is now in the watch table.

7. Repeat steps 3 to 6 to monitor the variables of various objects. If you are connected with the target system, you can monitor the variable contents.

Status and controlling variables In the Status value column, the current variable values are displayed and periodically updated. You can change the value of one or several variables. Proceed as follows for the variables to be changed: 1. Enter a value in the Control value column. 2. Activate the checkbox in this column 3. Click the Immediate control button. The values you entered are written to the selected variables.

Notice Note when you change the values of several variables: The values are written sequentially to the variables. It can take several milliseconds until the next value is written. The variables are changed from top to bottom in the watch table. There is therefore no guarantee of consistency.

Fix the display of the watch table You can fix the display of the active watch table: • To do so, click the Retain display icon in the right upper corner of the Watch table tab in

the detail view. The displayed symbol changes to . This watch table is still displayed even if another one is selected in the project navigator.

• To remove the display, click the icon again. The displayed symbol changes back to .

Using watch tables To monitor variables in watch tables, proceed as follows: 1. In the project navigator, select the Monitor folder. 2. Select Insert > Watch table to create a watch table, and enter the name of the watch

table. A watch table with this name appears in the Monitor folder. 3. In the project navigator, click the object from which you want to move variables to the

watch table. 4. In the symbol browser, select the corresponding variable line by clicking its number. From

the context menu, select the item Move variable to watch table and the appropriate watch table, e.g. Watch table_1.

Page 498: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.2 Monitoring variables in the symbol browser and watch tables

SIMOTION MCC Motion Control Chart 498 Programming and Operating Manual, 03/2007

5. If you click the watch table, you will see in the detail view of the Watch table tab that the selected variable is now in the watch table.

6. Repeat steps 3 to 5 to monitor the variables of various objects. You can fix the display of the active watch table: • To do so, click the Retain display icon in the right upper corner of the Watch table tab in

the detail view. This watch table is still displayed even if another one is selected in the project navigator. To remove the display, click the same icon again.

Page 499: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.3 Monitoring the program execution

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 499

7.3 Monitoring the program execution

7.3.1 Tracking program execution Tracking the program execution does not affect the actual execution of the program, but does increase the communication load. This has an impact on the execution of MotionTasks and the BackgroundTask. Program execution tracking can be switched on and off during program operation. When program execution monitoring is activated, the current active command is shown in yellow. The parameter screen forms of the active MCC chart can be opened and read, but no changes can be made.

Starting the program execution monitoring Program execution tracking can only be started for MCC charts that contain a program and are assigned to one (and only one) task. The MCC chart must be open. • Select the MCC chart > Monitor menu command. MCC charts with functions and function blocks that are called by the program can also be monitored. To do so, open the relevant charts, as well.

Stopping the program execution monitoring Program execution monitoring is stopped using the MCC chart > Monitor menu command.

Page 500: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.3 Monitoring the program execution

SIMOTION MCC Motion Control Chart 500 Programming and Operating Manual, 03/2007

7.3.2 Tracking single program steps Single-step tracking has no influence on the program execution itself, but it does extend the execution time of the program. This function can be switched on and off during program operation. Only MCC charts that are created as a program and assigned to exactly one task can be monitored in single-step mode. The program is suspended until the user initiates the next program step; the next command to be executed is shown in light blue. After initiation of the next single step, the active command is shown in yellow until execution of the command is complete. The program is then suspended again.

Notice As the execution time of the program is extended, the time watchdog must be adapted accordingly for cyclical tasks (TimerInterruptTask, BackgroundTask) or, if necessary, switched off.

Jumps in functions and function blocks can also be monitored if single-step tracking is enabled in their MCC charts. The relevant MCC chart is then opened when the function or function block is called.

Note Single-step tracking in functions and function blocks is only possible if single-step tracking is also enabled in the calling MCC chart. Single-step tracking is not possible within the Synchronous start (Page 213) command.

The parameter screen forms of the active MCC chart can be opened and read, but no changes can be made.

Enabling single-step tracking Single-step monitoring is enabled separately for every MCC chart. 1. Open the MCC chart whose program execution you want to monitor. 2. Select the MCC chart > Properties menu command.

The properties dialog opens. 3. Select the Single step check box. 4. Recompile the MCC chart (MCC chart > Accept and compile menu command). 5. Download the programs to the target system.

Page 501: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.3 Monitoring the program execution

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 501

Starting single-step tracking Single-step tracking can only be started for MCC charts that are assigned to one (and only one) task. The MCC chart must be open. 1. Select the MCC chart > Single step menu command. 2. You can Initiate the next single step in one of the following ways:

– By clicking the Next step button on the MCC editor toolbar – By selecting the MCC chart > Next step menu command – By selecting the Next step command on the context menu in the project navigator

Note The program stays in single-step mode if the SIMOTION device goes offline or the MCC chart is closed.

Stopping single-step tracking Single-step tracking is stopped using the MCC chart > Single step menu command.

Disabling single-step tracking 1. First, stop the "Single Step" function. 2. Clear the Single step check box in the Properties dialog. 3. Recompile the program and download it to the target system.

Page 502: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.4 Program status

SIMOTION MCC Motion Control Chart 502 Programming and Operating Manual, 03/2007

7.4 Program status Program status can be used to monitor variables for the following commands: • IF: Program branch • WHILE: Loop with condition at the start • UNTIL: Loop with condition at the end • ST zoom The values of the following variables are displayed: • Variables with elementary data type (INT, REAL, etc.) • Individual elements of a structure, provided an assignment is given • Individual elements of an array, provided an assignment is given • Variables with enumeration data types

Note The following variables cannot be displayed for the IF, WHILE, or UNTIL commands when the LAD or FBD programming language is used: • Local variables • Enumeration/constant values and hexadecimal and binary values Due to the restricted buffer capacity and the requirement for minimum runtime tampering, the following variables cannot be displayed: • Complete arrays • Complete structures However, individual array elements or individual structure elements are displayed if an assignment is made in the MCC chart. Program status requires additional CPU resources.

Preparing program status Before you can work with program status, additional code must be generated during compilation: 1. Select the SIMOTION device, and select Change operating mode on the shortcut menu. 2. Select Test mode.

Program status is available in this mode without restrictions (see Modes of the SIMOTION devices (Page 491)).

3. Open the Properties window of the MCC source file. 4. Activate the Permit program status check box in the Options tab (see Selecting compiler

options (Page 48)). 5. Compile the MCC source file (MCC source file > Accept and compile menu command).

Page 503: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.4 Program status

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 503

6. Download the programs to the target system.

Starting the Status program To start program status, proceed as follows. The relevant MCC chart must be open. 1. Open the commands for which you want to monitor variables (IF, WHILE, UNTIL, or ST

Zoom). 2. Start program status (MCC chart > Program status menu command). You can open more than one command at a time, but you will only be able to monitor the variables in the active window (that is, the window in the foreground).

Stopping program status The program status function is stopped using the MCC chart > Program status menu command.

Disabling program status Disabling program status frees up CPU resources. 1. First, stop the program status function (see Stopping program status). 2. Clear the Permit program status check box in the Properties dialog of the MCC source

file. 3. Select the SIMOTION device, and select Change operating mode on the shortcut menu. 4. Select Process mode. 5. This operating mode is optimized for maximum performance of program execution. 6. Recompile the program and download it to the target system.

Page 504: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.5 Trace

SIMOTION MCC Motion Control Chart 504 Programming and Operating Manual, 03/2007

7.5 Trace Trace allows you to log and graphically display the characteristics of signals and axis states. You must configure the data that you wish to record in the SIMOTION Trace tool (for description, see the online help).

7.5.1 Activate trace

Figure 7-1 Trace trigger

This command can be used to log the characteristics of signals and axis states at a defined position in the program. System variable traceState[n].tracestate on the SIMOTION device can be used to query whether the trace is still in progress or has already finished. You can monitor this variable in the symbol browser if you have selected the SIMOTION device in the project navigator.

Overview of parameters for You can set the following parameters:

Explanation/instructions Field/Button Up to Trace V2.0 Trace V2.1 and higher:

Trace Trigger 1 Trace block 1 is started. Trace is started when the following condition is satisfied: "Trigger with TraceTrigger 1 program call".

Trace Trigger 2 Trace block 2 is started. Trace is started when the following condition is satisfied: "Trigger with TraceTrigger 2 program call".

Page 505: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.5 Trace

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 505

Example of Activate trace The simultaneous starting of two axes (axis_1 and axis_2) will be recorded.

Figure 7-2 Trace recording of a synchronous start of two axes

Page 506: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.5 Trace

SIMOTION MCC Motion Control Chart 506 Programming and Operating Manual, 03/2007

Figure 7-3 Trace recording of synchronous start

Relevant system variable for Activate trace System variable of SIMOTION device: TraceControl

Page 507: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 507

7.6 Breakpoints

7.6.1 General procedure for setting breakpoints You can set breakpoints within a program source (e.g. ST source file, MCC source file, LAD/FBD source). On reaching an activated breakpoint, the task in which the POU with the breakpoint is called is stopped. The values of the local variables can be observed on the Status variables tab of the detail view. For function blocks, monitoring in/out parameters (VAR_IN_OUT) is not possible. You can continue to monitor global variables in the symbol browser.

Requirement: • The program source with the POU (e.g. ST source file, MCC chart, LAD/FBD program) is

open.

Proceed as follows: Follow these steps: 1. Select the Debug mode

for the associated SIMOTION device (see ) 2. Specify the debug task group. 3. Set the breakpoints. 4. Set the call path. 5. Activate the breakpoints.

7.6.2 Setting the debug mode

Setting the debug mode To set the debug mode, proceed as follows: 1. Select the debug mode for the relevant SIMOTION device. 2. Read 3. Do not make any changes to the defaults for life-sign monitoring, if possible.

Changes should only be made in special circumstances and in observance of all danger warnings.

4. Check and, if appropriate, change the emergency stop setting. To do this, click Expand>> . The Emergency stop on switching to a different Windows application check box must be selected. Set the key that initiates the emergency stop.

Page 508: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart 508 Programming and Operating Manual, 03/2007

The ESC key is set as emergency stop by default.

Note In debug mode, pressing the spacebar is interpreted as an emergency stop signal. This also affects the other applications running on the PC (e.g. word processing programs).

5. Confirm with OK. The system switches to online mode if you have not been online yet. Technology objects cannot be encoded, complied, stored, created, or changed in debug mode. The Debug toolbar appears.

7.6.3 Breakpoints toolbar This toolbar contains important operator actions for setting and activating breakpoints:

Figure 7-4 Breakpoints toolbar

Page 509: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 509

7.6.4 Define the debug task group On reaching an activated breakpoint, all tasks that are assigned to the debug task group are stopped.

Requirement • The relevant SIMOTION device is in debug mode.

Proceed as follows: How to assign a task to the debug task group: 1. Highlight the relevant SIMOTION device in the project navigator. 2. Select Debug task group from the context menu.

The Debug Settings window opens. 3. Select the tasks to be stopped on reaching the breakpoint:

– If you only want to stop individual tasks (in the RUN state): Activate the Debug task group selection option. Assign all tasks to be stopped on reaching a breakpoint to the Tasks to be stopped list.

– If you only want to stop individual tasks (in the HALT state): Activate the All tasks selection option. In this case, also select whether the outputs and technology objects are to be released again after resumption of program execution.

For more information on different behavior in reaching an activated breakpoint: see the table below.

Page 510: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart 510 Programming and Operating Manual, 03/2007

Table 7-2 Behavior on reaching an activated breakpoint depending on the tasks in the debug task group

Tasks to be stopped Properties Selected tasks All tasks

Operating state RUN STOP Stopped tasks Only tasks in the debug task group All tasks Outputs Active Deactivated Runtime measurement of the tasks Active for all tasks Deactivated for all tasks Watchdog Deactivated for tasks in the debug task

group Deactivated for all tasks

Technology Closed-loop control active No closed-loop control Real-time clock Continues to run Continues to run Behavior on resumption of program execution

Tasks of the debug task group continue to run.

All tasks continue to run. The behavior of the outputs and the technology objects depends on the 'Continue' activates the outputs checkbox. • Active: All outputs and technology

objects are released. • Inactive: All outputs and technology

objects are only released after another download of the project.

Note You can only make changes to the debug task group if no breakpoints are active.

Proceed as follows: 1. Set breakpoints (see Set breakpoints). 2. Define the call path (see Define call path for a single breakpoint). 3. Activate the breakpoints (see Activate breakpoints).

See also Setting breakpoints (Page 511) Defining the call path for a single breakpoint (Page 512) Activating breakpoints (Page 516)

Page 511: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 511

7.6.5 Setting breakpoints

Requirements: 1. The program source with the POU (e.g. ST source file, MCC chart, LAD/FBD program) is

open. 2. The relevant SIMOTION device is in debug mode

(see operating modes of SIMOTION devices). 3. The debug task group is defined (see Define debug task group).

Proceed as follows: How to set a breakpoint: 1. Select the code location where no breakpoint has been set:

– SIMOTION ST: Place the cursor on a line in the ST source file that contains a statement.

– SIMOTION MCC: Select an MCC command in the MCC chart (except module or comment block).

– SIMOTION LAD/FBD: Set the cursor in a network of the LAD/FBD program. 2. Click the Set/remove breakpoints button in the Breakpoints toolbar (or use the Ctrl+H

shortcut). To remove a breakpoint click the Set/remove breakpoint button again.

Note You cannot set breakpoints: • For SIMOTION ST: In lines that contain only comment. • For SIMOTION MCC: On the module or comment block commands. • For SIMOTION LAD/FBD: Within a network. • A code locations in which other debug points (e.g. trigger points) have been set. You can list all debug points: Select the SIMOTION device in the project navigator and select Debug table from the context menu. You can remove all breakpoints by clicking on the corresponding button on the Breakpoints toolbar or in the debug table.

You can use the program status diagnosis functions and breakpoints together in a program source file or POU. However, the following restrictions apply depending on the program languages: • SIMOTION ST: For Version V3.2 of the SIMOTION Kernel, the (marked) ST source file

lines to be tested with program status must not contain a breakpoint. • SIMOTION MCC and LAD/FBD: The commands of the MCC chart (or networks of the

LAD/FBD program) to be tested with program status must not contain a breakpoint.

Page 512: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart 512 Programming and Operating Manual, 03/2007

Proceed as follows: 1. Define the call path (see define call path for a single breakpoint). 2. Activate the breakpoints (see Activate breakpoints).

See also Modes of the SIMOTION devices (Page 491) Define the debug task group (Page 509) Defining the call path for a single breakpoint (Page 512) Activating breakpoints (Page 516)

7.6.6 Defining the call path for a single breakpoint

Requirements: 1. The program source with the POU (e.g. ST source file, MCC chart, LAD/FBD program) is

open. 2. The relevant SIMOTION device is in debug mode

(see operating modes of SIMOTION devices) 3. The debug task group is defined (see Define debug task group). 4. Breakpoint is set (see Set breakpoints).

Proceed as follows: To define the call path for a single breakpoint, proceed as follows: 1. Select the code location where a breakpoint has already been set:

– SIMOTION ST: Set the cursor in an appropriate line of the ST source. – SIMOTION MCC: Select an appropriate command in the MCC chart. – SIMOTION LAD/FBD: Set the cursor in an appropriate network of the LAD/FBD

program. 2. Place the cursor on the line of the ST source file at which a breakpoint is set. 3. Click the Edit call path button on the Breakpoints toolbar.

In the Call path breakpoint window, the marked code position is displayed (with the name of the ST source file, line number, name of the POU).

4. If the code position is called in several tasks: – Select the task.

The task must be in the debug task group. 5. Select the code position to be called (in the calling POU).

Page 513: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 513

You can select from the following: – The code positions to be called within the selected task (with the name of the program

source, line number, name of the POU). If the selected calling code position is in turn called by several code positions, further lines are displayed in which you proceed similarly.

– All: All displayed code positions are selected. Moreover, all code positions (up to the top level of the hierarchy) are selected from which the displayed code positions are called.

6. If the breakpoint is only to be activated after the code position has been reached several times, select the number of times.

Proceed as follows: • Activate the breakpoints (see Activate breakpoints).

Note You can view the call path with the Call stack function, depending on the task selected. See Display call stack.

See also Modes of the SIMOTION devices (Page 491) Define the debug task group (Page 509) Setting breakpoints (Page 511) Defining the call path for all breakpoints (Page 514) Activating breakpoints (Page 516)

Page 514: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart 514 Programming and Operating Manual, 03/2007

7.6.7 Defining the call path for all breakpoints With this procedure, you can: • For all breakpoints in a POU (e.g. MCC chart, LAD/FBD program or POU in an ST source

file): match the call path (also subsequently) • For all future breakpoints of this program source (ST source file, MCC source file,

LAD/FBD source file): select a default setting.

Requirements • The program source with the POU (e.g. ST source file, MCC chart, LAD/FBD program) is

open. • The relevant SIMOTION device is in debug mode Operating modes of SIMOTION

devices. • The debug task group is defined (see Define debug task group).

Proceed as follows: To define the call path for all breakpoints of a POU, proceed as follows: 1. Select the code location where no breakpoint has been set:

– SIMOTION ST: Set the cursor in an appropriate line of the ST source. – SIMOTION MCC: Select an appropriate command in the MCC chart. – SIMOTION LAD/FBD: Set the cursor in an appropriate network of the LAD/FBD

program. 2. Click the Edit call path button on the Breakpoints toolbar.

In the Call path/All breakpoints per POU task selection window, the selected MCC command (code position) is displayed (with the name of the MCC source file, line number, name of the MCC chart).

3. If the MCC command (code position) is called in several tasks: Select the calling task. The following are available: – Tasks in which the code position with the set breakpoint is called.

The selected task must be in the debug task group. – All

All tasks of the debug task group in which the code position with the set breakpoint is called are selected. The task must be in the debug task group.

4. Select the calling code position. The following are available: – Calling code positions within the selected task (with the name of the program source

file, line number, name of the POU, and name of the function block instance, if applicable) If the selected calling code position is in turn called by several code positions, further lines are displayed in which you proceed similarly.

Page 515: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 515

– All: All displayed code positions are selected. Moreover, all code positions (up to the top level of the hierarchy) are selected from which the displayed code positions are called.

5. If the breakpoint is only to be activated after the code position has been reached several times, select the number of times.

6. Confirm with OK.

Proceed as follows: • Activate the breakpoints (see Activate breakpoints).

Note You can view the call path with the Callstack function, depending on the task selected. Displaying the call stack.

See also Modes of the SIMOTION devices (Page 491) Setting the debug mode (Page 507) Setting breakpoints (Page 511) Defining the call path for a single breakpoint (Page 512) Display callstack (Page 515) Activating breakpoints (Page 516)

7.6.8 Display callstack You can use the callstack function to view the call path in accordance with the selected task.

Proceed as follows: To view the callstack: 1. Select the code location where a breakpoint has already been set:

– SIMOTION ST: Set the cursor in an appropriate line of the ST source. – SIMOTION MCC: Select an appropriate command in the MCC chart. – SIMOTION LAD/FBD: Set the cursor in an appropriate network of the LAD/FBD

program.

Page 516: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart 516 Programming and Operating Manual, 03/2007

2. Click the Display callstack button on the Breakpoints toolbar. The Callstack breakpoint dialog opens. If the program is stopped at a breakpoint, the current callstack is displayed including the calling task and the specified number of repetitions. The callstack itself (call path) cannot be modified. If the program is not stopped at a breakpoint, no dialog appears.

3. If you want to view the callstack for another task, change the calling task. The old data will be overwritten.

4. Use the Continue button in the Breakpoints toolbar to jump to the next breakpoint. The new callstack is displayed. The old data will be overwritten.

5. Confirm with OK.

7.6.9 Activating breakpoints Breakpoints must be activated if they are to have an effect on program execution.

Requirements 1. The program source with the POU (e.g. ST source file, MCC chart, LAD/FBD program) is

open. 2. The relevant SIMOTION device is in debug mode

(see operating modes of SIMOTION devices). 3. The debug task group is defined (see Define debug task group). 4. Breakpoints are set (see Set breakpoints). 5. Call paths are defined (see Define call path for a single breakpoint).

Proceed as follows: How to activate a single breakpoint: 1. Select the code location where a breakpoint has already been set:

– SIMOTION ST: Set the cursor in an appropriate line of the ST source. – SIMOTION MCC: Select an appropriate command in the MCC chart. – SIMOTION LAD/FBD: Set the cursor in an appropriate network of the LAD/FBD

program. 2. Click the Activate/deactivate breakpoint button on the Breakpoints toolbar.

To deactivate a breakpoint click the Activate/deactivate breakpoint button again How to activate all breakpoints: • Click the Activate all breakpoints button on the Breakpoints toolbar.

To deactivate all breakpoints, click the Deactivate all breakpoints button.

Page 517: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 517

On reaching an activated breakpoint, the tasks that are assigned to the debug task group are stopped. The behavior depending on the tasks in the debug task group is described in Define debug task group.

Note Breakpoints can also be activated and deactivated in the debug table: 1. Select the SIMOTION device in the project navigator and select Debug table from the

context menu. 2. The windows that open execute the action below, depending on which breakpoints you

activate or deactivate: – Single breakpoints: Check or clear the corresponding checkboxes. – All breakpoints: Click the corresponding button.

How to resume program execution: • Click the Resume button on the Breakpoints toolbar (Ctrl+F8 shortcut).

See also Modes of the SIMOTION devices (Page 491) Define the debug task group (Page 509) Setting breakpoints (Page 511) Defining the call path for a single breakpoint (Page 512)

Page 518: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Error Handling and Program Test 7.6 Breakpoints

SIMOTION MCC Motion Control Chart 518 Programming and Operating Manual, 03/2007

Page 519: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007, xxx 519

Appendix AA.1 Basics of LAD/FBD/Formula for MCC

A.1.1 Ladder logic (LAD) for MCC The LAD graphical programming language represents the program in the form of a circuit diagram. LAD enables you to track the flow of signals easily.

Note You can switch between LAD and FBD provided that the programmed functions can be displayed in both languages.

The ladder diagram (LAD) for MCC has a limited set of operations. The following operations are available in MCC: • NO contact • NC contact • Comparator (CMP) • Open/close branch Every logic operation queries the signal status (0 or 1) of an electrical contact. The result is then stored or used to execute another operation.

NO contact

This operation can be programmed to scan the signal status of a contact: • Signal status=0: Contact is open. • Signal status=1: Contact is closed.

Page 520: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.1 Basics of LAD/FBD/Formula for MCC

SIMOTION MCC Motion Control Chart 520 Programming and Operating Manual, 03/2007

The logic operation can be executed in a series connection or a parallel connection: • In a series connection, the operation gates the result of its signal state scan according to

the AND truth table. • In a parallel connection, the operation gates the result of its signal state scan according to

the OR truth table.

Figure A-1 Example of Normally open contact in a parallel circuit

NC contact

This operation can be programmed to scan the signal status of a contact: • Signal status=0: Contact is closed. • Signal status=1: Contact is open. The logic operation can be executed in a series connection or a parallel connection: • In a series connection, the operation gates the result of its signal state scan according to

the AND truth table. • In a parallel connection, the operation gates the result of its signal state scan according to

the OR truth table.

Figure A-2 Example of Normally closed contact in a parallel circuit

Page 521: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.1 Basics of LAD/FBD/Formula for MCC

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 521

Comparison instructions

This operation performs a comparison operation on integers or floating-point numbers. Input 1 and Input 2 are compared according to the comparison type (see figure). If the result of the comparison is "true", then the result is "1" (otherwise "0"). There is no negation of the comparison result as this can be achieved by the opposite comparison operation in each case.

Figure A-3 Possible comparison types

You can use one of two different addressing methods: • Direct addressing with constant as operand • Variable addressing with variable as operand

Figure A-4 Example of direct and variable addressing

Page 522: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.1 Basics of LAD/FBD/Formula for MCC

SIMOTION MCC Motion Control Chart 522 Programming and Operating Manual, 03/2007

Open/close branch

You can open and close parallel branches to fork the current flow. All operands and branches must be interlinked. Each branch must contain at least one operand.

Example of NO contact operations in a parallel circuit The result is 0 or 1 depending on the position of the contacts (see figure).

%I 0.1%I 0.2

%I 0.3

%I 0.1%I 0.2

%I 0.3

%I 0.1%I 0.2

%I 0.3

Figure A-5 Example of NO contact operations in a parallel circuit

Page 523: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.1 Basics of LAD/FBD/Formula for MCC

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 523

A.1.2 Function block diagram (FBD) for MCC Function block diagram (FBD) is a graphical programming language that represents logic using the graphical logic symbols normally associated with Boolean algebra.

Note You can switch between LAD and FBD provided that the programmed functions can be displayed in both languages.

The following operations are available in MCC: • AND operation • OR operation • Inverted input comparator • AND operation before OR operation OR operation before AND operation Every logic operation queries the signal status (0 or 1) of an electrical contact. The result is then stored or used to execute another operation.

AND operation

The signal statuses of two or more operands are scanned: If the signal status of all operands is 1, the condition is fulfilled, otherwise the result of the operation is 0.

Figure A-6 Example of an AND operation

Page 524: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.1 Basics of LAD/FBD/Formula for MCC

SIMOTION MCC Motion Control Chart 524 Programming and Operating Manual, 03/2007

OR operation

1

The signal statuses of two or more operands are scanned: The condition is fulfilled if one operand has signal status "1", otherwise the result is "0".

Example of an OR operation

Inverted input The signal status of the input is inverted by a dot at an operator input.

Figure A-7 Example of an OR operation with an inverted input

Comparison instructions

This operation performs a comparison operation on integers or floating-point numbers. Input 1 and Input 2 are compared according to the comparison type (see figure). If the result of the comparison is "true", then the result is "1" (otherwise "0").

Page 525: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.1 Basics of LAD/FBD/Formula for MCC

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 525

There is no negation of the comparison result as this can be achieved by the opposite comparison operation in each case.

Figure A-8 Possible comparison types

You can use one of two different addressing methods: • Direct addressing with constant as operand • Variable addressing with variable as operand

Figure A-9 Example of direct and variable addressing

AND operation before OR operation OR operation before AND operation

With the AND before OR logic operation, it is possible to scan the result of a signal status scan according to the OR truth table. The result is "1" if at least one AND operation is fulfilled.

Figure A-10 Example of an AND before OR operation

Page 526: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.1 Basics of LAD/FBD/Formula for MCC

SIMOTION MCC Motion Control Chart 526 Programming and Operating Manual, 03/2007

With the OR before AND logic operation, it is possible to query the result of a signal state scan according to the AND truth table. The result is "1" if all OR operations are fulfilled.

Figure A-11 Example of an OR before AND operation

A.1.3 Formula for MCC Formula is a text-based, high-level language that essentially complies with IEC 61131-3 in terms of language definition. It is suitable among other things for programming formula calculations and complex optimization algorithms. System functions and operators can be moved from the command library to the programming window using a drag-and-drop operation.

Note You can switch from Formula to LAD or FBD and vice versa provided that the programmed functions can be displayed in the other language.

Simple examples The two examples illustrate an AND operation and an OR operation.

Table A-1 Example of an AND operation (keyword AND)

Instruction Description %I0.0 AND a = 50 The result is 1 if input 0.0 is closed and variable a

has a value of 50.

Table A-2 Example of an AND operation (keyword AND)

Instruction Description %I0.0 OR %I0.1 The result is 1 if input 0.0 or input 0.1 is closed.

Page 527: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.1 Basics of LAD/FBD/Formula for MCC

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 527

Querying a system variable Formula is often used for scanning system variables; refer to the following example:

Table A-3 Example of an AND operation (keyword AND)

Instruction Description Axis_1.positioningstate.homed = YES The result = 1, if the axis has reached its homing

position and is therefore homed.

Figure A-12 Scan whether an axis has been homed

Page 528: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.2 Key combinations

SIMOTION MCC Motion Control Chart 528 Programming and Operating Manual, 03/2007

A.2 Key combinations The following key combinations are available:

Table A-4 Key combinations

Keystroke combination

Significance

When MCC source file is open Ctrl+F4 Closes the active MCC source file. Ctrl+B Accepts and compiles the active MCC source file. Alt+Enter Displays the properties of the active MCC source file for editing. Ctrl+R Inserts an MCC chart in the MCC source file. Ctrl+P Prints the active MCC chart. When MCC chart is open Ctrl+F4 Closes the MCC chart. Ctrl+B Accepts and compiles the MCC source file of the active MCC chart. Alt+Enter Displays the properties of the active MCC chart for editing. Ctrl+P Prints the active MCC chart. ↑ Selects the preceding command in the MCC chart. ↓ Selects the next command in the MCC chart. ← Selects the command to the left of the currently selected command (parallel

branching). → Selects the command to the right of the currently selected command (parallel

branching). Edit menu Ctrl+Z Undoes the last action (except: Save). Ctrl+Y Redoes the last action which was undone. Ctrl+X Cuts a command Ctrl+C Copies a command Ctrl+V Inserts a command Del Deletes selected commands in the MCC chart. Alt+Enter Displays the properties of the active/selected object for editing. Enter Opens the selected object. Ctrl+A Selects all objects in the current window. Ctrl+F Searches text in the active list. Ctrl+B Saves and compiles the active/selected object. Window menu Ctrl+Shift+F5 Cascades all windows open in this application. Ctrl+Shift+F2 Arranges all windows open in this application evenly from top to bottom in tile

formation. Ctrl+Shift+F3 Arranges all windows open in this application evenly from left to right. Alt+F4 Closes all windows and ends the application.

Page 529: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.2 Key combinations

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 529

Keystroke combination

Significance

View menu Ctrl+F11 Maximizes working area Ctrl+F12 Maximizes detail view Ctrl+Num+ Enlarges the contents of the working area. Ctrl+Num- Reduces the contents of the working area. LAD and FBD Cursor keys With a selected operator: Navigation between the individual operators

When an edit field is open: Navigates between individual operands Del Deletes an operator Tab / Shift+Tab Jumps forward to next button / input field / jumps back to previous button /

input field Pg up Reduces (zooms) display Pg down Enlarges (zooms) display Pos1 Zooms to 100% End Zooms to total view Return Opens the edit field of the current operand or confirms the entry made in the

edit field Esc Aborts the entry while edit field is open Alt+I With assignments: Inserts a new variable Alt+D With assignments: Deletes a variable Within LAD Alt+C Inserts an NO contact Alt+N Inserts an NC contact Alt+V Inserting comparator Alt+P Opens a branch Alt+L Closes a branch Within FBD Alt+A Inserts an AND Alt+O Inserts an OR Alt+B Add input Alt+N Negate input Alt+V Inserting comparator

Page 530: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Appendix A.2 Key combinations

SIMOTION MCC Motion Control Chart 530 Programming and Operating Manual, 03/2007

Page 531: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007, xxx 531

Index

_ _additionObjectType, 95 _camTrackType, 95 _controllerObjectType, 95 _device, 120 _direct, 108, 120 _fixedGearType, 95 _formulaObjectType, 95 _getSafeValue

Application, 120 _sensorType, 95 _setSafeValue

Application, 120

A ANY, 92 ANY_BIT, 92 ANY_DATE, 92 ANY_ELEMENTARY, 92 ANY_INT, 92 ANY_NUM, 92 ANY_REAL, 92 ANYOBJECT, 95 Axis enable

electric drive, 252, 262 hydraulic drive, 257, 266

B Basic commands, 163 Bit data types, 89 BOOL, 89 Breakpoint, 507

Activating, 516 Call path, 512, 514, 515 Deactivating, 516 remove, 511 Set, 511 Toolbar, 508

BYTE, 89

C Call path

Breakpoint, 512, 514, 515 camType, 95 Close

MCC source file, 43 Closing the parameter screen form, 81 Code attributes, 142 Command

Acknowledge specific technology object alarm, 220 Acknowledge technology object alarms, 218 Activate measuring input, 334 Activate simulation for object, 179 Activate trace, 187, 504 Cam off, 422 Cam on, 411 CASE statement, 206 Change operating mode, 186 Comment block, 187 Continue motion, 307 Continue path motion, 483 Continue task, 193 Deactivate measuring input, 340 Deactivate simulation for object, 181 Deactivate torque limitation, 283 Delete command queue, 318 Determine TaskId, 199 Encoder monitoring off, 333 Encoder monitoring on, 330 Establish connection using TCP/IP, 227 Exit, 212 External encoder off, 325 External encoder on, 323 FOR statement, 203 Gearing off, 390 Gearing on, 376 Go to, 208 Home axis, 245 IF statement, 200 Incoming message, 222 Interrupt task, 191 Module, 66, 174 Online correction, 309

Page 532: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Index

SIMOTION MCC Motion Control Chart 532 Programming and Operating Manual, 03/2007

Outgoing message, 225 Output cam track Off, 372 Output cam track On, 365 Parameterize cam, 438 Position axis, 285 Receive data, 239 Remove axis enable, 262 Remove connection using TCP/IP, 230 Remove fixed endstop, 293 Remove QF axis enable, 266 Reset object, 183 Reset output, 176 Reset task, 195 Return, 211 Selection, 210 Send data, 232 Set axis parameter, 310 Set offset on camming, 433 Set offset on the gearing, 396 Set output, 175 Set scaling on camming, 428 Set virtual axis values, 315 Shift measuring system, 343 Speed preset, 275 ST zoom, 177 Start axis position-controlled, 271 Start task, 189 Stop axis, 302 Stop path motion, 479 Subroutine call, 126, 153, 174 Switch axis enable, 252 Switch master setpoint, 443 Switch on torque limitation, 280 Switch output cam off, 358 Switch output cam on, 349 Switch output cam signal, 361 Switch parameter set, 320 Switch QF axis enable, 257 Synchronize external encoder, 327 Synchronize measuring system, 346 Synchronous start, 213 Synchronous velocity operation off, 407 Synchronous velocity operation on, 401 System function call, 174 Task status, 197 Time-dependent position profile, 295 Time-dependent velocity profile, 299 Travel to fixed endstop, 290 Traverse path circularly, 457 Traverse path linearly, 449 Traverse path using polynomials, 467 UNTIL statement, 205

Variable assignment, 177 Wait for axis, 165 Wait for condition, 170 Wait for signal, 168 Wait time, 163 WHILE statement, 202

CommandID variable, 75 Commands

Copying, 65 cutting, 65 deleting, 65 Hide and Display, 65 Inserting, 65 numbering, 64 Pasting, 61 programming, 69 representing, 63 selecting, 64

Comments, 63 Compiling

Library, 159 MCC chart, 53 MCC source file, 42

Connection defining, 122

Connections, 121 defining, 121 to LAD/FBD programs, 121 To libraries, 121 to MCC charts, 121 to ST source files, 121

VAR CONSTANT, 97 Constants

Time specifications, 90 Context menu, 36 Cross-reference list, 138 Cyclic program execution

Effect on I/O access, 108, 115 Effect on variable initialization, 101

D Data type

Technology object, 95 Data types

Bit data type, 89 elementary, 89 Inheritance, 96 Numeric, 89 Time, 90

DATE, 90 DATE_AND_TIME, 90

Page 533: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Index

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 533

Declaration Scope, 86

Declaration area, 35 Deleting

MCC chart, 53 MCC source file, 44

Derived data types, 93 DINT, 89 DINT#MAX, 91 DINT#MIN, 91 Direct access, 108

Features, 109 Download

Effect on variable initialization, 101 Drag&drop, 37 driveAxis, 95 DT, 90 DWORD, 89

E Elementary data types

Overview, 89 Enumerations, 94 Example, 60 Export

MCC charts in program source files, 57 MCC source file as an ST source file, 45 MCC source file in XML format, 45, 54

externalEncoderType, 95

F FBD, 144 Features

MCC chart, 56 MCC source file, 47

Floating-point number Data types, 89

followingAxis, 95 followingObjectType, 95 Formula, 144, 150

Fundamentals, 526 Function

Creating, 130 Example, 129 Programming, 130

Function block, 126 Function block insertion, 126 Function chart, 147

Fundamentals, 523

I I/O variable

Creating, 111, 118 Direct access, 108 Process image, 108 Process image of the BackgroundTask, 115

Importing MCC chart as MCC, 55 MCC source file from XML data, 46, 55

Inheritance For technology objects, 96

Initialization Time of the variable initialization, 101

Input fields, 71 Inserting a function, 126 INT, 89 INT#MAX, 91 INT#MIN, 91 Integer

Data types, 89

K Key combinations, 36 Know-how protection, 44

L LAD, 144 LAD/FBD

downloading programs to the target system, 489 Ladder diagram, 145

Closing a branch, 147 description of elements, 146, 149 Fundamentals, 519 Opens a branch, 147

Library, 157 Compiling, 159 Technology package, 157

LREAL, 89 LREAL#MAX, 91 LREAL#MIN, 91

M Maximizing detail view, 34 Maximizing working area, 34 MCC

Introduction, 29 MCC chart

Page 534: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Index

SIMOTION MCC Motion Control Chart 534 Programming and Operating Manual, 03/2007

Accept, 53 assigning programs to a task, 485 closing, 53 Compiling, 53 defining order, 54 deleting, 53 downloading programs to the target system, 489 downloading task to the target system, 485 Editor, 61 exporting, 45, 54 exporting to program source files, 57 Features, 56 Importing, 45, 54 importing as MCC, 55 Inserting, 51 inserting commands, 61 monitoring program execution, 499, 500 moving to the foreground, 35 Opening, 52 representation in the Workbench, 33 representing commands, 63 single step monitoring, 500 State, 502 Toolbar, 61 Tracking program execution, 499 using in program source files, 57 zooming in/out, 34

MCC charts changing the creation type, 56 renaming, 47, 56 using test functions, 48 wait commands, 59

MCC source file Accept, 42 closing, 43 Compiling, 42 cutting, 44 deleting, 44 exporting as an ST source file, 45 exporting in XML format, 45, 54 Features, 47 importing from XML data, 46, 55 Inserting, 39 Know-how protection, 44 Opening, 42 Pasting, 44 Toolbar, 43

measuringInputType, 95 Menu bar, 35 Module creation, 66

N Name space, 123 New

I/O variable, 111, 118 MCC chart, 51 MCC source file, 39

Numeric data types, 89

O Open

MCC chart, 52 MCC source file, 42

Operator input options, 35 outputCamType, 95

P posAxis, 95 Preprocessor

activate, 49 Using, 49

Principles of programming, 60 Print, 161 Process image

Features, 109 principle and use, 108, 115

Process image of the BackgroundTask, 108 process image of the cyclic tasks, 108 Program

see MCC chart, 42, 53 Program structure, 140 Programming

Principle, 31 Proceed as follows, 32

R REAL, 89 REAL#MAX, 91 REAL#MIN, 91 Reference, 95 Reference data, 138 References, 3 Registers

Dynamic response, 73 Expert, 75

Rename, 47, 56 reuse

MCC chart, 53

Page 535: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Index

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 535

MCC source file, 42 RUN

Effect on variable initialization, 101

S Scope of the declarations, 86 Selection lists, 71 Sequential program execution

Effect on I/O access, 108 Effect on variable initialization, 101

Settings, 38 Single axis commands, 245 SINT, 89 SINT#MAX, 91 SINT#MIN, 91 ST

_alarm, 123 _alarmS, 224, 226 _alarmSId, 224, 226 _alarmSq, 224, 226 _alarmSqId, 224, 226 _device, 123 _direct, 123 _disableAxis, 265 _disableAxisSimulation, 183 _disableCamTrack, 375 _disableCamTrackSimulation, 183 _disableFollowingObjectSimulation, 183 _disableMeasuringInput, 342 _disableMeasuringInputSimulation, 183 _disableMonitoringOfEncoderDifference, 334 _disableOutputCam, 360 _disablePathObjectSimulation, 183 _disableScheduler, 217 _enableAxis, 256 _enableAxisSimulation, 180 _enableCamming, 421 _enableCamTrack, 371 _enableCamTrackSimulation, 180 _enableExternalEncoder, 324 _enableFollowingObjectSimulation, 180 _enableGearing, 388 _enableMeasuringInput, 339 _enableMeasuringInputCyclic, 339 _enableMeasuringInputSimulation, 180 _enableMonitoringOfEncoderDifference, 332 _enableOutputCam, 357 _enableOutputCamSimulation, 180 _enablePathObjectSimulation, 180 _enableQFAxis, 261 _enableScheduler, 217

_enableTorqueLimiting, 282 _enableVelocityGearing, 405 _getStateOfTask, 198 _getStateOfTaskId, 198 _GetStateOfXCommand, 237, 242 _getSyncCommandId, 217 _getTaskId, 200 _move, 274, 279 _project, 123 _redefinePosition, 317, 345 _resetAdditionObject, 185 _resetAdditionObjectError, 220, 222 _resetAxis, 185 _resetAxisError, 219, 222 _resetCam, 185 _resetCamError, 219, 222 _resetCamTrack, 185 _resetCamTrackError, 219, 222 _resetControllerObject, 185 _resetControllerObjectError, 220, 222 _resetExternalEncoder, 185 _resetExternalEncoderError, 219, 222 _resetFixedGear, 185 _resetFixedGearError, 220, 222 _resetFollowingObject, 185 _resetFollowingObjectError, 219, 222 _resetFormulaObject, 185 _resetFormulaObjectError, 220, 222 _resetMeasuringInput, 185 _resetMeasuringInputError, 219, 222 _resetMotionBuffer, 319 _resetOutputCam, 185 _resetOutputCamError, 219, 222 _resetPathObject, 185 _resetPathObjectError, 220, 222 _resetSensor, 185 _resetSensorError, 220, 222 _resetTask, 196 _resetTaskId, 196 _resetTController, 185 _resetTControllerError, 220, 222 _resetTechnologicalErrors, 219 _restartTask, 190 _restartTaskId, 190 _resumeTask, 194 _resumeTaskId, 194 _setAndGetEncoderValue, 348 _setCamOffset, 442 _setCamScale, 443 _setMaster, 261, 265, 274, 279, 282, 284, 290, 292, 298, 302, 306, 308, 310, 314, 317, 319, 322, 388, 406, 422

Page 536: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Index

SIMOTION MCC Motion Control Chart 536 Programming and Operating Manual, 03/2007

_setOutputCamCounter, 357 _setOutputCamState, 360, 364 _startSyncCommands, 217 _stop, 306 _stopEmergency, 306 _suspendTask, 192 _suspendTaskId, 192 _task, 123 _tcpCloseConnection, 231 _tcpCloseServer, 231 _tcpOpenClient, 229 _tcpOpenServer, 229 _tcpReceive, 245 _tcpSend, 238 _to, 123 _udpReceive, 244 _udpReceive, 242 _udpSend, 238 _waitTime, 164, 217 _Xreceive, 244 _Xreceive, 242 _Xsend, 238 BEGIN_SYNC, 217 END_EXPRESSION, 168, 170, 173, 217 END_SYNC, 217 END_WAITFORCONDITION, 168, 170, 173, 217 EXPRESSION, 168, 170, 173, 217 tcpReceive, 242 Value assignments, 176, 177 WAITFORCONDITION, 168, 170, 173, 217

Step enabling condition, 78 STOP to RUN

Effect on variable initialization, 101 STRING, 90 StructAlarmId, 93 STRUCTALARMID#NIL, 93 StructTaskId, 93 STRUCTTASKID#NIL, 93 Structures, 94 Subroutine, 124

as a function, 124 as a function block, 124 Call, 126 information exchange, 125 inserting in MCC chart, 126 programming, 126

Symbol browser, 494 System function

Call, 153 inserting in MCC chart, 153 programming, 153

System functions

Inheritance, 96 System variables

Inheritance, 96

T T#MAX, 91 T#MIN, 91 Task

Effect on variable initialization, 101 Technology object

Data type, 95 Technology objects

Inheritance, 96 Technology package

in library, 157 TIME, 90 Time types

Overview, 90 TIME#MAX, 91 TIME#MIN, 91 TIME_OF_DAY, 90 TIME_OF_DAY#MAX, 91 TIME_OF_DAY#MIN, 91 TO#NIL, 95 TOD, 90 TOD#MAX, 91 TOD#MIN, 91 Toolbar, 36

MCC editor, 61 MCC source file, 43

Trace, 504 Transition behavior, 78

U UDINT, 89 UDINT#MAX, 91 UDINT#MIN, 91 UINT, 89 UINT#MAX, 91 UINT#MIN, 91 using test functions, 48 USINT, 89 USINT#MAX, 91 USINT#MIN, 91

V VAR, 97 VAR_GLOBAL, 97

Page 537: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Index

SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 537

VAR_GLOBAL CONSTANT, 97 VAR_GLOBAL RETAIN

RETAIN, 97 VAR_IN_OUT, 97 VAR_INPUT, 97 VAR_OUTPUT, 97 VAR_TEMP, 97 Variable types, 84

Keywords, 97 Variables, 97

defining, 98 global device user variables, 98 local variable, 100 Process image, 108, 115 timing of initialization, 101 unit variable, 99 Watch tables, 496

W Watch tables, 496 WORD, 89

Page 538: SIMOTION MCC Motion Control Chartftp.ruigongye.com/download/Siemens/SIMOTION...SIMOTION MCC Motion Control Chart Programming and Operating Manual, 03/2007 3 Preface Scope This document

Index

SIMOTION MCC Motion Control Chart 538 Programming and Operating Manual, 03/2007