User interfaces (API)
7.2 Initialize API
7.2
Initialize API
7.2.1
Load API library
Description
With PLCSIM Advanced the interfaces of the API V2.0 are not compatible with the interfaces
of the API V1.0. However, the Runtime Manager of PLCSIM Advanced V2.0 is compatible
with the API of PLCSIM Advanced V1.0.
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:
● Key: "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Siemens\Shared
Tools\PLCSIMADV_SimRT"
● Value: "Path"
To maintain the path to the API, add the character string of the following subdirectory at the
end: "API\<API version>" (e.g. "API\2.0").
When you use this path the API library (DLL) is loaded directly from the installation directory.
Reference
Additional information can be found in:
● For Native C++ in section InitializeApi() (Page 96).
● For .NET via the call of the function
online documentation for MSDN.
7.2.2
Native C++
7.2.2.1
InitializeApi()
Description
The
loads the version of the DLL that is compatible with the architecture of your application and
which is also compatible with the header file of the API (SimulationRuntimeApi.h).
To load the DLL, the function
the other:
● In the directory to which the parameter of the function leads
(
● In the directory of your application that calls this function.
● In the installation directory of PLCSIM Advanced
96
function loads the API library (DLL) and initializes the API. The function
InitializeApi
in_SimulationRuntimeApiDllPath
System.Reflection.Assembly.LoadFile(string)" in the
"
searches in the following directories one after
InitializeApi
)
S7-PLCSIM Advanced
Function Manual, 12/2017, A5E37039512-AB