Customization > SySim- SysML model execution > SySim profile package > <<SySim TWRemoteThing>> stereotype (SySim)
  
<<SySim TWRemoteThing>> stereotype (SySim)
Apply «SySim TWRemoteThing» stereotype to Blocks that have the «SySim ControlBlock» stereotype applied.
When applied to a Block, the Block is generated as a ThingWorx Remote Thing that can be included in ThingWorx mashups.
The «SySim TWRemoteThing» stereotype applies the following Tag Definitions:
SySim TWScanInterval
Set to the required scan time interval in milliseconds. The remotable properties of the Block will be evaluated and transmitted to the ThingWorx SDK infrastructure at intervals determined by the tagged value.
SySim TWIdentifier
Set to an unquoted string representing the ThingWorx identifier of the associated Remote Thing.
SySim TWShapeName
When set, the name of the ThingWorx Shape created in the Composer will be set to the set value. When blank, the ThingWorx Shape will be named SySim<block name>Shape.
How the code is generated
When a block is a Remote Thing, a nested class named TRemoteThing is defined within that Block. This class is instantiated in the block and it inherits VirtualThing from the ThingWorx SDK.
The TRemoteThing class contains the following:
The .NET attributes for each of the remotable properties.
A back pointer to the owning block instance.
An attribute that records last time the scan was completed.
A Boolean attribute that records if the Remote Thing instance has been registered in the ThingWorx client.
An operation for each remotable service that ThingWorx can call on the Remote Thing, with the relevant .NET ThingWorx SDK specific attributes for the operation, each of its parameters and the return value.
A Scan operation that is called on each SySim main loop execution. The Scan operation registers the instance in the ThingWorx client on the first execution, then collects and sends to the ThingWorx SDK the remote properties at each scan interval.
A synchronizeState override from the base class, with minimal implementation.
A constructor.
ThingShape generation
For each Remote Thing defined in the model, a ThingShape is generated in ThingWorx.
An XML file with the ThingShape definition including the associated remote properties and services is generated and the file is then submitted to the ThingWorx Composer via HTTP(S), through the CURL command line utility.
The invocation of the ThingShape transmission to ThingWorx originates from within the ACS DLL, and it happens whenever there is a difference in the XML file (with respect to the latest generation) for one of the Remote Thing Blocks. The name of the ThingShape is SySim<block name>Shape unless otherwise specified through the SySim TWShapeName tag definition.