Difference between revisions of "Component: J1939 (Misc)"

From Flowcode Help
Jump to navigationJump to search
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | |- | width="20%" style="color:gray;" | Version | 1.1 |- | width="20%" style="color:gray;" | Categ...")
 
 
(7 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_J1939.fcfx FC_Comp_Source_J1939.fcfx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_J1939.fcfx FC_Comp_Source_J1939.fcfx]
 +
 
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_J1939.fcfx FC_Comp_Source_J1939.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 40: Line 50:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 59: Line 77:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
 
==Macro reference==
 
==Macro reference==
  
 +
===Get_Address===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Check'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Get_Address'''
 
|-
 
|-
| colspan="2" | Returns 0 if running on an embedded target or 1 if running in simulation runtime.&nbsp;
+
| colspan="2" | Returns the device (ECU) actual address&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Get_Status===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Get_Status'''
 +
|-
 +
| colspan="2" | Returns the system status. 0 = Ready. 1 = Waiting address claim&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
==Property reference==
+
===Initialise===
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
 +
| colspan="2" | Initialise the CAN network and J1939 protocol&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Sim
 
 
|-
 
|-
| colspan="2" | &nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
|}==Macro reference==
+
| width="90%" | Preferred_Address
 +
|-
 +
| colspan="2" | Preferred Address (Requested Address)&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
  
 +
===Message_Data_Clear===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Transfer_Data'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Clear'''
 
|-
 
|-
| colspan="2" | Returns the byte count and data of the transfer message data&nbsp;
+
| colspan="2" | Clear the CAN Data Buffer&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 103: Line 150:
 
| width="90%" | DataBuffer
 
| width="90%" | DataBuffer
 
|-
 
|-
| colspan="2" | Buffer to receive copied data&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | Size
 
|-
 
| colspan="2" | Size (byte count) of buffer&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Message_Data_Read_SPN===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 138: Line 181:
  
  
 +
===Message_Data_Set===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Process'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Set'''
 
|-
 
|-
| colspan="2" | Does the message processing. Call this often.&nbsp;
+
| colspan="2" | Set all data in CAN Data Buffer to given value. e.g. 0 or 0xFF&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | TimeElapsed
+
| width="90%" | DataBuffer
 
|-
 
|-
| colspan="2" | Time elapsed since last call, in mS. Can be zero for frequent calling.&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | Value
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
| colspan="2" | &nbsp;
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Transfer_Check'''
 
 
|-
 
|-
| colspan="2" | Check for incoming multipart data transfers. If received, returns the PGN else 0&nbsp;
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Message_Data_Write_SPN===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Get_Address'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Write_SPN'''
 
|-
 
|-
| colspan="2" | Returns the device (ECU) actual address&nbsp;
+
| colspan="2" | Write the SPN value to the CAN data buffer&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | SPN
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
| colspan="2" | &nbsp;
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Set'''
 
 
|-
 
|-
| colspan="2" | Set all data in CAN Data Buffer to given value. e.g. 0 or 0xFF&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Value
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
Line 195: Line 229:
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Process===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Tx_Transfer_Send'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Process'''
 
|-
 
|-
| colspan="2" | Send a mulitpart data transfer message. Returns number of bytes accepted. Limited by max message size.&nbsp;
+
| colspan="2" | Does the message processing. Call this often.&nbsp;
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 
| width="90%" | PGN
 
|-
 
| colspan="2" | Multipart message program number&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
 
|-
 
|-
| colspan="2" | Data buffer to send&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Size
+
| width="90%" | TimeElapsed
 
|-
 
|-
| colspan="2" | Number of data bytes to send&nbsp;
+
| colspan="2" | Time elapsed since last call, in mS. Can be zero for frequent calling.&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Rx_Message_Check===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 246: Line 267:
  
  
 +
===Rx_Message_Data===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Get_Status'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Message_Data'''
 
|-
 
|-
| colspan="2" | Returns the system status. 0 = Ready. 1 = Waiting address claim&nbsp;
+
| colspan="2" | Returns the DLC and data of the last received message&nbsp;
 
|-
 
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | DataBuffer
 +
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 259: Line 286:
  
  
 +
===Rx_Message_Source===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Write_SPN'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Message_Source'''
 
|-
 
|-
| colspan="2" | Write the SPN value to the CAN data buffer&nbsp;
+
| colspan="2" | Returns the Source Address of the last received message&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SPN
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
===Rx_Transfer_Check===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
| colspan="2" | &nbsp;
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Transfer_Check'''
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| colspan="2" | Check for incoming multipart data transfers. If received, returns the PGN else 0&nbsp;
| width="90%" | Value
 
 
|-
 
|-
| colspan="2" | &nbsp;
 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | DataBuffer
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Rx_Transfer_Data===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Message_Data'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Transfer_Data'''
 
|-
 
|-
| colspan="2" | Returns the DLC and data of the last received message&nbsp;
+
| colspan="2" | Returns the byte count and data of the transfer message data&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 298: Line 326:
 
| width="90%" | DataBuffer
 
| width="90%" | DataBuffer
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Buffer to receive copied data&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Size
 +
|-
 +
| colspan="2" | Size (byte count) of buffer&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Tx_Message_Send===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 333: Line 367:
  
  
 +
===Tx_Transfer_Send===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Clear'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Tx_Transfer_Send'''
 
