Simulation definitions
- Last UpdatedDec 04, 2023
- 2 minute read
A simulation defines how to exchange data among two or more channels. A single Bridge configuration file can include one or more simulation definition but the XR Bridge is able to manage a simulation a time.
Each simulation definition is divided in two parts, the declaration of the exchanged variables for each involved channel and the rules for exchange data.
<simulations>
This is the container for the simulation definitions.
<simulations>
<!-- … -->
</simulations>
<simulation>
Contains the information to set up data exchange between two or more channels.
<simulation name="sim1" />
Parameters
These are the parameters for simulation.
|
Parameter |
Use |
Description |
|---|---|---|
|
name |
Mandatory |
Unique name given to the simulation. |
<channelName>
Each channel involved in a simulation is required to have a section in the <simulation> node with a tag matching the unique name given to the channel. This node works as container for the definition of all the data entries shared by the specific channel. Each channel data entry must have a unique name under the channel.
<dynsim simulation="IGCC4" simfullpath="C:\SIMSCI\DSS45\User\IGCC4.s4m" remoteStart="false" shutdownOnDisconnect="false" closeSimulationOnDisconnect="false" freezeOnDisconnect="true" useDataRouter="true" useScenarios="false" sendOnlyWhenRunning="true" firstDisconnect="false" useClientMessages="false">
<!-- … -->
</dynsim>
Only a few channels have attributes defined at simulation level.
For more information, see XR Bridge channels for the configuration details for each channel type and its exchanged data types.
<rules>
This is the container for the data exchange definition.
<rules>
<!-- … -->
</rules>
The name of the data entry is composed following the rule: nameOfChannel:nameOfDataEntry so a variable name CW.OUT in a channel named dynsim becomes dynsim:CW.OUT.
This way uniqueness is granted even when different data entries have same name in different channels.
<trigger>
This type of rule is very similar to the behavior of the route statement. As soon as the from variable changes its value, this is copied to the variable. Condition is used to limit the execution of the data exchange to specific situations, while the value clause can be used to override the original from value.
<trigger from="dynsim: RF232.POS" to="mwpl:0800-RF232.value"/>
Parameters
These are the parameters for trigger.
|
Parameter |
Use |
Description |
|---|---|---|
|
from |
Mandatory |
Name of the source data entry.* |
|
to |
Mandatory |
Name of the destination data entry. |
|
condition |
Optional |
Can be used to limit the data exchange to specific conditions. |
|
value |
Optional |
Used to eventually format or override the source value. |
* Setting from to a list of comma separated data entries is equivalent to the creation of multiple triggers each one referring to a single entry of the from list.
<refresh>
Less used compared to the trigger. Sets the value of a specific data entry at specific refresh interval.
<refresh interval="10" to="test:var7" value="#@test:var7@+1#"/>
Parameters
These are the parameters for refresh.
|
Parameter |
Use |
Description |
|---|---|---|
|
interval |
Mandatory |
Refresh interval set in milliseconds. |
|
to |
Mandatory |
Name of the destination data entry. |
|
condition |
Optional |
Can be used to limit the data exchange to specific conditions. |
|
value |
Mandatory |
Value to assign to the data entry. |