The chat responses are generated using Generative AI technology for intuitive search and may not be entirely accurate. They are not intended as professional advice. For full details, including our use rights, privacy practices and potential export control restrictions, please refer to our Generative AI Service Privacy Information. As this is a test version, please let us know if something irritating comes up. Like you get recommended a chocolate fudge ice cream instead of an energy managing application. If that occurs, please use the feedback button in our contact form!
Skip to content
SIMATIC S7-PLCSIM Advanced Share llms optimized content

Efficiently simulate SIMATIC S7 controllers with S7-PLCSIM Advanced. Test, debug, and optimize your control programs without using physical hardware.

Interface Siemens::Simatic::Simulation::Runtime::IInstance

ClassList > Siemens > Simatic > Simulation > Runtime > IInstance

  • #include <SimulationRuntimeApiNet.h>

Inherits the following classes: System::IDisposable

Public Attributes

TypeName
property System::StringArticleNumber = { System::String^ get()
Gets or sets the ArticleNumber cpu of the virtual controller. A change of the CPU will only happen when the controller is restarted.
property ECPUTypeCPUType = { [**ECPUType**](SimulationRuntimeApi_8h.md#enum-ecputype) get()
Gets or sets the CPU type of the virtual controller. A change of the CPU Type will only happen when the controller is restarted.
property ECommunicationInterfaceCommunicationInterface = { [**ECommunicationInterface**](SimulationRuntimeApi_8h.md#enum-ecommunicationinterface) get()
property array< System::String^>ControllerIP = { array&lt;System::String^&gt;^ get()
Returns a configured IP address of the instance.
property array< SIPSuite4 >ControllerIPSuite4 = { array&lt;[**SIPSuite4**](structSIPSuite4.md)&gt;^ get()
Returns the IP suite instance. If the "Softbus" communication interface is used, the subnet mask and default gateway are 0.
property System::StringControllerName = { System::String^ get()
Returns the downloaded controller name of the virtual controller.
property System::StringControllerShortDesignation = { System::String^ get()
Returns the downloaded short designation of the virtual controller.
property INT32ID = { INT32 get()
Returns the ID of the instance. The ID is assigned by the Runtime Manager when registering the instance.
property SInstanceInfoInfo = { [**SInstanceInfo**](structSInstanceInfo.md) get()
Returns a struct providing information about the instance.
property IIOAreaInputArea = { IIOArea^ get()
Returns the interface that can be used to call I/O access by address functions.
property boolIsSendSyncEventInDefaultModeEnabled = { bool get()
Gets or sets the SendSyncEventInDefault mode. If the mode is set, the OnSyncPointReached event is triggered after every cycle end in the operating mode "Default".
property ERuntimeErrorCodeLicenseStatus = { [**ERuntimeErrorCode**](SimulationRuntimeApi_8h.md#enum-eruntimeerrorcode) get()
Returns information about whether a Trial License is currently in use.
property IIOAreaMarkerArea = { IIOArea^ get()
Returns the interface that can be used to call I/O access by address functions.
property System::StringName = { System::String^ get()
Returns the name of the instance.
event Delegate_SREC_ST_UINT32_UINT32OnAlarmNotificationDone
Registers or unregisters an event handler method.
event Delegate_II_EREC_DT_SDRIOnDataRecordRead
Registers or unregisters an event handler method.
event Delegate_II_EREC_DT_SDROnDataRecordWrite
Registers or unregisters an event handler method.
event Delegate_DisplayDataChangedOnDisplayDataChanged
The event will be fired when the front panel data has changed. Afterwards it is always safe to access the display data.
event Delegate_II_EREC_DTOnHardwareConfigChanged
The event will be fired when the download of a HW-Config happens. It will always stop and restart the isochronous clock mechanism.
event Delegate_IPAddressChangedOnIPAddressChanged
Fired on IP address change
event Delegate_II_EREC_DT_ELT_ELMOnLedChanged
The event will be fired when a LED of the virtual controller has been changed.
event Delegate_II_EREC_DT_EOS_EOSOnOperatingStateChanged
The event will be fired every time the operating state of the virtual controller has been changed.
event Delegate_SREC_ST_UINT32_UINT32_EPET_UINT32OnProcessEventDone
Registers or unregisters an event handler method.
event Delegate_SREC_ST_UINT32OnProfileEventDone
The user can Register or unregister for an asynchronous acknowledgement of the Profile Event.
event Delegate_SREC_ST_UINT32_EPPET_UINT32OnPullOrPlugEventDone
Registers or unregisters an event handler method.
event Delegate_SREC_ST_UINT32_ERSFETOnRackOrStationFaultEvent
The user can Register or unregister for an asynchronous acknowledgement of the RackOrStationFault Event.
event Delegate_SoftwareConfigurationChangedOnSoftwareConfigurationChanged
Software configuration changed event handler.
event Delegate_SREC_ST_UINT32OnStatusEventDone
The registered user-defined function will be executed as acknowledgement that the execution of the Status Event OB (OB 55) has completed.
event Delegate_II_EREC_DT_UINT32_INT64_INT64_UINT32OnSyncPointReached
Registers or unregisters an event handler method.
event Delegate_SREC_ST_UINT32OnUpdateEventDone
The user can register or unregister for an asynchronous acknowledgement of the Update Event.
property EOperatingModeOperatingMode = { [**EOperatingMode**](SimulationRuntimeApi_8h.md#enum-eoperatingmode) get()
Gets or sets the operating mode of the virtual controller. Changes of the value during runtime take effect on the cycle control point.
property EOperatingStateOperatingState = { [**EOperatingState**](SimulationRuntimeApi_8h.md#enum-eoperatingstate) get()
Returns the operating state of the virtual controller.
property IIOAreaOutputArea = { IIOArea^ get()
Returns the interface that can be used to call I/O access by address functions.
property INT64OverwrittenMinimalCycleTime_ns = { INT64 get()
Gets or sets the overwritten minimal cycle time in nanoseconds used in the extended single-step operating mode. A valid input is a value between 0 and 6,000,000,000. Changes of the value during runtime take effect at the cycle control point.
property doubleScaleFactor = { double get()
Gets or sets the scale factor the virtual time proceeds. A valid input value X is a value between 0 and 1000. The default value is 1.0. If the value is unequal to 1, the virtual time of the virtual controller runs X times faster/slower than the wall clock time. Changes of the value during runtime take effect at the cycle control point.
property System::StringStoragePath = {System::String^ get()
Gets or sets the full path of the directory the instance is storing its data. This can also be a network share. The path has to be set while the instance is not running. The instance will read the path during power on only. If no path is set the default path will be 'user documents folder'\Siemens\Simatic\Simulation\Runtime\Persistence\'Instance Name'
property boolStrictMotionTiming = /* multi line expression */
property System::DateTimeSystemTime = { System::DateTime get()
Gets or sets the virtual system time of the virtual controller. A valid input is a system time between Jan 1 1970 00:00:00:000 and Dec 31 2200 23:59:59:999
property array< STagInfo >TagInfos = { array&lt;[**STagInfo**](structSTagInfo.md)&gt;^ get()
Get a list of all tags.

Public Functions

TypeName
virtual voidAlarmNotification (UINT16 in_HardwareIdentifier, UINT16 in_ModuleState, UINT16 in_NumberOfDiagnosisEvents, array< SDiagExtChannelDescription >^ in_ArrayOfDiagnosisEvents, UINT16% out_SequenceNumber)
This API is used to trigger the diagnosis alarms. Each call of this API-Method triggers the OB82 once, independent from the number and severity of the transmitted Diagnostic-Items.
virtual voidArchiveStorage (System::String^ in_FullFileName)
Stores the virtual memory card in a .zip file. The virtual controller has to be in the operating state off.
virtual ERuntimeErrorCodeCheckNetInterfaceMapping ()
Check for valid network interface mapping, so instance can be started. All already running instances on PC are checked for possible duplicate mappings. Also check for valid bindings on PC network interfaces.
virtual voidCleanupStoragePath ()
Cleans up the storage folder. The controller must be in operational state OFF.
virtual voidCreateConfigurationFile (System::String^ in_FullFileName)
Writes all taglist entries from the taglist storage into an XML file.
virtual ERuntimeErrorCodeDisplayKeyPress (EDisplayKey keyId)
This API Interacts with the selected button on the Display.
virtual array< SConfiguredProcessEvents >GetConfiguredProcessEvents ()
The API GetConfiguredProcessEvents can be used for reading the configuration of the downloaded process events at runtime.
virtual voidGetCycleTimeMonitoringMode (ECycleTimeMonitoringMode% out_CycleTimeMonitoringMode, INT64% out_MaxCycleTime_ns)
gets the maximum cycle time in nanoseconds based on the CycleTimeMonitoring mode.
virtual SDisplayDataGetDisplayData ()
This API gets the current display data of the display and writes it into the given uint8_t Buffer.
virtual intGetNetInterfaceMapping (EPLCInterface in_PLCInterfaceID)
Get the interface index of PC interface to which specified PLC interface is mapped.
virtual voidGetTagListStatus (ETagListDetails% out_TagListDetails, bool% out_IsHMIVisibleOnly)
Returns the current update state of the taglist storage. "inout_TagListDetails" is "NONE" if the list needs to be updated.
virtual boolHasDisplay ()
This API gets if the PLC is having a display or not. If the return value is true it is save that the display is simulated and the functions for accessing its data are returning simulated data.
virtual voidMemoryReset ()
Shuts down the virtual controller, closes its process and restarts it.
virtual voidMemoryReset (UINT32 in_TimeOut_ms)
Shuts down the virtual controller, closes its process and restarts it.
virtual voidPowerOff ()
Shuts down the virtual controller and closes its process.
virtual voidPowerOff (UINT32 in_TimeOut_ms)
Shuts down the virtual controller and closes its process.
virtual ERuntimeErrorCodePowerOn ()
Creates the process of the simulation runtime instance and starts the firmware of the virtual controller.
virtual ERuntimeErrorCodePowerOn (UINT32 in_TimeOut_ms)
Creates the process of the simulation runtime instance and starts the firmware of the virtual controller.
virtual voidProcessEvent (UINT16 in_HardwareIdentifier, UINT16 in_Channel, EProcessEventType in_ProcessEventType, UINT16% out_SequenceNumber)
This API is used to trigger the process event interrupt.
virtual voidProfileEvent (UINT16 in_HardwareIdentifier, UINT16 in_Specifier)
This API is used to trigger the Profile event OB (OB 57). Profile-Events are supported only for modules on a decentral IO-system.
virtual voidPullOrPlugEvent (UINT16 in_HardwareIdentifier, EPullOrPlugEventType in_PullOrPlugEventType, UINT16% out_SequenceNumber)
This API is used to trigger the Pull and Plug events. For Pull and Plug Events, the interrupt OB 83 �Pull or plug of modules� is executed.
virtual voidRackOrStationFaultEvent (UINT16 in_HardwareIdentifier, ERackOrStationFaultType in_EventType)
This API is used to trigger the RackOrStationFault event OB (OB 86). This event is only supported for Decentral devices.
virtual SDataValueRead (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual boolReadBool (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual charReadChar (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual doubleReadDouble (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual floatReadFloat (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual INT16ReadInt16 (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual INT32ReadInt32 (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual INT64ReadInt64 (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual INT8ReadInt8 (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual voidReadRecordDone (SDataRecordInfo in_RecordInfo, array< BYTE >^ in_Data, UINT32 in_Status)
Completion of Asynchronous Reading of Data record.
virtual voidReadSignals (array< SDataValueByName >^% inout_Signals)
Reads a list of signals at once. Only signals of the primitive data type are supported but the function is not type safe. The function is also taking care of the endianness.
virtual voidReadSignals (array< SDataValueByNameWithCheck >^% inout_Signals, bool% out_SignalsHaveChanged)
Reads a list of signals at once. Only signals of the primitive data type are supported but the function is not type safe. The function is also taking care of the endianness.
virtual System::StringReadString (System::String^ in_Tag)
Reads the value of a PLC string variable.
virtual UINT16ReadUInt16 (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual UINT32ReadUInt32 (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual UINT64ReadUInt64 (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual UINT8ReadUInt8 (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual WCHARReadWChar (System::String^ in_Tag)
Reads the value of a PLC variable.
virtual System::StringReadWString (System::String^ in_Tag)
Reads the value of a PLC wstring variable.
virtual voidRegisterOnDisplayDataChangedEvent ()
When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.
virtual voidRegisterOnHardwareConfigChangedEvent ()
When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.
virtual voidRegisterOnIPAddressChangedEvent ()
When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.
virtual voidRegisterOnLedChangedEvent ()
When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.
virtual voidRegisterOnOperatingStateChangedEvent ()
When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.
virtual voidRegisterOnSoftwareConfigurationChangedEvent ()
Registers event signaled whenever a software changed event becomes signaled.
virtual voidRegisterOnSyncPointReachedEvent ()
When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.
virtual voidRetrieveStorage (System::String^ in_FullFileName)
Restores a virtual memory card from a .zip file. The virtual controller has to be in the operating state off.
virtual voidRun ()
Requests the virtual controller to switch into run mode.
virtual voidRun (UINT32 in_TimeOut_ms)
Requests the virtual controller to switch into run mode.
virtual voidRunToNextSyncPoint ()
When operating the virtual controller in the single step or extended single step operating mode the virtual controller will go into freeze state at the end of each cycle. With this function the next cycle will be triggered.
virtual voidRunToNextSyncPoint (UINT32 in_IoSystemId, UINT64 in_BusTimeStamp_ns)
Extension to IInstance::RunToNextSyncPoint for bus synchronous mode.
virtual voidSetCycleTimeMonitoringMode (ECycleTimeMonitoringMode in_CycleTimeMonitoringMode)
sets the CycleTimeMonitoring mode. A valid input CycleTimeMonitoring modes are Ignored,Downloaded or Specified.
virtual voidSetCycleTimeMonitoringMode (ECycleTimeMonitoringMode in_CycleTimeMonitoringMode, INT64 in_MaxCycleTime_ns)
sets the maximum cycle time in nanoseconds based on the CycleTimeMonitoring mode. A valid input is a value between 1000000 and 60,000,000,000. Changes of the value during runtime take effect at the cycle control point.
virtual voidSetIPSuite (UINT32 in_InterfaceID, SIPSuite4 in_IPSuite, bool in_IsRemanent)
Sets the IP suite of a network interface of the virtual controller.
virtual voidSetNetInterfaceMapping (EPLCInterface in_PLCInterfaceID, UINT32 in_PCInterfaceIndex)
Set interface mappings between PLC interface and computer interface. Ethernet packets received by specified computer interface will be forwarded to the associated PLC interface.
virtual voidSetNetInterfaceMapping (EPLCInterface in_PLCInterfaceID, System::String^ in_PCInterfaceName)
Set interface mappings between PLC interface and computer interface. Ethernet packets received by specified computer interface will be forwarded to the associated PLC interface.
virtual voidSetNetInterfaceMapping (EPLCInterface in_PLCInterfaceID, SMACAddress in_MACAddressParam)
Set interface mappings between PLC interface and computer interface. Ethernet packets received by specified computer interface will be forwarded to the associated PLC interface.
virtual voidStartProcessing (INT64 in_MinimalTimeToRun_ns)
When operating the virtual controller in the timespan synchronized operating mode the virtual controller will go into freeze state at the cycle control point. This function will wake up the virtual controller. The virtual controller will now run for at least the requested time based on virtual time before going back into freeze state at the next cycle control point.
virtual voidStatusEvent (UINT16 in_HardwareIdentifier, UINT16 in_Specifier)
This API is used to trigger the Status event OB (OB 55). Status-Events are supported only for modules on a decentral IO-system.
virtual voidStop ()
Requests the virtual controller to switch into stop mode.
virtual voidStop (UINT32 in_TimeOut_ms)
Requests the virtual controller to switch into stop mode.
virtual voidUnregisterInstance ()
Unregisters this instance from the Runtime Manager.
virtual voidUnregisterOnDisplayDataChangedEvent ()
Unregisters the event object.
virtual voidUnregisterOnHardwareConfigChangedEvent ()
Unregisters the event object.
virtual voidUnregisterOnIPAddressChangedEvent ()
Unregisters the event object.
virtual voidUnregisterOnLedChangedEvent ()
Unregisters the event object.
virtual voidUnregisterOnOperatingStateChangedEvent ()
Unregisters the event object.
virtual voidUnregisterOnSoftwareConfigurationChangedEvent ()
Unregisters the software changed event.
virtual voidUnregisterOnSyncPointReachedEvent ()
Unregisters the event object.
virtual voidUpdateEvent (UINT16 in_HardwareIdentifier, UINT16 in_Specifier)
This API is used to trigger the Update event OB (OB 56). Update events are supported only for modules on a decentral IO-system.
virtual voidUpdateTagList ()
Reads the tags from the VPLC and writes them into the shared memory ordered by name.
virtual voidUpdateTagList (ETagListDetails in_TagListDetails)
Reads the tags from the VPLC and writes them into the shared memory ordered by name.
virtual voidUpdateTagList (ETagListDetails in_TagListDetails, bool in_IsHMIVisibleOnly)
Reads the tags from the VPLC and writes them into the shared memory ordered by name.
virtual voidUpdateTagList (ETagListDetails in_TagListDetails, bool in_IsHMIVisibleOnly, System::String^ in_DataBlockFilterList)
Reads the tags from the VPLC and writes them into the shared memory ordered by name.
virtual boolWaitForOnDisplayDataChangedEvent ()
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnDisplayDataChangedEvent (UINT32 in_Time_ms)
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnHardwareConfigChangedEvent ()
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnHardwareConfigChangedEvent (UINT32 in_Time_ms)
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnIPAddressChangedEvent ()
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnIPAddressChangedEvent (UINT32 in_Time_ms)
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnLedChangedEvent ()
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnLedChangedEvent (UINT32 in_Time_ms)
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnOperatingStateChangedEvent ()
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnOperatingStateChangedEvent (UINT32 in_Time_ms)
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual boolWaitForOnSoftwareConfigurationChangedEvent ()
Like WaitForOnSoftwareConfigurationChangedEvent(const UINT32) without timeout.
virtual boolWaitForOnSoftwareConfigurationChangedEvent (UINT32 in_Time_ms)
Wait for software changed event to be signaled.
virtual SOnSyncPointReachedResultWaitForOnSyncPointReachedEvent ()
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual SOnSyncPointReachedResultWaitForOnSyncPointReachedEvent (UINT32 in_Time_ms)
The function will block until the registered event object is in the signaled state or the timeout interval elapses.
virtual voidWrite (System::String^ in_Tag, SDataValue in_Value)
Writes the value of a PLC variable.
virtual voidWriteBool (System::String^ in_Tag, bool in_Value)
Writes the value of a PLC variable.
virtual voidWriteChar (System::String^ in_Tag, char in_Value)
Writes the value of a PLC variable.
virtual voidWriteDouble (System::String^ in_Tag, double in_Value)
Writes the value of a PLC variable.
virtual voidWriteFloat (System::String^ in_Tag, float in_Value)
Writes the value of a PLC variable.
virtual voidWriteInt16 (System::String^ in_Tag, INT16 in_Value)
Writes the value of a PLC variable.
virtual voidWriteInt32 (System::String^ in_Tag, INT32 in_Value)
Writes the value of a PLC variable.
virtual voidWriteInt64 (System::String^ in_Tag, INT64 in_Value)
Writes the value of a PLC variable.
virtual voidWriteInt8 (System::String^ in_Tag, INT8 in_Value)
Writes the value of a PLC variable.
virtual voidWriteRecordDone (SDataRecordInfo in_RecordInfo, UINT32 in_Status)
Completion of Asynchronous writing of Data record.
virtual voidWriteSignals (array< SDataValueByName >^% inout_Signals)
Writes multiple signals within a single API call.
virtual voidWriteString (System::String^ in_Tag, System::String^ in_Value)
Writes the value of a PLC variable.
virtual voidWriteUInt16 (System::String^ in_Tag, UINT16 in_Value)
Writes the value of a PLC variable.
virtual voidWriteUInt32 (System::String^ in_Tag, UINT32 in_Value)
Writes the value of a PLC variable.
virtual voidWriteUInt64 (System::String^ in_Tag, UINT64 in_Value)
Writes the value of a PLC variable.
virtual voidWriteUInt8 (System::String^ in_Tag, UINT8 in_Value)
Writes the value of a PLC variable.
virtual voidWriteWChar (System::String^ in_Tag, WCHAR in_Value)
Writes the value of a PLC variable.
virtual voidWriteWString (System::String^ in_Tag, System::String^ in_Value)
Writes the value of a PLC wstring variable.
voidset (ECPUType in_Value)
voidset (System::String^)
voidset (bool)
voidset (double)
voidset (INT64)
voidset (System::DateTime)
voidset (EOperatingMode)
voidset (bool)

Public Attributes Documentation

variable ArticleNumber

Gets or sets the ArticleNumber cpu of the virtual controller. A change of the CPU will only happen when the controller is restarted.

virtual property System::String Siemens::Simatic::Simulation::Runtime::IInstance::ArticleNumber;

variable CPUType

Gets or sets the CPU type of the virtual controller. A change of the CPU Type will only happen when the controller is restarted.

virtual property ECPUType Siemens::Simatic::Simulation::Runtime::IInstance::CPUType;

variable CommunicationInterface

virtual property ECommunicationInterface Siemens::Simatic::Simulation::Runtime::IInstance::CommunicationInterface;

Gets the communication interface of the virtual controller.

variable ControllerIP

Returns a configured IP address of the instance.

virtual property array<System::String^> Siemens::Simatic::Simulation::Runtime::IInstance::ControllerIP;

variable ControllerIPSuite4

Returns the IP suite instance. If the "Softbus" communication interface is used, the subnet mask and default gateway are 0.

virtual property array<SIPSuite4> Siemens::Simatic::Simulation::Runtime::IInstance::ControllerIPSuite4;

variable ControllerName

Returns the downloaded controller name of the virtual controller.

virtual property System::String Siemens::Simatic::Simulation::Runtime::IInstance::ControllerName;

variable ControllerShortDesignation

Returns the downloaded short designation of the virtual controller.

virtual property System::String Siemens::Simatic::Simulation::Runtime::IInstance::ControllerShortDesignation;

variable ID

Returns the ID of the instance. The ID is assigned by the Runtime Manager when registering the instance.

virtual property INT32 Siemens::Simatic::Simulation::Runtime::IInstance::ID;

variable Info

Returns a struct providing information about the instance.

virtual property SInstanceInfo Siemens::Simatic::Simulation::Runtime::IInstance::Info;

variable InputArea

Returns the interface that can be used to call I/O access by address functions.

virtual property IIOArea Siemens::Simatic::Simulation::Runtime::IInstance::InputArea;

variable IsSendSyncEventInDefaultModeEnabled

Gets or sets the SendSyncEventInDefault mode. If the mode is set, the OnSyncPointReached event is triggered after every cycle end in the operating mode "Default".

virtual property bool Siemens::Simatic::Simulation::Runtime::IInstance::IsSendSyncEventInDefaultModeEnabled;

variable LicenseStatus

Returns information about whether a Trial License is currently in use.

virtual property ERuntimeErrorCode Siemens::Simatic::Simulation::Runtime::IInstance::LicenseStatus;

variable MarkerArea

Returns the interface that can be used to call I/O access by address functions.

virtual property IIOArea Siemens::Simatic::Simulation::Runtime::IInstance::MarkerArea;

variable Name

Returns the name of the instance.

virtual property System::String Siemens::Simatic::Simulation::Runtime::IInstance::Name;

variable OnAlarmNotificationDone

Registers or unregisters an event handler method.

virtual event Delegate_SREC_ST_UINT32_UINT32 Siemens::Simatic::Simulation::Runtime::IInstance::OnAlarmNotificationDone;

variable OnDataRecordRead

Registers or unregisters an event handler method.

virtual event Delegate_II_EREC_DT_SDRI Siemens::Simatic::Simulation::Runtime::IInstance::OnDataRecordRead;

variable OnDataRecordWrite

Registers or unregisters an event handler method.

virtual event Delegate_II_EREC_DT_SDR Siemens::Simatic::Simulation::Runtime::IInstance::OnDataRecordWrite;

variable OnDisplayDataChanged

The event will be fired when the front panel data has changed. Afterwards it is always safe to access the display data.

virtual event Delegate_DisplayDataChanged Siemens::Simatic::Simulation::Runtime::IInstance::OnDisplayDataChanged;

variable OnHardwareConfigChanged

The event will be fired when the download of a HW-Config happens. It will always stop and restart the isochronous clock mechanism.

virtual event Delegate_II_EREC_DT Siemens::Simatic::Simulation::Runtime::IInstance::OnHardwareConfigChanged;

variable OnIPAddressChanged

Fired on IP address change

virtual event Delegate_IPAddressChanged Siemens::Simatic::Simulation::Runtime::IInstance::OnIPAddressChanged;

variable OnLedChanged

The event will be fired when a LED of the virtual controller has been changed.

virtual event Delegate_II_EREC_DT_ELT_ELM Siemens::Simatic::Simulation::Runtime::IInstance::OnLedChanged;

variable OnOperatingStateChanged

The event will be fired every time the operating state of the virtual controller has been changed.

virtual event Delegate_II_EREC_DT_EOS_EOS Siemens::Simatic::Simulation::Runtime::IInstance::OnOperatingStateChanged;

variable OnProcessEventDone

Registers or unregisters an event handler method.

virtual event Delegate_SREC_ST_UINT32_UINT32_EPET_UINT32 Siemens::Simatic::Simulation::Runtime::IInstance::OnProcessEventDone;

variable OnProfileEventDone

The user can Register or unregister for an asynchronous acknowledgement of the Profile Event.

virtual event Delegate_SREC_ST_UINT32 Siemens::Simatic::Simulation::Runtime::IInstance::OnProfileEventDone;

variable OnPullOrPlugEventDone

Registers or unregisters an event handler method.

virtual event Delegate_SREC_ST_UINT32_EPPET_UINT32 Siemens::Simatic::Simulation::Runtime::IInstance::OnPullOrPlugEventDone;

variable OnRackOrStationFaultEvent

The user can Register or unregister for an asynchronous acknowledgement of the RackOrStationFault Event.

virtual event Delegate_SREC_ST_UINT32_ERSFET Siemens::Simatic::Simulation::Runtime::IInstance::OnRackOrStationFaultEvent;

variable OnSoftwareConfigurationChanged

Software configuration changed event handler.

virtual event Delegate_SoftwareConfigurationChanged Siemens::Simatic::Simulation::Runtime::IInstance::OnSoftwareConfigurationChanged;

Exception:

  • SimulationRuntimeException

    • add:

      • ERuntimeErrorCode::WrongArgument: in_Delegate is a null pointer.

    • remove:

      • ERuntimeErrorCode::DoesNotExist: in_Delegate not found.

      • ERuntimeErrorCode::IsEmpty: No callback registered.

variable OnStatusEventDone

The registered user-defined function will be executed as acknowledgement that the execution of the Status Event OB (OB 55) has completed.

virtual event Delegate_SREC_ST_UINT32 Siemens::Simatic::Simulation::Runtime::IInstance::OnStatusEventDone;

variable OnSyncPointReached

Registers or unregisters an event handler method.

virtual event Delegate_II_EREC_DT_UINT32_INT64_INT64_UINT32 Siemens::Simatic::Simulation::Runtime::IInstance::OnSyncPointReached;

variable OnUpdateEventDone

The user can register or unregister for an asynchronous acknowledgement of the Update Event.

virtual event Delegate_SREC_ST_UINT32 Siemens::Simatic::Simulation::Runtime::IInstance::OnUpdateEventDone;

variable OperatingMode

Gets or sets the operating mode of the virtual controller. Changes of the value during runtime take effect on the cycle control point.

virtual property EOperatingMode Siemens::Simatic::Simulation::Runtime::IInstance::OperatingMode;

variable OperatingState

Returns the operating state of the virtual controller.

virtual property EOperatingState Siemens::Simatic::Simulation::Runtime::IInstance::OperatingState;

variable OutputArea

Returns the interface that can be used to call I/O access by address functions.

virtual property IIOArea Siemens::Simatic::Simulation::Runtime::IInstance::OutputArea;

variable OverwrittenMinimalCycleTime_ns

Gets or sets the overwritten minimal cycle time in nanoseconds used in the extended single-step operating mode. A valid input is a value between 0 and 6,000,000,000. Changes of the value during runtime take effect at the cycle control point.

virtual property INT64 Siemens::Simatic::Simulation::Runtime::IInstance::OverwrittenMinimalCycleTime_ns;

variable ScaleFactor

Gets or sets the scale factor the virtual time proceeds. A valid input value X is a value between 0 and 1000. The default value is 1.0. If the value is unequal to 1, the virtual time of the virtual controller runs X times faster/slower than the wall clock time. Changes of the value during runtime take effect at the cycle control point.

virtual property double Siemens::Simatic::Simulation::Runtime::IInstance::ScaleFactor;

variable StoragePath

Gets or sets the full path of the directory the instance is storing its data. This can also be a network share. The path has to be set while the instance is not running. The instance will read the path during power on only. If no path is set the default path will be 'user documents folder'\Siemens\Simatic\Simulation\Runtime\Persistence\'Instance Name'

virtual property System::String Siemens::Simatic::Simulation::Runtime::IInstance::StoragePath;

variable StrictMotionTiming

virtual property bool Siemens::Simatic::Simulation::Runtime::IInstance::StrictMotionTiming;

Get or set current strict motion timing setting. true get: Enabled. set: Enable. false get: Disabled. set: Disable.

Exception:

  • SimulationRuntimeException Instance is powered on.

variable SystemTime

Gets or sets the virtual system time of the virtual controller. A valid input is a system time between Jan 1 1970 00:00:00:000 and Dec 31 2200 23:59:59:999

virtual property System::DateTime Siemens::Simatic::Simulation::Runtime::IInstance::SystemTime;

variable TagInfos

Get a list of all tags.

virtual property array<STagInfo> Siemens::Simatic::Simulation::Runtime::IInstance::TagInfos;

Public Functions Documentation

function AlarmNotification

This API is used to trigger the diagnosis alarms. Each call of this API-Method triggers the OB82 once, independent from the number and severity of the transmitted Diagnostic-Items.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::AlarmNotification (
    UINT16 in_HardwareIdentifier,
    UINT16 in_ModuleState,
    UINT16 in_NumberOfDiagnosisEvents,
    array< SDiagExtChannelDescription >^ in_ArrayOfDiagnosisEvents,
    UINT16% out_SequenceNumber
) 

Parameters:

  • in_HardwareIdentifier The ID of the module or submodule from which the diagnosis item is sent.
  • in_ModuleState State of the Module. Accepted states are: DMODULE_STATE_OK, DMODULE_STATE_ERROR, DMODULE_STATE_MAINT_DEMANDED, DMODULE_STATE_MAINT_REQUIRED.
  • in_NumberOfDiagnosisEvents Number of Diagnosis Events sent to the CPU.
  • in_ArrayOfDiagnosisEvents Pointer to an array of diagnosis items. The array must match with the number of diagnosis items. It may be NULL-Pointer.
  • out_SequenceNumber Unique consecutive number assigned to every single alarm event.

function ArchiveStorage

Stores the virtual memory card in a .zip file. The virtual controller has to be in the operating state off.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::ArchiveStorage (
    System::String^ in_FullFileName
) 

Parameters:

  • in_FullFileName The full file path to the .zip file. The path is based on the directories of the computer the instance is running on.

function CheckNetInterfaceMapping

Check for valid network interface mapping, so instance can be started. All already running instances on PC are checked for possible duplicate mappings. Also check for valid bindings on PC network interfaces.

virtual ERuntimeErrorCode Siemens::Simatic::Simulation::Runtime::IInstance::CheckNetInterfaceMapping () 

function CleanupStoragePath

Cleans up the storage folder. The controller must be in operational state OFF.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::CleanupStoragePath () 

function CreateConfigurationFile

Writes all taglist entries from the taglist storage into an XML file.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::CreateConfigurationFile (
    System::String^ in_FullFileName
) 

Parameters:

  • in_FullFileName The full filename of the XML file ('path' + 'filename' + 'file extension').

function DisplayKeyPress

This API Interacts with the selected button on the Display.

virtual ERuntimeErrorCode Siemens::Simatic::Simulation::Runtime::IInstance::DisplayKeyPress (
    EDisplayKey keyId
) 

Parameters:

  • keyId The kind of the key press to set.

function GetConfiguredProcessEvents

The API GetConfiguredProcessEvents can be used for reading the configuration of the downloaded process events at runtime.

virtual array< SConfiguredProcessEvents > Siemens::Simatic::Simulation::Runtime::IInstance::GetConfiguredProcessEvents () 

function GetCycleTimeMonitoringMode

gets the maximum cycle time in nanoseconds based on the CycleTimeMonitoring mode.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::GetCycleTimeMonitoringMode (
    ECycleTimeMonitoringMode % out_CycleTimeMonitoringMode,
    INT64% out_MaxCycleTime_ns
) 

function GetDisplayData

This API gets the current display data of the display and writes it into the given uint8_t Buffer.

virtual SDisplayData Siemens::Simatic::Simulation::Runtime::IInstance::GetDisplayData () 

function GetNetInterfaceMapping

Get the interface index of PC interface to which specified PLC interface is mapped.

virtual int Siemens::Simatic::Simulation::Runtime::IInstance::GetNetInterfaceMapping (
    EPLCInterface in_PLCInterfaceID
) 

Parameters:

  • in_PLCInterfaceID ID of the PLC interface for which network interface mapping should be retrieved. Fixed range 0 - 2 (IE1 - IE3)

function GetTagListStatus

Returns the current update state of the taglist storage. "inout_TagListDetails" is "NONE" if the list needs to be updated.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::GetTagListStatus (
    ETagListDetails % out_TagListDetails,
    bool% out_IsHMIVisibleOnly
) 

Parameters:

  • out_TagListDetails The status of the tag list details. SRTLD_NONE if the list needs to be updated.
  • out_IsHMIVisibleOnly If "true", only tags marked as "HMI Visible" are available in the list.

function HasDisplay

This API gets if the PLC is having a display or not. If the return value is true it is save that the display is simulated and the functions for accessing its data are returning simulated data.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::HasDisplay () 

function MemoryReset [½]

Shuts down the virtual controller, closes its process and restarts it.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::MemoryReset () 

function MemoryReset [2/2]

Shuts down the virtual controller, closes its process and restarts it.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::MemoryReset (
    UINT32 in_TimeOut_ms
) 

Parameters:

  • in_TimeOut_ms A timeout value in milliseconds.
    • If no timeout is set the function returns immediately. Subscribe to the OnOperatingStateChanged() event to get noticed when the operation is done.
    • If set to a value greater than 0 (recommended is a value of 60000) the function will return after the operation is done or after the timeout value. Expected operating states for this function to return successfully are: { SROS_STOP , SROS_RUN }

function PowerOff [½]

Shuts down the virtual controller and closes its process.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::PowerOff () 

function PowerOff [2/2]

Shuts down the virtual controller and closes its process.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::PowerOff (
    UINT32 in_TimeOut_ms
) 

Parameters:

  • in_TimeOut_ms A timeout value in milliseconds.
    • If no timeout is set the function returns immediately. Subscribe to the OnOperatingStateChanged() event to get noticed when the operation is done.
    • If set to a value greater than 0 (recommended is a value of 60000) the function will return after the operation is done or after the timeout value. Expected operating states for this function to return successfully are: { EOperatingState.Off }

function PowerOn [½]

Creates the process of the simulation runtime instance and starts the firmware of the virtual controller.

virtual ERuntimeErrorCode Siemens::Simatic::Simulation::Runtime::IInstance::PowerOn () 

function PowerOn [2/2]

Creates the process of the simulation runtime instance and starts the firmware of the virtual controller.

virtual ERuntimeErrorCode Siemens::Simatic::Simulation::Runtime::IInstance::PowerOn (
    UINT32 in_TimeOut_ms
) 

Parameters:

  • in_TimeOut_ms A timeout value in milliseconds.
    • If no timeout is set the function returns immediately. Subscribe to the OnOperatingStateChanged() event to get informed when the operation is done.
    • If set to a value greater than 0 (recommended is a value of 60000) the function will return after the operation is done or after the timeout value. Expected operating states for this function to return successfully are: { SROS_STOP , SROS_RUN }

function ProcessEvent

This API is used to trigger the process event interrupt.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::ProcessEvent (
    UINT16 in_HardwareIdentifier,
    UINT16 in_Channel,
    EProcessEventType in_ProcessEventType,
    UINT16% out_SequenceNumber
) 

Parameters:

  • in_HardwareIdentifier The ID of the module or submodule from which the diagnosis item is sent.
  • in_Channel The channel of the I/O module from which the process event is generated.
  • in_ProcessEventType One value from the list of pre-defined process event types for S7-Modules. The event types are defined in the enumeration EProcessEventType.
  • out_SequenceNumber Unique consecutive number assigned to every single alarm event.

function ProfileEvent

This API is used to trigger the Profile event OB (OB 57). Profile-Events are supported only for modules on a decentral IO-system.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::ProfileEvent (
    UINT16 in_HardwareIdentifier,
    UINT16 in_Specifier
) 

Parameters:

  • in_HardwareIdentifier The ID of the module from which the Profile event is generated.
  • in_Specifier The parameter is transmitted as alarm specifier in the alarm telegram and is available as input parameter of the OB 57 call.

function PullOrPlugEvent

This API is used to trigger the Pull and Plug events. For Pull and Plug Events, the interrupt OB 83 �Pull or plug of modules� is executed.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::PullOrPlugEvent (
    UINT16 in_HardwareIdentifier,
    EPullOrPlugEventType in_PullOrPlugEventType,
    UINT16% out_SequenceNumber
) 

Parameters:

  • in_HardwareIdentifier The ID of the module or submodule from which the diagnosis item is sent.
  • in_PullOrPlugEventType One value from the list of pre-defined PullOrPlug event types. The event types are defined in the enumeration EPullOrPlugEventType.
  • out_SequenceNumber Unique consecutive number assigned to every single alarm event.

function RackOrStationFaultEvent

This API is used to trigger the RackOrStationFault event OB (OB 86). This event is only supported for Decentral devices.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RackOrStationFaultEvent (
    UINT16 in_HardwareIdentifier,
    ERackOrStationFaultType in_EventType
) 

Parameters:

  • in_HardwareIdentifier The HW ID of the device from which the RackOrStationFault event is generated.
  • in_EventType The event Type value from the list of pre-defined RackOrStationFault types. The event types are defined in the ERackOrStationFaultType.

function Read

Reads the value of a PLC variable.

virtual SDataValue Siemens::Simatic::Simulation::Runtime::IInstance::Read (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadBool

Reads the value of a PLC variable.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::ReadBool (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadChar

Reads the value of a PLC variable.

virtual char Siemens::Simatic::Simulation::Runtime::IInstance::ReadChar (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadDouble

Reads the value of a PLC variable.

virtual double Siemens::Simatic::Simulation::Runtime::IInstance::ReadDouble (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadFloat

Reads the value of a PLC variable.

virtual float Siemens::Simatic::Simulation::Runtime::IInstance::ReadFloat (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadInt16

Reads the value of a PLC variable.

virtual INT16 Siemens::Simatic::Simulation::Runtime::IInstance::ReadInt16 (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadInt32

Reads the value of a PLC variable.

virtual INT32 Siemens::Simatic::Simulation::Runtime::IInstance::ReadInt32 (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadInt64

Reads the value of a PLC variable.

virtual INT64 Siemens::Simatic::Simulation::Runtime::IInstance::ReadInt64 (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadInt8

Reads the value of a PLC variable.

virtual INT8 Siemens::Simatic::Simulation::Runtime::IInstance::ReadInt8 (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadRecordDone

Completion of Asynchronous Reading of Data record.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::ReadRecordDone (
    SDataRecordInfo in_RecordInfo,
    array< BYTE >^ in_Data,
    UINT32 in_Status
) 

Parameters:

  • in_RecordInfo Struct SDataRecordInfo which provides the DataRecord info.
  • in_Data Byte array of the Data Record read with the length specified by DataSize value of SDataRecordInfo.
  • in_Status Status of the job execution.

function ReadSignals [½]

Reads a list of signals at once. Only signals of the primitive data type are supported but the function is not type safe. The function is also taking care of the endianness.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::ReadSignals (
    array< SDataValueByName >^% inout_Signals
) 

Parameters:

  • inout_Signals The list of the signals to read.

function ReadSignals [2/2]

Reads a list of signals at once. Only signals of the primitive data type are supported but the function is not type safe. The function is also taking care of the endianness.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::ReadSignals (
    array< SDataValueByNameWithCheck >^% inout_Signals,
    bool% out_SignalsHaveChanged
) 

Parameters:

  • inout_Signals Contains name, the value and the expected type of the PLC variable. If the expected type is UNSPECIFIC the expected type will be set to the stored type when the function returns successfully. The type STRUCT is not supported.
  • out_SignalsHaveChanged Will return "true", if the value of at least one signal changed since the previous call.

function ReadString

Reads the value of a PLC string variable.

virtual System::String Siemens::Simatic::Simulation::Runtime::IInstance::ReadString (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC string variable to read.

function ReadUInt16

Reads the value of a PLC variable.

virtual UINT16 Siemens::Simatic::Simulation::Runtime::IInstance::ReadUInt16 (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadUInt32

Reads the value of a PLC variable.

virtual UINT32 Siemens::Simatic::Simulation::Runtime::IInstance::ReadUInt32 (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadUInt64

Reads the value of a PLC variable.

virtual UINT64 Siemens::Simatic::Simulation::Runtime::IInstance::ReadUInt64 (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadUInt8

Reads the value of a PLC variable.

virtual UINT8 Siemens::Simatic::Simulation::Runtime::IInstance::ReadUInt8 (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadWChar

Reads the value of a PLC variable.

virtual WCHAR Siemens::Simatic::Simulation::Runtime::IInstance::ReadWChar (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC variable to read.

function ReadWString

Reads the value of a PLC wstring variable.

virtual System::String Siemens::Simatic::Simulation::Runtime::IInstance::ReadWString (
    System::String^ in_Tag
) 

Parameters:

  • in_Tag The name of the PLC wstring variable to read.

function RegisterOnDisplayDataChangedEvent

When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RegisterOnDisplayDataChangedEvent () 

function RegisterOnHardwareConfigChangedEvent

When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RegisterOnHardwareConfigChangedEvent () 

function RegisterOnIPAddressChangedEvent

When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RegisterOnIPAddressChangedEvent () 

function RegisterOnLedChangedEvent

When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RegisterOnLedChangedEvent () 

function RegisterOnOperatingStateChangedEvent

When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RegisterOnOperatingStateChangedEvent () 

function RegisterOnSoftwareConfigurationChangedEvent

Registers event signaled whenever a software changed event becomes signaled.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RegisterOnSoftwareConfigurationChangedEvent () 

Returns:

  • ERuntimeErrorCode::OK: On success. Otherwise failure.

function RegisterOnSyncPointReachedEvent

When receiving the event, the registered event object is set to signaled state. There can be only one event object registered to the event. Registering a new one will automatically unregister the previous one.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RegisterOnSyncPointReachedEvent () 

function RetrieveStorage

Restores a virtual memory card from a .zip file. The virtual controller has to be in the operating state off.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RetrieveStorage (
    System::String^ in_FullFileName
) 

Parameters:

  • in_FullFileName The full file path to the .zip file. The path is based on the directories of the computer the instance is running on.

function Run [½]

Requests the virtual controller to switch into run mode.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::Run () 

function Run [2/2]

Requests the virtual controller to switch into run mode.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::Run (
    UINT32 in_TimeOut_ms
) 

Parameters:

  • in_TimeOut_ms A timeout value in milliseconds.
    • If no timeout is set the function returns immediately. Subscribe to the OnOperatingStateChanged() event to get noticed when the operation is done.
    • If set to a value greater than 0 (recommended is a value of 60000) the function will return after the operation is done or after the timeout value. Expected operating states for this function to return successfully are: { SROS_RUN }

function RunToNextSyncPoint [½]

When operating the virtual controller in the single step or extended single step operating mode the virtual controller will go into freeze state at the end of each cycle. With this function the next cycle will be triggered.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RunToNextSyncPoint () 

function RunToNextSyncPoint [2/2]

Extension to IInstance::RunToNextSyncPoint for bus synchronous mode.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::RunToNextSyncPoint (
    UINT32 in_IoSystemId,
    UINT64 in_BusTimeStamp_ns
) 

Parameters:

  • in_IoSystemId Bus ID.
  • in_BusTimeStamp_ns Timestamp in nanoseconds.

Exception:

  • SimulationRuntimeException Invalid bus ID. Invalid S7-PLCSIM version. S7-PLCSIM version must be V4.0 or higher.

function SetCycleTimeMonitoringMode [½]

sets the CycleTimeMonitoring mode. A valid input CycleTimeMonitoring modes are Ignored,Downloaded or Specified.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::SetCycleTimeMonitoringMode (
    ECycleTimeMonitoringMode in_CycleTimeMonitoringMode
) 

function SetCycleTimeMonitoringMode [2/2]

sets the maximum cycle time in nanoseconds based on the CycleTimeMonitoring mode. A valid input is a value between 1000000 and 60,000,000,000. Changes of the value during runtime take effect at the cycle control point.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::SetCycleTimeMonitoringMode (
    ECycleTimeMonitoringMode in_CycleTimeMonitoringMode,
    INT64 in_MaxCycleTime_ns
) 

function SetIPSuite

Sets the IP suite of a network interface of the virtual controller.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::SetIPSuite (
    UINT32 in_InterfaceID,
    SIPSuite4 in_IPSuite,
    bool in_IsRemanent
) 

Parameters:

  • in_InterfaceID The ID of the network interface.
  • in_IPSuite The IP suite to be set to the network interface. The IP suite is containing the IP address, the subnet mask and the default gateway. If the communication interface is set to Softbus subnet mask the default gateway will be ignored.
  • in_IsRemanent If set to true, the IP suite will be restored after restarting the virtual controller. If the communication interface is set to Softbus this flag will be ignored.

function SetNetInterfaceMapping [⅓]

Set interface mappings between PLC interface and computer interface. Ethernet packets received by specified computer interface will be forwarded to the associated PLC interface.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::SetNetInterfaceMapping (
    EPLCInterface in_PLCInterfaceID,
    UINT32 in_PCInterfaceIndex
) 

Parameters:

  • in_PLCInterfaceID ID of the PLC interface for which MAC address should be set. Fixed range 0 - 2 (IE1 - IE3)
  • in_PCInterfaceIndex Index of computer interface. If this value is 0, mapping will be deleted.

function SetNetInterfaceMapping [⅔]

Set interface mappings between PLC interface and computer interface. Ethernet packets received by specified computer interface will be forwarded to the associated PLC interface.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::SetNetInterfaceMapping (
    EPLCInterface in_PLCInterfaceID,
    System::String^ in_PCInterfaceName
) 

Parameters:

  • in_PLCInterfaceID ID of the PLC interface for which MAC address should be set. Fixed range 0 - 2 (IE1 - IE3)
  • in_PCInterfaceName A user-friendly name for the computer interface.

function SetNetInterfaceMapping [3/3]

Set interface mappings between PLC interface and computer interface. Ethernet packets received by specified computer interface will be forwarded to the associated PLC interface.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::SetNetInterfaceMapping (
    EPLCInterface in_PLCInterfaceID,
    SMACAddress in_MACAddressParam
) 

Parameters:

  • in_PLCInterfaceID ID of the PLC interface for which MAC address should be set. Fixed range 0 - 2 (IE1 - IE3)
  • in_MACAddressParam Hardware MAC address of the computer interface.

function StartProcessing

When operating the virtual controller in the timespan synchronized operating mode the virtual controller will go into freeze state at the cycle control point. This function will wake up the virtual controller. The virtual controller will now run for at least the requested time based on virtual time before going back into freeze state at the next cycle control point.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::StartProcessing (
    INT64 in_MinimalTimeToRun_ns
) 

Parameters:

  • in_MinimalTimeToRun_ns The minimal virtual time in nanoseconds the virtual controller will run before going into freeze state.

function StatusEvent

This API is used to trigger the Status event OB (OB 55). Status-Events are supported only for modules on a decentral IO-system.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::StatusEvent (
    UINT16 in_HardwareIdentifier,
    UINT16 in_Specifier
) 

Parameters:

  • in_HardwareIdentifier The ID of the module or submodule from which the Status event is sent.
  • in_Specifier The parameter is transmitted as alarm specifier in the alarm telegram and is available as input parameter of the OB 55 call.

function Stop [½]

Requests the virtual controller to switch into stop mode.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::Stop () 

function Stop [2/2]

Requests the virtual controller to switch into stop mode.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::Stop (
    UINT32 in_TimeOut_ms
) 

Parameters:

  • in_TimeOut_ms A timeout value in milliseconds.
    • If no timeout is set the function returns immediately. Subscribe to the OnOperatingStateChanged() event to get noticed when the operation is done.
    • If set to a value greater than 0 (recommended is a value of 60000) the function will return after the operation is done or after the timeout value. Expected operating states for this function to return successfully are: { EOperatingState.Stop }

function UnregisterInstance

Unregisters this instance from the Runtime Manager.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UnregisterInstance () 

function UnregisterOnDisplayDataChangedEvent

Unregisters the event object.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UnregisterOnDisplayDataChangedEvent () 

function UnregisterOnHardwareConfigChangedEvent

Unregisters the event object.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UnregisterOnHardwareConfigChangedEvent () 

function UnregisterOnIPAddressChangedEvent

Unregisters the event object.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UnregisterOnIPAddressChangedEvent () 

function UnregisterOnLedChangedEvent

Unregisters the event object.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UnregisterOnLedChangedEvent () 

Unregisters the event object.

function UnregisterOnOperatingStateChangedEvent

Unregisters the event object.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UnregisterOnOperatingStateChangedEvent () 

function UnregisterOnSoftwareConfigurationChangedEvent

Unregisters the software changed event.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UnregisterOnSoftwareConfigurationChangedEvent () 

Returns:

  • ERuntimeErrorCode::OK: On success. Otherwise failure.

  • ERuntimeErrorCode::DoesNotExist: No event registered.

function UnregisterOnSyncPointReachedEvent

Unregisters the event object.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UnregisterOnSyncPointReachedEvent () 

function UpdateEvent

This API is used to trigger the Update event OB (OB 56). Update events are supported only for modules on a decentral IO-system.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UpdateEvent (
    UINT16 in_HardwareIdentifier,
    UINT16 in_Specifier
) 

Parameters:

  • in_HardwareIdentifier The ID of the module from which the Update event is generated.
  • in_Specifier The parameter is transmitted as alarm specifier in the alarm telegram and is available as input parameter of the OB 56 call.

function UpdateTagList [¼]

Reads the tags from the VPLC and writes them into the shared memory ordered by name.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UpdateTagList () 

function UpdateTagList [2/4]

Reads the tags from the VPLC and writes them into the shared memory ordered by name.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UpdateTagList (
    ETagListDetails in_TagListDetails
) 

Parameters:

  • in_TagListDetails Any combination of the following four areas: IO: Inputs and Outputs M: Marker CT: Counter and Timer DB: Data blocks e.g. IOM will only read the tags from the input/output and marker area. The default value is IOMCTDB.

function UpdateTagList [¾]

Reads the tags from the VPLC and writes them into the shared memory ordered by name.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UpdateTagList (
    ETagListDetails in_TagListDetails,
    bool in_IsHMIVisibleOnly
) 

Parameters:

  • in_TagListDetails Any combination of the following four areas: IO: Inputs and Outputs M: Marker CT: Counter and Timer DB: Data blocks e.g. IOM will only read the tags from the input/output and marker area. The default value is IOMCTDB.
  • in_IsHMIVisibleOnly If "true", only tags marked as "HMI Visible" will be read. The default value is "false".

function UpdateTagList [4/4]

Reads the tags from the VPLC and writes them into the shared memory ordered by name.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::UpdateTagList (
    ETagListDetails in_TagListDetails,
    bool in_IsHMIVisibleOnly,
    System::String^ in_DataBlockFilterList
) 

Parameters:

  • in_TagListDetails Any combination of the following four areas: IO: Inputs and Outputs M: Marker CT: Counter and Timer DB: Data blocks e.g. IOM will only read the tags from the input/output and marker area. The default value is IOMCTDB.
  • in_IsHMIVisibleOnly If "true", only tags marked as "HMI Visible" will be read. The default value is "false".
  • in_DataBlockFilterList A string including the names of all data blocks that should be available in the tag entry storage.

function WaitForOnDisplayDataChangedEvent [½]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnDisplayDataChangedEvent () 

function WaitForOnDisplayDataChangedEvent [2/2]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnDisplayDataChangedEvent (
    UINT32 in_Time_ms
) 

Parameters:

  • in_Time_ms The value for the timeout limit in milliseconds.

function WaitForOnHardwareConfigChangedEvent [½]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnHardwareConfigChangedEvent () 

function WaitForOnHardwareConfigChangedEvent [2/2]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnHardwareConfigChangedEvent (
    UINT32 in_Time_ms
) 

Parameters:

  • in_Time_ms The value for the timeout limit in milliseconds.

function WaitForOnIPAddressChangedEvent [½]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnIPAddressChangedEvent () 

function WaitForOnIPAddressChangedEvent [2/2]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnIPAddressChangedEvent (
    UINT32 in_Time_ms
) 

Parameters:

  • in_Time_ms The value for the timeout limit in milliseconds.

function WaitForOnLedChangedEvent [½]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnLedChangedEvent () 

function WaitForOnLedChangedEvent [2/2]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnLedChangedEvent (
    UINT32 in_Time_ms
) 

Parameters:

  • in_Time_ms The value for the timeout limit in milliseconds.

function WaitForOnOperatingStateChangedEvent [½]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnOperatingStateChangedEvent () 

function WaitForOnOperatingStateChangedEvent [2/2]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnOperatingStateChangedEvent (
    UINT32 in_Time_ms
) 

Parameters:

  • in_Time_ms The value for the timeout limit in milliseconds.

function WaitForOnSoftwareConfigurationChangedEvent [½]

Like WaitForOnSoftwareConfigurationChangedEvent(const UINT32) without timeout.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnSoftwareConfigurationChangedEvent () 

function WaitForOnSoftwareConfigurationChangedEvent [2/2]

Wait for software changed event to be signaled.

virtual bool Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnSoftwareConfigurationChangedEvent (
    UINT32 in_Time_ms
) 

Parameters:

  • in_Time_ms [in] Timeout in milliseconds. If INFINITE, no timeout can occur.

Returns:

  • ERuntimeErrorCode::OK: Event received.

  • ERuntimeErrorCode::Timeout: Timeout occurred.

  • ERuntimeErrorCode::DoesNotExist: No event registered.

function WaitForOnSyncPointReachedEvent [½]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual SOnSyncPointReachedResult Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnSyncPointReachedEvent () 

function WaitForOnSyncPointReachedEvent [2/2]

The function will block until the registered event object is in the signaled state or the timeout interval elapses.

virtual SOnSyncPointReachedResult Siemens::Simatic::Simulation::Runtime::IInstance::WaitForOnSyncPointReachedEvent (
    UINT32 in_Time_ms
) 

Parameters:

  • in_Time_ms The value for the timeout limit in milliseconds.

function Write

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::Write (
    System::String^ in_Tag,
    SDataValue in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value and the expected type of the PLC variable to write. The type UNSPECIFIC and STRUCT are not supported.

function WriteBool

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteBool (
    System::String^ in_Tag,
    bool in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteChar

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteChar (
    System::String^ in_Tag,
    char in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteDouble

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteDouble (
    System::String^ in_Tag,
    double in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteFloat

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteFloat (
    System::String^ in_Tag,
    float in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteInt16

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteInt16 (
    System::String^ in_Tag,
    INT16 in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteInt32

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteInt32 (
    System::String^ in_Tag,
    INT32 in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteInt64

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteInt64 (
    System::String^ in_Tag,
    INT64 in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteInt8

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteInt8 (
    System::String^ in_Tag,
    INT8 in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteRecordDone

Completion of Asynchronous writing of Data record.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteRecordDone (
    SDataRecordInfo in_RecordInfo,
    UINT32 in_Status
) 

Parameters:

  • in_RecordInfo Struct SDataRecordInfo which provides the DataRecord info.
  • in_Status Status of the job execution.

function WriteSignals

Writes multiple signals within a single API call.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteSignals (
    array< SDataValueByName >^% inout_Signals
) 

Parameters:

  • inout_Signals Contains the name, value and the expected type of the PLC variable to write. The type UNSPECIFIC and STRUCT are not supported.

function WriteString

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteString (
    System::String^ in_Tag,
    System::String^ in_Value
) 

Parameters:

  • in_Tag The name of the PLC wstring string variable to write.
  • in_Value Contains the value of the PLC string variable to write.

function WriteUInt16

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteUInt16 (
    System::String^ in_Tag,
    UINT16 in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteUInt32

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteUInt32 (
    System::String^ in_Tag,
    UINT32 in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteUInt64

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteUInt64 (
    System::String^ in_Tag,
    UINT64 in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteUInt8

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteUInt8 (
    System::String^ in_Tag,
    UINT8 in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteWChar

Writes the value of a PLC variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteWChar (
    System::String^ in_Tag,
    WCHAR in_Value
) 

Parameters:

  • in_Tag The name of the PLC variable to write.
  • in_Value Contains the value of the PLC variable to write.

function WriteWString

Writes the value of a PLC wstring variable.

virtual void Siemens::Simatic::Simulation::Runtime::IInstance::WriteWString (
    System::String^ in_Tag,
    System::String^ in_Value
) 

Parameters:

  • in_Tag The name of the PLC wstring variable to write.
  • in_Value Contains the value of the PLC wstring variable to write.

function set [⅛]

void Siemens::Simatic::Simulation::Runtime::IInstance::set (
    ECPUType in_Value
) 

function set [2/8]

void Siemens::Simatic::Simulation::Runtime::IInstance::set (
    System::String^
) 

function set [⅜]

void Siemens::Simatic::Simulation::Runtime::IInstance::set (
    bool
) 

function set [4/8]

void Siemens::Simatic::Simulation::Runtime::IInstance::set (
    double
) 

function set [⅝]

void Siemens::Simatic::Simulation::Runtime::IInstance::set (
    INT64
) 

function set [6/8]

void Siemens::Simatic::Simulation::Runtime::IInstance::set (
    System::DateTime
) 

function set [⅞]

void Siemens::Simatic::Simulation::Runtime::IInstance::set (
    EOperatingMode
) 

function set [⅜]

void Siemens::Simatic::Simulation::Runtime::IInstance::set (
    bool
)