Data Definition

This MotoHawk™ block defines data to be accessed via a MotoHawk Data Read or Data Write block. See also Data Coherency for a discussion on ensuring data coherency when accessing global data across multiple threads of execution.

Block ID

motohawk_data_def

Library

MotoHawk_lib/Data Storage Blocks

Description

In the "Data Name" field, provide a globally unique name; this is accessible from anywhere in the model. Duplicate names are not allowed.

'Storage Class' identifies the behavior of the data on the target. Volatile data will return to its 'Initial Value' on every startup. NonVolatile data is preserved across power cycles and returns to the last written value on startup.
Fixed NonVolatile provides more flexibility in retaining values over programming cycles when data definitions are added or removed from a build.

This block accepts any Matlab value that uses a basic Matlab data type as its Default Value, including data-typing casts. Custom data types are not valid and will display an update error.

An additional signal output will be present when 'Output Data Reference' is checked, which is of data type 'reference_T'. This is a pointer to the data, and may be used by the Data Read and Write blocks, to perform pointer-based access to data structures.

Checking 'Allow data store visibility to Instrumentation Tools' will show similar parameters as the Calibration block. If unchecked, the variable will not be available to Instrumentation Tools.

NOTE: The MotoTune Instrumentation Tool is unable to display vectors or matrices with > 4096 elements. Other tools will have different limitations. Eg. ASAP2 limits to 32768 elements.

A Structure Instance can be defined with the data type "struct" selected. A structure name must be provided and must match the structure name specified in a "Structure Declaration" block. For more details on structures and exposing structures to Instrumentation Tools, see Structures.

Block Parameters

Parameter Field Values Comments/Description
Data Name Alpha-numeric text, single-quote enclosed. Provide a globally unique name, accessible from anywhere in the model. Duplicate names are not allowed. No special characters, such as spaces, dashes, commas (underscore allowed).
Container Name Alpha-numeric text, single-quote enclosed. (Use when Data Type of "struct" or "struct container" selected) Provide a globally unique container name, accessible from anywhere in the model. Duplicate names are not allowed. No special characters, such as spaces, dashes, commas (underscore allowed).
Initial Value Enter value The initial value of the variable. Specify the native value (not the engineering value). See the Engineering Values versus Native Values for further information.
Data Type Select a data type from list, or select "Inherit from 'Table Data'" to set type as inferred from entry in Table Data field. Be sure to select a data type if there is possible ambiguity.
Storage Class Select from list, type of storage for data read, which identifies the behavior of the data on the target.
  Constant Data Initial Value remains as a constant.
Volatile Volatile data value returns to the 'Initial Value' on every startup.
NonVolatile NonVolatile data is preserved across power cycles and returns to the last written value on startup
Fixed NonVolatile Fixed NonVolatile data is preserved across power cycles and returns to the last written value on startup. Fixed NonVolatile data allows for greater flexibility by permitting the addition of new data items whilst retaining existing data during an application upgrade.
Output Data Reference Check box (enable) Enable output data reference for use.
Specify Memory Region Check box (enable) Selects that the data will be placed in region specified by Memory Region Name. This option is only available if the target and selected storage class support memory regions. The default memory region is used when this option is not available or unchecked.
Memory Region Name Alpha-numeric text, single-quote enclosed Name of the memory region in which to place the data. This option is only available when Specify Memory Region is checked.
Allow data store visibility to Instrumentation Tools Check box (enable) Enable to access variable with Instrumentation Tools.
Instrumentation Tool Window Display/Calibration Choose Display to view/edit values that will not be saved beyond current key cycle. Choose Calibration to view/edit values that will be saved beyond current key cycle.
Read Access Level 0-8 Sets security level 1 lowest, 8 highest, for user access to read value. A setting of zero indicates unsecured access is allowed.
Write Access Level 0-8, Read Only Sets security level 1 lowest, 8 highest, for user access to write value. A setting of zero indicates unsecured access is allowed. The parameter can be marked as having no write access with the (Read Only) setting.
Use uploaded calibration values from Instrumentation Tool Checkbox enable Enable/disable to use or ignore uploaded values from Instrumentation Tool
View Value as
Sets "Default Value" data type
  Number Numeric value
Enumeration Enables enumeration - Cell String: A cell array of strings such as {'Off', 'On'} may be used to define the names of enumerated values. In this case, the values start with 0 and increment by one. This is especially useful for defining names for boolean flags like 'On' and 'Off'. Struct: A Matlab struct array containing a 'name' field, and optionally a 'value' field may be used to define the names and explicitly define the values of an enumerated type. For example: struct('name', {'Off', 'On'}, 'value', {0,1}). If the 'value' field is missing, then the values start with 0 and increment by one, just like with the Cell String format. Note that only integer or boolean values may be used with enumerations. Floating point types such as double and single are not allowed.
Text Text string
Show Vectors As Wide Row/Tall Column Set viewing format for values displayed
Help Text Alpha-numeric text, single-quote enclosed Enter text to describe block usage per needs.
Units Alpha-numeric text, single-quote enclosed Enter text to describe or label units or data for clarification in Instrumentation Tool, as appropriate per application.
Row Header Enumeration (Cell String, or Struct) Alpha-numeric text, single-quote enclosed Use to identify / locate probe value (see Enumeration) - row header.
Column Header Enumeration (Cell String, or Struct) Alpha-numeric text, single-quote enclosed Use to identify / locate probe value (see Enumeration) - column header.
Minimum Value Numeric Value Sets the lower end of the allowable range for the variable. The specified value is in engineering units (see Engineering Values versus Native Values).

Typically this value is used by instrumentation to prevent a user from entering an out of range value when modifying.
Maximum Value Numeric Value Sets the higher end of the allowable range for the variable. The specified value is in engineering units (see Engineering Values versus Native Values).

Typically this value is used by instrumentation to prevent a user from entering an out of range value when modifying.
Precision Numeric value, single-quote enclosed Set the precision of the variable as displayed in Instrumentation Tool, by entering a value '1.x' where "x" is the number of decimal places requested. Default is two decimal places.
Gain* Numeric Value Multiplier component of the conversion equation that converts a native value into an engineering units value (see Engineering Values versus Native Values).
Offset* Numeric Value Offset component of the conversion equation that converts a native value into an engineering units value (see Engineering Values versus Native Values).
Exponent* Numeric Value Exponent component of the conversion equation that converts a native value into an engineering units value (see Engineering Values versus Native Values).
Instrumentation Tool Group String Alpha-numeric text, single-quote enclosed Determines Folder name and hierarchy as displayed in Instrumentation Tools. Use "|" character between folder names to delineate subfolder structure.

*NOTE: Engineering Value = ((Native Value * Gain)^Exponent) + Offset
See the Engineering Values versus Native Values help topic for further information.