Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

ChannelSIM4ME​.ChannelSIM4ME

  • Last UpdatedAug 22, 2023
  • 5 minute read

The ChannelSIM4ME.ChannelSIM4ME channel enables connection to SIM4ME bus.

Code example

This is a code example for ChannelSIM4ME.ChannelSIM4ME.

<channel name="dynsim" class="ChannelSIM4ME.ChannelSIM4ME"

hostName="dynsim5"

hostAddress="dynsim5"

hostPort="10152"

slave="false"

connectionString="-sim4mehost %hostName% -sim4mename SimExecutive -ORBInitRef NameService=iioploc://%hostAddress%:%hostPort%/NameService -ORBSvcConfDirective static%SPC%Server_Strategy_Factory%SPC%'-ORBConcurrency%SPC%thread-per-connection' -nsversion DSS50 -logging_level INFO -logging_file simbridge.log"

remoteConnectionString="-sim4mehost %hostName% -sim4mename SimExecutive -ORBInitRef NameService=iioploc://%hostAddress%:%hostPort%/NameService -ORBSvcConfDirective static%SPC%Server_Strategy_Factory%SPC%'-ORBConcurrency%SPC%thread-per-connection' -nsversion DSS50 -logging_level INFO -logging_file simbridge.log -simulation %simulation% -simfullpath %simfullpath%"

/>

Sample Mappings

See Sample mappings for ChannelSIM4ME.

Parameters

These are parameters for the channel connection.

Parameter

Type

Default

Description

class

Mandatory

Must be ChannelSIM4ME.ChannelSIM4ME.

connectionString

Mandatory

The connection string to connect with Start method. This does not load the simulation.

hostAddress

Mandatory

Must be set to the address of the machine where AVEVA™ Dynamic Simulator is installed. This is the same on hostName if reachable with machine name on local LAN.

hostName

Mandatory

Must be set to the name of the machine where AVEVA™ Dynamic Simulator is installed.

hostPort

Mandatory

The host port to connect to. The AVEVA™ Dynamic Simulator default is 10152.

KILLALL_TIME_LOADING

Optional

Default: 150000

If the simulation loading or simulation connection takes more than KILLALL_TIME_LOADING, the system assumes the AVEVA™ Dynamic Simulator is not responding and restarts the bridge.

KILLALL_TIME_LOOP

Optional

Default: 60000

The maximum ping time when the connection is active and simulation running. If the bridge does not receive any value from AVEVA™ Dynamic Simulator for a KILLALL_TIME_LOOP interval, it assumes AVEVA™ Dynamic Simulator is not responding and restarts the bridge.

name

Mandatory

The name of the channel.

remoteConnectionString

Mandatory

The connection string to connect with remoteStart method. This loads the simulation.

RESTORE_IC_LOADING_SLEEP

Optional

Default: 10000

The wait time after connection before forcing Initial Condition (IC) loading, if any IC is specified in the VR simulation. This is the first interval. For the second time, RESTORE_IC_LOADING_SECOND_SLEEP is used.

RESTORE_IC_LOADING_SECOND_SLEEP

Optional

Default: 2000

The wait time after connection before forcing IC loading, if any IC is specified in the VR simulation.

slave

Mandatory

Set to True to have AVEVA™ Dynamic Simulator working as a slave. Set to False to have mixed master mode.

Connection strings

Use slave set to False to support mixed master mode. Mixed master mode is a special mode where either DYNSIM and the bridge can control the simulation state. This is done by the channel by entering and exiting slave mode every time there is need to perform operations that control the simulation state.

Note: The default strings are for DYNSIM 5.0.x. To connect to a DYNSIM 4.5.x version, change the -nsversion value from DSS50 to DSS45.

Simulation

Unlike other channels, the DYNSIM channel has several attributes to be populated inside the <simulation> to better define behavior.

Code example

This is a code example for simulation parameter.

<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">

<analog name="XV5.OP" direction="out" mode="router"/>

<analog name="LV004.OP" direction="in" mode="router"/>

<discrete name="CW" direction="inout" mode="direct"/>

<analog name="DrainVlv.OP" direction="in" mode="router"/>

<analog name="TV101.OP" direction="in" mode="router"/>

