Real-Time Workshop Embedded Coder | ![]() ![]() |
Other Custom Storage Classes
This section discusses other custom storage classes that have been provided for special purposes.
GetSet Custom Storage Class
for Data Store Memory
The GetSet
custom storage class can only be used for the memory of Data Store Read and Data Store Write blocks. The properties of the GetSet
class are summarized in Table 4-4 and Table 4-5.
This class supports only signals of noncomplex data types. Its purpose is to generate code that reads (gets) and writes (sets) data via functions. For example, if the GetFunction
for signal x
is specified as "get_x"
then the generated code will call get_x()
wherever the value of x
is used. If the SetFunction
for signal x
is specified as "set_x"
then the generated code will call set_x(value)
wherever the value of x
is assigned.
For wide signals, an additional index argument is passed, as in
The cscgetsetdemo demo illustrates the use of the GetSet
custom storage class.
Designing Custom Storage Classes
Designing your own custom storage classes is an advanced topic. We have provided a step-by-step tutorial with the Real-Time Workshop Embedded Coder demo suite. To view this tutorial, type the following command at the MATLAB command prompt:
![]() | Class-Specific Storage Class Attributes | Assigning a Custom Storage Class to Data | ![]() |