Skip to Main Content Skip to Search
Product Documentation

ssSetDWorkRTWStorageClass - Specify the storage class of a DWork vector in code generated from the associated S-function

Syntax

ssRTWStorageType ssSetDWorkRTWStorageClass(SimStruct *S, int_T vector, 
 ssRTWStorageType sc) 

Arguments

S

SimStruct representing an S-Function block.

vector

Index of the work vector, where the index is one of 0, 1, 2, ... ssGetNumDWork(S)-1.

sc

Storage class of the work vector. Must be one of the values enumerated by ssRTWStorageType in simstruc.h:

typedef enum { 
    SS_RTW_STORAGE_AUTO = 0, 
    SS_RTW_STORAGE_EXPORTED_GLOBAL, 
    SS_RTW_STORAGE_IMPORTED_EXTERN, 
    SS_RTW_STORAGE_IMPORTED_EXTERN_POINTER 
} ssRTWStorageType

Returns

The ssRTWStorageType value entered as sc. Invokes an error if sc is not a valid storage class.

Description

Sets sc as the storage class of the DWork vector specified by vector. The storage class is a code-generation attribute that determines how code generated by the Simulink Coder product for this S-function allocates memory for this work vector (see Signal Storage Concepts in the Simulink Coder User's Guide) . For more information on using DWork vectors, see Using Work Vectors.

Languages

C, C++

Example

See the S-function sfun_rtwdwork.c used in sfcndemo_sfun_rtwdwork.mdl.

See Also

ssGetDWorkRTWStorageClass

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS