Component: OBD2 ECU (Server) (Comms: System): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| Line 95: | Line 95: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DTC_Add''' | ||
|- | |- | ||
| colspan="2" | Adds a DTC to the store (e.g. "B1318") Checks to see if the DTC string is already in the store before adding. | | colspan="2" | Adds a DTC to the store (e.g. "B1318") Checks to see if the DTC string is already in the store before adding. | ||
| Line 119: | Line 119: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DTC_Clear''' | ||
|- | |- | ||
| colspan="2" | Clears the DTC store | | colspan="2" | Clears the DTC store | ||
| Line 133: | Line 133: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DTC_Count''' | ||
|- | |- | ||
| colspan="2" | Returns the number of stored DTCs | | colspan="2" | Returns the number of stored DTCs | ||
| Line 147: | Line 147: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DTC_Get''' | ||
|- | |- | ||
| colspan="2" | Get the DTC from the store at Index | | colspan="2" | Get the DTC from the store at Index | ||
| Line 166: | Line 166: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''FlushBuffer''' | ||
|- | |- | ||
| colspan="2" | Clears the contents of the buffer and re-initialises the index locations. | | colspan="2" | Clears the contents of the buffer and re-initialises the index locations. | ||
| Line 180: | Line 180: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetByte''' | ||
|- | |- | ||
| colspan="2" | Reads the next available byte from the circular buffer, Returns 255 if the buffer is empty. | | colspan="2" | Reads the next available byte from the circular buffer, Returns 255 if the buffer is empty. | ||
| Line 194: | Line 194: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetNumberBytes''' | ||
|- | |- | ||
| colspan="2" | Returns the number of valid data bytes currently inside the buffer. | | colspan="2" | Returns the number of valid data bytes currently inside the buffer. | ||
| Line 208: | Line 208: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Initialise the CAN network | | colspan="2" | Initialise the CAN network | ||
| Line 222: | Line 222: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Process''' | ||
|- | |- | ||
| colspan="2" | Does the message processing. Call this often. | | colspan="2" | Does the message processing. Call this often. | ||
| Line 241: | Line 241: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Set_ECU_Name''' | ||
|- | |- | ||
| colspan="2" | Set the ECU Name | | colspan="2" | Set the ECU Name | ||
| Line 260: | Line 260: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Set_Engine_Coolant_Temperature''' | ||
|- | |- | ||
| colspan="2" | -40 to 215 (deg C) | | colspan="2" | -40 to 215 (deg C) | ||
| Line 279: | Line 279: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Set_Engine_Load''' | ||
|- | |- | ||
| colspan="2" | 0 to 100 (%) | | colspan="2" | 0 to 100 (%) | ||
| Line 298: | Line 298: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Set_Engine_Speed''' | ||
|- | |- | ||
| colspan="2" | 0 to 16,383.75 (rpm) | | colspan="2" | 0 to 16,383.75 (rpm) | ||
| Line 317: | Line 317: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Set_MAF_Rate''' | ||
|- | |- | ||
| colspan="2" | 0 to 655.35 grams/sec | | colspan="2" | 0 to 655.35 grams/sec | ||
| Line 336: | Line 336: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Set_Throttle_Position''' | ||
|- | |- | ||
| colspan="2" | 0 - 100 (%) | | colspan="2" | 0 - 100 (%) | ||
| Line 355: | Line 355: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Set_VIN''' | ||
|- | |- | ||
| colspan="2" | Set the 17 character VIN | | colspan="2" | Set the 17 character VIN | ||
| Line 374: | Line 374: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Set_Vehicle_Speed''' | ||
|- | |- | ||
| colspan="2" | 0 - 255 (km/h) | | colspan="2" | 0 - 255 (km/h) | ||
| Line 394: | Line 394: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
Revision as of 14:23, 13 July 2026
| Author | Matrix TSL |
| Version | 1.0 |
| Category | Comms: System |
OBD2 ECU (Server) component
Implements an ECU side OBD-II server
Component Source Code
Please click here to download the component source project: FC_Comp_Source_OBD2_ECU.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_OBD2_ECU.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
DTC_Add
DTC_Clear
| DTC_Clear | |
| Clears the DTC store | |
| Return | |
DTC_Count
| DTC_Count | |
| Returns the number of stored DTCs | |
| Return | |
DTC_Get
| DTC_Get | |
| Get the DTC from the store at Index | |
| Index | |
| Return | |
FlushBuffer
| FlushBuffer | |
| Clears the contents of the buffer and re-initialises the index locations. | |
| Return | |
GetByte
| GetByte | |
| Reads the next available byte from the circular buffer, Returns 255 if the buffer is empty. | |
| Return | |
GetNumberBytes
| GetNumberBytes | |
| Returns the number of valid data bytes currently inside the buffer. | |
| Return | |
Initialise
| Initialise | |
| Initialise the CAN network | |
| Return | |
Process
| Process | |
| Does the message processing. Call this often. | |
| TimeElapsed | |
| Time elapsed since last call, in mS. Can be zero for frequent calling. | |
| Return | |
Set_ECU_Name
| Set_ECU_Name | |
| Set the ECU Name | |
| Name | |
| Return | |
Set_Engine_Coolant_Temperature
| Set_Engine_Coolant_Temperature | |
| -40 to 215 (deg C) | |
| Value | |
| Value range -40 to 215 deg C | |
| Return | |
Set_Engine_Load
| Set_Engine_Load | |
| 0 to 100 (%) | |
| Value | |
| Speed in RPM | |
| Return | |
Set_Engine_Speed
| Set_Engine_Speed | |
| 0 to 16,383.75 (rpm) | |
| Value | |
| Speed in RPM | |
| Return | |
Set_MAF_Rate
| Set_MAF_Rate | |
| 0 to 655.35 grams/sec | |
| Value | |
| MAF air flow rate in grams/sec | |
| Return | |
Set_Throttle_Position
| Set_Throttle_Position | |
| 0 - 100 (%) | |
| Value | |
| Position value as a percentage (0 - 100%) | |
| Return | |
Set_VIN
| Set_VIN | |
| Set the 17 character VIN | |
| VIN | |
| Return | |
Set_Vehicle_Speed
| Set_Vehicle_Speed | |
| 0 - 255 (km/h) | |
| Value | |
| Speed in RPM | |
| Return | |