<analog name="S14.W" uom="kg/hr" direction="in" mode="router"/>

<analog name="D102.FLASH.T" uom="C" direction="in" mode="router"/>

<malfunction name="TV101Malf" id="1"/>

<malfunction name="TT101Malf" id="2"/>

<scenario name="Scen-LoadIC" id="5"/>

<scenario name="Scen-Malfun" id="6"/>

</dynsim>

Attributes

Attribute

Type

Description

closeSimulationOnDisconnect

Mandatory

Closes the simulation when bridge disconnects leaving DYNSIM simExecutive up.

firstDisconnect

Mandatory

If set to True, automatically disconnects and reconnects the first time accessing simExecutive. Should be used in case of communication problems to separate simulation loading and data exchange.

freezeOnDisconnect

Mandatory

Automatically freezes simulation runtime when disconnecting.

remoteStart

Mandatory

Enables/disables remoteStart. Remote Start means that the simulation is loaded by the bridge using the parameters.

sendOnlyWhenRunning

Mandatory

Blocks data exchange when VR simulation state is not running. Should be kept to True to avoid possible fake values exchange.

shutdownOnDisconnect

Mandatory

Shuts down DYNSIM when bridge disconnects closing simExecutive. Usually set to False.

simulation

Mandatory

Must be the name of the simulation to be started using remote start.

simfullpath

Mandatory

Must be the path of the simulation used for remoteStart. This path should not contain spaces.

tolerance

Optional (def=0.002)

Changes general analog variables tolerance.

useClientMessages

Optional (def=false)

Shows DYNSIM client messages inside the log.

useDataRouter

Optional (def=false)

Enables data router exchange. Set to True for data router. Set to Read for using data router just for reading. Set to False to force use of direct.

useScenarios

Optional (def=false)

Enables scenario support.

Variables

There are four types of variables:

  • Analog

  • Discrete

  • Malfunction

  • Scenario

Analog variable

This is a code example of an analog variable that is mapped to a float value.

<analog name="S14.W" uom="kg/hr" direction="in" mode="router"/>

Attributes

Attribute

Description

Use

direction

The direction of the variable. The value can be: in, out, or inout.

Mandatory

mode

The mode to read/write the variable. The value can be: router, direct, or mixed.

  • Router mode uses the DataRouter and only supports in or out direction. It cannot read or write to the same variable.

  • Direct mode uses getvariable and setvariable and fully supports in, out, and inout directions. However, Direct mode can be less efficient.

  • Mixed mode uses Router for reading and Direct for writing. This is a compromise to better handle inout direction variables.

Mandatory

name

The name of the variable.

Mandatory

tolerance

Enables override for the specific variable if value exceeds tolerance. This is useful for very large or very small variation ranges.

Optional

uom

A particular unit of measure, if needed. If not set, the value is loaded according to the DYNSIM default.

Optional

Discrete variable

This is a code example of a discrete variable that is mapped to a Boolean value.

<discrete name="CW" direction="inout" mode="direct"/>

Attributes

Attribute

Description

Use

direction

The direction of the variable. The value can be: in, out, or inout.

Mandatory

mode

The mode to read/write the variable. The value can be: router, direct, or mixed.

  • Router mode uses the DataRouter and only support in the out direction. You cannot read or write to the same variable.

  • Direct mode uses getvariable and setvariable and fully supports in, out, and inout. However, Direct mode can be less efficient.

  • Mixed mode uses Router for reading and Direct for writing. It is a compromise to better handle inout direction variables.

Mandatory

name

The name of the variable.

Mandatory

Malfunction

This is a code example of a malfunction.

<malfunction name="TV101Malf" id="1"/>

Parameter

Description

Use

id

The DYNSIM ID (number) for the malfunction.

Mandatory

name

The name of the malfunction.

Mandatory

Scenario

This is a code example of a scenario.

<scenario name="Scen001" id="1"/>

Parameter

Description

Use

id

The DYNSIM ID (number) for the scenario.

Mandatory

name

The name of the scenario.

Mandatory

Cybersecurity Note Please note that Message Bus does not provide data confidentiality from potential cyber attacks. It is strongly advised not to use this communication means to share credentials or other sensitive data as it could be intercepted.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in