SIMIT Remote Control Interface EnUS en-US
SIMIT Remote Control Interface EnUS en-US
SIMIT Remote Control Interface EnUS en-US
Setup firewall 2
Handshake protocol 7
Service calls 8
Minimum implementation of a
client 9
Implementation of a passive,
synchronized client 10
06/2018
A5E44876253-AA
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be
used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property
damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified
personnel are those who, based on their training and experience, are capable of identifying risks and avoiding
potential hazards when working with these products/systems.
Proper use of Siemens products
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. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described.
Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in
this publication is reviewed regularly and any necessary corrections are included in subsequent editions.
1 Introduction...................................................................................................................................................5
2 Setup firewall................................................................................................................................................7
3 SIMIT operating modes................................................................................................................................9
3.1 Determining the operating mode (synchronous/asynchronous).............................................10
3.2 Determining the PROCEED time...........................................................................................11
3.3 Acceleration and delay of the simulation time........................................................................12
4 Execution sequence and timing..................................................................................................................15
4.1 Asynchronous (real-time/fast/slow)........................................................................................15
4.2 Synchronous (control with SIMIT)..........................................................................................16
4.3 Synchronous (control by a client)...........................................................................................17
5 Architecture of the RCI interface................................................................................................................19
6 Implementation...........................................................................................................................................21
6.1 Undocumented service calls..................................................................................................21
6.2 Common parameters.............................................................................................................21
6.2.1 Client......................................................................................................................................21
6.2.2 ControlSystemService............................................................................................................22
6.2.3 ControlSystemServiceParams...............................................................................................22
6.2.4 SimInfo...................................................................................................................................23
6.2.5 ControlSystemResult.............................................................................................................23
6.2.6 Error message........................................................................................................................24
7 Handshake protocol....................................................................................................................................25
7.1 Query of execution capability.................................................................................................25
7.2 Confirmation of execution capability......................................................................................26
7.3 Initiation of service command.................................................................................................26
7.4 Confirmation of execution......................................................................................................26
7.5 Information on the completion of the service command.........................................................26
7.6 General error messages........................................................................................................27
8 Service calls...............................................................................................................................................29
8.1 Connection establishment and termination............................................................................29
8.1.1 Connection establishment......................................................................................................29
8.1.2 Connection termination..........................................................................................................29
8.1.3 Information about the current simulation................................................................................29
8.1.4 Lifebeat..................................................................................................................................30
8.1.5 Information about the language setting..................................................................................30
8.2 Simulation control...................................................................................................................30
*UDSKLFDO
XVHULQWHUIDFH
5XQWLPHHQYLURQPHQW
This enables other simulators to be coupled to SIMIT. The operation of the simulation can then
be performed by SIMIT or the external simulator.
NOTICE
Read the security notes included in the foreword
Changes to the firewall may influence the security of your system!
Contact, if necessary, your system administrator before performing the steps described in
the following.
Requirement
● SIMIT has been installed.
● All nodes are located within the same network.
Procedure
Proceed as follows to set up the firewall:
1. Open the "Windows Defender Firewall with extended safety", for example, by entering
"wf.msc" in the system prompt and confirming with "Enter".
2. Click on “Incoming rules”.
3. Double-click "SIMIT-CS Manager".
The “Properties of SIMIT CS Manager" windows opens.
4. Select the “Area” tab.
5. Under “Remote IP address”, select “Arbitrary IP address”. Alternatively, add the IP
addresses of the systems involved to the list of approved remote IP addresses.
6. Confirm with "OK".
Result
The firewall has been set such that SIMIT SP can set up a connection to other systems.
0RGHO
&RXSOLQJ
2XWSXWVLJQDOLVGHWHFWHG ,QSXWVLJQDOLVUHWXUQHG
If the model calculation or the data communication of couplings takes longer than half of the
cycle time, this time offset does not result in optimization.
A PROCEED command explicitly triggers each calculation step and determines the amount
by which to advance the simulation time.
In addition, the coupling is separated into the acquisition of output signals and the writing of
input signals:
0RGHO
&RXSOLQJ
3URFHVVLQJ
2XWSXWVLJQDOLV ,QSXWVLJQDO
GHWHFWHG LVUHWXUQHG
This results in better response times with short cycle times. However, each submodel, each
coupling and each logged-on client can block the entire simulation execution.
Example:
● SIMIT is active, the lowest cycle time (= PROCEED time) = 100 ms
The entire calculation (clients and SIMIT including couplings) takes only 20 ms.
When the step is fully executed, there is a wait time of 80 ms in order to reach "real-time".
In asynchronous real-time mode, in contrast, the coupling is calculated according to t=50
ms.
● SIMIT is passive, the lowest cycle time = 100 ms, PROCEED time = 1000 ms.
The calculation takes only 150 ms (client and SIMIT including couplings; the submodel with
100 ms is calculated 10 times, for example). The PROCEED call of the active client returns
after 150 ms. It is the responsibility of this client to wait 850 ms until the next PROCEED
call. As soon as another client has control of the simulation, the active client is also
responsible for complying with the real-time/fast/slow conditions, although real-time is
specified. The set speed is of no importance to SIMIT in this case.
)DFWRU
)DVWHUWKDQUHDOWLPH 6ORZHUWKDQUHDOWLPH
Note
When the maximum speed is set in asynchronous operating mode, the simulation is paused
internally and resumed in synchronous operating mode.
The following factors are offered for selection (you can also enter intermediate values):
In follow-up mode (synchronous operating mode and SIMIT is passive), the selection box is
disabled. You cannot change the factor in this case.
In all other situations (synchronous operating mode and SIMIT is active or asynchronous
operating mode), you can change the factor during ongoing simulation. The clients are
informed of the change. This is a requirement particularly in asynchronous operating mode.
Maximum acceleration is limited in such a way that the fastest cycle time of the project is at
least 10 ms taking into account the acceleration. This means that, depending on the cycle time,
acceleration might not be possible. SIMIT only offers appropriate values and does not allow
faster values. If the values are too high, the clients get WrongState as a return value.
The following combinations of asynchronous/synchronous operating mode and speeds are
possible:
* AFAP = Maximum speed ("as fast as possible"), only possible with synchronous operating
mode.
Maximum Proceed time
Like all other service calls, the PROCEED command is a WCF command which can only need
a limited computing time. Therefore, the maximum PROCEED time is always limited to 4
seconds based on real-time, regardless of cycle times used.
With a simulation speed with 10% or the factor 10.0, the maximum PROCEED time is 400 ms.
The return value ProceedTimeTooLong is generated with longer times.
6LPXODWLRQWLPH
7 PV
. PV
7 PV
7 PV
5HDOWLPHZLWK5HDOWLPH IDFWRU
5HDOWLPHZLWK)DVW0RGH IDFWRU
5HDOWLPHZLWK6ORZ0RGH IDFWRU
7776XEPRGHOVLQWLPHVOLFHRU
6LPXODWLRQWLPH
6& PV
6 PV
6 PV
6LPXODWLRQWLPH
6& PV
6 PV
6 PV
6LPXODWLRQWLPH
6& PV
6 PV
6 PV
7. PV
7 PV
7 PV
6,0,7HQJLQHHULQJ
*UDSKLFDO
XVHULQWHUIDFH
:&)FOLHQW
7&3,3
:&)VHUYHU
5XQWLPHHQYLURQPHQW
6,0,7FRQWUROV\VWHP
If additional applications want to communicate with SIMIT, they can also connect to the WCF
server:
*UDSKLFDO
XVHULQWHUIDFH
:&)FOLHQW
7&3,3
:&)VHUYHU
5XQWLPHHQYLURQPHQW
6,0,7FRQWUROV\VWHP
Note
Note the following:
● Reference this DLL direct in the Global Assembly Cache.
● Do not copy this DLL into your own project.
● Do not supply this DLL with your coupling.
6.2.1 Client
Each client is assigned a unique identifier (integer) when connecting to SIMIT. This is used to
identify the client in all subsequent service calls.
6.2.2 ControlSystemService
The ControlSystemService enumeration includes all the services of the WCF interface, even
if they are only used internally. Only the following services are relevant for external clients:
Value Description
Internal Internal action of the control system (e.g. in BroadcastMessage)
Connect Connects a client
Disconnect Disconnects a client
OpenProject Opens a project
CloseProject Closes the open project
RenameProject Renames the project
Terminate Stops the control system (cannot be initiated by the client)
Open Opens the simulation
Close Closes the simulation
Init Initializes the simulation
Reset Resets the simulation
Step Performs a calculation step
Proceed Single step for externally controlled operating mode
Run Starts the simulation
Stop Stops the simulation
SetSpeed Sets the speed
CreateSnapshot Creates a snapshot
CreateSnapshotFolder Creates a snapshot folder
LoadSnapshot Loads a snapshot
DeleteSnapshot Deletes a snapshot
DeleteSnapshotFolder Deletes a snapshot folder
RenameSnapshot Renames a snapshot
RenameSnapshotFolder Renames a snapshot folder
CopySnapshot Copies a snapshot
CopySnapshotFolder Copies a snapshot folder
GetInfo Returns information about the current simulation
GetLanguage Indicates the current language setting of SIMIT
6.2.3 ControlSystemServiceParams
The ControlSystemServiceParams structure contains the parameters of the original service
call, with the exception of the default parameters client, result and errormessage.
6.2.4 SimInfo
The information about the current simulation has the following values:
6.2.5 ControlSystemResult
The ControlSystemResult enumeration contains the following values:
Value Description
Ok No error.
Rejected The service call was rejected by another client.
Forbidden The service call was rejected by the SIMIT control system, because it
can only be used by SIMIT itself.
Error General error.
Value Description
Warning General warning.
Busy The SIMIT control system is still working on another call.
Note: SIMIT does not allow service calls to accumulate. Instead, a call
returns with this result and it must be repeated.
NoLicense The SIMIT control system has not (yet) found a valid license.
NoLicenseMultipleSimits Only used internally.
NoLicenseExternalClients There is no license for connecting to external clients.
WrongSimState The service call cannot be completed in the current state of the simu‐
lation.
WrongProject SIMIT has already opened another project.
UnknownClient The specified client is not known to SIMIT.
ScriptError The script cannot be executed.
FileAccessError The specified file cannot be accessed.
FileNotFound The specified file was not found.
ProceedTimeTooLong The specified time span of a PROCEED call is too long
OutOfMemory There is not enough memory available.
6HUYLFHFDOO
6LP&RPPDQG&DQ([HFXWH
6LP&RPPDQG$QVZHU&DQ([HFXWH
:DLWLQJIRUUHVSRQVH
RIDOOFRQQHFWHGFOLHQWV
6LP&RPPDQG'R([HFXWH
6LP&RPPDQG$QVZHU'R([HFXWH
:DLWLQJIRUUHVSRQVH
RIDOOFRQQHFWHGFOLHQWV
6LP&RPPDQG1RWLI\([HFXWHG
void SimCommandCanExecute(
ControlSystemServiceParams parameters);
Parameter Description
connectedProjectPath The path in which the current SIMIT project is located or null if there is
no project open.
info Information about the current simulation; for details, see SimGetInfo.
id null should always be passed for this parameter.
name Descriptive name of the client.
Return value >0: The unique ID of the client with which it identifies itself during future
service calls.
<0: The service call failed; for details, see result and errormessage.
8.1.4 Lifebeat
If a client has not communicated for 24 hours, the connection to SIMIT is terminated. Therefore,
a client should at least make regular SimGetInfo calls.
6WHS 3URFHHG
Parameter Description
simitFile The SIMIT file with the extension ".simit" or null for opening the most
recently used project.
void SimClose(
int client,
out ControlSystemResult result,
out string errormessage);
All logged-on clients receive this service call.
Parameter Description
time The time span in milliseconds by which the simulation time should pro‐
gress. If the value is <= 0, the lowest cycle time of the current project is
used.
Parameter Description
time The time span in milliseconds by which the simulation time should pro‐
gress. If the value is <= 0, the lowest cycle time of the project is used.
Note
All logged-on clients receive this service call. The clients are not asked beforehand with
SimCommandCanExecute and SimCommandAnswerCanExecute whether they can perform
the call. A client that has accepted SimRun with parameter SyncActive or SyncPassive must
be able to execute SimProceed. The client has thus implicitly confirmed
SimCommandCanExecute in advance.
Parameter Description
syncMode Specifies the operating mode in which the simulation should run:
● Async: The simulation runs asynchronously
● SyncActive: The simulation runs synchronously, the caller assumes
control over the simulation time.
● SyncPassive: The simulation runs synchronously, the caller does not
assume control over the simulation time. If no other client takes
control, SIMIT controls the simulation time.
speed The speed to be used. For values <0, the speed last set is used; the
default value is real-time.
proceedTime The time that is to be used for PROCEED calls when SIMIT assumes
control. SIMIT uses the lower out of this value, other values set by other
clients and the minimum cycle time of the project.
RequireSyncTime = Value
Requests a maximum time for Proceed calls.
RequireSyncControl = true
This client wants to take over time control
All logged-on clients receive this service call.
Parameter Description
speed Speed; see SimInfo for meaning of the values
All logged-on clients receive this service call, as long as the simulation is in the Running state.
Otherwise, the value is evaluated when SimRun is called.
8.3 Snapshots
You can save a snapshot of the simulation as a file. Snapshots are stored in the "snap" folder
or a subfolder. All calls involved in snapshots refer to this folder.
To keep the simulation state consistent, all logged-on clients must create snapshots of their
state and manage them in a similar way to SIMIT.
Parameter Description
name Name of the snapshot. The snapshot is stored in the "snap" folder of the
project.
You cannot specify a subfolder in this case.
Parameter Description
name The name of the new folder relative to the "snap" folder.
Parameter Description
name Name of the snapshot. If there are subfolders present, these must be
preceded by a slash "/".
Parameter Description
name Name of the snapshot. A slash "/" must precede the subfolders.
Parameter Description
name The name of the snapshot folder relative to the "snap" snapshot folder.
A slash "/" must precede the subfolders.
Note
All subfolders are deleted.
Parameter Description
oldName Old name of the snapshot. A slash "/" must precede the subfolders.
newName New name of the snapshot. A slash "/" must precede the subfolders.
string oldName,
string newName);
Parameter Description
oldName Old name of the snapshot folder. A slash "/" must precede the subfolders.
newName New name of the snapshot folder. A slash "/" must precede the subfolders.
Parameter Description
oldName Name of the existing snapshot. A slash "/" must precede the subfolders.
newName Name of the copied snapshot. A slash "/" must precede the subfolders.
Parameter Description
oldName Name of the existing snapshot folder. A slash "/" must precede the sub‐
folders.
newName Name of the new snapshot folder. A slash "/" must precede the subfolders.
namespace WCFClient
{
public class Program
{
static ControlSystemResult result;
static string errormessage;
static string connectedProjectPath;
static SimInfo info;
public static int clientID;
Console.WriteLine("Disconnecting ...");
Client.proxy.SimDisconnect(
clientID, out result, out errormessage);
Console.WriteLine("Exit");
}
}
SimInfo info)
{
Console.WriteLine(
"SimCommandNotifyExecuted received, Service=" +
parameters.Service);
}
}
}
namespace WCFClient
{
public class Program
{
static ControlSystemResult result;
static string errormessage;
static string connectedProjectPath;
static SimInfo info;
try
{
Client.clientID = Client.proxy.SimConnect(
out result,
out errormessage,
out connectedProjectPath,
out info,
null,
"ConsoleDemoClient");
if (result == ControlSystemResult.Ok)
{
Client.isConnected = true;
Console.WriteLine("Connected.");
}
else
{
Console.WriteLine("NOT Connected!!!");
Console.WriteLine("Result : " + result);
Console.WriteLine("Errormessage : " + errormessage);
Client.isConnected = false;
}
Console.WriteLine("Press any key to exit!");
Console.ReadLine();
Console.WriteLine("Disconnecting ...");
if (Client.isConnected)
{
try
{
Client.proxy.SimDisconnect(
Client.clientID,
out result,
out errormessage);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
Console.WriteLine("Exit");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
{
Console.WriteLine("SimBroadcastMessage received:");
Console.WriteLine("\ttime=" + time);
Console.WriteLine("\tresult=" + result);
Console.WriteLine("\tcategory=" + category);
Console.WriteLine("\tsource=" + source);
Console.WriteLine("\tmessage=" + message);
Console.WriteLine("\tcome=" + come);
}
ControlSystemResult result,
string errormessage,
SimInfo info)
{
Console.WriteLine(
"SimCommandNotifyExecuted received, Service=" +
parameters.Service);
if (parameters.Service == ControlSystemService.Run)
{
Console.WriteLine(
"--> Run in " + parameters.SyncMode + " mode.");
}
}
Console.WriteLine("finished.");
proxy.SimCommandAnswerDoExecute(
clientID,
ControlSystemResult.Ok,
null,
commandReceivedParameters.Service);
}
}
}