Customization > SySim- SysML model execution > SySim Integration with Phoenix ModelCenter > SySim Stereotypes and Tag Definitions for ModelCenter integration
  
SySim Stereotypes and Tag Definitions for ModelCenter integration
Stereotypes and Tag Definitions related to the ModelCenter integration are stored in the SySim ModelCenter package for the SySim Profile.
SySim ModelCenterBlock Stereotype
Apply the << SySim ModelCenterBlock>> stereotype to a <<SySim Control Block>> whose behavior is specified by a ModelCenter simulation.
* 
On a <<SySim ModelCenterBlock>>, the user can redefine the following operations needed by the ModelCenter integration, that are otherwise automatically created by the code generator:
InitMC() —Called at each loop. Intent is to initialize the ModelCenter subsystem if not already initialized.
ExecuteAnalysis(Timespan) —Called when the intent is start or continue the execution of a ModelCenter analysis.
OnModelCenterAdvance(Timespan) —Called at each loop to progress the SySim simulation.
OnModelCenterError(System.Exception) —Called whenever Model Center returns an exception.
OnModelCenterEnd() —Called when the used presses the simulation end button on the SySim form.
Tag Definitions:
SySim ModelCenterAnalysisPathName: set to the URL value that makes the ModelCenter simulation available via Phoenix Analysis Server. For example: aserv://localhost/brake/MotorXls
SySim ModelCenterPort Stereotype
Apply the << SySim ModelCenterPort>> stereotype to a <<SySim InputPort>> or a <<SySim OutputPort>> of a <<SySim ModelCenterBlock>> when such port represents an input or output variable of the Model Center simulation.
Tag Definitions:
SySim ModelCenterType: Set to the Visual Basic type that will be used in the VB application to represent the ModelCenter variable type. Leave blank when SySim is able to elaborate a suitable default from the port/part type (see below).
SySim ModelCenterName: Set to the name of the simulation variable in ModelCenter. Leave blank when the name of the part/port in Modeler and the name of the variable in ModelCenter are the same
SySim ToModelCenterConversion: When the type of the object in Modeler cannot be mapped directly to a ModelCenter type, specify a suitable conversion expression using __VALUE__ to reference the value in the Visual Basic context, e.g. MyConversionToMC (__VALUE__). The tag definition can also be used when you want to pass any arbitrary expression to ModelCenter instead of the pure value of the part or port.
SySim FromModelCenterConversion: When the type of the object in Modeler cannot be mapped directly to a ModelCenter type, specify a suitable conversion expression using __VALUE__ to reference the value in the ModelCenter context, e.g. MyConversionFromMC (__VALUE__). The tag definition can also be used when you want to assign any arbitrary expression to the part/port instead of the pure value returned by ModelCenter.
SySim ModelCenterPart Stereotype
Apply the << SySim ModelCenterPart>> stereotype to any block property of a <<SySim ModelCenterBlock>> when such part represents an input or output variable of the ModelCenter simulation.
Tag Definitions: the same tag definitions of <SySim ModelCenterPort>>, in addition to:
SySim ModelCenterDirection: This tag definition is used to qualify the direction flow of the part data. It can be Input or InputOutput, depending on whether the data is an input to ModelCenter, or both an Input and Output.
SySim ModelCenterAnalysisEndPort Stereotype
Apply the << SySim ModelCenterAnalysisEndPort>> stereotype to a <<SySim OutputPort>> typed by Boolean to use that port as a trigger to advise the design that a ModelCenter analysis has terminated and its results have made been available to the SySim parts/ports involved. The analysis end port will exhibit a false-to-true value transition for one SySim loop, this value transition can be used (for instance, by means of a change event transition in a state machine) to tell the SySim simulation that new data are available.
* 
The semantics of ports within a <<SySim ModelCenterBlock>> block is as follows:
When <<SySim ModelCenterPort>> is not applied to any of the SySim ports in the block, then all the SySim ports in the block as assumed to be ModelCenter ports (with all tag definitions empty that will assume their predefined meaning)
Otherwise, the user must specify <<SySim ModelCenterPort>> (along with the needed tag definition values) for each of the ports representing ModelCenter variables.
Default types for ModelCenter ports and parts
When no type is specified in the “SySim ModelCenterType” tag definition, SySim assigns the type as follows:
Type of part or port
Type in Visual Basic is assigned to
IDecimal
IDouble
ISingle
Decimal
Double
Single
Phoenix.ModelCenter.Common.Types.RealValue
IInteger
ILong
Integer
Long
Phoenix.ModelCenter.Common.Types. IntegerValue
IBoolean
Boolean
Phoenix.ModelCenter.Common.Types.BooleanValue
IString
String
Phoenix.ModelCenter.Common.Types.StringValue
<any other>, with “SySim ModelCenterType” left empty
An error is generated during SySim preparation
* 
When a ModelCenter type is specified directly, omit the prefix Phoenix.ModelCenter.Common.Types as it is automatically added by the code generator.