Page 1
Preface Fundamental safety instructions Overview of the functionality of modular machines SIMOTION Synchronizing SIMOTION devices with a higher-level bus cycle clock Motion Control Basic Functions for Modular Setting the communication addresses via the user Machines program Activating and deactivating Function Manual...
Page 2
Note the following: WARNING Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems.
The following is a list of sections included in this manual along with a description of the information presented in each section. ● Overview of the functionality of modular machines in the SIMOTION system (Section 1) This section provides an overview of the functionalities for modular machines that are automated using SIMOTION and PROFIBUS DP or PROFINET IO.
● Index Keyword index for locating information. SIMOTION Documentation An overview of the SIMOTION documentation can be found in the SIMOTION Documentation Overview document. This documentation is included as electronic documentation in the scope of delivery of SIMOTION SCOUT. It comprises ten documentation packages.
Page 5
My Documentation Manager Click the following link for information on how to compile documentation individually on the basis of Siemens content and how to adapt it for the purpose of your own machine documentation: http://www.siemens.com/mdm Training...
Selecting and activating a configuration using an initial configuration........23 2.4.4 Procedure............................23 Synchronizing SIMOTION devices with a higher-level bus cycle clock............25 General information about synchronizing a SIMOTION device with the bus cycle clock....25 3.1.1 Cycle clock generation and synchronization in PROFIBUS DP..........26 3.1.2 Cycle clock generation and synchronization in PROFINET IO...........28...
Page 8
6.3.1 Selecting and activating a configuration using an initial configuration........99 6.3.2 Status diagram for what happens when a SIMOTION device is switched on depending on whether or not the SelfAdaptingConfiguration functionality is active ........102 6.3.3 Example program for an initial configuration................103 Reading the activation state of configurations................104...
Page 9
Script to call up the individual scripts to create the card image..........128 Loading the card image to the target device by means of SCOUT scripting......128 Storing configuration files for SIMOTION D4xx devices up to kernel version V4.1.4....129 Index.................................131 Basic Functions for Modular Machines...
Fundamental safety instructions General safety instructions WARNING Risk of death if the safety instructions and remaining risks are not carefully observed If the safety instructions and residual risks are not observed in the associated hardware documentation, accidents involving severe injuries or death can occur. ●...
Siemens recommends strongly that you regularly check for product updates. For the secure operation of Siemens products and solutions, it is necessary to take suitable preventive action (e.g. cell protection concept) and integrate each component into a holistic, state-of-the-art industrial security concept.
SINAMICS drives, PROFIBUS DP, and PROFINET IO. The SIMOTION system offers several ways of designing a machine on a modular basis and optimizing the rated conditions: ● The targeted and automated creation of a SIMOTION project in the SIMOTION SCOUT engineering system, for example by: –...
See Synchronizing a SIMOTION device without an isochronous DP master interface (Page 31) ● At least one isochronous DP master interface is available (for example in SIMOTION D). Synchronization of the isochronous DP master interfaces is controlled by the user and occurs when the user calls up a system function.
Page 15
Overview of the functionality of modular machines 2.2 Changing communication addresses via the user program SIMOTION devices. These are interconnected via a communication network. This is shown schematically: ● In the PROFIBUS DP example: A base machine with several identical modules, which communicate via PROFIBUS DP ●...
Page 16
Overview of the functionality of modular machines 2.2 Changing communication addresses via the user program Example of communication via PROFIBUS DP Figure 2-2 Base machine with several identical modules (communication via PROFIBUS DP) Basic Functions for Modular Machines Function Manual, 04/2014...
Page 17
Overview of the functionality of modular machines 2.2 Changing communication addresses via the user program Example of communication via PROFINET IO Figure 2-3 Base machine with several identical modules (communication via PROFINET IO) Replacing a module on the base machine The user connects a replacement module to the base machine.
2.2 Changing communication addresses via the user program Operating a module on several base machines A module (with dedicated SIMOTION control) is alternately connected to different base machines (e.g. a transport vehicle travels to different assembly sites and connects there). At each base machine, the module is to be integrated in the respective communication network and contact established with the higher-level control.
● To change the device name (NameOfStation) of an IO device on PROFINET IO (see Setting the device name (NameOfStation) of an IO device on PROFINET IO (Page 46)): As of SIMOTION Kernel version V4.4, the following functions should be used in new projects: –...
● Technology objects (e.g. axes assigned to drives that are not required) can be activated or deactivated. The computational load of the SIMOTION device can be reduced through specific use of these system functions; the computing capability can be concentrated on the drives or technology objects which are currently required.
2.3.2 User program You can use the following SIMOTION system functionalities in the user program: ● System functions are provided (see Activating and deactivating nodes on the PROFIBUS or PROFINET IO (Page 57)) to activate or deactivate a bus node (DP slaves or IO devices) and to query its status;...
(using connector coding, for example); this configuration can then be added – The memory and computing capability of the SIMOTION device are only used for the configured functionalities – Cycle times and cycle clocks (e.g. DP cycle clock, position control cycle clock, IPO cycle clock) can be optimized for each requirement.
1. Configure and program each required configuration as a unique device in the engineering system (e.g. SIMOTION SCOUT). 2. Create the files required for the file system on the memory card of the SIMOTION device. 3. Transfer this card image to the associated memory card.
Page 24
Overview of the functionality of modular machines 2.4 Activating the configuration or the SIMOTION kernel This process is described in detail in Procedure for creating the card images of configurations (Page 107). Basic Functions for Modular Machines Function Manual, 04/2014...
General information about synchronizing a SIMOTION device with the bus cycle clock SIMOTION devices provide a range of interfaces for connecting to PROFIBUS DP or PROFINET IO. The devices and their applications (e.g. in ServoSynchronousTask or IPOSynchronousTask) can be operated isochronously to the bus cycle clocks occurring on the interfaces.
In this case, this interface supplies the basic cycle clock for the SIMOTION device. – If a DP cycle is available at this interface, the SIMOTION device must be synchronized with this cycle clock. The synchronization behavior depends on whether the PROFIBUS DP interfaces of the SIMOTION device have been configured as the isochronous DP master.
Page 27
If the DP slave interface is operated isochronously, the SIMOTION device must be synchronized with the higher-level bus cycle clock. The synchronization behavior depends on whether the PROFIBUS DP interfaces of the SIMOTION device have been configured as the isochronous DP master: ●...
Clock generation in PROFINET IO The following applies for clock generation in PROFINET IO: If a PROFINET IO interface is available, the base cycle clock of a SIMOTION device is supplied by this interface providing the interface has been configured as follows: 1.
Page 29
3.1 General information about synchronizing a SIMOTION device with the bus cycle clock Note Only a single cycle clock source is permitted on a SIMOTION device. For this reason: If a SIMOTION device contains a PROFINET IO interface, a PROFIBUS DP interface can no longer be operated as an isochronous DP slave.
Page 30
See Activating and deactivating components and technology objects (Page 57). Note In SIMOTION D devices, the DP Integrated interface is always configured as the isochronous DP master interface. Therefore, if these devices are connected to a higher-level isochronous master, they must always be synchronized.
Therefore, the synchronization must not be performed until after Safety Integrated in the drive is ready. In order to achieve this, use the user-controlled synchronization, see synchronization of a SIMOTION device with isochronous DP master interface (Page 33). Wait with the call of the system function _synchronizeDPInterfaces until: 1.
Page 32
Note Only a single cycle clock source is permitted on a SIMOTION device. For this reason: If a SIMOTION device contains a PROFINET IO interface, a PROFIBUS DP interface can no longer be operated as an isochronous DP slave.
Synchronization of a SIMOTION device with an isochronous DP master interface Prerequisites 1. At least one PROFIBUS interface in the SIMOTION device has been configured as an isochronous DP master. This prerequisite is always met with SIMOTION D4xx devices; the interface "DP Integrated"...
Page 34
Synchronizing SIMOTION devices with a higher-level bus cycle clock 3.3 Synchronization of a SIMOTION device with an isochronous DP master interface Figure 3-5 Example configuration for synchronization of a SIMOTION device which has an isochronous DP master interface with a higher-level PROFIBUS DP cycle clock Figure 3-6...
Page 35
Synchronizing SIMOTION devices with a higher-level bus cycle clock 3.3 Synchronization of a SIMOTION device with an isochronous DP master interface For synchronization of the internal cycle clocks of the SIMOTION device and the programs running in the SynchronousTasks, see section: "Synchronization of the cycle clocks of the SIMOTION device".
Page 36
Synchronizing SIMOTION devices with a higher-level bus cycle clock 3.3 Synchronization of a SIMOTION device with an isochronous DP master interface Procedure for automatic synchronization So that the interface configured as an isochronous DP master in the SIMOTION_2 device automatically synchronizes itself with the higher-level bus cycle clock, you should proceed as follows: 1.
Page 37
Status diagram of user-controlled synchronization The status diagram in the figure below describes the fundamental procedure for synchronizing isochronous DP master interfaces in a SIMOTION device with a higher-level bus cycle clock. Basic Functions for Modular Machines Function Manual, 04/2014...
Behavior in the STOP and RUN operating modes The SIMOTION device exhibits the following behavior in the operating modes and in transition between them. Observe this information when configuring/programming synchronization variants in accordance with Synchronizing a SIMOTION device without an isochronous DP master interface (Page 31) and Synchronization of a SIMOTION device with an isochronous DP master interface (Page 33).
Page 39
3.4 Behavior in the STOP and RUN operating modes Behavior in the STOP operating mode If the interfaces of a SIMOTION device are not consecutively synchronized, the input cycle clock is monitored and a signal generated that leads to the _SC_DP_CLOCK_DETECTED event in the RUN operating mode.
Communication System Manual. Setting the PROFIBUS address Using system functions, the user program can set and activate the required address (node number) for the SIMOTION device on PROFIBUS DP. The activation results in a restart of SIMOTION. Basic Functions for Modular Machines...
Devices" List Manual (reference list) and in the online help (see index). You specify the DP interface of the SIMOTION device via its project-wide, unique, logical, diagnostics address. This diagnostics address is obtained, e.g. in HW Config, via the object properties of the interface (Addresses tab).
System behavior Configuring the DP slave interface The following should be noted when configuring the SIMOTION device interface that has been configured as a DP slave: The configured quantity structure of the data to be exchanged must be identical in both the DP slave and the higher-level DP master.
No topology detection is possible in PROFIBUS DP due to the other existing bus topology. The result for each local port can be read out using the following system functions. ● As of SIMOTION Kernel version V4.4, the following function should be used in new projects: _getPnPortNeighbour (as of Kernel V4.4, replaces _getPnInterfacePortNeighbour) ●...
Page 45
(NameOfStation) which is unique within the project, the return value for the device name will comprise: – PROFINET IO node is not a SIMOTION device: The hardware address (MAC address) will be returned. The MAC address will be shown in the usual notation xx:xx:xx:xx:xx:xx, where x is a hexadecimal number [0 to 9, A to F].
Setting the device name (NameOfStation) of an IO device on PROFINET IO The user program can change and activate the device name (NameOfStation) for the SIMOTION device on the PROFINET IO using system functions. The activation results in a restart of SIMOTION. Note After changing the configured device name (NameOfStation), the following should be noted: ●...
SIMOTION SCOUT (e.g. in the programming languages). 4.3.1 System functions As of SIMOTION Kernel version V4.4, the following functions should be used in new projects: ● _getPnNameOfStation (as of Kernel V4.4) You can use this function to determine the active device name (NameOfStation) of a PROFINET IO interface on the SIMOTION device.
Page 48
MAC address hexadecimal numbers will be returned, e.g. SIMOTION‑D‑08‑00‑06‑73‑6C‑E6. As of SIMOTION Kernel version V4.4, the _getPnNameOfStation function should be used in new projects: ● _setNameOfStation You can use this function to set a new device name (NameOfStation) for a PROFINET IO interface on the SIMOTION device.
Page 49
Setting the communication addresses via the user program 4.3 Setting the device name (NameOfStation) of an IO device on PROFINET IO Example with _getPnPortNeighbour, _getPnNameOfStation, _setPnNameOfStation (as of V4.4, asynchronous call) END_STRUCT; bgrNameStruct : STRUCT ioId : EnumIoIdType; logAddressPort : DINT; nameOfStation : STRING;...
Page 50
Setting the communication addresses via the user program 4.3 Setting the device name (NameOfStation) of an IO device on PROFINET IO Example with _getPnPortNeighbour, _getPnNameOfStation, _setPnNameOfStation (as of V4.4, asynchronous call) 16#7003: ; // Function aborted ELSE // Error bgrNameState := 10009; END_CASE;...
Page 51
Setting the communication addresses via the user program 4.3 Setting the device name (NameOfStation) of an IO device on PROFINET IO Example with _getPnPortNeighbour, _getPnNameOfStation, _setPnNameOfStation (as of V4.4, asynchronous call) 16#7002: ; // Function active 16#7003: ; // Function aborted ELSE // Error bgrNameState := 30009;...
System behavior Configuring the PROFINET IO interface The following should be noted when configuring the PROFINET IO interface of the SIMOTION device (IO device): The configured quantity structure of the data to be exchanged must be identical in both the IO device and the higher-level IO controller.
Page 53
4.4 Setting the IP address (on Ethernet) System functions As of SIMOTION Kernel version V4.4, the following functions should be used in new projects: ● _getPnIpConfig (as of Kernel V4.4) You can use this function to determine the IP configuration of an Ethernet interface which you can specify via the logical diagnostics address of the port.
Page 54
Setting the communication addresses via the user program 4.4 Setting the IP address (on Ethernet) Example with _getPnIpConfig and _setPnIpConfig (as of V4.4, asynchronous call) result_setIpConfig : UDINT; ioId : EnumIoIdType; logAddress : DINT; : ARRAY [0..3] OF USINT; mask : ARRAY [0..3] OF USINT;...
Page 55
Setting the communication addresses via the user program 4.4 Setting the IP address (on Ethernet) Example with _getPnIpConfig and _setPnIpConfig (as of V4.4, asynchronous call) bgrPnIpConfig.ioId := INPUT; bgrPnIpConfig.logAddress := X150_PORT_1_LOG_ADDRESS; // 16378; bgrPnIpConfig.ip [0] := 169; bgrPnIpConfig.ip [1] := 250; bgrPnIpConfig.ip [2] := 11;...
Page 56
Setting the communication addresses via the user program 4.4 Setting the IP address (on Ethernet) Example with _getIpConfig and _setIpConfig (up to V4.3) (* IP address of the configuration will be read from the input with address 0. *) ip_conf_id AT %IB0 : USINT; END_VAR // Read the current data of the Ethernet interfaces ipRead[1] := _getIpConfig (...
Activating and deactivating components and technology objects This section describes how PROFIBUS DP slaves and technology objects are activated and deactivated. Activating and deactivating nodes on the PROFIBUS or PROFINET IO The user has configured and programmed a maximum configuration. The user program deactivates bus nodes that are not available or not required in order to achieve the following: ●...
Activating and deactivating components and technology objects 5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO The syntax of these system functions is described in detail in the "System Functions/Variables Devices" List Manual (reference list) and in the online help (see index). Note Technology objects are often assigned to the distributed I/O (DP slave, IO device);...
Page 59
Activating and deactivating components and technology objects 5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO information relating to the status diagram (Page 60), asynchronous calls (Page 62) and synchronous calls (Page 64). Functions (Page 68) are available for converting a PROFIBUS address or device number for PROFINET IO into the logical diagnostics address and vice versa.
Activating and deactivating components and technology objects 5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO Example structure of a modular machine Figure 5-1 Example of a modular machine with differentiation between DP address and logical diagnostics address 5.1.1.1 Status diagram for the functions _activateDpSlave and _deactivateDpSlave The figure below shows the states of the system functions _activateDpSlave and...
Page 61
Activating and deactivating components and technology objects 5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO ● With an asynchronous call (parameter nextCommand := IMMEDIATELY), the user program is continued immediately after the start of the system function. You must regularly query the state of the function to be able to determine when a command has been executed in full.
Activating and deactivating components and technology objects 5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO Return values: 16#0000_0001 // Activation successful, station recovery alarm is issued 16#0000_0002 // Deactivation successful, station failure alarm is issued 16#0000_0005 // Station already activated, station recovery alarm is not issued 16#0000_0006 // Station already deactivated, station failure alarm is not issued 16#0000_7000...
Page 63
Activating and deactivating components and technology objects 5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO 1. Call the following parameters to start the system function: – reqActDeactGetStateMode := REQUEST_TRUE – nextCommand := IMMEDIATELY 2. Check the return value. –...
● Query the activation state using system functions (Page 66) ● Query the status using system functions (Page 67) ● Monitor the status in the engineering system (e.g. SIMOTION SCOUT) (Page 68). 5.1.2.1 Querying the activation state of the DP slaves and IO devices using system functions...
Activating and deactivating components and technology objects 5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO 5.1.2.2 Querying the status of the DP slaves and IO devices using system functions System functions The system functions _getStateOfAllDPStations, _getStateOfAllDpSlaves, and _getStateOfSingleDpSlave can be used to query the status of all or just one DP slave or IO device in a user program.
All DP slaves and IO devices connected to the SIMOTION device's subnets and their states are displayed. Note Up to version V3.0 of the SIMOTION kernel, only the statuses of those DP slaves that are drives are displayed. 5.1.3 Converting a PROFIBUS address or device number for PROFINET IO into the...
Activating and deactivating components and technology objects 5.2 Option handling for ET 200S with reserve modules For more details, please refer to the SIMOTION SCOUT online help. 5.2.1 Principle of operation of option handling without reserve modules Principle In the case of option handling without RESERVE modules, the configuration data are insufficient to compare the preset configuration with the actual configuration.
STEP 7 as from: You do not require a GSD file for option handling in ● STEP 7 V5.3 SP 3 with HSP0102 You can find the description for option handling in the STEP 7 Online Help or SIMOTION SCOUT. 5.2.3...
Activating and deactivating components and technology objects 5.2 Option handling for ET 200S with reserve modules Figure 5-3 Example for use without RESERVE modules 5.2.4 Assigning parameters for option handling without reserve modules Introduction You configure option handling without RESERVE modules as described below. Basic Functions for Modular Machines Function Manual, 04/2014...
Page 72
Activating and deactivating components and technology objects 5.2 Option handling for ET 200S with reserve modules Procedure 1. Drag a PM-E 24..48 VDC or PM-E 24..48 VDC/24..230 VAC power module with one of the following entries into the configuration table: –...
Note For consistent access to the control and feedback interface, create an I/O variable of BYTE data type and array length 8 in SIMOTION SCOUT. This procedure is comparable with the SFC 14/15 for SIMATIC S7. Principle The control and feedback interface is located in the input and output process image of the PM- E 24..48 VDC or PM-E 24..48 VDC/24..230 VAC power modules.
Page 74
Activating and deactivating components and technology objects 5.2 Option handling for ET 200S with reserve modules Control interface PIQ (AB x to AB x+7): You must inform the IM151-1 via the control interface about which modules actually exist and which slots have been left out. The IM151-1 cannot evaluate the configuration until it has received this information.
Activating and deactivating components and technology objects 5.3 Activating and deactivating SINAMICS components Activating and deactivating SINAMICS components There is a fundamental difference between how individual components are activated and deactivated within a SINAMICS S120 multi-axis group and the corresponding procedures for, say, I/O components.
Page 76
Activating and deactivating components and technology objects 5.3 Activating and deactivating SINAMICS components ● With the machine switched off, "drive 1" is removed and the DRIVE-CLiQ cable from the control unit is connected directly to "drive 2" (sub-topology, actual topology). ●...
Page 77
Activating and deactivating components and technology objects 5.3 Activating and deactivating SINAMICS components Figure 5-5 Example of a sub-topology Basic Functions for Modular Machines Function Manual, 04/2014...
Activating and deactivating components and technology objects 5.4 Activating and deactivating technology objects Activating and deactivating technology objects The user has configured and programmed a maximum configuration. Technology objects which are not required (e.g. those assigned to deactivated DP slaves or IO devices) can be deactivated without restarting during operation.
Activating and deactivating components and technology objects 5.4 Activating and deactivating technology objects 5.4.1 System functions for activating and deactivating technology objects System functions Use the functions _deactivateTo and _activateTo to activate and deactivate the technology objects during runtime. The related technology object is transferred in parameter TO_Instance (data type ANYOBJECT).
Activating and deactivating components and technology objects 5.4 Activating and deactivating technology objects Start the status query of the function with parameter reqActDeactGetStateMode := REQUEST_FALSE. Use the same command ID as for the first call. Note To correctly complete the function on an asynchronous call, you must call the function with the parameter reqActDeactGetStateMode := REQUEST_FALSE as often as necessary until you obtain 16#0000_0000 as the return value or an error message.
Page 81
5. On error-free completion of the functions _activateTo and _deactivateTo note the information below. Note Note for versions up to and including V4.0 of the SIMOTION Kernel: The activation or deactivation of the technology object is not yet finished on completion without errors of the functions _activateTo or _deactivateTo.
Activating and deactivating components and technology objects 5.4 Activating and deactivating technology objects Example program for the asynchronous call for the _activateTo function INTERFACE USEPACKAGE Cam; PROGRAM backGround; VAR_GLOBAL bgrRequestActivate : DINT := 0; bgrResultActivate : DINT := 0; bgrToInstance : posaxis;...
Page 83
For the functions _activateTo and _deactivateTo note the information below. Note Note for versions up to and including V4.0 of the SIMOTION Kernel: The activation or deactivation of the technology object is not yet finished on completion without errors of the functions _activateTo or _deactivateTo.
2. Select the SIMOTION device (e.g. D435) in the project navigator. 3. Select the Edit > Object states menu. A list of all technology objects configured on this SIMOTION device is displayed. The check box in front of the identifier of each technology object indicates whether it is activated during the transition from STOP to RUN operating mode.
You can now carry out the following for individual technology objects: ● Query the activation state using system functions (Page 85) ● Monitor the activation state in the engineering system (e.g. SIMOTION SCOUT) (Page 86). 5.4.3.1 Querying the activation state of technology objects using system functions...
Monitoring the activation state of technology objects in the engineering system You can monitor the current activation state of the technology objects of a SIMOTION device in the engineering system (e.g. SIMOTION SCOUT). The engineering system must be in online mode.
(e.g. axis). – Start the deactivation process with the system function _deactivateTo (Page 79). – Only up to version V4.0 of the SIMOTION kernel: After error-free completion of the _deactivateTo system function, keep calling the _getStateOfTo (Page 85) system function until the commandIdState component of the return value (data type EnumStateOfTo) has the value INACTIVE.
Page 88
(e.g. measuring inputs, output cams, synchronous objects). – Start the activation process with the system function _activateTo (Page 79). – Only up to version V4.0 of the SIMOTION kernel: After error-free completion of the _activateTo system function, keep calling the _getStateOfTo (Page 85) system function until the commandIdState component of the return value (data type EnumStateOfTo) has the value ACTIVE.
(Page 89)) or select it via an initial configuration (see Selecting and activating a configuration using an initial configuration (Page 99)). 2. Replace the active kernel of the SIMOTION device with another one whose card image is present on the memory card (see Activating a kernel (Page 94)).
Page 90
Changing the active configuration or the active kernel 6.1 Activating a configuration card of the SIMOTION device. After the machine module is connected to the base machine, the user program identifies the relevant machine module. System function When the _activateConfiguration system function is initiated, the user program loads the required configuration and restarts the SIMOTION device.
For the implementation of a modular machine, several projects with their drive configurations can be stored on the SIMOTION memory card. These configurations can then be activated, and it is possible to switch between the different configurations. You must therefore ensure that all projects with their drive configurations (incl.
Example for the activation of a configuration Description In the figure below, a transport device with a SIMOTION control transports a workpiece to various machining stations. The following sequences can be observed here: 1. Drawing a blank from the store and transporting it to the machining station.
Page 93
; // ... END_IF; About parameter timeOut The timeOut parameter specifies the maximum time the SIMOTION device can require after the restart until the RUN mode is reached. When this time is exceeded, the system performs the following actions: 1. The system tries to activate the initial configuration (if present), and to use this to select a configuration (see Selecting and activating a configuration using an initial configuration (Page 99)).
6.2.1 Activating a kernel This section describes how you can exchange the active kernel of the SIMOTION device using the user program and, for example, carry out an update to a new version without having to replace the memory card of the device. In this regard, you must replace all configurations (configuration data) of the SIMOTION device.
Page 95
Directory structure on the memory card System function To activate the SIMOTION Kernel stored on the card, call in the user program the _activateConfiguration system function with the kernel := YES parameter. In the kernelId parameter, specify the last six characters of the directory name on the memory card (example: Directory name = VE004156, kernelId = 16#004156).
SIMOTION device under the path: \user\simotion\hmicfg \userdatabase. When changing the SIMOTION Kernel version from 4.3 to V4.4, an attempt is made to convert the previous user administration into the new format. However, this is not always possible (e.g.
Page 97
Changing the active configuration or the active kernel 6.2 Activating a kernel Example for activating a kernel without details of a configuration to be activated // Variable declaration retActivateConf : StructRetConfiguration; newKernelId : UDINT; // kernelId of the // kernel to be loaded END_VAR newKernelId := 16#004156;...
Page 98
Changing the active configuration or the active kernel 6.2 Activating a kernel Example for activating a kernel with details of a configuration to be activated kernel := YES, kernelId := newKernelId, timeOut := T#5m // 5 minutes IF ( 0 <> retActivateConf.result ) THEN // Error response ;...
6.3.1 Selecting and activating a configuration using an initial configuration Loading an initial configuration during ramp-up (after POWER ON) of a SIMOTION device ensures that it can be integrated failure-free into a running communication network of another device after switch-on.
Page 100
(e.g. using a connector coding), and automatically loads the required configuration. The card images for all configurations that the SIMOTION device (machine module) can transfer to the base machine is stored on its memory card. The initial configuration also stored there will be loaded automatically after POWER ON.
Page 101
(Page 105) Note If one or more CX32 controller extensions are connected to a SIMOTION D4x5, please note the following when activating a configuration with the _activateConfiguration function: The activated configuration will only take effect on the CX32 controller extension after the CX32 has been restarted.
SelfAdaptingConfiguration functionality is active Figure 6-4 Status diagram for what happens when a SIMOTION device is switched on depending on whether or not the SelfAdaptingConfiguration functionality is active When the device is switched on (POWER ON), the SIMOTION performs a one-off run through the status diagram: ●...
Changing the active configuration or the active kernel 6.3 Selecting and activating a configuration using an initial configuration 6.3.3 Example program for an initial configuration The following example program shows the determination and activation of a configuration in the initial configuration: Example for activating a configuration in an initial configuration // Variable declaration ipRead...
Changing the active configuration or the active kernel 6.4 Reading the activation state of configurations Reading the activation state of configurations You can use the _getConfigurationData function to query the status of the last two calls of the _activateConfiguration system function. The syntax of this system function is described in detail in the "System Functions/Variables Devices"...
Changing the active configuration or the active kernel 6.5 Retaining retentive data in the event of a configuration change Example program for the _getConfigurationData (synchronous call) function // Variable declaration configurationInfoId : EnumConfigurationInfoId; locRequest : EnumReqSysFunctMode; nextCommand : EnumNextCommandMode; locCommandId : CommandIdType;...
Page 106
Proceed as follows to ensure the retentive system variables of technology objects are retained (not initialized) during a configuration change. Configure the SIMOTION devices and the technology objects in the following manner in all configurations: 1. Set the system variable of the SIMOTION device _configurationManagement.preserveToRetainData := YES in offline.
Preparing the memory card of the SIMOTION device Check the following: 1. The SIMOTION Kernel for the associated SIMOTION device is present on the card. 2. The INSTALL directory in the root directory of the card does not contain any files or subdirectories.
Creating the work directories on the PC/PG You must create the required work directories in the file directory of the PC/PG on which the SIMOTION SCOUT engineering software is installed. The directory structures for the following applications are described in the following: 1.
Page 109
– /d"Destination Path" option: Specification of the complete path for the directory for storing the card images (e.g. /d"d:\modular_machine\cardfiles"). – /i"Identifier" option: Specification of the identifier for the version of the SIMOTION Kernel in the form VEyyyyyy, where yyyyyy is a hexadecimal number (e.g. /i"VE004156").
Page 110
3. Copy or move the download and zip directories to the directories that you have just created (e.g. VE004153 and VE004156). 4. In the cardfiles\INSTALL\SIMOTION directory, copy the VEyyyyyy directory (e.g. VE004156) corresponding to the number of kernel versions. Assign unique names to the copies in the form of VEyyyyyy, where yyyyyy is a hexadecimal number (e.g.
PC/PG. Requirements You have created a project in the SIMOTION SCOUT engineering system in which the required configurations are configured as dedicated devices (with technology objects, programs, etc.). This project has been compiled without errors.
Page 112
6.6 Procedure for creating the card images of configurations Note For the procedure with SIMOTION D4xx devices up to version V4.1.4 (V4.1 SP4) of the SIMOTION Kernel: See the appendix, "Storing configuration files for SIMOTION D4xx devices up to kernel version V4.1.4 (Page 129)".
Page 113
DExxxxxx directory of the respective configuration: ● The user administration depends on the configuration to be activated. ● The SIMOTION Kernel version changes (particularly for a change from a version up to 4.3 to a version as of 4.4) with the configuration to be activated.
Changing the active configuration or the active kernel 6.6 Procedure for creating the card images of configurations 6.6.4 Creating the compressed configuration files Proceed as follows to compress the configuration files 1. Create a batch file (e.g. make_zip.bat). 2. Edit this batch file. Write a command line for each configuration to start the u7mkcnfx.exe application with the following options: –...
Saving the kernel in the work directory on the PC/PG You can obtain the kernel (firmware) suitable for the stored configurations in two ways: ● As of version V4.1 of the SIMOTION Kernel, directly from a SIMOTION device that is connected via Ethernet to the PC/PG:...
Page 116
/a"ON": The initial configuration is started after each POWER ON. /a"OFF": The initial configuration is not started after POWER ON. /i"Identifier" option: Specification of the identifier for the version of the SIMOTION Kernel (as described in Creating the work directories on the PC/PG (Page 108)). The identifier has the form VEyyyyyy, where yyyyyy is a hexadecimal number (e.g.
Page 117
– The INITIAL subdirectory contains the card image of the initial configuration INITIAL.ZIP. – The PACKAGE subdirectory contains the card image of the technology packages. – The KERNEL subdirectory contains the card image of the SIMOTION Kernel KERNEL.ZIP. A BOOT.INI file is also created in the specified directory (e.g. D:\modular_machine \cardfiles).
Page 118
Changing the active configuration or the active kernel 6.6 Procedure for creating the card images of configurations Note The steps described in this chapter can also be automated by means of SCOUT scripting. A corresponding script is shown in the appendix in "Creating the card images of the configurations"...
Appendix Command line application u7mkcnfx.exe Command line application for Windows, with which the card images of the configurations and the SIMOTION Kernel are created in several steps (/m"Mode" option). Options The following options are available: /m"Mode" Specification of the functional principle of the command line application.
Page 120
Appendix A.1 Command line application u7mkcnfx.exe /m"MAKE_STORE" Creating card images The following additional options must be specified: ● /s"Source Path" ● /d"Destination Path" ● /a"Mode Self Adapting Configuration" ● /i"Identifier" For application information and an example, see Chapter Creating the card images of the configurations (Page 115) and Creating the card images of the configurations (Page 115) in the appendix.
Only for options m/"MAKE_DIRS", /m"MAKE_STORE" and m/"MAKE_ZIP ● For options /m"MAKE_DIRS", /m"MAKE_STORE" and /m"MAKE_STORE_ARCHIVE" Specification of the identifier for the version of the SIMOTION Kernel. The identifier has the form VEyyyyyy, where yyyyyy is a hexadecimal number (e.g. /i"VE004156"). With this number you specify the kernel version for the call of the _activateConfiguration system function (see Activating a kernel (Page 94)).
A.2.1 Creating the script folder in the SCOUT project First, you must set up the folder in the engineering system (e.g. SIMOTION SCOUT) in which the scripts will be stored. Proceed as follows: 1.
Page 123
Appendix A.2 Creating the card images for the configuration server by means of SCOUT scripting Set objFso = CreateObject("Scripting.FileSystemObject") basePath = "d:\modular_machine" App.PrintToLog "remove dirs ...\cardfiles ..." _ & "\download ...\zip ...\cfes" If (objFso.FolderExists(basePath)) Then App.PrintToLog "delete folder basePath" call objFso.deleteFolder(basePath) End If If not (objFso.FolderExists(basePath)) Then App.PrintToLog "create basePath ...\modMach"...
Appendix A.2 Creating the card images for the configuration server by means of SCOUT scripting End If App.LogActive = False A.2.3 Saving the configuration files in the work directories on the PC/PG The following script "downl" stores the configuration files of the configured device in the download directory, see also Storing the configuration files in the file system (Page 111).
Page 127
The card images in the cardfiles directory and the BOOT.INI file can then be transferred to the memory card of the SIMOTION device via a read/write device connected to the PG/PC (Creating the card images of the configurations (Page 115)).
For other target devices, the scripts are to be changed accordingly. After loading the card images, the SIMOTION devices must be restarted in order for the card images to become effective as the active configuration. Setting up an online connection to the target device The following script "online"...
Storing configuration files for SIMOTION D4xx devices up to kernel version V4.1.4 Requirements 1. You have created a project in the SIMOTION SCOUT engineering system in which the required configurations are configured as dedicated devices with technology objects, programs, etc.
Page 130
5. The PC with the SIMOTION SCOUT engineering system is connected to the SIMOTION device (e.g. via PROFIBUS). 6. The PC is included in the network of the SIMOTION device (e.g. with NetPro). 7. A read/write device for the memory card is connected to the PC.