Real-Time Workshop |
 |
Block States and Simulink Signal Objects
If you are not familiar with Simulink data objects and signal objects, you should read Simulink Data Objects and Code Generation before reading this section.
You can associate a block state with a signal object, and control code generation for the block state through the signal object. To do this:
- Instantiate the desired signal object, and set its
RTWInfo.StorageClass
property as you require.
- Open the State Properties dialog box for the block whose state you want to associate with the signal object. Enter the name of the signal object into the State name field.
- Make sure that the storage class and type qualifier settings of the block's State Properties dialog box are compatible with those of the signal object. See Resolving Conflicts in Configuration of Parameter and Signal Objects.
- Click Apply and close the dialog box.
Note
When associating a block state with a signal object, the mapping between the block state and the signal object must be one-to-one. If two or more identically named entities, such as a block state and a signal, map to the same signal object, the name conflict will be flagged as an error at code generation time.
|
| Symbolic Names for Block States | | Summary of State Storage Class Options |  |