Component: OBD2 ECU (Server) (Comms: System)

From Flowcode Help
Jump to navigationJump to search
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

Fc9-comp-macro.png 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. 
Fc9-string-icon.png - STRING DTC_String
 
Fc9-bool-icon.png - BOOL CheckExists
Checks to see if error code already exists 
Fc9-u8-icon.png - BYTE Return


DTC_Clear

Fc9-comp-macro.png DTC_Clear
Clears the DTC store 
Fc9-void-icon.png - VOID Return


DTC_Count

Fc9-comp-macro.png DTC_Count
Returns the number of stored DTCs 
Fc9-u16-icon.png - UINT Return


DTC_Get

Fc9-comp-macro.png DTC_Get
Get the DTC from the store at Index 
Fc9-u16-icon.png - UINT Index
 
Fc9-string-icon.png - STRING Return


FlushBuffer

Fc9-comp-macro.png FlushBuffer
Clears the contents of the buffer and re-initialises the index locations. 
Fc9-void-icon.png - VOID Return


GetByte

Fc9-comp-macro.png GetByte
Reads the next available byte from the circular buffer, Returns 255 if the buffer is empty. 
Fc9-u16-icon.png - UINT Return


GetNumberBytes

Fc9-comp-macro.png GetNumberBytes
Returns the number of valid data bytes currently inside the buffer. 
Fc9-u16-icon.png - UINT Return


Initialise

Fc9-comp-macro.png Initialise
Initialise the CAN network 
Fc9-u8-icon.png - BYTE Return


Process

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


Set_ECU_Name

Fc9-comp-macro.png Set_ECU_Name
Set the ECU Name 
Fc9-string-icon.png - STRING Name
 
Fc9-void-icon.png - VOID Return


Set_Engine_Coolant_Temperature

Fc9-comp-macro.png Set_Engine_Coolant_Temperature
-40 to 215 (deg C) 
Fc9-f32-icon.png - FLOAT Value
Value range -40 to 215 deg C 
Fc9-void-icon.png - VOID Return


Set_Engine_Load

Fc9-comp-macro.png Set_Engine_Load
0 to 100 (%) 
Fc9-f32-icon.png - FLOAT Value
Speed in RPM 
Fc9-void-icon.png - VOID Return


Set_Engine_Speed

Fc9-comp-macro.png Set_Engine_Speed
0 to 16,383.75 (rpm) 
Fc9-f32-icon.png - FLOAT Value
Speed in RPM 
Fc9-void-icon.png - VOID Return


Set_MAF_Rate

Fc9-comp-macro.png Set_MAF_Rate
0 to 655.35 grams/sec 
Fc9-f32-icon.png - FLOAT Value
MAF air flow rate in grams/sec 
Fc9-void-icon.png - VOID Return


Set_Throttle_Position

Fc9-comp-macro.png Set_Throttle_Position
0 - 100 (%) 
Fc9-f32-icon.png - FLOAT Value
Position value as a percentage (0 - 100%) 
Fc9-void-icon.png - VOID Return


Set_VIN

Fc9-comp-macro.png Set_VIN
Set the 17 character VIN 
Fc9-string-icon.png - STRING VIN
 
Fc9-void-icon.png - VOID Return


Set_Vehicle_Speed

Fc9-comp-macro.png Set_Vehicle_Speed
0 - 255 (km/h) 
Fc9-f32-icon.png - FLOAT Value
Speed in RPM 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-21-icon.png DTC Store Size
Maximum number of DTC codes to store 
Fc9-type-10-icon.png VIN
17 character Vehicle Identification Number 
Fc9-conn-icon.png CAN
Fc9-type-16-icon.png Channel
Switches between Internal CAN peripheral and External CAN controller IC MCP2515. 
Fc9-type-16-icon.png Controller Osc
 
Fc9-type-16-icon.png Bus Rate
Data rate of the bus specified in thousand bits per second, Kbps. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png SPI
Fc9-type-16-icon.png CHANNEL
SPI Channel selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png 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.  
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-16-icon.png Sample Point
Data bit read sample point 
Fc9-type-16-icon.png Config Delay