Jump to content

Component: OBD2 ECU (Server) (Misc): Difference between revisions

From Flowcode Help
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 79: Line 79:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''DTC_Add'''
| 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 103: Line 103:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''DTC_Clear'''
| width="90%" class="mtx-class-macrohead" | '''DTC_Clear'''
|-
|-
| colspan="2" | Clears the DTC store 
| colspan="2" | Clears the DTC store 
Line 117: Line 117:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''DTC_Count'''
| 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 131: Line 131:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''DTC_Get'''
| 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 150: Line 150:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''FlushBuffer'''
| 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 164: Line 164:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetByte'''
| 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 178: Line 178:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetNumberBytes'''
| 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 192: Line 192:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Initialise the CAN network 
| colspan="2" | Initialise the CAN network 
Line 206: Line 206:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Process'''
| 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 225: Line 225:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Set_ECU_Name'''
| width="90%" class="mtx-class-macrohead" | '''Set_ECU_Name'''
|-
|-
| colspan="2" | Set the ECU Name 
| colspan="2" | Set the ECU Name 
Line 244: Line 244:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Set_Engine_Coolant_Temperature'''
| 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 263: Line 263:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Set_Engine_Load'''
| width="90%" class="mtx-class-macrohead" | '''Set_Engine_Load'''
|-
|-
| colspan="2" | 0 to 100 (%) 
| colspan="2" | 0 to 100 (%) 
Line 282: Line 282:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Set_Engine_Speed'''
| 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 301: Line 301:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Set_MAF_Rate'''
| 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 320: Line 320:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Set_Throttle_Position'''
| width="90%" class="mtx-class-macrohead" | '''Set_Throttle_Position'''
|-
|-
| colspan="2" | 0 - 100 (%) 
| colspan="2" | 0 - 100 (%) 
Line 339: Line 339:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Set_VIN'''
| width="90%" class="mtx-class-macrohead" | '''Set_VIN'''
|-
|-
| colspan="2" | Set the 17 character VIN 
| colspan="2" | Set the 17 character VIN 
Line 358: Line 358:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Set_Vehicle_Speed'''
| width="90%" class="mtx-class-macrohead" | '''Set_Vehicle_Speed'''
|-
|-
| colspan="2" | 0 - 255 (km/h) 
| colspan="2" | 0 - 255 (km/h) 
Line 378: Line 378:
|-
|-
| 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

Revision as of 14:23, 13 July 2026

Author
Version 1.0
Category Misc


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_Add
Adds a DTC to the store (e.g. "B1318") Checks to see if the DTC string is already in the store before adding. 
- STRING DTC_String
 
- BOOL CheckExists
Checks to see if error code already exists 
- BYTE Return


DTC_Clear

DTC_Clear
Clears the DTC store 
- VOID Return


DTC_Count

DTC_Count
Returns the number of stored DTCs 
- UINT Return


DTC_Get

DTC_Get
Get the DTC from the store at Index 
- UINT Index
 
- STRING Return


FlushBuffer

FlushBuffer
Clears the contents of the buffer and re-initialises the index locations. 
- VOID Return


GetByte

GetByte
Reads the next available byte from the circular buffer, Returns 255 if the buffer is empty. 
- UINT Return


GetNumberBytes

GetNumberBytes
Returns the number of valid data bytes currently inside the buffer. 
- UINT Return


Initialise

Initialise
Initialise the CAN network 
- BYTE Return


Process

Process
Does the message processing. Call this often. 
- UINT TimeElapsed
Time elapsed since last call, in mS. Can be zero for frequent calling. 
- BYTE Return


Set_ECU_Name

Set_ECU_Name
Set the ECU Name 
- STRING Name
 
- VOID Return


Set_Engine_Coolant_Temperature

Set_Engine_Coolant_Temperature
-40 to 215 (deg C) 
- FLOAT Value
Value range -40 to 215 deg C 
- VOID Return


Set_Engine_Load

Set_Engine_Load
0 to 100 (%) 
- FLOAT Value
Speed in RPM 
- VOID Return


Set_Engine_Speed

Set_Engine_Speed
0 to 16,383.75 (rpm) 
- FLOAT Value
Speed in RPM 
- VOID Return


Set_MAF_Rate

Set_MAF_Rate
0 to 655.35 grams/sec 
- FLOAT Value
MAF air flow rate in grams/sec 
- VOID Return


Set_Throttle_Position

Set_Throttle_Position
0 - 100 (%) 
- FLOAT Value
Position value as a percentage (0 - 100%) 
- VOID Return


Set_VIN

Set_VIN
Set the 17 character VIN 
- STRING VIN
 
- VOID Return


Set_Vehicle_Speed

Set_Vehicle_Speed
0 - 255 (km/h) 
- FLOAT Value
Speed in RPM 
- VOID Return


Property reference

Properties
DTC Store Size
Maximum number of DTC codes to store 
VIN
17 character Vehicle Identification Number 
CAN
Channel
Switches between Internal CAN peripheral and External CAN controller IC MCP2515. 
Controller Osc
 
Bus Rate
Data rate of the bus specified in thousand bits per second, Kbps. 
Connections
SPI
CHANNEL
SPI Channel selector 
MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Prescale
Prescale option selector 
Sample Point
Data bit read sample point 
Config Delay