Real-Time Workshop    

Block States: Storing and Interfacing

For certain block types, Real-Time Workshop lets you control how block states in your model are stored and represented in the generated code. Using the State Properties dialog, you can:

Storage of Block States

The discussion of block state storage in this section applies to the following block types:

These block types require persistent memory to store values representing the state of the block between consecutive time intervals. By default, such values are stored in a data type work vector. This vector is usually referred to as the DWork vector. It is represented in generated code as rtDWork, a global data structure. For further information on the DWork vector, see the Target Language Compiler Reference Guide.

If you want to interface a block state to your hand-written code, you can specify that the state is to be stored in a location other than the DWork vector. You do this by assigning a storage class to the block state.

You can also define a symbolic name, to be used in code generation, for a block state.


  Resolving Conflicts in Configuration of Parameter and Signal Objects Block State Storage Classes