MotoHawk OBD Custom Field Definition

The OBD Custom Field Definition block defines a data store that is allocated according to the number of faults in the user application.

Block ID

OBD Custom Field Definition

Library

MotoHawk OBD Fault Manager

Description

The OBD Custom Field Definition block defines a data store that is allocated according to the number of faults in the user application. The purpose is to map a particular type of data to a particular fault. The user can update and read the data at run time when it is required. The data can also be used by protocol handlers and other algorithms.

In the "Custom Field Name" field, provide a 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.

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.

Checking 'Attach a VarDec' will show similar parameters as the Calibration block. If unchecked, the variable will not be available in a calibration tool. Note that the group string and read/write levels for this calibration are determined in the fault definition block for each fault.

Block Parameters

Parameter Field Values Comments/Description
Custom Field 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).
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 like memory and value returns to the last written value on startup
Attach a VarDec Check box (enable) Expose the custom field to a compatible instrumentation tool.
Treatment by Instrumentation Instrumentation can treat the custom field as either a Calibration or a Measurement. Some Storage Classes imply how the tool will treat the field. The option to edit this attribute is disabled when this is the case.
  Constant Treatment implies Calibration.
Volatile Treatment implies Measurement.
NonVolatile Treatment is specified by the developer using the drop-down.
Instrumentation Name Format Drop Down Specifies the format of the instrumentation name.
<FaultName>_<CustomFieldName>
Eg: Fault1_MyData
<CustomFieldName>_<FaultName>
Eg: MyData_Fault1
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.
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, as appropriate per application.
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, 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.
Offset* Numeric Value Constant added (Default is 0) to the raw value calculations to result in the engineering value.
Exponent* Numeric Value Exponent applied (Default is 1) to the (raw value*gain) product used in calculating the engineering value.
Access Source Dropdown Specify whether the access to this field is to inherit from the fault definition or be specified by this definition. All instances of this field definition will have the same access if the custom field definition defines the access.
Read Level 0-8 Sets the security level (1 lowest, 8 highest) for instrumentation read access to all instances of this custom field. A setting of zero indicates unsecured access is allowed. Only applicable (and visible) when Access Source doesn't specify inherited access.
Write Level 0-8 or (Read Only) Sets the security level (1 lowest, 8 highest) for instrumentation write access to all instances of this custom field. A setting of zero indicates unsecured access is allowed and Read Only will prevent write access. Only applicable (and visible) when Access Source doesn't specify inherited access.
Group Source Dropdown Specify whether the group string associated with the custom field is to inherit from the fault definition, inherit, but with an extension, or be specified solely by this definition. The separating pipe ('|') will be included automatically if extension is selected. For example the an extended group string would be of this form:
'Fault Defn Group | Group String'
Group String Single quote enclosed text Specifies the group string. Only visible when applicable based upon the Group Source

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