Custom sensor description in ecuxml syntax
Добавлено: 18 июл 2013, 14:22
hobdrive supports dynamic sensor definition files, named ecuxml, to easily describe sensor fetching logic, parsing and conversion from ECU.
A number of predefined ecuxml files could be found within hobdrive distribution, under "ecu" folder. They could be used as examples for further work in different ECU support.
Here is a formal description of ecuxml syntax format. It is xml based, so to edit you should have basic xml knowledge or use any of XML editors.
In all vehicle configurations hobdrive always reads "hobdrive/ecu/default.ecuxml" and "hobdrive/user.ecuxml" files.
You should use "user.ecuxml" file for your own sensor descriptions. This way they are guaranteed not to be overwritten/erased during hobdrive version update.
parameters
This is a root tag, it contains two attributes:
description - Free text describing this ECU
namespace - Single word namespace, where all described sensors belong to
disable-obd2
Not currently supported
Tag with text values of true or false. true means this ECU is not OBD2 compatible, therefore standard OBD2 sensors are not applicable for this ECU.
false means this ECU description is an extra addition to the existing OBD2 PIDs and sensors.
init-string
Not currently supported
This is a ELM init string which should be used to enable ELM for the described ECU.
models
List of known vehicle models and years, this ECU is used on.
parameter
Main tag, describing one sensor/PID.
Each sensor has an id (attribute of the tag) - which is a sensor's system name. This name is system wide and should not be ECU specific. F.e. you should name vehicle's speed as id="Speed", not as "MyECUSpeed". This way hobdrive will reuse this sensor in generic calculations.
display attribute is optional, and is a system sensor name normally used in documentation or hardware testers. F.e. Catalyst Temperature on bank 1 sensor 1 is oficcially named with display CATEMP11
description
This sub-tag contains description tags of a sensor:
name - Short display name.
unit - Sensor unit name.
description - Longer (one-two line) description of a sensor.
Description may contain optional attribute lang, showing two-letter iso language code which is used for sensor description.
There are different ways to define sensors. They mainly differ by source of sensor data. There are multiple sources:
1. base
This tag should contain other sensor name, which this sensor is based on. f.e.
This defines a new sensor, which is derived from MAP sensor, and its value is a multiplication of MAP value by 0.01.
2. raw
3. base-raw
4. class
<value-09> 0.3 </value-09> - значение берется из девятого байта ответа и умножается на число 0.3
<word-09> 0.3 </word-09> - значение берется из двух байтов по адресу девятого байта ответа и умножается на число 0.3
<dword-09> 0.3 </dword-09> - значение берется из четырех байтов по адресу девятого байта ответа и умножается на число 0.3
wordle-xx и dwordle-xx - то же, что и word/dword, но порядок байтов "little endian" - первый байт - младший, далее - более старшие.
<offset> 10 </offset> - к значению добавляется указанное смещение
<bit> 4 </bit> - из значения берется лишь 4-й бит
A number of predefined ecuxml files could be found within hobdrive distribution, under "ecu" folder. They could be used as examples for further work in different ECU support.
Here is a formal description of ecuxml syntax format. It is xml based, so to edit you should have basic xml knowledge or use any of XML editors.
In all vehicle configurations hobdrive always reads "hobdrive/ecu/default.ecuxml" and "hobdrive/user.ecuxml" files.
You should use "user.ecuxml" file for your own sensor descriptions. This way they are guaranteed not to be overwritten/erased during hobdrive version update.
parameters
This is a root tag, it contains two attributes:
description - Free text describing this ECU
namespace - Single word namespace, where all described sensors belong to
disable-obd2
Not currently supported
Tag with text values of true or false. true means this ECU is not OBD2 compatible, therefore standard OBD2 sensors are not applicable for this ECU.
false means this ECU description is an extra addition to the existing OBD2 PIDs and sensors.
init-string
Not currently supported
This is a ELM init string which should be used to enable ELM for the described ECU.
models
List of known vehicle models and years, this ECU is used on.
parameter
Main tag, describing one sensor/PID.
Each sensor has an id (attribute of the tag) - which is a sensor's system name. This name is system wide and should not be ECU specific. F.e. you should name vehicle's speed as id="Speed", not as "MyECUSpeed". This way hobdrive will reuse this sensor in generic calculations.
display attribute is optional, and is a system sensor name normally used in documentation or hardware testers. F.e. Catalyst Temperature on bank 1 sensor 1 is oficcially named with display CATEMP11
description
This sub-tag contains description tags of a sensor:
name - Short display name.
unit - Sensor unit name.
description - Longer (one-two line) description of a sensor.
Description may contain optional attribute lang, showing two-letter iso language code which is used for sensor description.
There are different ways to define sensors. They mainly differ by source of sensor data. There are multiple sources:
1. base
This tag should contain other sensor name, which this sensor is based on. f.e.
Код: Выделить всё
<base>IntakeManifoldPressure</base>
<value> 0.01 </value>
2. raw
3. base-raw
4. class
<value-09> 0.3 </value-09> - значение берется из девятого байта ответа и умножается на число 0.3
<word-09> 0.3 </word-09> - значение берется из двух байтов по адресу девятого байта ответа и умножается на число 0.3
<dword-09> 0.3 </dword-09> - значение берется из четырех байтов по адресу девятого байта ответа и умножается на число 0.3
wordle-xx и dwordle-xx - то же, что и word/dword, но порядок байтов "little endian" - первый байт - младший, далее - более старшие.
<offset> 10 </offset> - к значению добавляется указанное смещение
<bit> 4 </bit> - из значения берется лишь 4-й бит