|-
 
|-
| colspan="2" | Clear the CAN Data Buffer&nbsp;
+
| colspan="2" | Send a mulitpart data transfer message. Returns number of bytes accepted. Limited by max message size.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | DataBuffer
+
| width="90%" | PGN
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Multipart message program number&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | Data
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
| colspan="2" | Data buffer to send&nbsp;
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Message_Source'''
 
 
|-
 
|-
| colspan="2" | Returns the Source Address of the last received message&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Size
 
|-
 
|-
 +
| colspan="2" | Number of data bytes to send&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | Initialise the CAN network and J1939 protocol&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Preferred_Address
 
|-
 
| colspan="2" | Preferred Address (Requested Address)&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
  
  

Latest revision as of 13:11, 7 February 2023

Author
Version 1.1
Category Misc


J1939 component

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

Get_Address

Fc9-comp-macro.png Get_Address
Returns the device (ECU) actual address 
Fc9-u8-icon.png - BYTE Return


Get_Status

Fc9-comp-macro.png Get_Status
Returns the system status. 0 = Ready. 1 = Waiting address claim 
Fc9-u8-icon.png - BYTE Return


Initialise

Fc9-comp-macro.png Initialise
Initialise the CAN network and J1939 protocol 
Fc9-u8-icon.png - BYTE Preferred_Address
Preferred Address (Requested Address) 
Fc9-u8-icon.png - BYTE Return


Message_Data_Clear

Fc9-comp-macro.png Message_Data_Clear
Clear the CAN Data Buffer 
Fc9-u8-icon.png - BYTE DataBuffer
 
Fc9-void-icon.png - VOID Return


Message_Data_Read_SPN

Fc9-comp-macro.png Message_Data_Read_SPN
Read the SPN value from the CAN data buffer 
Fc9-u16-icon.png - UINT SPN
 
Fc9-u8-icon.png - BYTE DataBuffer
 
Fc9-u16-icon.png - UINT Return


Message_Data_Set

Fc9-comp-macro.png Message_Data_Set
Set all data in CAN Data Buffer to given value. e.g. 0 or 0xFF 
Fc9-u8-icon.png - BYTE DataBuffer
 
Fc9-u8-icon.png - BYTE Value
 
Fc9-void-icon.png - VOID Return


Message_Data_Write_SPN

Fc9-comp-macro.png Message_Data_Write_SPN
Write the SPN value to the CAN data buffer 
Fc9-u16-icon.png - UINT SPN
 
Fc9-u16-icon.png - UINT Value
 
Fc9-u8-icon.png - BYTE DataBuffer
 
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


Rx_Message_Check

Fc9-comp-macro.png Rx_Message_Check
If a data message has been received returns the PGN,otherwise 0 
Fc9-u16-icon.png - UINT Return


Rx_Message_Data

Fc9-comp-macro.png Rx_Message_Data
Returns the DLC and data of the last received message 
Fc9-u8-icon.png - BYTE DataBuffer
 
Fc9-u8-icon.png - BYTE Return


Rx_Message_Source

Fc9-comp-macro.png Rx_Message_Source
Returns the Source Address of the last received message 
Fc9-u8-icon.png - BYTE Return


Rx_Transfer_Check

Fc9-comp-macro.png Rx_Transfer_Check
Check for incoming multipart data transfers. If received, returns the PGN else 0 
Fc9-u32-icon.png - ULONG Return


Rx_Transfer_Data

Fc9-comp-macro.png Rx_Transfer_Data
Returns the byte count and data of the transfer message data 
Fc9-u8-icon.png - BYTE DataBuffer
Buffer to receive copied data 
Fc9-u16-icon.png - UINT Size
Size (byte count) of buffer 
Fc9-u16-icon.png - UINT Return


Tx_Message_Send

Fc9-comp-macro.png Tx_Message_Send
Send the prepared CAN message 
Fc9-u16-icon.png - UINT PGN
 
Fc9-u8-icon.png - BYTE DLC
 
Fc9-u8-icon.png - BYTE DataBuffer
 
Fc9-u8-icon.png - BYTE Return


Tx_Transfer_Send

Fc9-comp-macro.png Tx_Transfer_Send
Send a mulitpart data transfer message. Returns number of bytes accepted. Limited by max message size. 
Fc9-u32-icon.png - ULONG PGN
Multipart message program number 
Fc9-u8-icon.png - BYTE Data
Data buffer to send 
Fc9-u16-icon.png - UINT Size
Number of data bytes to send 
Fc9-u16-icon.png - UINT Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png NAME
Fc9-type-16-icon.png Industry Group
 
Fc9-type-16-icon.png Vehicle System Instance
 
Fc9-type-21-icon.png Vehicle System
 
Fc9-type-21-icon.png Function
 
Fc9-type-21-icon.png Function Instance
 
Fc9-type-16-icon.png ECU Instance
 
Fc9-type-21-icon.png Manufacturer Code
 
Fc9-type-21-icon.png Identity Number
 
Fc9-type-21-icon.png Transmit Message Buffer Size
Byte buffer size to allocate for transmitted multipart messages. Maximum is 1785 or available RAM 
Fc9-type-21-icon.png Receive Message Buffer Size
Byte buffer size to allocate for received multipart messages. Maximum is 1785 or available RAM 
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