getDataStore

Get code configuration from code mappings for local or shared local data store

    Description

    example

    propertyValue = getDataStore(myCodeMappingObj,dataStore,property) returns the value of a code mapping property for the specified local or shared local data store. Use this function to return the storage class or the value of a storage class property configured for a local or shared local data store in a model.

    Examples

    collapse all

    From the model code mappings for model myConfigModel, get the name of the storage class that is configured for local data store mode.

    cm = coder.mapping.api.get('myConfigModel');
    scMode = getState(cm,'mode','StorageClass');
    

    From the model code mappings for model myConfigModel, get the code identifier configured for the local data store mode.

    cm = coder.mapping.api.get('myConfigModel');
    idDSMmode = getDataStore(cm,'mode','Identifier');
    

    Input Arguments

    collapse all

    Code mapping object (model code mappings) returned by a call to function coder.mapping.api.get.

    Example: myCM

    Path of the Data Store Memory block for which to return the code mapping information, specified as a character vector or string scalar. Alternatively, you can specify a block handle or the name of the data store. If you specify the name of a data store and that name is not unique within the model, Simulink® returns an error that instructs you to specify the block path or handle.

    Example: blockHandle

    Data Types: char | string | block_handle

    Code mapping property for which to return a value. Specify one of these property names.

    Information to ReturnProperty Name
    Name of storage classStorageClass
    Name of variable for data store in the generated codeIdentifier

    Example: 'StorageClass'

    Output Arguments

    collapse all

    Name of the storage class or value of the specified storage class property configured for the specified data store.

    Data Types: char

    Introduced in R2020b