Siemens Simatic S7-1500 Function Manual

Siemens Simatic S7-1500 Function Manual

Show thumbs Also See for Simatic S7-1500:
Table of Contents
Table of Contents
loading

Summary of Contents for Siemens Simatic S7-1500

  • Page 2 ___________________ Preface ___________________ Guide ___________________ SIMATIC Product overview ___________________ Installing S7-1500 S7-PLCSIM Advanced ___________________ Communication paths ___________________ Simulate CPU Function Manual ___________________ Virtual time response ___________________ User interfaces (API) ___________________ Restrictions ___________________ List of abbreviations 12/2017 A5E37039512-AB...
  • Page 3 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.
  • Page 4: Preface

    S7-PLCSIM Advanced V2.0. You can use this software to simulate and test your SIMATIC STEP 7 programs on a virtual controller. You can obtain updates to the function manual as downloads on the Internet (https://support.industry.siemens.com/cs/us/en/view/109739154). An application example for S7-PLCSIM Advanced is also available on the Internet (https://support.industry.siemens.com/cs/ww/en/view/109739660).
  • Page 5 In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions only form one element of such a concept. Customer is responsible to prevent unauthorized access to its plants, systems, machines and networks.
  • Page 6: Table Of Contents

    Table of contents Preface ..............................4 Guide ..............................27 Documentation guide ......................27 S7-PLCSIM products ......................29 Product overview ..........................30 What is S7-PLCSIM Advanced? .................... 30 Compatibility during upgrade ....................31 Security for S7-PLCSIM Advanced ..................32 Simulations support ....................... 33 Supported CPUs ........................
  • Page 7 Table of contents Download ..........................64 Network addresses in the simulation ..................66 5.4.1 Siemens PLCSIM Virtual Ethernet Adapter ................66 5.4.2 PLCSIM Advanced instances ....................66 Simulate peripheral I/O ......................68 Simulate communication ......................69 5.6.1 Communication services that can be simulated ..............69 5.6.2...
  • Page 8 Table of contents Global functions (Native C++) ....................106 API ISimulationRuntimeManager ..................111 7.5.1 Interfaces - Information and settings..................111 7.5.2 Simulation Runtime instances ....................113 7.5.3 Remote connections ......................119 7.5.4 Events ..........................124 7.5.4.1 OnConfigurationChanged events..................124 7.5.4.2 OnRuntimeManagerLost events ..................
  • Page 9 Table of contents API IRemoteRuntimeManager ....................265 7.7.1 Interfaces - Information and settings ..................265 7.7.2 Simulation Runtime instances ....................268 7.7.2.1 Simulation Runtime instances (remote) ................268 7.7.3 Events ........................... 275 7.7.3.1 OnConnectionLost events ....................275 Data types ..........................279 7.8.1 DLL import functions (Native C++) ..................
  • Page 10 Table of contents 7.8.6 Structures ..........................309 7.8.6.1 SDataValue .......................... 309 7.8.6.2 SDVBNI ..........................311 7.8.6.3 SDataValueByAddress ......................311 7.8.6.4 SDataValueByAddressWithCheck ..................312 7.8.6.5 SDataValueByName ......................312 7.8.6.6 SDataValueByNameWithCheck ................... 313 7.8.6.7 SConnectionInfo........................313 7.8.6.8 SInstanceInfo ........................314 7.8.6.9 SDimension .......................... 314 7.8.6.10 STagInfo ..........................
  • Page 11 Table of contents Restrictions with Motion Control ................... 352 8.9.1 MCR and EMCR ........................352 8.9.2 Technology modules ......................353 8.9.3 OB 91 and OB 92 ........................353 8.10 Restrictions to local communication via Softbus ..............354 8.11 Restrictions of security with VMware vSphere Hypervisor (ESXi) ........355 8.12 Error with overflow of cyclical events and motion OBs ............
  • Page 12 Table of contents List of abbreviations ..........................358 Tables Table 1- 1 Comparison of S7-PLCSIM products ................... 29 Table 2- 1 Compatibility of API and Runtime versions .................. 31 Table 2- 2 Supported CPUs .......................... 34 Table 2- 3 Compatibility to the TIA Portal...................... 35 Table 3- 1 Minimum requirements for hardware ...................
  • Page 13: S7-Plcsim Advanced Function Manual, 12/2017, A5E37039512-Ab

    Table of contents Table 7- 25 GetNameOfAreaSection() - Native C++ ..................106 Table 7- 26 GetNameOfCPUType() - Native C++ ..................106 Table 7- 27 GetNameOfCommunicationInterface() - Native C++ ..............106 Table 7- 28 GetNameOfDataType() - Native C++ ..................106 Table 7- 29 GetNameOfErrorCode() - Native C++ ..................
  • Page 14 Table of contents Table 7- 61 ClosePort() - Native C++ ......................120 Table 7- 62 ClosePort() - .NET (C#) ......................120 Table 7- 63 GetPort() - Native C++ ....................... 120 Table 7- 64 Port { get; } - .NET (C#) ......................121 Table 7- 65 GetRemoteConnectionsCount() - Native C++ ................
  • Page 15 Table of contents Table 7- 97 GetCommunicationInterface() - Native C++ ................133 Table 7- 98 SetCommunicationInterface() - Native C++ ................133 Table 7- 99 CommunicationInterface { get; set; } - .NET (C#) ..............134 Table 7- 100 GetInfo() - Native C++ ........................ 134 Table 7- 101 Info { get;...
  • Page 16 Table of contents Table 7- 133 Stop() - .NET (C#) ........................151 Table 7- 134 UpdateTagList() - Native C++ ....................153 Table 7- 135 UpdateTagList() - .NET (C#) ...................... 154 Table 7- 136 GetTagListStatus() - Native C++ ....................155 Table 7- 137 GetTagListStatus() - .NET (C#)....................
  • Page 17 Table of contents Table 7- 169 ReadInt16() - .NET (C#) ......................178 Table 7- 170 ReadInt32() - Native C++ ......................179 Table 7- 171 ReadInt32() - .NET (C#) ......................179 Table 7- 172 ReadInt64() - Native C++ ......................180 Table 7- 173 ReadInt64() - .NET (C#) ......................
  • Page 18 Table of contents Table 7- 205 WriteUInt8() - .NET (C#) ......................204 Table 7- 206 WriteUInt16() - Native C++ ......................205 Table 7- 207 WriteUInt16() - .NET (C#) ......................206 Table 7- 208 WriteUInt32() - Native C++ ......................207 Table 7- 209 WriteUInt32() - .NET (C#) ......................
  • Page 19 Table of contents Table 7- 241 Overview - API methods and associated events ............... 228 Table 7- 242 ReadRecordDone() - Native C++....................230 Table 7- 243 ReadRecordDone() - .NET (C#) ....................230 Table 7- 244 WriteRecordDone() - Native C++ ....................231 Table 7- 245 WriteRecordDone() - .NET (C#) ....................
  • Page 20 Table of contents Table 7- 277 WaitForOnSyncPointReachedEvent() - Native C++ ..............249 Table 7- 278 WaitForOnSyncPointReachedEvent() - .NET (C#) ..............249 Table 7- 279 OnConfigurationChanging - .NET (C#) ..................249 Table 7- 280 RegisterOnConfigurationChangingCallback() - Native C++ ............250 Table 7- 281 RegisterOnConfigurationChangingEvent() - Native C++ ............
  • Page 21 Table of contents Table 7- 313 OnPullOrPlugEventDone() - .NET (C#) ..................260 Table 7- 314 RegisterOnPullOrPlugEventDoneCallback() - Native C++ ............260 Table 7- 315 UnregisterOnPullOrPlugEventDoneCallback() - Native C++ ............. 261 Table 7- 316 OnStatusEventDone() - .NET (C#) .................... 261 Table 7- 317 RegisterOnStatusEventDoneCallback() - Native C++ ...............
  • Page 22 Table of contents Table 7- 349 RegisterOnConnectionLostCallback() - Native C++ ..............276 Table 7- 350 RegisterOnConnectionLostEvent() - Native C++ ............... 276 Table 7- 351 RegisterOnConnectionLostEvent() - .NET (C#) ................. 276 Table 7- 352 UnregisterOnConnectionLostCallback() - Native C++ ............... 277 Table 7- 353 UnregisterOnConnectionLostEvent() - Native C++ ..............
  • Page 23 Table of contents Table 7- 385 Delegate_SREC_ST_UINT32_UINT32_EPET_UINT32 - Native C++ ........302 Table 7- 386 Delegate_SREC_ST_UINT32 - .NET (C#) ................. 303 Table 7- 387 Delegate_SREC_ST_UINT32_UINT32 - .NET (C#) ..............304 Table 7- 388 Delegate_SREC_ST_UINT32_ERSFET - .NET (C#) ..............305 Table 7- 389 Definitions - Native C++ ......................
  • Page 24 Table of contents Table 7- 421 SDataRecord - .NET (C#) ......................322 Table 7- 422 SConfiguredProcessEvents - Native C++ .................. 323 Table 7- 423 SConfiguredProcessEvents - .NET (C#) ..................323 Table 7- 424 SDiagExtChannelDescription - Native C++ ................324 Table 7- 425 SDiagExtChannelDescription - .NET (C#) .................
  • Page 25 Table of contents Table 7- 457 EPullOrPlugEventType - .NET (C#) ................... 344 Table 7- 458 EProcessEventType - Native C++ ..................... 344 Table 7- 459 EProcessEventType - .NET (C#) ....................345 Table 7- 460 EDirection - Native C++ ......................345 Table 7- 461 EDirection - .NET (C#) .......................
  • Page 26 Table of contents Figures Figure 2-1 Enable simulation capability ......................33 Figure 4-1 Local communication via Softbus ....................53 Figure 4-2 Local communication via TCP/IP ....................53 Figure 4-3 Distributed communication via Ethernet ..................54 Figure 4-4 Distributed communication via network adapters ................ 55 Figure 4-5 Activate PLCSIM Virtual Switch ....................
  • Page 27: Guide

    ET 200SP distributed I/O system is arranged into three areas. Basic information System manuals and Getting Started describe in detail the configuration, installation, wiring and commissioning of the SIMATIC S7-1500 and ET 200SP systems. The STEP 7 online help supports you in configuration and programming. Device information Product manuals contain a compact description of the module-specific information, such as properties, terminal diagrams, characteristics and technical specifications.
  • Page 28 You must register once to use the full functionality of "mySupport". You can find "mySupport" on the Internet (http://support.industry.siemens.com/My/ww/en/documentation). "mySupport" - Documentation In the Documentation area in "mySupport" you can combine entire manuals or only parts of these to your own manual.
  • Page 29: S7-Plcsim Products

    Guide 1.2 S7-PLCSIM products S7-PLCSIM products PLCSIM Advanced V2.0, PLCSIM V15 and PLCSIM V5.x Table 1- 1 Comparison of S7-PLCSIM products Function PLCSIM Advanced V2.0 PLCSIM V15 PLCSIM V5.x Runtime Independent Programming with STEP 7 Programming with STEP 7 User interface Control Panel Look&Feel of TIA Portal Look&Feel of STEP 7 V5.x...
  • Page 30: Product Overview

    Product overview What is S7-PLCSIM Advanced? Using PLCSIM Advanced, you can simulate your CPU programs on a virtual controller. You do not need any real controllers for this. You can configure your CPU with STEP 7 in the TIA Portal, program your application logic and then load the hardware configuration and the program into the virtual controller.
  • Page 31: Compatibility During Upgrade

    Product overview 2.2 Compatibility during upgrade Compatibility during upgrade Compatibility of API and Runtime versions The installation of PLCSIM Advanced V2.0 leads to an upgrade of an existing earlier version. However, the Runtime Manager of PLCSIM Advanced V2.0 is compatible with projects that were created with the API version V1.0.
  • Page 32: Security For S7-Plcsim Advanced

    Product overview 2.3 Security for S7-PLCSIM Advanced Security for S7-PLCSIM Advanced Restrictions for security Note the following restrictions when using PLCSIM Advanced: Authentication ● The user interfaces (API) do not have options for authentication and authorization. There is no protection using user accounts and passwords. ●...
  • Page 33: Simulations Support

    Product overview 2.4 Simulations support Simulations support Requirement for simulation Note Enable simulation capability To use a STEP 7 project with simulation, you must select the "Support simulation during block compilation" option in the "Protection" tab in the properties of the project and confirm with OK.
  • Page 34: Supported Cpus

    Product overview 2.5 Supported CPUs Supported CPUs Supported CPUs from the S7-1500 family PLCSIM Advanced V2.0 supports the simulation of the following CPUs: Table 2- 2 Supported CPUs Type Version V1.8, V2.0, V2.1, V2.5 Standard CPUs CPU 1511-1 PN CPU 1511F-1 PN CPU 1513-1 PN CPU 1513F-1 PN CPU 1515-2 PN...
  • Page 35: Table 2- 3 Compatibility To The Tia Portal

    Product overview 2.5 Supported CPUs Compatibility to the TIA Portal The following versions of PLCSIM Advanced and the TIA Portal are compatible: Table 2- 3 Compatibility to the TIA Portal PLCSIM Advanced version TIA Portal version Supported CPU version V1.0 SP1 V14 (SP1), V15 V1.8, V2.0 V2.0...
  • Page 36: Differences Between A Simulated And A Real Cpu

    Product overview 2.6 Differences between a simulated and a real CPU Differences between a simulated and a real CPU The virtual controller cannot fully simulate a real CPU down to the individual details. Even if a program is downloaded without errors to the CPU and running successfully, this does not necessarily mean that the virtual controller in the simulation behaves exactly like a real CPU.
  • Page 37: Restrictions For All Supported Cpus

    Product overview 2.6 Differences between a simulated and a real CPU 2.6.1 Restrictions for all supported CPUs Bus systems PLCSIM Advanced does not simulate bus systems (PROFINET IO, PROFIBUS DP, backplane bus). PLCSIM Advanced simulates the real CPU, but not configured I/O modules and the on-board I/O of the compact CPUs.
  • Page 38 Product overview 2.6 Differences between a simulated and a real CPU Recipes PLCSIM Advanced does not simulate the use of recipes. Copy protection PLCSIM Advanced does not simulate copy protection. Limited support PLCSIM Advanced simulates some functions to a limited extent. You can find an overview in the section Restrictions (Page 347).
  • Page 39: Simulating Motion Control

    Additional information Information on "Setting in the drive and encoder connection" for actual value calculation of a virtual axis and on the topic "Virtual axis/Simulation" is available in the S7-1500T Motion Control (https://support.industry.siemens.com/cs/ww/en/view/109481326) function manual. S7-PLCSIM Advanced Function Manual, 12/2017, A5E37039512-AB...
  • Page 40: Installing

    Recommendation: Create up to 4 local instances on your PC or virtualization platform. Minimum requirements for hardware Preferably, you should install PLCSIM Advanced stand-alone on a Siemens field programming device or PC, independent of STEP 7. Alternatively, you can install PLCSIM Advanced on the configuration PC on which STEP 7 is already installed.
  • Page 41 ● VMware vSphere Hypervisor (ESXi) 6.5 ● VMware Workstation 12.5.5 ● VMware Workstation Player 12.5.5 The information that you need to install STEP 7 (TIA Portal) on a virtual machine is available on the Internet (https://support.industry.siemens.com/cs/en/en/view/78788417). S7-PLCSIM Advanced Function Manual, 12/2017, A5E37039512-AB...
  • Page 42: Licenses

    Installing 3.1 Introduction 3.1.2 Licenses Floating license PLCSIM Advanced is supplied with a floating type license. It can be stored locally and shared for a network. Note Validity A license is valid for up to three instances within a PLCSIM Advanced installation. PLCSIM Advanced V2.0 cannot be used with a V1.0 license.
  • Page 43 Installing 3.1 Introduction A message at the start of the instances shows the remaining number of days. Note Remote access With remote access, the message must be confirmed on the computer on which the instance was started. Note Sequence of the Trial License If no valid license is available after the Trial License has elapsed, the instance is no longer started.
  • Page 44: Installation Log

    An archive file with the installation log and all other required files is stored in CAB format. This archive file can be found at "%autinstlog%\Reports\Setup_report.cab". If you need help during installation, send this CAB file to SIEMENS Technical Support. Technical Support personnel can troubleshoot your installation based on the information in the CAB file.
  • Page 45: S7-Plcsim Advanced

    Installing 3.2 S7-PLCSIM Advanced S7-PLCSIM Advanced The S7-PLCSIM Advanced package contains the following software: ● S7-PLCSIM Advanced ● Automation License Manager ● S7-PLCSIM V5.4 ● .NET Framework ● WinPcap The package is available as download and on DVD. ● SIMATIC S7-PLCSIM Advanced V2.0 Floating License Download ●...
  • Page 46: Installing S7-Plcsim Advanced

    ● The hardware and software of the computer meet the system requirements. ● You have administrator rights on the installation computer. ● No other programs are active. This also applies to the Siemens Automation License Manager and other Siemens applications.
  • Page 47 Remedy Run the setup for S7-PLCSIM prior or equal to V14 and uninstall the program. When the setup is not available, download the setup files for S7-PLCSIM via Siemens Mall (https://support.industry.siemens.com/cs/ww/en/view/65601780). S7-PLCSIM Advanced...
  • Page 48: Changing S7-Plcsim Advanced

    Installing 3.4 Changing S7-PLCSIM Advanced Changing S7-PLCSIM Advanced Requirements The following conditions must be met before you can start changing the installation: ● The hardware and software of the computer meet the system requirements. ● You have administrator rights on the installation computer. ●...
  • Page 49: Repairing S7-Plcsim Advanced

    Installing 3.5 Repairing S7-PLCSIM Advanced Repairing S7-PLCSIM Advanced Requirements The following conditions must be met before you can start repairing the installation: ● The hardware and software meet the system requirements. ● You have administrator rights on the installation computer. ●...
  • Page 50: Uninstalling S7-Plcsim Advanced

    Uninstalling S7-PLCSIM Advanced using the Windows Control Panel Proceed as follows: 1. Double-click the "Programs and Features" option in the Windows Control Panel. 2. Right-click "Siemens S7-PLCSIM Advanced V2.0" and select "Uninstall". 3. Follow the prompts for uninstallation. 4. Complete the uninstallation operation by restarting your computer.
  • Page 51: Communication Paths

    Communication paths Local and distributed communication The following paths are open for communication between STEP 7 V15 or higher and the instances of PLCSIM Advanced user interfaces: Communication paths Local Local Distributed Protocol Softbus TCP/IP TCP/IP Communication interface in PLCSIM PLCSIM Virtual PLCSIM Virtual PLCSIM Advanced...
  • Page 52 Communication paths API functions for selecting the communication interface ● GetCommunicationInterface() (Page 133) ● SetCommunicationInterface() (Page 133) ● CommunicationInterface { get; set; } (Page 134) See also Interfaces - Information and settings (Page 130) S7 PLCSIM Advanced Control Panel (Page 60) S7-PLCSIM Advanced Function Manual, 12/2017, A5E37039512-AB...
  • Page 53: Local Communication

    Communication paths 4.1 Local communication Local communication Local communication can be performed via the Softbus protocol or TCP/IP. For local communication, the PLCSIM Advanced instance is on the same PC or on the same virtualization platform (VMware) as STEP 7 or another communication partner. Local communication via Softbus Local communication is performed via Softbus in PLCSIM Advanced by default.
  • Page 54: Communication Via Tcp / Ip

    Communication paths 4.2 Communication via TCP / IP Communication via TCP / IP Distributed communication Distributed communication via TCP/IP means that the PLCSIM Advanced instances communicate with the other devices via the Virtual Switch . Communication is possible with real or simulated CPUs, real or simulated HMIs. The PLCSIM Virtual Switch must be activated on the PLCSIM Virtual Ethernet Adapter for instances on the network to be visible.
  • Page 55: Figure 4-4 Distributed Communication Via Network Adapters

    Communication paths 4.2 Communication via TCP / IP Recommendation Use to ensure the VMware settings as the network adapter type for the Bridged Mode to ensure error-free operation. Figure 4-4 Distributed communication via network adapters S7-PLCSIM Advanced Function Manual, 12/2017, A5E37039512-AB...
  • Page 56: Enable Distributed Communication

    1. To do this, open the "Network and Sharing Center" in the Windows Control Panel. 2. Open the properties of the desired network adapter, for example, for the "Local Area Connection". 3. Select the check box for the "Siemens PLCSIM Virtual Switch" and confirm with OK. Figure 4-5 Activate PLCSIM Virtual Switch...
  • Page 57: Figure 4-6 Accessible Devices On The Virtual Ethernet Adapter

    Communication paths 4.3 Enable distributed communication Accessible devices When the PLCSIM Virtual Switch is activated, STEP 7 shows the devices available on the Virtual Ethernet Adapter in the project tree. Figure 4-6 Accessible devices on the Virtual Ethernet Adapter Distributed communication via WLAN When using distributed communication via WLAN, it may happen that the WinPcap software installed by PLCSIM Advanced does not work with the integrated WLAN adapter of the computer.
  • Page 58: Simulate Cpu

    Simulate CPU Basic procedure for the simulation The following overview shows the basic steps to perform simulation with an instance of a virtual controller. Requirements The following requirements must be met for starting simulation via local communication: ● STEP 7 as of V14 and S7-PLCSIM Advanced V2.0 are installed on the same PC. ●...
  • Page 59: User Interface

    Simulate CPU 5.2 User interface User interface 5.2.1 S7 PLCSIM Advanced Symbol After installing PLCSIM Advanced, the following icons are on the Windows desktop: Figure 5-1 PLCSIM Advanced Symbol After double-clicking the icon, the icon appears in the taskbar of the information area. You can use Windows functions to permanently display the icon in the information area of the taskbar.
  • Page 60: S7 Plcsim Advanced Control Panel

    Simulate CPU 5.2 User interface 5.2.2 S7 PLCSIM Advanced Control Panel Control Panel The Control Panel is optional and is not needed to use PLCSIM Advanced via the API. It is available in English in version 2.0. ① Online access Switch to select the communication interface ②...
  • Page 61: Figure 5-3 Control Panel

    Simulate CPU 5.2 User interface ⑤ The input boxes are visible when you switch the communication IP address • interface to "PLCSIM Virtual Ethernet Adapter". The IP address is Subnet mask • entered automatically. Standard gateway • ⑥ CPU type Here you select the type of CPU to be simulated.
  • Page 62 Simulate CPU 5.2 User interface Virtual time Use the slider or the mouse wheel to select the scaling factor for the virtual time. The selected scaling factor applies to the instances for which the virtual time is enabled. Clicking on "Off" restores the default (1) again. For more information, seeVirtual time response (Page 73).
  • Page 63 Simulate CPU 5.2 User interface Display messages Each time the panel starts, help information and messages relating to the Control Panel are displayed, for example, when changing the IP address or when a license is missing. Disable the display if you do not need the messages. Exit ●...
  • Page 64: Download

    In the Download dialog box, select the PG/PC interface: ● "PLCSIM" for download via Softbus ● "Siemens PLCSIM Virtual Ethernet Adapter" for download via TCP/IP ● For distributed communication the real adapter that is connected to the network Display in the download dialog The dialog in STEP 7 at the first download of the CPU shows the compatible PLCSIM Advanced instances.
  • Page 65: Figure 5-4 Example: Download Via The "Plcsim Virtual Ethernet Adapter" (Tcp/Ip) After Naming

    Simulate CPU 5.3 Download Perform download 1. Select the PG/PC interface. 2. Click "Download". → In the "Load preview" window, STEP 7 shows the message "The downloads are performed on a simulated CPU". → After the first download, the PLCSIM Advanced instance displays the CPU type. Figure 5-4 Example: Download via the "PLCSIM Virtual Ethernet Adapter"...
  • Page 66: Network Addresses In The Simulation

    Simulate CPU 5.4 Network addresses in the simulation Network addresses in the simulation 5.4.1 Siemens PLCSIM Virtual Ethernet Adapter IP address At the PLCSIM Virtual Ethernet Adapter you assign a static IP address or obtain an IP address via DHCP (default).
  • Page 67: Table 5- 1 Assignment Of The Ethernet Interfaces, For Example, For A Cpu 1518-4 Pn/Dp

    Example 02-C0-A8-00-83-10 means: 02 → locally managed MAC address of a PLCSIM Advanced instance C0-A8-00-83 → IP of the Siemens PLCSIM Virtual Ethernet adapter = 192.168.0.131 1 → Instance 1 0 → Ethernet interface IE 1 If no Virtual SIMATIC Memory Card is loaded during startup of PLCSIM Advanced, the interfaces of PLCSIM Advanced display instances with their locally managed MAC address.
  • Page 68: Simulate Peripheral I/O

    Simulate CPU 5.5 Simulate peripheral I/O Simulate peripheral I/O The Runtime API writes to and reads from a memory area. This memory is synchronized with the internal process image of the virtual S7-1500 controller at the cycle control point and when calling cyclic and acyclic OBs (process image partitions, interrupts, events).
  • Page 69: Simulate Communication

    Simulate CPU 5.6 Simulate communication Simulate communication 5.6.1 Communication services that can be simulated PLCSIM Advanced V2.0 supports the following communication options: Table 5- 2 Supported communication options Communications options Functionality / instructions PG communication On commissioning, testing, diagnostics Open communication using TCP/IP TSEND_C / TRCV_C •...
  • Page 70: Communication Between Instances

    Simulate CPU 5.6 Simulate communication TMAIL_C When the TMAIL_C instruction is used, the mail server may not be located on the same computer as the PLCSIM Advanced instance. Remedy Make the mail server available via a different computer in the network. 5.6.2 Communication between instances PLCSIM Advanced supports communication between instances.
  • Page 71: Provide Project Data Offline For Simulation

    Simulate CPU 5.7 Provide project data offline for simulation Provide project data offline for simulation Simulations regardless of STEP 7 To perform simulations independent of STEP 7, you can save the user program and the hardware configuration in STEP 7 in a directory. Provide project data offline 1.
  • Page 72 Simulate CPU 5.7 Provide project data offline for simulation Provide project data for simulation 1. On the PC on which PLCSIM Advanced is installed, create the directory \SIMATIC_MC in the directory in which the instance saves its data. 2. Move the \SIMATIC.S7S folder to the directory you have created. →...
  • Page 73: Virtual Time Response

    Virtual time response The virtual controller uses internally two types of clocks for simulation: A virtual clock and a real clock. The virtual clock is always the basis for the user program. It is used by components that are relevant for running the STEP 7 user program, such as cyclic OBs, cycle time monitoring, minimum cycle time, virtual system time and time calculations.
  • Page 74 Virtual time response Scaling factor Using a scaling factor, you can speed up or slow down the virtual clock of the virtual controller for simulations. ● The default is 1, i.e. the course of the virtual time corresponds to the course of real time. ●...
  • Page 75: Speed Up And Slow Down Simulation

    Virtual time response 6.1 Speed up and slow down simulation Speed up and slow down simulation Influence of fast forward and slow motion Simulations can be accelerated and slowed down. Fast forward and slow motion only affects time-based components, for example, cyclic OBs. Compared to the real time, they are performed more frequently with fast forward and less frequently with slow motion.
  • Page 76: Stop Simulation

    Virtual time response 6.2 Stop simulation Stop simulation Freeze state of the virtual controller To stop a simulation and to synchronize a simulation partner, a virtual controller can be set to a freeze state via the API. When the virtual controller has reached a synchronization point, it sends the event to the API clients.
  • Page 77: Figure 6-2 Overview Of The Synchronization Points

    Virtual time response 6.2 Stop simulation Synchronization points A synchronization point always exists before inputs are read in, for example at the cycle control point or at the beginning of a cyclic OB. Figure 6-2 Overview of the synchronization points Trigger freeze state To trigger the freeze state, following modes are available for the virtual controller: ●...
  • Page 78: Synchronize Simulation Partner

    Virtual time response 6.3 Synchronize simulation partner Synchronize simulation partner 6.3.1 Synchronize simulation partner cycle-controlled SingleStep operating modes Several simulation partners (clients) are synchronized cycle-controlled with the SingleStep operating modes of the virtual controller. The operating modes define the synchronization point at which the virtual controller changes to the freeze state and sends the event.
  • Page 79: Figure 6-3 Example: Sequence In The Singlestep_Cp Operating Mode

    Virtual time response 6.3 Synchronize simulation partner Example The figure schematically shows the sequence in the operating mode. SingleStep_CP In addition to the event the virtual controller also sends the virtual time OnSyncPointReached since the last synchronization point of the same process image partition ID or of any process image partition ID has been reached ( TimeSinceSameSyncPoint_ns TimeSinceAnySyncPoint_ns...
  • Page 80: Synchronize Simulation Partner Time-Controlled

    Virtual time response 6.3 Synchronize simulation partner 6.3.2 Synchronize simulation partner time-controlled TimespanSynchronized operating modes Several simulation partners (clients) are synchronized time-controlled with the TimespanSynchronized operating modes of the virtual controller. The operating modes define the synchronization point at which the virtual controller changes to the freeze state and sends the event.
  • Page 81: Figure 6-4 Example: Sequence In The Timespansynchronized_Cp Operating Mode

    Virtual time response 6.3 Synchronize simulation partner Example The figure schematically shows the sequence in the operating TimespanSynchronized_CP mode. In addition to the event the virtual controller also sends the runtime since OnSyncPointReached the last call of the (t) ( StartProcessing TimeSinceSameSyncPoint_ns ) function.
  • Page 82: User Interfaces (Api)

    User interfaces (API) Introduction Components of the Simulation Runtime The following components are relevant for handling the Simulation Runtime of PLCSIM Advanced: ● Runtime – Siemens.Simatic.Simulation.Runtime.Manager.exe – Siemens.Simatic.Simulation.Runtime.Instance.exe ● Libraries – Siemens.Simatic.Simulation.Runtime.Api.x86.dll – Siemens.Simatic.Simulation.Runtime.Api.x64.dll – SimulationRuntimeApi.h ● Documentation of interfaces with examples in native C++ and .NET (Managed Code)
  • Page 83: Figure 7-1 External Applications And Simulation Runtime

    User interfaces (API) 7.1 Introduction External applications and Simulation Runtime The following figure schematically presents the access of external applications to Simulation Runtime via the Runtime API. The Simulation Runtime Manager manages the Runtime instances. These load the libraries of the virtual controllers. An external application can be other simulation software or a graphical user interface (GUI), for example.
  • Page 84: Access To Instances

    User interfaces (API) 7.1 Introduction 7.1.1 Access to instances Access via the Control Panel and the API You can access only one instance that is available locally on the PC via the Control Panel. It does not matter on which PC an instance was created and started. With distributed communication, the Runtime API accesses the instance of the other PCs via the Simulation Runtime Manager.
  • Page 85: User Interfaces (Api)

    User interfaces (API) 7.1 Introduction 7.1.2 User interfaces (API) The user interfaces of Simulation Runtime include functions you use, for example, to create instances, to change the operating state of a virtual controller, or to exchange I/O data. Simulation Runtime has the following user interfaces: ●...
  • Page 86: Overview Of User Interfaces For Native C

    User interfaces (API) 7.1 Introduction 7.1.3 Overview of user interfaces for native C++ Initializing and shutting down API Table 7- 1 Overview of initializing and shutting down API - Native C++ Actions Functions Initialize API InitializeApi (Page 96) RuntimeApiEntry_Initialize (Page 98) DestroyInterface Shut down API (Page 100) RuntimeApiEntry DestroyInterface...
  • Page 87: Table 7- 3 Overview Of Api Isimulationruntimemanager Functions - Native C

    User interfaces (API) 7.1 Introduction API ISimulationRuntimeManager Table 7- 3 Overview of API ISimulationRuntimeManager functions - Native C++ Settings and information Functions GetVersion() Interface (Page 111) IsInitialized() IsRuntimeManagerAvailable() Shutdown() GetRegisteredInstancesCount() Simulation Runtime instances GetRegisteredInstanceInfoAt() (Page 113) RegisterInstance() RegisterCustomInstance() CreateInterface() OpenPort() Remote connections ClosePort() (Page 119)
  • Page 88 User interfaces (API) 7.1 Introduction Settings and information Functions GetOperatingState() Operating state (Page 144) PowerOn() PowerOff() MemoryReset() Run() Stop() UpdateTagList() Tag list (Page 152) GetTagListStatus() GetTagInfoCount() GetTagInfos() CreateConfigurationFile() GetAreaSize() I/O access via address - Read- ReadBit() ing (Page 158) ReadByte() ReadBytes() ReadSignals() WriteBit()
  • Page 89: Table 7- 6 Overview Of Iinstances Events - Native C

    User interfaces (API) 7.1 Introduction Table 7- 6 Overview of IInstances events - Native C++ Events Functions RegisterOnOperatingStateChangedCallback() OnOperatingStateChanged UnregisterOnOperatingStateChangedCallback() (Page 243) RegisterOnOperatingStateChangedEvent() UnregisterOnOperatingStateChangedEvent() WaitForOnOperatingStateChangedEvent() RegisterOnSyncPointReachedCallback() OnSyncPointReached UnregisterOnSyncPointReachedCallback() (Page 247) RegisterOnSyncPointReachedEvent() UnregisterOnSyncPointReachedEvent() WaitForOnSyncPointReachedEvent() RegisterOnConfigurationChangingCallback() OnConfigurationChanging UnregisterOnConfigurationChangingCallback() (Page 249) RegisterOnConfigurationChangingEvent() UnregisterOnConfigurationChangingEvent() WaitForOnConfigurationChangingEvent() RegisterOnConfigurationChangedCallback() OnConfigurationChanged...
  • Page 90: Overview Of User Interfaces For Managed Code

    User interfaces (API) 7.1 Introduction 7.1.4 Overview of user interfaces for managed code Initializing and shutting down API Table 7- 9 Overview of initializing and shutting down API - .NET (C#) Actions Functions Sie- Initialize API (Page 99) mens.Simatic.Simulation.Runtime.SimulationRuntimeManager Shut down API (Page 105) API ISimulationRuntimeManager Table 7- 10 Overview of ISimulationRuntimeManager functions - .NET (C#)
  • Page 91: Table 7- 12 Overview Of Iinstances Functions - .Net (C#)

    User interfaces (API) 7.1 Introduction API IInstances Table 7- 12 Overview of IInstances functions - .NET (C#) Settings and information Functions Dispose () Interface (Page 130) ID { get; } Name { get; } CPUType { get; set; } CommunicationInterface { get; } Info { get;...
  • Page 92: Table 7- 13 Overview Of Iinstances Events - .Net (C#)

    User interfaces (API) 7.1 Introduction Table 7- 13 Overview of IInstances events - .NET (C#) Events Functions OnOperatingStateChanged OnOperatingStateChanged RegisterOnOperatingStateChangedEvent() (Page 243) UnregisterOnOperatingStateChangedEvent() WaitForOnOperatingStateChangedEvent() OnSyncPointReached OnSyncPointReached RegisterOnSyncPointReachedEvent() (Page 247) UnregisterOnSyncPointReachedEvent() WaitForOnSyncPointReachedEvent() OnConfigurationChanging OnConfigurationChanging RegisterOnConfigurationChangingEvent() (Page 249) UnregisterOnConfigurationChangingEvent() WaitForOnConfigurationChangingEvent() OnConfigurationChanged OnConfigurationChanged RegisterOnConfigurationChangedEvent() (Page 252) UnregisterOnConfigurationChangedEvent()
  • Page 93: Overview Of Data Types For Native C

    User interfaces (API) 7.1 Introduction 7.1.5 Overview of data types for native C++ The following table shows which data types are available for the simulation in Runtime Manager. Table 7- 16 Overview of data types - Native C++ Data type ApiEntry_Initialize DLL import functions ApiEntry_DestroyInterface...
  • Page 94: Overview Of Data Types For Managed Code

    User interfaces (API) 7.1 Introduction Data type ERuntimeErrorCode Enumerations (Page 327) EArea EOperatingState EOperatingMode ECPUType ECommunicationInterface ELEDType ELEDMode EPrimitiveDataTypes EDataType ETagListDetails ERuntimeConfigChanged EInstanceConfigChanged New in V2.0: EPullOrPlugEventType EProcessEventType EDirection EDiagProperty EDiagSeverity ERackOrStationFaultType 7.1.6 Overview of data types for managed code The following table shows which data types are available for the simulation in Runtime Manager.
  • Page 95 User interfaces (API) 7.1 Introduction Data type SDataValue Structures (Page 309) SDVBNI SDataValueByAddress SDataValueByName SConnectionInfo SInstanceInfo SDimension STagInfo SIPSuite4 SOnSyncPointReachedResult New in V2.0: SDataValueByAddressWithCheck SDataValueByNameWithCheck SDataRecordInfo SDataRecord SConfiguredProcessEvents SDiagExtChannelDescription ERuntimeErrorCode Enumerations (Page 326) EArea EOperatingState EOperatingMode ECPUType ECommunicationInterface ELEDType ELEDMode EPrimitiveDataTypes EDataType ETagListDetails...
  • Page 96: Initialize Api

    Earlier versions of the API are also installed during the installation of PLCSIM Advanced V2.0. The default path is: ● C:\Program Files (x86)\Common Files\Siemens\PLCSIMADV\API\1.0 ● C:\Program Files (x86)\Common Files\Siemens\PLCSIMADV\API\2.0 The installation path of PLCSIM Advanced is contained in the registry: ●...
  • Page 97: Table 7- 18 Initializeapi() - Native C

    User interfaces (API) 7.2 Initialize API If no DLL is available, the function accesses the next directory. The function returns an interface to the Simulation Runtime Manager. Use this interface to create a new instance of the virtual controller or to obtain access to an existing instance. Table 7- 18 InitializeApi() - Native C++ ERuntimeErrorCode InitializeApi(...
  • Page 98: Runtimeapientry_Initialize

    User interfaces (API) 7.2 Initialize API 7.2.2.2 RuntimeApiEntry_Initialize Description Use the function only if the API library (DLL) is to be loaded RuntimeApiEntry_Initialize from a different directory than the directory of your application that calls this function. When the API is initialized, the API library is first loaded and the function is then Initialize imported and called.
  • Page 99: Net (C#)

    The entry point to the API is the static class iemens.Simatic.Simulation.Runtime.SimulationRuntimeManager The API is initialized when a function of this class is used the first time. Table 7- 20 Initialize - .NET (C#) Siemens.Simatic.Simulation.Runtime.SimulationInitializationException Exceptions Runtime error code Condition ERuntimeError- Unable to establish a connection to the Runtime Code.ConnectionError...
  • Page 100: Shut Down Api

    User interfaces (API) 7.3 Shut down API Shut down API 7.3.1 Native C++ Basic procedure for deleting the user interfaces To delete all user interfaces, generally follow these steps: 1. Delete the interfaces IInstances and IRemoteRuntimeManager. 2. Call the function of the ISimulationRuntimeManager interface. Shutdown() 3.
  • Page 101: Destroyinterface()

    User interfaces (API) 7.3 Shut down API 7.3.1.1 DestroyInterface() Description A function pointer to the function. The function pointer RuntimeApiEntry_DestroyInterface is only valid if the function has been successfully called. DestoyInterface() InitializeApi The function unloads the memory of an ISimulationRuntimeManager, IRemoteRuntimeManager or IInstance interface.
  • Page 102: Runtimeapientry_Destroyinterface

    User interfaces (API) 7.3 Shut down API 7.3.1.2 RuntimeApiEntry_DestroyInterface Description Use the function only if the API library (DLL) is to be RuntimeApiEntry_DestroyInterface loaded from a different directory than the Startup directory of the application that calls this function. If the API was initialized using the function, you select the DestroyInterface() InitializeApi (Page 101) function.
  • Page 103: Freeapi()

    User interfaces (API) 7.3 Shut down API 7.3.1.3 FreeApi() Description function unloads the library of the Runtime API. FreeApi() This function can only be called after the successful call of the function. If the InitializeApi function was not called, the library must be unloaded using the Win32 API InitializeApi function FreeLibrary()
  • Page 104: Shutdownandfreeapi()

    User interfaces (API) 7.3 Shut down API 7.3.1.4 ShutdownAndFreeApi() Description function shuts down the Runtime API, deletes the ShutdownAndFreeApi() IRuntimeManager interface and unloads the library of the Runtime API. This function can only be called after the successful call of the function.
  • Page 105: Net (C#)

    User interfaces (API) 7.3 Shut down API 7.3.2 .NET (C#) 7.3.2.1 Shut down API You can terminate the .NET components of the API for the IInstance and IRemoteRuntimeManager interfaces by calling the Dispose (Page 130) function. In addition these interfaces can also be cleared automatically by the .NET Garbage Collector.
  • Page 106: Global Functions (Native C++)

    User interfaces (API) 7.4 Global functions (Native C++) Global functions (Native C++) The global functions return the name of the enumeration entry. GetNameOf... GetNameOfAreaSection() Table 7- 25 GetNameOfAreaSection() - Native C++ const WCHAR* GetNameOfAreaSection( Syntax EArea in_AreaSection Parameters • EArea in_AreaSection: Enumeration entry Return values Name of the enumeration entry...
  • Page 107 User interfaces (API) 7.4 Global functions (Native C++) GetNameOfErrorCode() Table 7- 29 GetNameOfErrorCode() - Native C++ const WCHAR* GetNameOfErrorCode( Syntax ERuntimeErrorCode in_ErrorCode Parameters • ERuntimeErrorCode in_ErrorCode: Enumeration entry Return values Name of the enumeration entry const WCHAR*: GetNameOfLEDMode() Table 7- 30 GetNameOfLEDMode() - Native C++ const WCHAR* GetNameOfLEDMode( Syntax...
  • Page 108 User interfaces (API) 7.4 Global functions (Native C++) GetNameOfErrorCode() Table 7- 33 GetNameOfErrorCode() - Native C++ const WCHAR* GetNameOfErrorCode( Syntax ERuntimeErrorCode in_ErrorCode Parameters • ERuntimeErrorCode in_ErrorCode: Enumeration entry Return values Name of the enumeration entry const WCHAR*: GetNameOfOperatingState Table 7- 34 GetNameOfOperatingState() - Native C++ const WCHAR* GetNameOfOperatingState( Syntax...
  • Page 109 User interfaces (API) 7.4 Global functions (Native C++) GetNameOfRuntimeConfigChanged() Table 7- 37 GetNameOfRuntimeConfigChanged() - Native C++ const WCHAR* GetNameOfRuntimeConfigChanged( Syntax ERuntimeConfigChanged in_RuntimeConfigChanged); Parameters • ERuntimeConfigChanged in_RuntimeConfigChanged: Enumeration entry Return values Name of the enumeration entry const WCHAR*: GetNameOfInstanceConfigChanged() Table 7- 38 GetNameOfInstanceConfigChanged() - Native C++ const WCHAR* GetNameOfInstanceConfigChanged( Syntax...
  • Page 110 User interfaces (API) 7.4 Global functions (Native C++) GetNameOfRackOrStationFaultType() Table 7- 41 GetNameOfRackOrStationFaultType() - Native C++ const WCHAR* GetNameOfRackOrStationFaultType( Syntax ERackOrStationFaultType in_RackOrStationFaultType Parameter • ERackOrStationFaultType in_RackOrStationFaultType: Enumeration entry Return values Name of the enumeration entry const WCHAR*: See also EPrimitiveDataType (Page 335) EDataType (Page 338) Enumerations (Page 326) S7-PLCSIM Advanced...
  • Page 111: Api Isimulationruntimemanager

    User interfaces (API) 7.5 API ISimulationRuntimeManager API ISimulationRuntimeManager 7.5.1 Interfaces - Information and settings GetVersion() / Version { get; } Returns the version of Runtime Manager. If the function fails, version 0.0 is returned. Table 7- 42 GetVersion() - Native C++ UINT32 GetVersion();...
  • Page 112 User interfaces (API) 7.5 API ISimulationRuntimeManager Subscribe to the event to find out whether the connection is OnRuntimeManagerLost() interrupted. See Events (Page 124). Table 7- 46 IsRuntimeManagerAvailable() - Native C++ bool IsRuntimeManagerAvailable(); Syntax Parameters None Return values If the connection is interrupted. •...
  • Page 113: Simulation Runtime Instances

    RegisteredInstanceInfo { get; } - .NET (C#) Syntax SInstanceInfo[] RegisteredInstanceInfo { get; Parameters None Return values An array of information about all registered instances. SInstanceInfo[]: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeErrorCode.Timeout The function does not return on time. S7-PLCSIM Advanced Function Manual, 12/2017, A5E37039512-AB...
  • Page 114 User interfaces (API) 7.5 API ISimulationRuntimeManager RegisterInstance() Registers a new instance of a virtual controller in Runtime Manager. Creates and returns an interface of this instance. Table 7- 53 RegisterInstance() - Native C++ ERuntimeErrorCode RegisterInstance( Syntax IInstance** out_InstanceInterface ERuntimeErrorCode RegisterInstance( WCHAR* in_InstanceName, IInstance** out_InstanceInterface ERuntimeErrorCode RegisterInstance(...
  • Page 115 . See Data types (Page 306). DINSTANCE_NAME_LENGTH Return values If the function is successful, an interface of a virtual controller, otherwise a null pointer. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 116 User interfaces (API) 7.5 API ISimulationRuntimeManager RegisterCustomInstance() Registers a new instance of a virtual controller in Runtime Manager. Creates and returns an interface of this instance. Table 7- 55 RegisterCustomInstance() - Native C++ ERuntimeErrorCode RegisterCustomInstance( Syntax WCHAR* in_VplcDll, IInstance** out_InstanceInterface ERuntimeErrorCode RegisterCustomInstance( WCHAR* in_VplcDll, WCHAR* in_InstanceName,...
  • Page 117 . See Data types (Page 306). DINSTANCE_NAME_LENGTH Return values If the function is successful, an interface of a virtual controller; otherwise a Null pointer. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 118 User interfaces (API) 7.5 API ISimulationRuntimeManager CreateInterface() Creates and returns an interface of an already registered instance of a virtual controller. The instance could have been registered via the application or another application that uses the Simulation Runtime API. Table 7- 57 CreateInterface() - Native C++ ERuntimeErrorCode CreateInterface( Syntax...
  • Page 119: Remote Connections

    The name of the registered instance from which you want to receive the inter- face. Return values If the function is successful, an interface of a virtual controller; otherwise a Null pointer. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 120 Syntax UInt16 in_Port Parameters • UInt16 in_Port: The port. The value must be greater than 1024. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeErrorCode.Timeout The function does not return on time. ERuntimeErrorCode.AlreadyExists A port is already open. ERuntimeErrorCode.WrongArgument The port is invalid.
  • Page 121 RemoteConnectionInfo { get; } - .NET (C#) SConnectionInfo[] RemoteConnectionInfo { get; } Syntax Parameters None Return values An array of information about all open connections. SConnectionInfo[]: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeErrorCode.Timeout The function does not return on time. S7-PLCSIM Advanced Function Manual, 12/2017, A5E37039512-AB...
  • Page 122 User interfaces (API) 7.5 API ISimulationRuntimeManager RemoteConnect() Creates a new connection to a remote Runtime Manager or uses an existing connection to create an IRemoteRuntimeManager interface. Table 7- 68 RemoteConnect() - Native C++ ERuntimeErrorCode RemoteConnect( Syntax UINT8 in_IP3, UINT8 in_IP2, UINT8 in_IP1, UINT8 in_IP0, UINT16 in_Port,...
  • Page 123 IP address of the remote PC. • UInt16 in_Port: The port that is open on the remote PC. Return values Interface to the remote Runtime Manager. IRemoteRuntimeManager: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- Connection to the remote Runtime Man- Code.ConnectionError ager cannot be established.
  • Page 124: Events

    User interfaces (API) 7.5 API ISimulationRuntimeManager 7.5.4 Events Events for the ISimulationRuntimeManager interface The following events are differentiated in the API: Table 7- 70 Events for the ISimulationRuntimeManager interface Event Cause OnConfigurationChanged This event is triggered at a change of the Runtime Manager configura- (Page 124) tion.
  • Page 125 User interfaces (API) 7.5 API ISimulationRuntimeManager RegisterOnConfigurationChangedEvent() When the event occurs, the registered event object is set to the signaled state. Only one event object can be registered for the event. Registration of a new event object causes the previous event object to be deleted. Table 7- 73 RegisterOnConfigurationChangedEvent() - Native C++ void RegisterOnConfigurationChangedEvent();...
  • Page 126 User interfaces (API) 7.5 API ISimulationRuntimeManager Table 7- 77 UnregisterOnConfigurationChangedEvent() - .NET (C#) void UnregisterOnConfigurationChangedEvent(); Syntax Parameters None Return values None WaitForOnConfigurationChangedEvent() The function blocks the program until the registered event object is set to the signaled state or the timeout interval is exceeded. Table 7- 78 WaitForOnConfigurationChangedEvent() - Native C++ bool WaitForOnConfigurationChangedEvent();...
  • Page 127: Onruntimemanagerlost Events

    User interfaces (API) 7.5 API ISimulationRuntimeManager 7.5.4.2 OnRuntimeManagerLost events OnRuntimeManagerLost Registers or unregisters an event handler method. Table 7- 80 OnRuntimeManagerLost - .NET (C#) event Delegate_Void OnRuntimeManagerLost; Syntax Parameters None. See Delegate_Void (Page 293). Return values None Exceptions None Note The event handler method runs in a separate thread.
  • Page 128 User interfaces (API) 7.5 API ISimulationRuntimeManager Table 7- 83 RegisterOnRuntimeManagerLostEvent() - .NET (C#) void RegisterOnRuntimeManagerLostEvent(); Syntax Parameters None Return values None UnregisterOnRuntimeManagerLostCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 84 UnregisterOnRuntimeManagerLostCallback() - Native C++ void UnregisterOnRuntimeManagerLostCallback();...
  • Page 129 User interfaces (API) 7.6 API IInstances WaitForOnRuntimeManagerLostEvent() The function will block the program until the registered event object is set to the signaled state or the timeout interval is exceeded. Table 7- 87 WaitForOnRuntimeManagerLostEvent() - Native C++ bool WaitForOnRuntimeManagerLostEvent(); Syntax bool WaitForOnRuntimeManagerLostEvent( UINT32 in_Time_ms Parameters...
  • Page 130: Api Iinstances

    User interfaces (API) 7.6 API IInstances API IInstances 7.6.1 Interfaces - Information and settings Dispose() Deletes the managed interface and unloads the native components of the user interfaces. Table 7- 89 Dispose() - .NET (C#) void Dispose() Syntax Parameters None Return values None GetID() / ID { get;...
  • Page 131 Table 7- 93 Name { get; } - .NET (C#) string Name { get; } Syntax Parameters None Return values Name of the instance. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 132 User interfaces (API) 7.6 API IInstances GetCPUType() Returns the CPU type of the virtual controller. Table 7- 94 GetCPUType() - Native C++ ECPUType GetCPUType(); Syntax Parameters None Return values An enumeration element that defines the CPU type. See ECPUType (Page 332). SetCPUType() Sets the CPU type of the virtual controller.
  • Page 133: Table

    User interfaces (API) 7.6 API IInstances GetCommunicationInterface() Returns the communication interface of the virtual controller: Local communication (Softbus) or TCPIP. A change of communication interface occurs only when the controller is restarted. All instances that are started must use the same communication interface. PowerOn is prevented if a communication interface that is not used by the started instances is selected.
  • Page 134: Table 7- 100 Getinfo() - Native C

    User interfaces (API) 7.6 API IInstances CommunicationInterface { get; set; } Sets or returns the communication interface of the virtual controller: Local communication (Softbus) or TCPIP. A change of communication interface occurs only when the controller is restarted. All instances that are started must use the same communication interface. PowerOn is prevented if a communication interface that is not used by the started instances is selected.
  • Page 135: Table 7- 102 Unregisterinstance() - Native C

    SREC_TIMEOUT The function does not return on time. Table 7- 103 UnregisterInstance() - .NET (C#) void UnregisterInstance(); Syntax Parameters None Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager. ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 136: Controller - Information And Settings

    Table 7- 105 ControllerName { get; } - .NET (C#) string ControllerName { get; } Syntax Parameters None string: Return values The downloaded name of the virtual controller. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 137: Table 7- 106 Getcontrollershortdesignation() - Native C

    Table 7- 107 ControllerShortDesignation { get; } - .NET (C#) string ControllerShortDesignation { get; } Syntax Parameters None string: Return values The downloaded short designation of the virtual controller. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 138: Table 7- 109 Getcontrollerip() - Native C

    User interfaces (API) 7.6 API IInstances GetControllerIP() / ControllerIP { get; } Returns a configured IP address of the instance. Table 7- 109 GetControllerIP() - Native C++ UIP GetControllerIP(); Syntax UIP GetControllerIP( UINT32 in_Index Parameters • WCHAR in_Index: The index of the IP address you want to receive. The index must be less than the value you receive from .
  • Page 139: Table 7- 113 Setipsuite() - Native C

    User interfaces (API) 7.6 API IInstances SetIPSuite() Sets the IP suite of the network interface of a virtual controller. Table 7- 113 SetIPSuite() - Native C++ ERuntimeErrorCode SetIPSuite( Syntax UINT32 in_InterfaceID, SIPSuite4 in_IPSuite, bool in_IsRemanent Parameters • UINT32 in_InterfaceID: The ID of the network interface. •...
  • Page 140: Table 7- 114 Setipsuite() - .Net (C#)

    , the IP suite is saved after restart of the virtual controller. true If the communication interface is "Softbus", this flag is ignored. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 141: Table 7- 116 Setstoragepath() - Native C

    Set the path before you start the instance. A change to the path takes effect only when the controller is restarted. If no path is set, the default setting: >\Siemens\Simatic\Simulation\Runtime\Persistence\ is used. Table 7- 116 SetStoragePath() - Native C++...
  • Page 142: Table 7- 118 Archivestorage() - Native C

    The full path to the ZIP file. The path relates to directories of the computer where the API is being called. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 143: Table 7- 120 Retrievestorage() - Native C

    The full path to the ZIP file. The path relates to directories of the computer where the API is being called. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 144: Operating State

    User interfaces (API) 7.6 API IInstances 7.6.3 Operating state GetOperatingState() / OperatingState { get; } Returns the operating state of the virtual controller. When the operating state changes, the OnOperatingStateChanged() (Page 243) event is triggered. For details about the operating state, see Data types (Page 330).
  • Page 145: Table 7- 123 Operatingstate { Get; } - .Net (C#)

    User interfaces (API) 7.6 API IInstances Table 7- 123 OperatingState { get; } - .NET (C#) EOperatingState OperatingState { get; } Syntax Parameters None Return values • EOperatingState.InvalidOperatingState: If the function fails. • EOperatingState.Off: If the Simulation Runtime instance is not running. •...
  • Page 146: Table 7- 124 Poweron() - Native C

    User interfaces (API) 7.6 API IInstances PowerOn() The function creates the process for the Simulation Runtime instance and starts the firmware of the virtual controller. Table 7- 124 PowerOn() - Native C++ ERuntimeErrorCode PowerOn(); Syntax ERuntimeErrorCode PowerOn( UINT32 in_Timeout_ms Parameters •...
  • Page 147: Table 7- 125 Poweron() - .Net (C#)

    The instance is not registered in Runtime Code.InterfaceRemoved Manager. ERuntimeErrorCode.Timeout The expected operating state does not occur on time. ERuntimeError- The Siemens.Simatic.Simulation. Code.ErrorLoadingDll Runtime.Instance.exe cannot load the Siemens.Simatic.PlcSim.Vplc1500.dll. ERuntimeError- The selected path for this instance is Code.StoragePathAlreadyInUse already being used by another instance.
  • Page 148: Table 7- 126 Poweroff() - Native C

    Expected operating states when this function is successful: { EOperatingState.Off } Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 149: Table 7- 128 Memoryreset() - Native C

    Expected operating states when this function is successful: { EOperatingState.Run, EOperatingState.Stop } Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 150: Table 7- 130 Run() - Native C

    Expected operating states when this function is successful: { EOperatingState.Run } Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 151: Table 7- 132 Stop() - Native C

    Expected operating states when this function is successful: { EOperatingState.Stop } Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 152: Tag List

    User interfaces (API) 7.6 API IInstances 7.6.4 Tag list UpdateTagList() The function reads the tags from the virtual controller and writes them to the shared storage arranged by name. If the tag is an array or a structure, there are multiple entries. In the case of a structure, there is an entry for the structure itself and an additional entry for each structure element.
  • Page 153: Updatetaglist() - Native C

    User interfaces (API) 7.6 API IInstances If there are problems with the maximum number of entries and not all tags are needed, two filters can be used when refreshing the tag table. Table 7- 134 UpdateTagList() - Native C++ ERuntimeErrorCode UpdateTagList(); Syntax ERuntimeErrorCode UpdateTagList( ETagListDetails in_TagListDetails...
  • Page 154: Updatetaglist() - .Net (C#)

    For this list to be taken into consideration, has to be in_DataBlockFilterList unequal to NULL and has to contain "DB". in_TagListDetails Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 155: Gettagliststatus() - Native C

    ETagListDetails.None is required. • out bool out_IsHMIVisibleOnly: , only tags marked with "HMI Visible" are available in the list. true Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager. ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 156: Gettaginfos() - Native C

    Table 7- 140 TagInfos { get; } - .NET (C#) STagInfo[] TagInfos { get; } Syntax Parameters None Return values An array that contains all available entries of the storage. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 157: Createconfigurationfile() - Native C

    None Return values • string in_FullFileName: File name of the XML file that is to be written to: + + . Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 158: I/O Access

    User interfaces (API) 7.6 API IInstances 7.6.5 I/O access 7.6.5.1 Synchronizing inputs and outputs Description In PLCSIM Advanced the complete scope of the input and output area is used (see GetAreaSize/AreaSize (Page 158)). This is also possible when no IO module is configured. Inputs and outputs that are defined via configured IO modules are synchronized to the defined update of the process image partition (PIP).
  • Page 159: Getareasize() - Native C

    User interfaces (API) 7.6 API IInstances GetAreaSize() / AreaSize { get; } Returns the size of the area in bytes. Table 7- 144 GetAreaSize() - Native C++ UINT32 GetAreaSize( Syntax EArea in_Area Parameters • EArea in_Area: The area whose size you want to receive. Permissible values: See EArea (Page 330).
  • Page 160: Readbit() - Native C

    AreaSize • Byte in_Bit: The bit offset within the byte. The value must be between 0 and 7. Return values Bit value bool: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Man- Code.InterfaceRemoved ager.
  • Page 161: Readbyte() - Native C

    User interfaces (API) 7.6 API IInstances ReadByte() Reads an individual bit from the area. Note The function allows access to the entire storage area of the virtual controller. Therefore, use access via the tag name and not via the address areas. Table 7- 148 ReadByte() - Native C++ ERuntimeErrorCode ReadByte( Syntax...
  • Page 162: Readbyte() - .Net (C#)

    UInt32 in_Offset: The byte offset within the area. The value must be between 0 and the value that returns. AreaSize Return values Byte value. Byte: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 163: Readbyte() - Native C

    User interfaces (API) 7.6 API IInstances Table 7- 150 ReadByte() - Native C++ ERuntimeErrorCode ReadBytes( Syntax EArea in_Area, UINT32 in_Offset, UINT32 in_BytesToRead, UINT32* out_BytesRead, BYTE inout_Values[] Parameters • EArea in_Area: The area from which you want to read. Permissible values: See EArea (Page 330).
  • Page 164: Readbytes() - .Net (C#)

    AreaSize • UInt32 in_BytesToRead: The number of bytes to be read. Return values The read bytes. Byte[]: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager. ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 165: Readsignals() - Native C

    User interfaces (API) 7.6 API IInstances Table 7- 152 ReadSignals() - Native C++ ERuntimeErrorCode ReadSignals( Syntax EArea in_Area, SDataValueByAddress* inout_Signals, UINT32 in_SignalCount ERuntimeErrorCode ReadSignals( EArea in_Area, SDataValueByAddressWithCheck* inout_Signals, UINT32 in_SignalCount, bool* out_SignalsHaveChanged Parameters • EArea in_Area: The area from which you want to read. Permissible values: See EArea (Page 330).
  • Page 166: I/O Access Via Address - Writing

    None Signal error Runtime error code Condition ERuntimeErrorCode.OK The signal operation is successful. ERuntimeError- Offset or bits are invalid. Code.IndexOutOfRange Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager. ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 167: Writebit() - Native C

    User interfaces (API) 7.6 API IInstances Table 7- 154 WriteBit() - Native C++ ERuntimeErrorCode WriteBit( Syntax EArea in_Area, UINT32 in_Offset, UINT8 in_Bit, bool in_Value Parameters • EArea in_Area: The area that is to be written. Permissible values: {SRA_INPUT, SRA_MARKER, SRA_OUTPUT}. See EArea (Page 330).
  • Page 168: Writebit() - .Net (C#)

    Byte in_Bit: The bit offset within the byte. The value must be between 0 and 7. • bool in_Value: Bit value. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 169: Writebyte() - Native C

    The byte offset within the area. The value must be between 0 and the value that returns. AreaSize • BYTE in_Value: Byte value. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager. ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 170: Writebytes() - Native C

    User interfaces (API) 7.6 API IInstances WriteBytes() Writes a byte array to the area. Note Data can be overwritten The function allows access to the entire storage area of the virtual controller. In particular, do not write to bytes that belong to other applications or contain internal data, for example, qualifier bits for fail-safe I/O modules.
  • Page 171: Writebytes() - .Net (C#)

    Contains the number of bytes to be written. The value must be between 1 and the size of the array value. • BYTE in_Value: Byte value. Return values Contains the number of bytes that were just written. Uint32: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 172: Writesignals() - Native C

    User interfaces (API) 7.6 API IInstances WriteSignals() Writes multiple signals within an API call. The function also takes into consideration the byte order (Endianness). The function supports only primitive data type signals, but it is not typical. Note Data can be overwritten The function allows access to the entire storage area of the virtual controller.
  • Page 173: I/O Access Via Tag Name - Reading

    None Signal error Error code Condition ERuntimeErrorCode.OK The signal operation is successful. ERuntimeError- Offset or bits are invalid. Code.IndexOutOfRange Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager. ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 174: Read() - Native C

    User interfaces (API) 7.6 API IInstances Read() Reads the value of a PLC tag. Table 7- 162 Read() - Native C++ ERuntimeErrorCode Read( Syntax WCHAR* in_Tag, SDataValue* inout_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be read. •...
  • Page 175: Read() - .Net (C#)

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. SDataValue: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 176: Readbool() - Native C

    Parameters • string in_Tag: The name of the PLC tag that is to be read. Return values Contains the value of the PLC tag. bool: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 177: Readint8() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. Int8: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 178: Readint16() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. Int16: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 179: Readint32() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. Int32: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 180: Readint64() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. Int64: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 181: Readuint8() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. UInt8: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 182: Readuint16() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. UInt16: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 183: Readuint32() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. Uint32: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 184: Readint64() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. UInt64: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 185: Readfloat() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. float: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 186: Readdouble() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. double: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 187: Readchar() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. sbyte: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 188: Readwchar() - Native C

    The name of the PLC tag that is to be read. Return values Contains the value and the type of the PLC tag. char: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 189: Readsignals() - Native C

    User interfaces (API) 7.6 API IInstances ReadSignals() Reads multiple signals within an API call. When the function is called for the first time, it stores internal information in the structures * to improve the performance of SDataValueByName the subsequent calls. Note To simulate a regular exchange of signals, create a signal list for each set of signals.
  • Page 190: Readsignals() - .Net (C#)

    Access to entire structures or arrays is not supported. ERuntimeErrorCode.TypeMismatch The expected type does not match the stored type. See Compatible primitive data types (Page 335). Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 191: I/O Access Via Tag Name - Writing

    User interfaces (API) 7.6 API IInstances 7.6.5.5 I/O access via tag name - Writing Individual access to IO data is used for displaying and writing values that are not refreshed regularly in a graphical user interface (GUI). Note To simulate a regular exchange of signals, create a signal list for each set of signals. Use this signal list for all further accesses.
  • Page 192: Write() - .Net (C#)

    STRUCT Structures and fields can be emulated through signal lists and then be written by using the function. WriteSignals() Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 193: Writebool() - Native C

    User interfaces (API) 7.6 API IInstances WriteBool() Writes the value of a PLC tag. Table 7- 194 WriteBool() - Native C++ ERuntimeErrorCode WriteBool( Syntax WCHAR* in_Tag, bool in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 194: Writebool() - .Net (C#)

    The name of the PLC tag that is to be written. • bool in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 195: Writeint8() - Native C

    User interfaces (API) 7.6 API IInstances WriteInt8() Writes the value of a PLC tag. Table 7- 196 WriteInt8() - Native C++ ERuntimeErrorCode WriteInt8( Syntax WCHAR* in_Tag, INT8 in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 196: Writeint8() - .Net (C#)

    The name of the PLC tag that is to be written. • Int8 in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 197: Writeint16() - Native C

    User interfaces (API) 7.6 API IInstances WriteInt16() Writes the value of a PLC tag. Table 7- 198 WriteInt16() - Native C++ ERuntimeErrorCode WriteInt16( Syntax WCHAR* in_Tag, INT16 in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 198: Writeint16() - .Net (C#)

    The name of the PLC tag that is to be written. • Int16 in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 199: Writeint32() - Native C

    User interfaces (API) 7.6 API IInstances WriteInt32() Writes the value of a PLC tag. Table 7- 200 WriteInt32() - Native C++ ERuntimeErrorCode WriteInt32( Syntax WCHAR* in_Tag, INT32 in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 200: Writeint32() - .Net (C#)

    The name of the PLC tag that is to be written. • Int32 in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 201: Writeint64() - Native C

    User interfaces (API) 7.6 API IInstances WriteInt64() Writes the value of a PLC tag. Table 7- 202 WriteInt64() - Native C++ ERuntimeErrorCode WriteInt64( Syntax WCHAR* in_Tag, INT64 in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 202: Writeint64() - .Net (C#)

    The name of the PLC tag that is to be written. • Int64 in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 203: Writeuint8() - Native C

    User interfaces (API) 7.6 API IInstances WriteInt8() Writes the value of a PLC tag. Table 7- 204 WriteUInt8() - Native C++ ERuntimeErrorCode WriteUInt8( Syntax WCHAR* in_Tag, UINT8 in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 204: Table 7- 205 Writeuint8() - .Net (C#)

    The name of the PLC tag that is to be written. • UInt8 in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 205: Table 7- 206 Writeuint16() - Native C

    User interfaces (API) 7.6 API IInstances WriteUInt16() Reads the value of a PLC tag. Table 7- 206 WriteUInt16() - Native C++ ERuntimeErrorCode WriteUInt16( Syntax WCHAR* in_Tag, UINT16 in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 206: Table 7- 207 Writeuint16() - .Net (C#)

    The name of the PLC tag that is to be written. • UInt16 in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 207: Table 7- 208 Writeuint32() - Native C

    User interfaces (API) 7.6 API IInstances WriteUInt32() Writes the value of a PLC tag. Table 7- 208 WriteUInt32() - Native C++ ERuntimeErrorCode WriteUInt32( Syntax WCHAR* in_Tag, UINT32 in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 208: Table 7- 209 Writeuint32() - .Net (C#)

    The name of the PLC tag that is to be written. • UInt32 in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 209: Table 7- 210 Writeuint64() - Native C

    User interfaces (API) 7.6 API IInstances WriteUInt64() Writes the value of a PLC tag. Table 7- 210 WriteUInt64() - Native C++ ERuntimeErrorCode WriteUInt64( Syntax WCHAR* in_Tag, UINT64 in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 210: Table 7- 211 Writeuint64() - .Net (C#)

    The name of the PLC tag that is to be written. • UInt64 in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 211: Table 7- 212 Writefloat() - Native C

    User interfaces (API) 7.6 API IInstances WriteFloat() Writes the value of a PLC tag. Table 7- 212 WriteFloat() - Native C++ ERuntimeErrorCode WriteFloat( Syntax WCHAR* in_Tag, float in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 212: Table 7- 213 Writefloat() - .Net (C#)

    The name of the PLC tag that is to be written. • float in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 213: Table 7- 214 Writedouble() - Native C

    User interfaces (API) 7.6 API IInstances WriteDouble() Writes the value of a PLC tag. Table 7- 214 WriteDouble() - Native C++ ERuntimeErrorCode WriteDouble( Syntax WCHAR* in_Tag, double in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 214: Table 7- 215 Writedouble() - .Net (C#)

    The name of the PLC tag that is to be written. • double in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 215: Table 7- 216 Writechar() - Native C

    User interfaces (API) 7.6 API IInstances WriteChar() Writes the value of a PLC tag. Table 7- 216 WriteChar() - Native C++ ERuntimeErrorCode WriteChar( Syntax WCHAR* in_Tag, char in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 216: Table 7- 217 Writechar() - .Net (C#)

    The name of the PLC tag that is to be written. • sbyte in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 217: Table 7- 218 Writewchar() - Native C

    User interfaces (API) 7.6 API IInstances WriteWChar() Writes the value of a PLC tag. Table 7- 218 WriteWChar() - Native C++ ERuntimeErrorCode WriteWChar( Syntax WCHAR* in_Tag, WCHAR in_Value Parameters • WCHAR* in_Tag: The name of the PLC tag that is to be written. •...
  • Page 218: Table 7- 219 Writewchar() - .Net (C#)

    The name of the PLC tag that is to be written. • char in_Value: Contains the value of the PLC tag. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 219: Table 7- 220 Writesignals() - Native C

    User interfaces (API) 7.6 API IInstances Table 7- 220 WriteSignals() - Native C++ ERuntimeErrorCode WriteSignals( Syntax SDataValueByName* inout_Signals, UINT32 in_SignalCount Parameters • SDataValueByName* inout_Signals: Contains the name, the value and the expected type of the PLC tag. The types are not supported. UNSPECIFIC STRUCT •...
  • Page 220: Settings For The Virtual Time

    SDataValueByName: Contains the name, the value and the expected type of the PLC tag. The types are not supported. UNSPECIFIC STRUCT Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 221: Table 7- 223 Setsystemtime() - Native C

    "Jan 1 1970 00:00:00:000" and "Dec 31 2200 23:59:59:999" is valid. Table 7- 224 SystemTime { get; set; } - .NET (C#) DateTime SystemTime { get; set; } Syntax Parameters None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Return values Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 222: Table 7- 226 Setscalefactor() - Native C

    User interfaces (API) 7.6 API IInstances SetScaleFactor() Sets the scaling factor with which the virtual time advances. Start with a small scaling factor and incrementally approach a scaling factor at which the virtual controller remains in RUN. A value between 0.01 and 100 is valid. The default setting is 1. ●...
  • Page 223: Cycle Control

    Table 7- 227 ScaleFactor { get; set; } - .NET (C#) double ScaleFactor { get; set; } Syntax Parameters None Return values Scaling factor of the virtual time. double: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 224: Table 7- 230 Operatingmode { Get; Set; } - .Net (C#)

    Table 7- 230 OperatingMode { get; set; } - .NET (C#) EOperatingMode OperatingMode { get; set; } Syntax Parameters None Return values Operating mode of the virtual controller EOperatingMode: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 225: Table 7- 233 Issendsynceventindefaultmodeenabled { Get; Set; } - .Net (C#)

    Return values The event is not triggered (unless the Sync-Freeze mode is active). • false: The event is triggered after every cycle. • true: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 226: Table 7- 236 Overwrittenminimalcycletime_Ns { Get; Set; } - .Net (C#)

    Table 7- 236 OverwrittenMinimalCycleTime_ns { get; set; } - .NET (C#) Int64 OverwrittenMinimalCycleTime_ns { get; set; } Syntax Parameters None Return values The overwritten minimum cycle time in nanoseconds. Int64: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 227: Table 7- 239 Startprocessing() - Native C

    Parameters • Int64 in_MinimalTimeToRun_ns: The minimum virtual time (in nanoseconds) that the virtual controller runs be- fore it changes to Freeze state. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 228: Acyclic Services

    User interfaces (API) 7.6 API IInstances 7.6.8 Acyclic services 7.6.8.1 Overview The acyclic services of PLCSIM Advanced include: ● Interrupt and event information which the I/O modules send to the CPU. ● Read and write processes of parameter and status data from the user program of the PLC to the I/O modules.
  • Page 229: Figure 7-5 Flowchart

    User interfaces (API) 7.6 API IInstances Events Events triggered by the user program (TIA Portal), which have logged on for the notification: Name API event for triggering the SFB API method (alarm) RDREC OnDataRecordRead (Page 257) ReadRecordDone (Page 230) WRREC OnDataRecordWrite (Page 257) WriteRecordDone (Page 230) Figure 7-5...
  • Page 230: Readrecorddone / Writerecorddone

    Byte array of the read data record with the length defined by in the DataSize structure SDataRecordInfo • UInt32 in_Status: Status of the job execution Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager. ERuntimeErrorCode.DoesNotExist No hardware identifier of the module.
  • Page 231: Table 7- 244 Writerecorddone() - Native C

    SDataRecordInfo in_RecordInfo: Structure which contains the data record information. See SDataRecordInfo (Page 321). • UInt32 in_Status: Status of the job execution Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 232: Alarmnotification

    User interfaces (API) 7.6 API IInstances 7.6.8.3 AlarmNotification AlarmNotification() This function triggers diagnostic alarms according to the PROFINET standard. Each call of this function calls the OB 82 once, regardless of the number and the severity level of the transferred diagnostic entries. Table 7- 246 AlarmNotification() - Native C++ ERuntimeErrorCode AlarmNotification( Syntax...
  • Page 233: Table 7- 247 Alarmnotification() - .Net (C#)

    PLCSIM Advanced assigns a unique consecutive number to each alarm event. According to PROFINET standard the sequence number is 10 bits wide (1 to ). When the highest number is reached the numbering starts again at 1. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code...
  • Page 234: Processevent

    User interfaces (API) 7.6 API IInstances 7.6.8.4 ProcessEvent ProcessEvent() Process events from central and distributed input modules can be simulated with this function. Table 7- 248 ProcessEvent() - Native C++ ERuntimeErrorCode ProcessEvent( Syntax UINT16 in_HardwareIdentifier, UINT16 in_Channel, EProcessEventType in_ProcessEventType, UINT16* out SequenceNumber); Parameters •...
  • Page 235: Table 7- 249 Processevent() - .Net (C#)

    According to PROFINET standard the sequence number is 10 bits wide (1 to ). When the highest number is reached the numbering starts again at 1. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 236: Pullorplugevent

    User interfaces (API) 7.6 API IInstances 7.6.8.5 PullOrPlugEvent PullOrPlugEvent() This function triggers pull/plug events. The interrupt OB (OB 83) "Pull or plug of modules" is executed for these events. Table 7- 250 PullOrPlugEvent() - Native C++ ERuntimeErrorCode PullOrPlugEvent( Syntax UINT16 in_HardwareIdentifier, EPullOrPlugEventType in_PullOrPlugEventType, UINT16* out_SequenceNumber Parameters...
  • Page 237: Table 7- 251 Pullorplugevent() - .Net (C#)

    According to PROFINET standard the sequence number is 10 bits wide (1 to ). When the highest number is reached the numbering starts again at 1. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 238: Statusevent

    The parameter is transferred to the interrupt frame as interrupt specifier. It is available as input parameter of the OB 55 call. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 239: Profileevent

    The parameter is transferred to the interrupt frame as interrupt specifier. It is available as input parameter of the OB 57 call. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 240: Updateevent

    The parameter is transferred to the interrupt frame as interrupt specifier. It is available as input parameter of the OB 56 call. Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 241: Getconfiguredprocessevent

    SConfiguredProcessEvents [] GetConfiguredProcessEvents( Syntax Parameters None Return values Field with configured process events and field size provide the number of config- ured process events. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
  • Page 242: Rackorstationfaultevent

    The hardware identifier of the device that sends the event. • ERackOrStationFaultType in_EventType: A value from the list of predefined types of events, see ERackOrStation- FaultType (Page 346). Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved...
  • Page 243: Events

    User interfaces (API) 7.6 API IInstances 7.6.9 Events Events for IInstances The following events are differentiated in the API: Table 7- 262 Events for the IInstances interface Event Cause OnOperatingStateChanged This event is always triggered when the operating state of the virtual (Page 243) controller has changed.
  • Page 244: Table 7- 264 Registeronoperatingstatechangedcallback() - Native C

    User interfaces (API) 7.6 API IInstances RegisterOnOperatingStateChangedCallback() When the event occurs, the registered callback function is called. Only one callback function can be registered for the event. Registering a new callback function causes the previous callback function to be deleted. Table 7- 264 RegisterOnOperatingStateChangedCallback() - Native C++ void RegisterOnOperatingStateChangedCallback( Syntax...
  • Page 245: Table 7- 266 Unregisteronoperatingstatechangedcallback() - Native C

    User interfaces (API) 7.6 API IInstances // Thread 1 -------------------------------------------------- Example C++ ISimulationRuntimeManager * api = NULL; ERuntimeErrorCode result = Initialize(&api); IInstance* psa = NULL; if (result == SREC_OK) result = api->RegisterInstance(&psa); // Create an event object HANDLE eventHandle = CreateEvent(NULL, FALSE, FALSE, NULL); // Register the user created event object RegisterOnOperatingStateChangedEvent psa->...
  • Page 246: Table 7- 268 Unregisteronoperatingstatechangedevent() - .Net (C#)

    User interfaces (API) 7.6 API IInstances Table 7- 268 UnregisterOnOperatingStateChangedEvent() - .NET (C#) void UnregisterOnOperatingStateChangedEvent(); Syntax Parameters None Return values None WaitForOnOperatingStateChangedEvent() The function blocks the program until the registered event object is in the signaled state or the timeout interval is exceeded. Table 7- 269 WaitForOnOperatingStateChangedEvent() - Native C++ bool WaitForOnOperatingStateChangedEvent();...
  • Page 247: Onsyncpointreached Events

    User interfaces (API) 7.6 API IInstances 7.6.9.2 OnSyncPointReached events OnSyncPointReached Registers or unregisters an event handler method. Table 7- 271 OnSyncPointReached - .NET (C#) event Delegate_II_EREC_DT_UINT32_INT64_INT64_UINT32 OnSyncPoin- Syntax tReached; Parameters None. See Delegate_II_EREC_DT_UINT32_INT64_INT64_UINT32 (Page 296). Return values None Exceptions None Note The event handler method runs in a separate thread.
  • Page 248: Table 7- 273 Registeronsyncpointreachedevent() - Native C

    User interfaces (API) 7.6 API IInstances RegisterOnSyncPointReachedEvent() When the event occurs, the registered event object is set to the signaled state. Only one event object can be registered for the event. Registering a new event object causes the previous event object to be deleted. Table 7- 273 RegisterOnSyncPointReachedEvent() - Native C++ void RegisterOnSyncPointReachedEvent();...
  • Page 249: Onconfigurationchanging Events

    User interfaces (API) 7.6 API IInstances WaitForOnSyncPointReachedEvent() The function blocks the program until the registered event object is in the signaled state or the timeout interval is exceeded. Table 7- 277 WaitForOnSyncPointReachedEvent() - Native C++ SOnSyncPointReachedResult WaitForOnSyncPointReachedEvent(); Syntax SOnSyncPontReachedResult WaitForOnEndOfCycleOnSyncPoin- tReachedEvent( UINT32 in_Time_ms Parameters...
  • Page 250: Table 7- 280 Registeronconfigurationchangingcallback() - Native C

    User interfaces (API) 7.6 API IInstances RegisterOnConfigurationChangingCallback() When the event occurs, the registered callback function is called. Only one callback function can be registered for the event. Registering a new callback function causes the previous callback function to be deleted. Table 7- 280 RegisterOnConfigurationChangingCallback() - Native C++ void RegisterOnConfigurationChangingCallback( Syntax...
  • Page 251: Table 7- 283 Unregisteronconfigurationchangingevent() - Native C

    User interfaces (API) 7.6 API IInstances UnregisterOnConfigurationChangingEvent() Unregisters the event object. Table 7- 283 UnregisterOnConfigurationChangingEvent() - Native C++ void UnregisterOnConfigurationChangingEvent(); Syntax Parameters None Return values None Table 7- 284 UnregisterOnConfigurationChangingEvent() - .NET (C#) void UnregisterOnConfigurationChangingEvent(); Syntax Parameters None Return values None WaitForOnConfigurationChangingEvent() The function blocks the program until the registered event object is in the signaled state or...
  • Page 252: Onconfigurationchanged Events

    User interfaces (API) 7.6 API IInstances 7.6.9.4 OnConfigurationChanged events OnConfigurationChanged Registers or unregisters an event handler method. Table 7- 287 OnConfigurationChanged - .NET (C#) event Delegate_II_EREC_DT_SRICC_UINT32_UINT32_UINT32_UINT32 OnCon- Syntax figurationChanged; Parameters None. See Delegate_II_EREC_DT_SRICC_UINT32_UINT32_UINT32_UINT32 (Page 298). Return values None Exceptions None Note The event handler method runs in a separate thread.
  • Page 253: Table 7- 289 Registeronconfigurationchangedevent() - Native C

    User interfaces (API) 7.6 API IInstances RegisterOnConfigurationChangedEvent() When the event occurs, the registered event object is set to the signaled state. Only one event object can be registered for the event. Registering a new event object causes the previous event object to be deleted. Table 7- 289 RegisterOnConfigurationChangedEvent() - Native C++ void RegisterOnConfigurationChangedEvent();...
  • Page 254: Onledchanged Events

    User interfaces (API) 7.6 API IInstances WaitForOnConfigurationChangedEvent() The function blocks the program until the registered event object is in the signaled state or the timeout interval is exceeded. Table 7- 293 WaitForOnConfigurationChangedEvent() - Native C++ bool WaitForOnConfigurationChangedEvent(); Syntax bool WaitForOnConfigurationChangedEvent( UINT32 in_Time_ms Parameters •...
  • Page 255: Table 7- 296 Registeronledchangedcallback() - Native C

    User interfaces (API) 7.6 API IInstances RegisterOnLedChangedCallback() When the event occurs, the registered callback function is called. Only one callback function can be registered for the event. Registering a new callback function causes the previous callback function to be deleted. Table 7- 296 RegisterOnLedChangedCallback() - Native C++ void RegisterOnLedChangedCallback( Syntax...
  • Page 256: Table 7- 299 Unregisteronledchangedevent() - Native C

    User interfaces (API) 7.6 API IInstances UnregisterOnLedChangedEvent() Unregisters the event object. Table 7- 299 UnregisterOnLedChangedEvent() - Native C++ void UnregisterOnLedChangedEvent(); Syntax Parameters None Return values None Table 7- 300 UnregisterOnLedChangedEvent() - .NET (C#) void UnregisterOnLedChangedEvent(); Syntax Parameters None Return values None WaitForOnLedChangedEvent() The function blocks the program until the registered event object is in the signaled state or...
  • Page 257: Events For Acyclic Services

    User interfaces (API) 7.6 API IInstances 7.6.10 Events for acyclic services 7.6.10.1 OnDataRecordRead / OnDataRecordWrite events OnDataRecordRead Registers or unregisters an event handler method. Table 7- 303 OnDataRecordRead - .NET (C#) event Delegate_II_EREC_DT_SDRI OnDataRecordRead; Syntax Parameter None. See Delegate_II_EREC_DT_SDRI (Page 300). Return values None Exceptions...
  • Page 258: Onalarmnotification Events

    User interfaces (API) 7.6 API IInstances UnregisterOnDataRecordReadCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 306 UnregisterOnDataRecordReadCallback() - Native C++ void UnregisterOnDataRecordReadCallback(); Syntax Parameters None Return values None 7.6.10.2 OnAlarmNotification events OnAlarmNotificationDone() Registers or unregisters an event handler method. Table 7- 307 OnAlarmNotificationDone() - .NET (C#) event Delegate_SREC_ST_UINT32_UINT32 OnAlarmNotificationDone;...
  • Page 259: Onprocessevent Events

    User interfaces (API) 7.6 API IInstances UnregisterOnAlarmNotificationDoneCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 309 UnregisterOnAlarmNotificationDoneCallback() - Native C++ void UnregisterOnAlarmNotificationDoneCallback (); Syntax Parameters None Return values None 7.6.10.3 OnProcessEvent events OnProcessEventDone() Registers or unregisters an event handler method.
  • Page 260: Onpullorplugevent Events

    User interfaces (API) 7.6 API IInstances UnregisterOnProcessEventDoneCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 312 UnregisterOnProcessEventDoneCallback() - Native C++ void UnregisterOnProcessEventDoneCallback (); Syntax Parameters None Return values None 7.6.10.4 OnPullOrPlugEvent events OnPullOrPlugEventDone() Registers or unregisters an event handler method.
  • Page 261: Onstatusevent Events

    User interfaces (API) 7.6 API IInstances UnregisterOnPullOrPlugEventDoneCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 315 UnregisterOnPullOrPlugEventDoneCallback() - Native C++ void UnregisterOnPullOrPlugEventDoneCallback (); Syntax Parameters None Return values None 7.6.10.5 OnStatusEvent events OnStatusEventDone() Registers or unregisters an event handler method.
  • Page 262: Onprofileevent Events

    User interfaces (API) 7.6 API IInstances UnregisterOnStatusEventDoneCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 318 UnregisterOnStatusEventDoneCallback() - Native C++ void UnregisterOnStatusEventDoneCallback (); Syntax Parameters None Return values None 7.6.10.6 OnProfileEvent events OnProfileEventDone() Registers or unregisters an event handler method.
  • Page 263: Onupdateevent Events

    User interfaces (API) 7.6 API IInstances UnregisterOnProfileEventDoneCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 321 UnregisterOnProfileEventDoneCallback() - Native C++ void UnregisterOnProfileEventDoneCallback (); Syntax Parameters None Return values None 7.6.10.7 OnUpdateEvent events OnUpdateEventDone() Registers or unregisters an event handler method.
  • Page 264: Rackorstationfault Events

    User interfaces (API) 7.6 API IInstances UnregisterOnUpdateEventDoneCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 324 UnregisterOnUpdateEventDoneCallback() - Native C++ void UnregisterOnUpdateEventDoneCallback (); Syntax Parameters None Return values None 7.6.10.8 RackOrStationFault events OnRackOrStationFaultEvent Registers or unregisters an event handler method.
  • Page 265: Api Iremoteruntimemanager

    User interfaces (API) 7.7 API IRemoteRuntimeManager API IRemoteRuntimeManager 7.7.1 Interfaces - Information and settings Dispose() Deletes the managed interface and unloads the native components of the user interfaces. Note When the interface of the Remote Runtime Manager is deleted, no IInstance interface which was generated by the IRemoteRuntimeManager interface can be used.
  • Page 266: Table 7- 331 Getip() - Native C

    User interfaces (API) 7.7 API IRemoteRuntimeManager GetIP() / IP { get; } Returns the IP address of the PC on which the remote Runtime Manager is running. If the function fails, the return value is 0. Table 7- 331 GetIP() - Native C++ UIP GetIP();...
  • Page 267: Table 7- 335 Getremotecomputername() - Native C

    RemoteComputerName { get; } Syntax Parameters None Return values Name of the PC on which the remote Runtime Manager is running. string: Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The interface is disconnected from the Code.InterfaceRemoved remote Runtime Manager.
  • Page 268: Simulation Runtime Instances

    User interfaces (API) 7.7 API IRemoteRuntimeManager Table 7- 338 Disconnect() - .NET (C#) void Disconnect(); Syntax Parameters None Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The interface is disconnected from the Code.InterfaceRemoved remote Runtime Manager. ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 269: Table 7- 341 Registerinstanceinfo { Get; } - .Net (C#)

    CreateInterface() Table 7- 341 RegisterInstanceInfo { get; } - .NET (C#) Syntax SInstanceInfo[] RegisteredInstanceInfo { get; Parameters None Return values None Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The interface is disconnected from the Code.InterfaceRemoved remote Runtime Manager. ERuntimeErrorCode.Timeout The function does not return on time.
  • Page 270 User interfaces (API) 7.7 API IRemoteRuntimeManager Return values Runtime error code Condition SREC_OK The function is successful. SREC_INTERFACE_REMOVED The interface is disconnected from the remote Runtime Manager. SREC_TIMEOUT The function does not return on time. SREC_WRONG_ARGUMENT The name or the IInstance pointer is invalid.
  • Page 271: Table 7- 343 Registerinstance() - .Net (C#)

    . See Data types (Page 306). DINSTANCE_NAME_LENGTH Return values If the function is successful, an interface of a virtual controller. Otherwise, a Null pointer. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The interface is disconnected from the Code.InterfaceRemoved remote Runtime Manager.
  • Page 272: Table 7- 344 Registercustominstance() - Native C

    User interfaces (API) 7.7 API IRemoteRuntimeManager RegisterCustomInstance() Registers a new instance of a virtual controller in Runtime Manager. Creates and returns an interface of this instance. Table 7- 344 RegisterCustomInstance() - Native C++ ERuntimeErrorCode RegisterCustomInstance( Syntax WCHAR* in_VplcDll, IInstance** out_InstanceInterface ERuntimeErrorCode RegisterCustomInstance( WCHAR* in_VplcDll, WCHAR* in_InstanceName,...
  • Page 273: Table 7- 345 Registercustominstance() - .Net (C#)

    . See Data types (Page 306). DINSTANCE_NAME_LENGTH Return values If the function is successful, an interface of a virtual controller; otherwise a Null pointer. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The interface is disconnected from the Code.InterfaceRemoved remote Runtime Manager.
  • Page 274: Table 7- 346 Createinterface() - Native C

    User interfaces (API) 7.7 API IRemoteRuntimeManager CreateInterface() Creates and returns an interface of an already registered instance of a virtual controller. The instance could have been registered via the application or another application that uses the Simulation Runtime API. Table 7- 346 CreateInterface() - Native C++ ERuntimeErrorCode CreateInterface( Syntax WCHAR* in_InstanceName,...
  • Page 275: Events

    The name of the registered instance from which you want to receive the inter- face. Return values If the function is successful, an interface of a virtual controller; otherwise a Null pointer. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The interface is disconnected from the Code.InterfaceRemoved...
  • Page 276: Table 7- 349 Registeronconnectionlostcallback() - Native C

    User interfaces (API) 7.7 API IRemoteRuntimeManager RegisterOnConnectionLostCallback() When the event occurs, the registered callback function is called. Only one callback function can be registered for the event. Registering a new callback function causes the previous callback function to be unregistered. Table 7- 349 RegisterOnConnectionLostCallback() - Native C++ void RegisterOnConnectionLostCallback( Syntax...
  • Page 277: Table 7- 352 Unregisteronconnectionlostcallback() - Native C

    User interfaces (API) 7.7 API IRemoteRuntimeManager UnregisterOnConnectionLostCallback() Unregisters the callback function. When the event occurs, no callback function is called. Table 7- 352 UnregisterOnConnectionLostCallback() - Native C++ void UnregisterOnConnectionLostCallback(); Syntax Parameters None Return values None UnregisterOnConnectionLostEvent() Unregisters the event object. Table 7- 353 UnregisterOnConnectionLostEvent() - Native C++ void UnregisterOnConnectionLostEvent();...
  • Page 278: Table 7- 356 Waitforonconnectionlostevent() - .Net (C#)

    User interfaces (API) 7.7 API IRemoteRuntimeManager Table 7- 356 WaitForOnConnectionLostEvent() - .NET (C#) bool WaitForOnConnectionLostEvent(); Syntax bool WaitForOnConnectionLostEvent( UInt32 in_Time_ms ) Parameters • None: The time limit is set to INFINITE • UInt32 in_Time_ms: Value for the time limit in milliseconds. Return values If the event object was set to the signaled state.
  • Page 279: Data Types

    999. Without BCD conversion, there is no value and writes no value at all. UInt16 Write Additional information For information on data types and conversion, refer to section "Data types" in the STEP 7 Professional (https://support.industry.siemens.com/cs/ww/en/view/109747136) System Manual. S7-PLCSIM Advanced Function Manual, 12/2017, A5E37039512-AB...
  • Page 280: Dll Import Functions (Native C++)

    User interfaces (API) 7.8 Data types 7.8.1 DLL import functions (Native C++) 7.8.1.1 ApiEntry_Initialize Description Type of the central entry point for the API library (DLL). Table 7- 357 ApiEntry_Initialize - Native C++ typedef ERuntimeErrorCode(*ApiEntry_Initialize)( Syntax ISimulationRuntimeManager** out_RuntimeManagerInterface Parameters • ISimulationRuntimeManager** out_SimulationRuntimeManagerInterface: Pointer to a Runtime Manager interface pointer.
  • Page 281: Event Callback Functions (Native C++)

    User interfaces (API) 7.8 Data types 7.8.2 Event callback functions (Native C++) 7.8.2.1 EventCallback_VOID Description Table 7- 359 EventCallback_VOID - Native C++ typedef void (*EventCallback_VOID)(); Syntax Parameters None Return values None 7.8.2.2 EventCallback_II_SREC_ST Description Table 7- 360 EventCallback_II_SREC_ST - Native C++ typedef void (*EventCallback_II_SREC_ST)( Syntax IInstance* in_Sender,...
  • Page 282: Eventcallback_Ii_Srec_St_Sros_Sros

    User interfaces (API) 7.8 Data types 7.8.2.3 EventCallback_II_SREC_ST_SROS_SROS Description Table 7- 361 EventCallback_II_SREC_ST_SROS_SROS - Native C++ typedef void (*EventCallback_II_SREC_ST_SROS_SROS)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, EOperatingState in_PrevState, EOperatingState in_OperatingState Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 283: Eventcallback_Ii_Srec_St_Srlt_Srlm

    User interfaces (API) 7.8 Data types 7.8.2.4 EventCallback_II_SREC_ST_SRLT_SRLM Description Table 7- 362 EventCallback_II_SREC_ST_SRLT_SRLM - Native C++ typedef void (*EventCallback_II_SREC_ST_SRLT_SRLM)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, ELEDType in_LEDType, ELEDMode in_LEDMode, Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 284: Eventcallback_Ii_Srec_St_Uint32_Int64_Int64_Uint32

    User interfaces (API) 7.8 Data types 7.8.2.5 EventCallback_II_SREC_ST_UINT32_INT64_INT64_UINT32 Description Table 7- 363 EventCallback_II_SREC_ST_UINT32_INT64_INT64_UINT32 - Native C++ typedef void Syntax (*EventCallback_II_SREC_ST_UINT32_INT64_INT64_UINT32)( IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, UINT32 in_PipId, INT64 in_TimeSinceSameSyncPoint_ns, INT64 in_TimeSinceAnySyncPoint_ns, UINT32 in_SyncPointCount Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 285: Eventcallback_Irrtm

    User interfaces (API) 7.8 Data types 7.8.2.6 EventCallback_IRRTM Description Table 7- 364 EventCallback_IRRTM - Native C++ typedef void (*EventCallback_IRRTM)( Syntax IRemoteRuntimeManager* in_Sender Parameters • IRemoteRuntimeManager* in_Sender: An interface of the remote Runtime Manager that receives this event. Return values None 7.8.2.7 EventCallback_SRCC_UINT32_UINT32_INT32 Description...
  • Page 286: Eventcallback_Ii_Srec_St_Sricc_Uint32_Uint32_Uint32_Uint32

    User interfaces (API) 7.8 Data types 7.8.2.8 EventCallback_II_SREC_ST_SRICC_UINT32_UINT32_UINT32_UINT32 Description Table 7- 366 EventCallback_II_SREC_ST_SRICC_UINT32_UINT32_UINT32_UINT32 - Native C++ typedef void Syntax (*EventCallback_II_SREC_ST_SRICC_UINT32_UINT32_UINT32_UINT32)( IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, EInstanceConfigChanged in_InstanceConfigChanged, UINT32 in_Param1, UINT32 in_Param2, UINT32 in_Param3, UINT32 in_Param4 Parameters • IInstance in_Sender: An interface of the instance that receives this event.
  • Page 287: Eventcallback_Ii_Srec_St_Sdri

    User interfaces (API) 7.8 Data types 7.8.2.9 EventCallback_II_SREC_ST_SDRI Description Table 7- 367 EventCallback_II_SREC_ST_SDRI - Native C++ typedef void (*EventCallback_II_SREC_ST_SDRI)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, SDataRecordInfo in_DataRecordInfo Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 288: Eventcallback_Ii_Srec_St_Sdr

    User interfaces (API) 7.8 Data types 7.8.2.10 EventCallback_II_SREC_ST_SDR Description Table 7- 368 EventCallback_II_SREC_ST_SDR - .NET (C#) typedef void (*EventCallback_II_SREC_ST_SDR)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, SDataRecord in_DataRecord Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 289: Eventcallback_Ii_Srec_St_Uint32_Eppet_Uint32

    User interfaces (API) 7.8 Data types 7.8.2.11 EventCallback_II_SREC_ST_UINT32_EPPET_UINT32 Description Table 7- 369 EventCallback_II_SREC_ST_UINT32_EPPET_UINT32 - Native C++ typedef void (*EventCallback_II_SREC_ST_UINT32_EPPET_UINT32)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SYSTEMTIME, UINT32 in_HardwareIdentifier, EPullOrPlugEventType in_PullOrPlugEventType, UINT32 in_SequenceNumber Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 290: Eventcallback_Ii_Srec_St_Uint32_Uint32_Epet_Uint32

    User interfaces (API) 7.8 Data types 7.8.2.12 EventCallback_II_SREC_ST_UINT32_UINT32_EPET_UINT32 Description Table 7- 370 EventCallback_II_SREC_ST_UINT32_UINT32_EPET_UINT32 - Native C++ typedef void (*EventCallback_II_SREC_ST_UINT32_UINT32_EPET_UINT32)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, UINT32 in_HardwareIdentifier, UINT32 in_Channel, EProcessEventType in_ProcessEventType, UINT32 in_SequenceNumber Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 291: Eventcallback_Ii_Srec_St_Uint32

    User interfaces (API) 7.8 Data types 7.8.2.13 EventCallback_II_SREC_ST_UINT32 Description Table 7- 371 EventCallback_II_SREC_ST_UINT32 - Native C++ typedef void (*EventCallback_II_SREC_ST_UINT32)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, UINT32 in_HardwareIdentifier); Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 292: Eventcallback_Ii_Srec_St_Uint32_Uint32

    User interfaces (API) 7.8 Data types 7.8.2.14 EventCallback_II_SREC_ST_UINT32_UINT32 Description Table 7- 372 EventCallback_II_SREC_ST_UINT32_UINT32 - Native C++ typedef void (*EventCallback_II_SREC_ST_UINT32_UINT32)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, UINT32 in_HardwareIdentifier), UINT32 in_SequenceNumber Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 293: Eventcallback_Ii_Srec_St_Uint32_Ersfet

    User interfaces (API) 7.8 Data types 7.8.2.15 EventCallback_II_SREC_ST_UINT32_ERSFET Description Table 7- 373 EventCallback_II_SREC_ST_UINT32_ERSFET - Native C++ typedef void (*EventCallback_II_SREC_ST_UINT32_ERSFET)( Syntax IInstance* in_Sender, ERuntimeErrorCode in_ErrorCode, SYSTEMTIME in_SystemTime, UINT32 in_HardwareIdentifier, ERackOrStationFaultType in_EventType Parameters • IInstance* in_Sender: An interface of the instance that receives this event. •...
  • Page 294: Delegate_Ii_Erec_Dt

    User interfaces (API) 7.8 Data types 7.8.3.2 Delegate_II_EREC_DT Description Table 7- 375 Delegate_II_EREC_DT - .NET (C#) delegate void Delegate_II_EREC_DT ( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 295: Delegate_Ii_Erec_Dt_Elt_Elm

    User interfaces (API) 7.8 Data types Return values None Error codes Runtime error code Condition ERuntimeErrorCode.OK The function is successful. ERuntimeError- No license available. You can use the Code.WarningTrialModeActive instance without restrictions with the Trial License. Afterwards, the instance is shut down. ERuntimeError- Test mode has expired.
  • Page 296: Delegate_Ii_Erec_Dt_Uint32_Int64_Int64_Uint32

    User interfaces (API) 7.8 Data types 7.8.3.5 Delegate_II_EREC_DT_UINT32_INT64_INT64_UINT32 Description Table 7- 378 Delegate_II_EREC_DT_UINT32_INT64_INT64_UINT32 - .NET (C#) delegate void Delegate_II_EREC_DT_UINT32_INT64_INT64_UINT32 ( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, UInt32 in_PipId, Int64 in_TimeSinceSameSyncPoint_ns, Int64 in_TimeSinceAnySyncPoint_ns, UInt32 in_SyncPointCount Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 297: Delegate_Irrtm

    User interfaces (API) 7.8 Data types 7.8.3.6 Delegate_IRRTM Description Table 7- 379 Delegate_IRRTM - .NET (C#) delegate void Delegate_IRRTM( Syntax IRemoteRuntimeManager in_Sender, Parameters • IRemoteRuntimeManager in_Sender: An interface of the remote Runtime Manager that receives this event. Return values None 7.8.3.7 Delegate_SRCC_UINT32_UINT32_INT32 Description...
  • Page 298: Delegate_Ii_Erec_Dt_Sricc_Uint32_Uint32_Uint32_Uint32

    User interfaces (API) 7.8 Data types 7.8.3.8 Delegate_II_EREC_DT_SRICC_UINT32_UINT32_UINT32_UINT32 Description Table 7- 381 Delegate_II_EREC_DT_SRICC_UINT32_UINT32_UINT32_UINT32 - .NET (C#) delegate void Dele- Syntax gate_II_EREC_DT_SRICC_UINT32_UINT32_UINT32_UINT32( IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, EInstanceConfigChanged in_InstanceConfigChanged, UInt32 in_Param1, UInt32 in_Param2, UInt32 in_Param3, UInt32 in_Param4 Parameters • IInstance in_Sender: An interface of the instance that receives this event.
  • Page 299: Delegate_Ii_Erec_Dt_Sdri

    User interfaces (API) 7.8 Data types 7.8.3.9 Delegate_II_EREC_DT_SDRI Description Table 7- 382 Delegate_II_EREC_DT_SDRI - .NET (C#) delegate void Delegate_II_EREC_DT_SDRI ( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, SDataRecordInfo in_DataRecordInfo Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 300: Delegate_Ii_Erec_Dt_Sdr

    User interfaces (API) 7.8 Data types 7.8.3.10 Delegate_II_EREC_DT_SDR Description Table 7- 383 Delegate_II_EREC_DT_SDR - .NET (C#) delegate void Delegate_II_EREC_DT_SDR ( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, SDataRecord in_DataRecord Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 301: Delegate_Srec_St_Uint32_Eppet_Uint32

    User interfaces (API) 7.8 Data types 7.8.3.11 Delegate_SREC_ST_UINT32_EPPET_UINT32 Description Table 7- 384 Delegate_SREC_ST_UINT32_EPPET_UINT32 - .NET (C#) delegate void Delegate_SREC_ST_UINT32 ( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, UInt32 in_HardwareIdentifier, EPullOrPlugEventType in_PullOrPlugEventType, UInt32 in_SequenceNumber Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 302: Delegate_Srec_St_Uint32_Uint32_Epet_Uint32

    User interfaces (API) 7.8 Data types 7.8.3.12 Delegate_SREC_ST_UINT32_UINT32_EPET_UINT32 Description Table 7- 385 Delegate_SREC_ST_UINT32_UINT32_EPET_UINT32 - Native C++ delegate void Delegate_SREC_ST_UINT32_UINT32_EPET_UINT32( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, UInt32 in_HardwareIdentifier UInt32 in_Channel, EProcessEventType in_ProcessEventType, UInt32 in_SequenceNumber Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 303: Delegate_Srec_St_Uint32

    User interfaces (API) 7.8 Data types 7.8.3.13 Delegate_SREC_ST_UINT32 Description Table 7- 386 Delegate_SREC_ST_UINT32 - .NET (C#) delegate void Delegate_SREC_ST_UINT32 ( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, UInt32 in_HardwareIdentifier Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 304: Delegate_Srec_St_Uint32_Uint32

    User interfaces (API) 7.8 Data types 7.8.3.14 Delegate_SREC_ST_UINT32_UINT32 Description Table 7- 387 Delegate_SREC_ST_UINT32_UINT32 - .NET (C#) delegate void Delegate_SREC_ST_UINT32 ( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, UInt32 in_HardwareIdentifier UInt32 in_SequenceNumber Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 305: Delegate_Srec_St_Uint32_Ersfet

    User interfaces (API) 7.8 Data types 7.8.3.15 Delegate_SREC_ST_UINT32_ERSFET Description Table 7- 388 Delegate_SREC_ST_UINT32_ERSFET - .NET (C#) delegate void Delegate_SREC_ST_UINT32_ERSFET( Syntax IInstance in_Sender, ERuntimeErrorCode in_ErrorCode, DateTime in_DateTime, UInt32 in_HardwareIdentifier, ERackOrStationFaultType in_EventType Parameters • IInstance in_Sender: An interface of the instance that receives this event. •...
  • Page 306: Definitions And Constants

    User interfaces (API) 7.8 Data types 7.8.4 Definitions and constants The following identifiers are used in the API: Table 7- 389 Definitions - Native C++ Identifier Value Description DINSTANCE_NAME_MAX_LENGTH The unique name of an instance must be less than this value. DSTORAGE_PATH_MAX_LENGTH The maximum path length to the virtual memory card.
  • Page 307: Unions (Native C++)

    User interfaces (API) 7.8 Data types 7.8.5 Unions (Native C++) 7.8.5.1 Description Contains an IPv4 address. Table 7- 391 UIP - Native C++ union UIP Syntax DWORD IP; BYTE IPs[4]; Member • DWORD IP: The IP address in a single DWORD •...
  • Page 308: Udatavalue

    User interfaces (API) 7.8 Data types 7.8.5.2 UDataValue Description Contains the value of a PLC tag. Table 7- 392 UDataValue - Native C++ union UDataValue Syntax bool Bool; INT8 Int8; INT16 Int16; INT32 Int32; INT64 Int64; UINT8 UInt8; UINT16 UInt16; UINT32 UInt32;...
  • Page 309: Structures

    User interfaces (API) 7.8 Data types 7.8.6 Structures 7.8.6.1 SDataValue Description The structure contains the value and type of a PLC tag. Table 7- 393 SDataValue - Native C++ struct SDataValue Syntax UDataValue Value; EPrimitiveDataType Type; Member • UDataValue Value: The value of the PLC tags •...
  • Page 310: Table 7- 394 Sdatavalue - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 394 SDataValue - .NET (C#) struct SDataValue Syntax bool Bool { get; set; } Int8 Int8 { get; set; } Int16 Int16 { get; set; } Int32 Int32 { get; set; } Int64 Int64 { get;...
  • Page 311: Sdvbni

    User interfaces (API) 7.8 Data types 7.8.6.2 SDVBNI Description This structure is for internal use only. Do not change this structure. Table 7- 395 SDVBNI - Native C++ struct SDVBNI Syntax Table 7- 396 SDVBNI - .NET (C#) struct SDVBNI Syntax 7.8.6.3 SDataValueByAddress...
  • Page 312: Sdatavaluebyaddresswithcheck

    User interfaces (API) 7.8 Data types 7.8.6.4 SDataValueByAddressWithCheck Description This structure represents a PLC tag that is accessed via its address. Table 7- 399 SDataValueByAddressWithCheck - Native C++ struct SDataValueByAddressWithCheck Syntax UINT32 Offset; UINT8 Bit; SDataValue DataValue; ERuntimeErrorCode ErrorCode; bool ValueHasChanged; Table 7- 400 SDataValueByAddressWithCheck - .NET (C#) struct SDataValueByAddressWithCheck Syntax...
  • Page 313: Sdatavaluebynamewithcheck

    User interfaces (API) 7.8 Data types 7.8.6.6 SDataValueByNameWithCheck Description This structure represents a PLC tag that is called by its name. Table 7- 403 SDataValueByNameWithCheck - Native C++ struct SDataValueByNameWithCheck Syntax WCHAR Name[DTAG_NAME_MAX_LENGTH]; SDataValue DataValue; ERuntimeErrorCode ErrorCode; SDVBNI Internal; bool ValueHasChanged; Table 7- 404 SDataValueByNameWithCheck - .NET (C#) struct SDataValueByNameWithCheck Syntax...
  • Page 314: Sinstanceinfo

    User interfaces (API) 7.8 Data types 7.8.6.8 SInstanceInfo Description This structure contains an IPv4 address. Table 7- 407 SInstanceInfo - Native C++ struct SInstanceInfo Syntax INT32 ID; WCHAR Name[DINSTANCE_NAME_MAX_LENGTH]; Member • INT32 ID: The ID of the instance • WCHAR Name[DINSTANCE_NAME_MAX_LENGTH]: The name of the instance Table 7- 408 SInstanceInfo - .NET (C#) struct SInstanceInfo...
  • Page 315: Staginfo

    User interfaces (API) 7.8 Data types 7.8.6.10 STagInfo Description This structure contains information about a PLC tag. Table 7- 411 STagInfo - Native C++ struct STagInfo Syntax WCHAR Name[DTAG_NAME_MAX_LENGTH]; EArea Area; EDataType DataType; EPrimitiveDataType PrimitiveDataType; UINT16 Size; UINT32 Offset; UINT8 Bit; UINT8 DimensionCount;...
  • Page 316: Table 7- 412 Staginfo - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 412 STagInfo - .NET (C#) public struct STagInfo Syntax String Name; EArea Area; EDataType DataType; EPrimitiveDataType PrimitiveDataType; UInt16 Size; UInt32 Offset; UInt8 Bit; UInt32 Index; UInt32 ParentIndex; SDimension[] Dimension; Member • String name: The name of the tag •...
  • Page 317: Sipsuite4

    User interfaces (API) 7.8 Data types 7.8.6.11 Description This structure contains an IPv4 address. Table 7- 413 SIP - .NET (C#) struct SIP Syntax byte[] IPArray { get; set; } UInt32 IPDWord { get; set; } string IPString { get; set; } Member •...
  • Page 318: Table 7- 415 Sipsuite4 - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 415 SIPSuite4 - .NET (C#) struct SIPSuite4 Syntax SIP IPAddress; SIP SubnetMask; SIP DefaultGateway; Member • SIP IPAddress: The IP address • SIP SubnetMask: The subnet mask • SIP DefaultGateway: The standard gateway S7-PLCSIM Advanced Function Manual, 12/2017, A5E37039512-AB...
  • Page 319: Sonsyncpointreachedresult

    User interfaces (API) 7.8 Data types 7.8.6.13 SOnSyncPointReachedResult Description This structure contains the results of the OnSyncPointReached event. Table 7- 416 SOnSyncPointReachedResult - Native C++ struct SOnSyncPointReachedResult Syntax ERuntimeErrorCode ErrorCode; SYSTEMTIME SystemTime; UINT32 PipId; INT64 TimeSinceSameSyncPoint_ns; INT64 TimeSinceAnySyncPoint_ns; UINT32 SyncPointCount; Member •...
  • Page 320: Table 7- 417 Sonsyncpointreachedresult - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 417 SOnSyncPointReachedResult - .NET (C#) struct SOnSyncPointReachedResult Syntax ERuntimeErrorCode ErrorCode; DateTime SystemTime; UInt32 PipId; Int64 TimeSinceSameSyncPoint_ns; Int64 TimeSinceAnySyncPoint_ns; UInt32 SyncPointCount; Member • ERuntimeErrorCode ErrorCode: A possible error code (Page 327). If no event was triggered during the de- fined time interval: ERuntimeErrorCode.Timeout •...
  • Page 321: Sdatarecordinfo

    User interfaces (API) 7.8 Data types 7.8.6.14 SDataRecordInfo Description This structure contains read/write data record information. Table 7- 418 SDataRecordInfo - Native C++ struct SDataRecordInfo Syntax UINT32 HardwareId; UINT32 RecordIdx; UINT32 DataSize; Member • UINT32 HardwareId: The ID of the hardware module (hardware identifier) •...
  • Page 322: Sdatarecord

    User interfaces (API) 7.8 Data types 7.8.6.15 SDataRecord Description This structure contains read/write data record information and data records. Table 7- 420 SDataRecord - Native C++ struct SDataRecord Syntax SDataRecordInfo Info; BYTE Data[DDATARECORD_MAX_SIZE]; Member • SDataRecordInfo Info: The data record information, see SDataRecordInfo (Page 321) •...
  • Page 323: Sconfiguredprocessevents

    User interfaces (API) 7.8 Data types 7.8.6.16 SConfiguredProcessEvents Description This structure contains information about the configured process events. Table 7- 422 SConfiguredProcessEvents - Native C++ struct SConfiguredProcessEvents Syntax UINT16 HardwareIdentifier; UINT16 Channel; EProcessEventType ProcessEventType; WCHAR Name[DPROCESS_EVENT_NAME_MAX_LENGTH]; Member • UINT16 HardwareIdentifier: The HW identifier •...
  • Page 324: Sdiagextchanneldescription

    User interfaces (API) 7.8 Data types 7.8.6.17 SDiagExtChannelDescription Description This structure contains read/write data record information and data records. Table 7- 424 SDiagExtChannelDescription - Native C++ struct SDiagExtChannelDescription Syntax UINT16 ChannelNumber; UINT16 ErrorType; UINT16 ExtErrorType; EDiagSeverity Severity; EDiagProperty Direction; Member •...
  • Page 325: Table 7- 425 Sdiagextchanneldescription - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 425 SDiagExtChannelDescription - .NET (C#) struct SDiagExtChannelDescription Syntax UInt16 ChannelNumber; UInt16 ErrorType; UInt16 ExtErrorType; EDiagSeverity Severity; EDiagProperty Direction; Member • UInt16 ChannelNumber: If the interrupt relates to a specific channel of the IO device (e.g. short circuit), this parameter must contain the number of the faulty channel.
  • Page 326: Enumerations

    User interfaces (API) 7.8 Data types The following table contains error types "Remote ExtChannelErrorType ChannelErrorType mismatch": Table 7- 427 ExtChannelErrType error types Value Meaning 0x0000 Reserved 0x0001 to 0x7FFF Manufacturer ID Interrupt/diagnostics 0x8000 Peer name of station mismatch Interrupt/diagnostics 0x8001 Peer name of port mismatch Interrupt/diagnostics 0x8002...
  • Page 327: Eruntimeerrorcode

    User interfaces (API) 7.8 Data types 7.8.7.1 ERuntimeErrorCode Description This enumeration contains all error codes that are used by the Simulation Runtime API. Most API functions return one of these error codes. If the function is successful, the return value is always .
  • Page 328 User interfaces (API) 7.8 Data types SREC_INVALID_CONFIGURATION = -28, SREC_TYPE_MISMATCH = -29, SREC_LICENSE_NOT_FOUND = -30, SREC_NO_LICENSE_AVAILABLE = -31, SREC_WRONG_COMMUNICATION_INTERFACE = -32, SREC_LIMIT_REACHED = -33, SREC_NO_STORAGE_PATH_SET = -34, SREC_STORAGE_PATH_ALREADY_IN_USE = -35, SREC_MESSAGE_INCOMPLETE = -36, SREC_ARCHIVE_STORAGE_NOT_CREATED = -37, SREC_RETRIEVE_STORAGE_FAILURE = -38 SREC_INVALID_OPERATING_STATE = -39, SREC_INVALID_ARCHIVE_PATH = -40, SREC_DELETE_EXISTING_STORAGE_FAILED = -41, SREC_CREATE_DIRECTORIES_FAILED = -42,...
  • Page 329: Table 7- 429 Eruntimeerrorcode - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 429 ERuntimeErrorCode - .NET (C#) enum ERuntimeErrorCode Syntax OK = 0, InvalidErrorCode = -1, NotImplemented = -2, IndexOutOfRange = -3, DoesNotExist = -4, AlreadyExists = -5, UnknownMessageType = -6, InvalidMessageId = -7, WrongArgument = -8, WrongPipe = -9, ConnectionError = -10,...
  • Page 330: Earea

    User interfaces (API) 7.8 Data types 7.8.7.2 EArea Description This enumeration contains all PLC areas that contain the available PLC tags. Table 7- 430 EArea - Native C++ enum EArea Syntax SRA_INVALID_AREA = 0, SRA_INPUT = 1, SRA_MARKER = 2, SRA_OUTPUT = 3, SRA_COUNTER = 4, SRA_TIMER = 5,...
  • Page 331: Eoperatingmode

    User interfaces (API) 7.8 Data types Table 7- 433 EOperatingState - .NET (C#) enum EOperatingState Syntax InvalidOperatingState = 0, Off = 1, Booting = 2, Stop = 3, Startup = 4, Run = 5, Freeze = 6, ShuttingDown = 7, Hold = 8 7.8.7.4 EOperatingMode...
  • Page 332: Ecputype

    User interfaces (API) 7.8 Data types 7.8.7.5 ECPUType Description This enumeration contains all CPU types that can be loaded in a virtual controller. Table 7- 436 ECPUType - Native C++ Syntax enum ECPUType SRCT_1500_Unspecified = 0x000005DC, SRCT_1511 = 0x000005E7, SRCT_1511v2 = 0x010005E7, SRCT_1511v3 = 0x020005E7 SRCT_1513 = 0x000005E9, SRCT_1513v2 = 0x010005E9,...
  • Page 333: Table 7- 437 Ecputype - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 437 ECPUType - .NET (C#) Syntax enum ECPUType CPU1500_Unspecified = 0x000005DC, CPU1511 = 0x000005E7, CPU1511v2 = 0x010005E7, CPU1513 = 0x000005E9, CPU1513v2 = 0x010005E9, CPU1511v3 = 0x020005E7, CPU1515 = 0x000005EB, CPU1515v2 = 0x010005EB, CPU1513v3 = 0x020005E9, CPU1516 = 0x000005EC, CPU1516v2 = 0x010005EC,...
  • Page 334: Ecommunicationinterface

    User interfaces (API) 7.8 Data types 7.8.7.6 ECommunicationInterface Description This enumeration contains the available communication interfaces of a virtual controller. Table 7- 438 ECommunicationInterface - Native C++ enum ECommunicationInterface Syntax SRCI_NONE = 0, SRCI_SOFTBUS = 1, SRCI_TCPIP = 2, SRCI_ENUMERATION_SIZE = 3 Table 7- 439 ECommunicationInterface - .NET (C#) enum ECommunicationInterface Syntax...
  • Page 335: Eledmode

    User interfaces (API) 7.8 Data types 7.8.7.8 ELEDMode Description This list contains all the LED states of a virtual controller. Table 7- 442 ELEDMode - Native C++ enum ELEDMode Syntax SRLM_OFF = 0, SRLM_ON = 1, SRLM_FLASH_FAST = 2, SRLM_FLASH_SLOW = 3, SRLM_INVALID = 4 Table 7- 443 ELEDMode - .NET (C#) enum ELEDMode...
  • Page 336: Table 7- 445 Eprimitivedatatype - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 445 EPrimitiveDataType - .NET (C#) enum EPrimitiveDataType Syntax Unspecific = 0, Struct = 1, Bool = 2, Int8 = 3, Int16 = 4, Int32 = 5, Int64 = 6, UInt8 = 7, UInt16 = 8, UInt32 = 9, UInt64 = 10,...
  • Page 337: Table 7- 447 Compatible Primitive Data Types - Write

    User interfaces (API) 7.8 Data types Table 7- 447 Compatible primitive data types - Write PLCSIM Advanced instance Bool INT8 INT16 INT32 INT64 UINT8 UINT16 UINT32 UINT6 Float Double Char WChar Bool INT8 INT16 INT32 INT64 UINT8 UINT16 UINT32 UINT64 Float Double Char...
  • Page 338: Edatatype

    User interfaces (API) 7.8 Data types 7.8.7.10 EDataType Description This enumeration contains all the PLC data types (STEP 7). Table 7- 448 EDataType - Native C++ enum EDataType Syntax SRDT_UNKNOWN = 0, SRDT_BOOL = 1, SRDT_BYTE = 2, SRDT_CHAR = 3, SRDT_WORD = 4, SRDT_INT = 5, SRDT_DWORD = 6,...
  • Page 339 User interfaces (API) 7.8 Data types SRDT_CREF = 101, SRDT_AOM_IDENT = 128, SRDT_EVENT_ANY = 129, SRDT_EVENT_ATT = 130, SRDT_EVENT_HWINT = 131, SRDT_HW_ANY = 144, SRDT_HW_IOSYSTEM = 145, SRDT_HW_DPMASTER = 146, SRDT_HW_DEVICE = 147, SRDT_HW_DPSLAVE = 148, SRDT_HW_IO = 149, SRDT_HW_MODULE = 150, SRDT_HW_SUBMODULE = 151, SRDT_HW_HSC = 152, SRDT_HW_PWM = 153,...
  • Page 340: Table 7- 449 Edatatype - .Net (C#)

    User interfaces (API) 7.8 Data types Table 7- 449 EDataType - .NET (C#) public enum EDataType Syntax Unknown = 0, Bool = 1, Byte = 2, Char = 3, Word = 4, Int = 5, DWord = 6, DInt = 7, Real = 8, Date = 9, TimeOfDay = 10,...
  • Page 341 User interfaces (API) 7.8 Data types Aom_Ident = 128, Event_Any = 129, Event_Att = 130, Event_HwInt = 131, Hw_Any = 144, Hw_IoSystem = 145, Hw_DpMaster = 146, Hw_Device = 147, Hw_DpSlave = 148, Hw_Io = 149, Hw_Module = 150, Hw_SubModule = 151, Hw_Hsc = 152, Hw_Pwm = 153, Hw_Pto = 154,...
  • Page 342: Etaglistdetails

    User interfaces (API) 7.8 Data types 7.8.7.11 ETagListDetails Description This list contains all PLC areas that can be used as a filter to update the tag table. Table 7- 450 ETagListDetails - Native C++ enum ETagListDetails Syntax SRTLD_NONE = 0, SRTLD_IO = 1, SRTLD_M = 2, SRTLD_IOM = 3,...
  • Page 343: Eruntimeconfigchanged

    User interfaces (API) 7.8 Data types 7.8.7.12 ERuntimeConfigChanged Description This list contains all possible causes of a OnConfigurationChanged event that the Runtime Manager sends. Table 7- 452 ERuntimeConfigChanged - Native C++ enum ERuntimeConfigChanged Syntax SRCC_INSTANCE_REGISTERED = 0, SRCC_INSTANCE_UNREGISTERED = 1 SRCC_CONNECTION_OPENED = 2, SRCC_CONNECTION_CLOSED = 3, SRCC_PORT_OPENED = 4,...
  • Page 344: Epullorplugeventtype

    User interfaces (API) 7.8 Data types 7.8.7.14 EPullOrPlugEventType Description This enumeration contains predefined types of pull/plug events for S7 modules. Table 7- 456 EPullOrPlugEventType - Native C++ enum EPullOrPlugEventType Syntax SR_PPE_UNDEFINED = 0, SR_PPE_PULL_EVENT = 1, SR_PPE_PLUG_EVENT = 2, SR_PPE_PLUG_EVENT_ERROR_REMAINS = 3, SR_PPE_PLUG_WRONG_MODULE_EVENT = 4 Table 7- 457 EPullOrPlugEventType - .NET (C#) enum EPullOrPlugEventType...
  • Page 345: Edirection

    User interfaces (API) 7.8 Data types Table 7- 459 EProcessEventType - .NET (C#) enum EProcessEventType Syntax Undefined = 0, RisingEdge = 1, FallingEdge = 2, Limit_1_Underrun = 3, Limit_1_Overrun = 4, Limit_2_Underrun = 5, Limit_2_Overrun = 6 7.8.7.16 EDirection Description This enumeration contains properties of the diagnostic alarm.
  • Page 346: Ediagseverity

    User interfaces (API) 7.8 Data types 7.8.7.18 EDiagSeverity Description This enumeration contains the severity of the diagnostic alarm (error, maintenance demanded, maintenance required). Table 7- 464 EDiagSeverity - Native C++ enum EDiagSeverity Syntax SRDS_SEVERITY_FAILURE = 0, SRDS_SEVERITY_MAINTENANCE_DEMANDED = 1, SRDS_SEVERITY_MAINTENANCE_REQUIRED = 2 Table 7- 465 EDiagSeverity - .NET (C#) enum EDiagSeverity Syntax...
  • Page 347: Overview

    Restrictions Overview Certain actions or events may lead to behavior in PLCSIM Advanced or in STEP 7 which deviates from that of a hardware CPU. Restrictions and possible remedies can be found in the following sections: ● Restrictions with fail-safe CPUs (Page 347) ●...
  • Page 348: Opc Ua Server

    Restrictions 8.3 OPC UA server OPC UA server With OPC UA, data exchange is performed through an open, standardized and manufacturer-independent communication protocol. The CPU acting as the OPC UA server can communicate with OPC UA clients, for example, with HMI panels V14 and SCADA systems.
  • Page 349: Web Server

    Restrictions 8.4 Web server Web server The Web server integrated in a CPU enables monitoring and administering of the CPU by authorized users over a network. This permits evaluation and diagnostics over long distances. Each PLCSIM Advanced instance can simulate its own Web server. The simulation of the Web server is restricted under S7-PLCSIM Advanced V2.0.
  • Page 350: Backing Up And Restoring The Configuration Of A Plcsim Advanced Instance

    Restrictions 8.5 Backing up and restoring the configuration of a PLCSIM Advanced instance Backing up and restoring the configuration of a PLCSIM Advanced instance Backing up and restoring the configuration As of PLCSIM Advanced V2.0 it is possible to back up and restore a PLCSIM Advanced instance.
  • Page 351: Restrictions For Communications Services

    Restrictions 8.7 Restrictions for communications services Restrictions for communications services TUSEND / TURCV When you run the UDP blocks TUSEND and TURCV via the "PLCSIM" communication interface (Softbus), you get error code 0x80C4 at the transmission end and receiving end: Temporary communications error.
  • Page 352: Restrictions With Motion Control

    Restrictions 8.9 Restrictions with Motion Control Restrictions with Motion Control 8.9.1 MCR and EMCR There are Motion Control resources (MCR) and Extended Motion Control resources (EMCR) on each CPU that can be distributed to the technology objects. Note PLCSIM Advanced does not support the complete quantity structure of MCR und EMCR. The simulation of motion control is therefore restricted for the following CPUs: Table 8- 1 CPUs with limited Motion Control resources (MCR, EMCR) during the simulation...
  • Page 353: Technology Modules

    Motion Control instructions are not supported. Additional information For more information on Motion Control, refer to the following manuals: ● Device manuals to support SIMATIC controllers (https://support.industry.siemens.com/cs/ww/en/view/109744173) ● Function manual S7-1500 Motion Control (https://support.industry.siemens.com/cs/ww/en/view/109739589) ● Function manual S7-1500T Motion Control (https://support.industry.siemens.com/cs/ww/en/view/109481326)
  • Page 354: Restrictions To Local Communication Via Softbus

    Restrictions 8.10 Restrictions to local communication via Softbus 8.10 Restrictions to local communication via Softbus Identical IP addresses for instances If the "PLCSIM" communication interface (Softbus) is set, then identical IP addresses are created automatically for all instances when creating the instances through the Control Panel.
  • Page 355: Figure 8-1 Policy Exceptions For Vmware Vsphere Hypervisor (Esxi)

    Restrictions 8.11 Restrictions of security with VMware vSphere Hypervisor (ESXi) 8.11 Restrictions of security with VMware vSphere Hypervisor (ESXi) When you use the virtualization platform VMware vSphere Hypervisor (ESXi), you must change the policy exception to communicate over TCP/IP. Remedy Accept the "Promiscuous mode and "Forged transmit"...
  • Page 356: Deviating I/O Values In The Step 7 User Program

    Restrictions 8.13 Deviating I/O values in the STEP 7 user program 8.13 Deviating I/O values in the STEP 7 user program Updated values Each value change made by a STEP 7 user program in the I/O address areas is overwritten in the cycle control point with the updated value that was written via the API functions .
  • Page 357: Error Installing The Antivirus Software From Kaspersky

    Restrictions 8.17 Error installing the antivirus software from Kaspersky 8.17 Error installing the antivirus software from Kaspersky When using the Anti-Virus virus scanner from Kaspersky, the network settings may not be set correctly during the installation of PLCSIM Advanced. The result is that communication via TCP/IP cannot be used (error code -50 in the Control Panel).
  • Page 358: List Of Abbreviations

    List of abbreviations Abbreviation Term Automation License Manager Tool for managing license keys in STEP 7 Application Programming Interface user interface Address resolution protocol Binary Coded Decimal Central Processing Unit (Synonym for PLC) EMCR Extended Motion Control resources Engineering System Human Machine Interface user interface Industrial Ethernet Graphical User Interface...

Table of Contents