The Statemate Transform provides an automated interface to connect to C code generated by an IBM Rational Statemate model. The Transform is derived from the SIL Easy Transform and is used in much the same way.

SM1

Use the Create New Project verb to create a new Visual Studio project. Use the Launch Project verb to open an existing project.

Properties

SM2

Use the Properties box to specify the following properties:

Workarea Path: the path to the work area where the Statemate model is located. The directory name usually takes the form: wa_projectname

Project Name: the name of the model inside the Statemate project (should be the same as projectname above)

Chart Name: the name of the top level chart in the Statemate model (this is Statemate terminology)

Codegen Dump File: path to the *.dmp file created by Statemate's MicroC Code Generator

Harness Code File: path the SilHarness.ccp file used to build the SIL (created by the new SIL Easy project from above)

Auto Harness: a toggle that forces the Transform to be updated automatically when set to True

Once all of the properties (except Auto Harness) are filled in, the Harness Chart verb becomes available. This parses information from the Codegen directory and updates the Transform with ports relevant to the project. It is also used to re-compile the project after any changes.

All of the code files from the Codegen directory need to be manually added to the SIL project. The figure below shows an emptied Main.c file containing the SilInitialize, SilTick, and SilFinalize functions. These still need to coded manually, just like a normal SIL Easy. However, most Statemate projects should have initialization and task functions created by the Codegen process so usually all that is necessary is to add the function calls to the appropriate SIL function calls. At this point, the Transform operates like a SIL Easy Transform.

SM3

Notes:

The SIL Tick period is defined in the Transform's properties. Most Statemate projects also have a timing parameter that defines how frequently the model gets updated. Usually you want these numbers to match.

Once the code is generated by Statemate, it is usually more convenient to copy the code dump to the SIL code directory. This enables the project to be distributed to other users who may not have Statemate installed and still be able to run the project.

The figure below shows an important option to verify in your Statemate model. Setting the Task/ISR run mode to 'Single Step' makes the code generate closest to the execution model for the SIL Easy (which is to run a single pass through the model for each SIL Tick).

SM4-marked

Related Topics:

SIL Easy Transform

Connector Transforms