MotoHawk:Blocks:Data Definition Block

From MotoHawk
Jump to navigationJump to search

Data Definition

This MotoHawk™ block defines data to be accessed via a MotoHawk Data Read or Data Write block.

Block ID

motohawk_data_def

Library

MotoHawk_lib/Data Storage Blocks I

Description

Data Definition.png

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 will be saved in EEPROM, and return to the last written value on startup. 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 'Attach a VarDec for visibility in MotoTune' will show similar parameters as the Calibration block. If unchecked, the variable will not be available from MotoTune.

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. MotoTune VarDecs for structures are not specified in this block, but can be specified with the "Create Structure VarDec" block. For more information, 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 Enter the initial data field (type is implied, or select type in Data Type).
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 saved in EEPROM, and value returns to the last written value on startup
Output Data Reference Check box (enable) Enable output data reference for use.
Attach a VarDec for Visibility from MotoTune Check box (enable) Enable to use MotoTune.
MotoTune 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 1-4 Sets security level 1 lowest, 4 highest, for user access to read value
Write Access Level 1-4 Sets security level 1 lowest, 4 highest, for user access to write value
Use uploaded calibration values from MotoTune Checkbox enable Enable/disable to use or ignore uploaded values from Mototune
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 MotoTune, 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 lower end of allowable range for value. This can be used to prevent a user from entering an out of range number when calibrating.
Maximum Value Numeric Value Sets higher end of allowable range for value. This can be used to prevent a user from entering an out of bounds range when calibrating.
Precision Numeric value, single-quote enclosed Set the precision of the variable as displayed in MotoTune, by entering a value '1.x' where "x" is the number of decimal places requested. Default is two decimal places.
Gain* Numeric Value Multiplier applied (Default is 1) to the raw value used in calculation of the engineering value as observed in MotoTune.
Offset* Numeric Value Constant added (Default is 0) to the raw value calculations to result in the engineering value as observed in MotoTune.
Exponent* Numeric Value Exponent applied (Default is 1) to the (raw value*gain) product used in calculating the engineering value as observed in MotoTune.
MotoTune Group String Alpha-numeric text, single-quote enclosed Determines Folder name and hierarchy as displayed in MotoTune. Use "|" character between folder names to delineate subfolder structure.

*NOTE: Engineering Value = (Raw Module Value*Gain)^Exp)+Offset.