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.
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 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 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 ....................
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.
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.
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.
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. ●...
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.
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...
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...
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.
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).
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...
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...
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.
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.
● 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...
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. ●...
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. ●...
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.
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...
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.
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.
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...
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...
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.
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. ●...
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.
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 ②...
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 ●...
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.
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"...
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).
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.
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).
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 •...
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.
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. →...
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. ●...
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.
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.
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: ●...
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.
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...
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.
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.
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)
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.
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.
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: ●...
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...
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#)
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...
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...
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: ●...
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(...
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.
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...
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.
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.
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.
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()
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.
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.
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...
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. •...
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...
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.
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();...
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...
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.
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.
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.
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.
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 .
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. •...
, 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...
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: <My Documents>>\Siemens\Simatic\Simulation\Runtime\Persistence\<Instance Name> is used. Table 7- 116 SetStoragePath() - 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...
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...
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).
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. •...
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 •...
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.
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...
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...
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...
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...
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.
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...
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.
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.
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.
None Return values • string in_FullFileName: File name of the XML file that is to be written to: <Path> + <File name> + <File extension>. Siemens.Simatic.Simulation.Runtime.SimulationRuntimeException Exceptions Runtime error code Condition ERuntimeError- The instance is not registered in Runtime Code.InterfaceRemoved Manager.
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).
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).
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.
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...
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.
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).
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.
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).
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.
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).
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.
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.
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.
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.
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.
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.
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. •...
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...
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.
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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.
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...
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.
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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. •...
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.
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 •...
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.
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. ●...
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.
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.
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.
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...
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.
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.
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...
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...
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 •...
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...
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...
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...
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...
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...
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...
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.
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...
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.
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...
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->...
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();...
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();...
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...
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...
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...
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();...
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 •...
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...
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...
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.
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.
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.
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.
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.
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.
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.
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();...
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.
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.
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.
. 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.
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,...
. 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.
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,...
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...
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...
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();...
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.
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...
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.
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.
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.
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 •...
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 •...
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...
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...
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...
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 •...
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) •...
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) •...
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 •...
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 •...
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.
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...
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 .
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,...
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...
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,...
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,...
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) ●...
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.
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.
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.
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.
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...
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)
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.
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"...
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 .
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).
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...