Net (C#); Initialize; Table 7- 20 Initialize - .Net (C#) - Siemens Simatic S7-1500 Function Manual

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

Advertisement

Example C++
Note
If you no longer require the interface, delete it.
See DestroyInterface() (Page 101).
7.2.3

.NET (C#)

7.2.3.1

Initialize

Description
The entry point to the API is the static class
S
iemens.Simatic.Simulation.Runtime.SimulationRuntimeManager
The API is initialized when a function of this class is used the first time.
Table 7- 20
Exceptions
S7-PLCSIM Advanced
Function Manual, 12/2017, A5E37039512-AB
// Include The Headerfile Of The API
#include "SimulationRuntimeApi.h"
// Prepare The Variables
ERuntimeErrorCode result = SREC_INVALID_ERROR_CODE;
HMODULE dllHandle = NULL;
ApiEntry_Initialize Initialize = NULL;
ISimulationRuntimeManager* api = NULL;
// Load The DLL And Import The "Initialize" Function (using the
Win32 API)
dllHandle = LoadLibrary(DAPI_DLL_NAME_X86);
if ( dllHandle != NULL )
{
Initialize = (ApiEntry_Initialize)GetProcAddress(dllHandle,
DAPI_ENTRY_INITIALIZE);
}
// Initialize The API And Get The RuntimeManager Interface
if ( Initialize != NULL )
{
Initialize
result =
}
Initialize - .NET (C#)
Siemens.Simatic.Simulation.Runtime.SimulationInitializationException
Runtime error code
ERuntimeError-
Code.ConnectionError
ERuntimeError-
Code.WrongVersion
ERuntimeError-
Code.RuntimeNotAvailable
(&api, DAPI_DLL_INTERFACE_VERSION);
Condition
Unable to establish a connection to the Runtime
Manager.
The version of the API is not compatible with
Runtime.
See Compatibility during upgrade (Page 31).
No Runtime Manager runs in this Windows user
session.
User interfaces (API)
7.2 Initialize API
.
99

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents