Jump to content

Component: J1939 Automotive Node (Comms: System): 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 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%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClearSPN'''
| width="90%" class="mtx-class-macrohead" | '''ClearSPN'''
|-
|-
| colspan="2" | Clears the list of registered SPN allowing new SPN to be registered. 
| colspan="2" | Clears the list of registered SPN allowing new SPN to be registered. 
Line 109: Line 109:
|-
|-
| 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;" | '''Get_Address'''
| width="90%" class="mtx-class-macrohead" | '''Get_Address'''
|-
|-
| colspan="2" | Returns the device (ECU) actual address 
| colspan="2" | Returns the device (ECU) actual address 
Line 123: Line 123:
|-
|-
| 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;" | '''Get_Status'''
| width="90%" class="mtx-class-macrohead" | '''Get_Status'''
|-
|-
| colspan="2" | Returns the system status. 0 = Ready. 1 = Waiting address claim 
| colspan="2" | Returns the system status. 0 = Ready. 1 = Waiting address claim 
Line 137: Line 137:
|-
|-
| 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 and J1939 protocol 
| colspan="2" | Initialise the CAN network and J1939 protocol 
Line 156: Line 156:
|-
|-
| 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;" | '''Message_Data_Clear'''
| width="90%" class="mtx-class-macrohead" | '''Message_Data_Clear'''
|-
|-
| colspan="2" | Clear the CAN Data Buffer 
| colspan="2" | Clear the CAN Data Buffer 
Line 175: Line 175:
|-
|-
| 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;" | '''Message_Data_Read_SPN'''
| width="90%" class="mtx-class-macrohead" | '''Message_Data_Read_SPN'''
|-
|-
| colspan="2" | Read the SPN value from the CAN data buffer 
| colspan="2" | Read the SPN value from the CAN data buffer 
Line 199: Line 199:
|-
|-
| 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;" | '''Message_Data_Set'''
| width="90%" class="mtx-class-macrohead" | '''Message_Data_Set'''
|-
|-
| colspan="2" | Set all data in CAN Data Buffer to given value. e.g. 0 or 0xFF 
| colspan="2" | Set all data in CAN Data Buffer to given value. e.g. 0 or 0xFF 
Line 223: Line 223:
|-
|-
| 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;" | '''Message_Data_Write_SPN'''
| width="90%" class="mtx-class-macrohead" | '''Message_Data_Write_SPN'''
|-
|-
| colspan="2" | Write the SPN value to the CAN data buffer 
| colspan="2" | Write the SPN value to the CAN data buffer 
Line 252: Line 252:
|-
|-
| 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 271: Line 271:
|-
|-
| 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;" | '''RegisterSPN'''
| width="90%" class="mtx-class-macrohead" | '''RegisterSPN'''
|-
|-
| colspan="2" | Allows a SPN and PGN to be registered onto the system. Returns 1 if the SPN has been regisered successfully. 
| colspan="2" | Allows a SPN and PGN to be registered onto the system. Returns 1 if the SPN has been regisered successfully. 
Line 310: Line 310:
|-
|-
| 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;" | '''Rx_Message_Check'''
| width="90%" class="mtx-class-macrohead" | '''Rx_Message_Check'''
|-
|-
| colspan="2" | If a data message has been received returns the PGN,otherwise 0 
| colspan="2" | If a data message has been received returns the PGN,otherwise 0 
Line 324: Line 324:
|-
|-
| 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;" | '''Rx_Message_Data'''
| width="90%" class="mtx-class-macrohead" | '''Rx_Message_Data'''
|-
|-
| colspan="2" | Returns the DLC and data of the last received message 
| colspan="2" | Returns the DLC and data of the last received message 
Line 343: Line 343:
|-
|-
| 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;" | '''Rx_Message_Source'''
| width="90%" class="mtx-class-macrohead" | '''Rx_Message_Source'''
|-
|-
| colspan="2" | Returns the Source Address of the last received message 
| colspan="2" | Returns the Source Address of the last received message 
Line 357: Line 357:
|-
|-
| 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;" | '''Rx_Transfer_Check'''
| width="90%" class="mtx-class-macrohead" | '''Rx_Transfer_Check'''
|-
|-
| colspan="2" | Check for incoming multipart data transfers. If received, returns the PGN else 0 
| colspan="2" | Check for incoming multipart data transfers. If received, returns the PGN else 0 
Line 371: Line 371:
|-
|-
| 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;" | '''Rx_Transfer_Data'''
| width="90%" class="mtx-class-macrohead" | '''Rx_Transfer_Data'''
|-
|-
| colspan="2" | Returns the byte count and data of the transfer message data 
| colspan="2" | Returns the byte count and data of the transfer message data 
Line 395: Line 395:
|-
|-
| 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;" | '''Tx_Message_Send'''
| width="90%" class="mtx-class-macrohead" | '''Tx_Message_Send'''
|-
|-
| colspan="2" | Send the prepared CAN message 
| colspan="2" | Send the prepared CAN message 
Line 424: Line 424:
|-
|-
| 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;" | '''Tx_Transfer_Send'''
| width="90%" class="mtx-class-macrohead" | '''Tx_Transfer_Send'''
|-
|-
| colspan="2" | Send a mulitpart data transfer message. Returns number of bytes accepted. Limited by max message size. 
| colspan="2" | Send a mulitpart data transfer message. Returns number of bytes accepted. Limited by max message size. 
Line 454: Line 454:
|-
|-
| 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 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