|
|
Re: Static local variable - code generation
Posted:
Oct 4, 2010 10:17 AM
|
|
Hi Peter Add the below contents in the csc_registration.m file and assign the csc to local for the mpt signals ****************************************************************** h = Simulink.CSCDefn; set(h, 'Name', 'Local'); set(h, 'OwnerPackage', 'mpt'); set(h, 'CSCType', 'Other'); set(h, 'MemorySection', 'Default'); set(h, 'IsMemorySectionInstanceSpecific', false); set(h, 'IsGrouped', false); set(h.DataUsage, 'IsParameter', false); set(h.DataUsage, 'IsSignal', true); set(h, 'DataScope', 'File'); set(h, 'IsDataScopeInstanceSpecific', false); set(h, 'DataInit', 'None'); set(h, 'IsDataInitInstanceSpecific', false); set(h, 'DataAccess', 'Direct'); set(h, 'IsDataAccessInstanceSpecific', false); set(h, 'HeaderFile', ''); set(h, 'IsHeaderFileInstanceSpecific', false); set(h, 'CommentSource', 'Default'); set(h, 'TypeComment', ''); set(h, 'DeclareComment', ''); set(h, 'DefineComment', ''); set(h, 'CSCTypeAttributesClassName', 'mpt.CSCTypeAttributes_Unstructed'); set(h.CSCTypeAttributes, 'Owner', ''); set(h.CSCTypeAttributes, 'IsOwnerInstanceSpecific', false); set(h.CSCTypeAttributes, 'DefinitionFile', ''); set(h.CSCTypeAttributes, 'IsDefinitionFileInstanceSpecific', true); set(h.CSCTypeAttributes, 'ExportedMacroFile', ''); set(h.CSCTypeAttributes, 'IsExportedMacroFileInstanceSpecific', false); set(h.CSCTypeAttributes, 'ExportedMacroName', ''); set(h.CSCTypeAttributes, 'IsExportedMacroNameInstanceSpecific', false); set(h.CSCTypeAttributes, 'PersistenceLevel', 1); set(h.CSCTypeAttributes, 'IsPersistenceLevelInstanceSpecific', true); set(h, 'TLCFileName', 'MPTUnstructured.tlc'); defs = [defs; h]; ******************************************************************
I assume that you are using RTW E Coder...
Regards Karthikeyan.B
"Piotr S" <sawek84@wp.pl> wrote in message <i7bagc$gcm$1@fred.mathworks.com>... > Hi All, > > I'm trying to set my RTW in such a way so that when generating code states are stored in local static variables. I know how to make signal a global static variable (using custom storage class) but could not figure out how to create a local static one. Is there any way of doing this by using TLC files with custom storage classes or in any other way? > > Thanks, > > Peter
|
|