Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Static local variable - code generation
Replies: 2   Last Post: Mar 5, 2012 11:20 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
karthikeyan

Posts: 15
Registered: 1/12/09
Re: Static local variable - code generation
Posted: Oct 4, 2010 10:17 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.