Jump to content

Component: J1939 Automotive Node (Comms: System): Difference between revisions

From Flowcode Help
m Text replacement - "style="background-color:#EAE1EA; color:#4B008D;"" to "class="mtx-class-propfolder""
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
Line 457: Line 457:
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | NAME
| width="90%" class="mtx-class-propfolder" | NAME
|-
|-
Line 516: Line 516:
| colspan="2" | Byte buffer size to allocate for received multipart messages. Maximum is 1785 or available RAM 
| colspan="2" | Byte buffer size to allocate for received multipart messages. Maximum is 1785 or available RAM 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | CAN
| width="90%" class="mtx-class-propfolder" | CAN
|-
|-
Line 535: Line 535:
| colspan="2" | Data rate of the bus specified in thousand bits per second, Kbps. 
| colspan="2" | Data rate of the bus specified in thousand bits per second, Kbps. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Connections
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | SPI
| width="90%" class="mtx-class-propfolder" | SPI
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 1.1
Category Comms: System


J1939 Automotive Node component

Allows an automotive J1939 network node to be created sat on top of CAN bus. Used in heavy duty vehicles it provides a base layer on which 1-16 bit signals or SPN can be assigned and passed between nodes. SPN are arranged into groups called PGN which each contain eight bytes of data.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_J1939.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_J1939.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples









Macro reference

ClearSPN

ClearSPN
Clears the list of registered SPN allowing new SPN to be registered. 
- VOID Return


Get_Address

Get_Address
Returns the device (ECU) actual address 
- BYTE Return


Get_Status

Get_Status
Returns the system status. 0 = Ready. 1 = Waiting address claim 
- BYTE Return


Initialise

Initialise
Initialise the CAN network and J1939 protocol 
- BYTE Preferred_Address
Preferred Address (Requested Address) 
- VOID Return


Message_Data_Clear

Message_Data_Clear
Clear the CAN Data Buffer 
- BYTE DataBuffer
 
- VOID Return


Message_Data_Read_SPN

Message_Data_Read_SPN
Read the SPN value from the CAN data buffer 
- UINT SPN
 
- BYTE DataBuffer
 
- UINT Return


Message_Data_Set

Message_Data_Set
Set all data in CAN Data Buffer to given value. e.g. 0 or 0xFF 
- BYTE DataBuffer
 
- BYTE Value
 
- VOID Return


Message_Data_Write_SPN

Message_Data_Write_SPN
Write the SPN value to the CAN data buffer 
- UINT SPN
 
- UINT Value
 
- BYTE DataBuffer
 
- 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


RegisterSPN

RegisterSPN
Allows a SPN and PGN to be registered onto the system. Returns 1 if the SPN has been regisered successfully. 
- UINT SPN
Suspect Parameter Number 
- UINT PGN
Parameter Group Number 
- BYTE OffsetBytes
Range: 0-7 Data byte where the SPN data starts 
- UINT OffsetBits
Range: 0-7 Bit in the data byte where the SPN data starts 
- UINT BitLength
Range: 1-16 Number of bits assigned to the SPN data 
- BOOL Return


Rx_Message_Check

Rx_Message_Check
If a data message has been received returns the PGN,otherwise 0 
- UINT Return


Rx_Message_Data

Rx_Message_Data
Returns the DLC and data of the last received message 
- BYTE DataBuffer
 
- BYTE Return


Rx_Message_Source

Rx_Message_Source
Returns the Source Address of the last received message 
- BYTE Return


Rx_Transfer_Check

Rx_Transfer_Check
Check for incoming multipart data transfers. If received, returns the PGN else 0 
- ULONG Return


Rx_Transfer_Data

Rx_Transfer_Data
Returns the byte count and data of the transfer message data 
- BYTE DataBuffer
Buffer to receive copied data 
- UINT Size
Size (byte count) of buffer 
- UINT Return


Tx_Message_Send

Tx_Message_Send
Send the prepared CAN message 
- UINT PGN
 
- BYTE DLC
 
- BYTE DataBuffer
 
- BYTE Return


Tx_Transfer_Send

Tx_Transfer_Send
Send a mulitpart data transfer message. Returns number of bytes accepted. Limited by max message size. 
- ULONG PGN
Multipart message program number 
- BYTE Data
Data buffer to send 
- UINT Size
Number of data bytes to send 
- UINT Return


Property reference

Properties
NAME
Industry Group
 
Vehicle System Instance
 
Vehicle System
 
Function
 
Function Instance
 
ECU Instance
 
Manufacturer Code
 
Identity Number
 
Number of SPNs
Number of SPN that can be registered in the database 
Transmit Message Buffer Size
Byte buffer size to allocate for transmitted multipart messages. Maximum is 1785 or available RAM 
Receive Message Buffer Size
Byte buffer size to allocate for received multipart messages. Maximum is 1785 or available RAM 
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