Difference between revisions of "Component: J1939 (Misc)"
From Flowcode Help
Jump to navigationJump to search| (2 intermediate revisions by the same user not shown) | |||
| Line 77: | Line 77: | ||
| ''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| Line 85: | Line 91: | ||
| ==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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Get_Address''' | 
| |- | |- | ||
| − | | colspan="2" | Returns the  | + | | colspan="2" | Returns the device (ECU) actual address  | 
| |- | |- | ||
| |- | |- | ||
| − | | 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%" |  | + | | 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  | 
| − | |||
| |- | |- | ||
| − | |||
| |- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
| |} | |} | ||
| − | === | + | ===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;" 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Initialise the CAN network and J1939 protocol  | 
| |- | |- | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| − | | width="90%" |  | + | | width="90%" | Preferred_Address | 
| |- | |- | ||
| − | | colspan="2" |   | + | | colspan="2" | Preferred Address (Requested Address)  | 
| |- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
| |} | |} | ||
| − | === | + | ===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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Clear''' | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Clear the CAN Data Buffer  | 
| |- | |- | ||
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" |  | + | | width="90%" | DataBuffer | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" |   | 
| |- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
| |} | |} | ||
| − | === | + | ===Message_Data_Read_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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Read_SPN''' | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Read the SPN value from the CAN data buffer  | 
| |- | |- | ||
| |- | |- | ||
| − | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%"  | + | | width="90%" | SPN | 
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| |- | |- | ||
| − | |  | + | | colspan="2" |   | 
| − | |||
| |- | |- | ||
| − | |  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| + | | width="90%" | DataBuffer | ||
| |- | |- | ||
| + | | colspan="2" |   | ||
| |- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
| |} | |} | ||
| Line 204: | Line 205: | ||
| − | === | + | ===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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Message_Data_Write_SPN''' | 
| + | |- | ||
| + | | colspan="2" | Write the SPN value to the CAN data buffer  | ||
| |- | |- | ||
| − | |||
| |- | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | SPN | ||
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | colspan="2" |   | 
| − | | width="90%" |  | + | |- | 
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | Value | ||
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" |   | 
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| − | | width="90%" |  | + | | width="90%" | DataBuffer | 
| + | |- | ||
| + | | colspan="2" |   | ||
| + | |- | ||
| + | | 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'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | ===Process=== | ||
| + | {| 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;" | '''Process''' | ||
| + | |- | ||
| + | | colspan="2" | Does the message processing. Call this often.  | ||
| |- | |- | ||
| − | |||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| − | | width="90%" |  | + | | width="90%" | TimeElapsed | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Time elapsed since last call, in mS. Can be zero for frequent calling.  | 
| |- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
| |} | |} | ||
| Line 247: | 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Message_Data''' | 
| + | |- | ||
| + | | colspan="2" | Returns the DLC and data of the last received message  | ||
| + | |- | ||
| |- | |- | ||
| − | |  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| + | | width="90%" | DataBuffer | ||
| |- | |- | ||
| + | | colspan="2" |   | ||
| |- | |- | ||
| | 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 261: | 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Message_Source''' | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Returns the Source Address of the last received message  | 
| |- | |- | ||
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" |  | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
| + | |} | ||
| + | |||
| + | |||
| + | ===Rx_Transfer_Check=== | ||
| + | {| 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;" | '''Rx_Transfer_Check''' | ||
| |- | |- | ||
| − | |  | + | | colspan="2" | Check for incoming multipart data transfers. If received, returns the PGN else 0  | 
| − | |||
| |- | |- | ||
| − | |||
| |- | |- | ||
| − | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| | 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Rx_Transfer_Data''' | 
| |- | |- | ||
| − | | colspan="2" | Returns the  | + | | colspan="2" | Returns the byte count and data of the transfer message data  | 
| |- | |- | ||
| |- | |- | ||
| Line 302: | Line 326: | ||
| | width="90%" | DataBuffer | | width="90%" | DataBuffer | ||
| |- | |- | ||
| − | | colspan="2" |   | + | | colspan="2" | Buffer to receive copied data  | 
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | Size | ||
| + | |- | ||
| + | | colspan="2" | Size (byte count) of buffer  | ||
| |- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
| |} | |} | ||
| Line 338: | 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Tx_Transfer_Send''' | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Send a mulitpart data transfer message. Returns number of bytes accepted. Limited by max message size.  | 
| |- | |- | ||
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | 
| − | | width="90%" |  | + | | width="90%" | PGN | 
| |- | |- | ||
| − | | colspan="2" |   | + | | colspan="2" | Multipart message program number  | 
| |- | |- | ||
| − | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%"  | + | | width="90%" | Data | 
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| |- | |- | ||
| − | |  | + | | colspan="2" | Data buffer to send  | 
| − | |||
| |- | |- | ||
| − | |  | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
| + | | width="90%" | Size | ||
| |- | |- | ||
| + | | colspan="2" | Number of data bytes to send  | ||
| |- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
| |} | |} | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Latest revision as of 13:11, 7 February 2023
| Author | |
| Version | 1.1 | 
| Category | Misc | 
Contents
- 1 J1939 component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 Get_Address
- 5.2 Get_Status
- 5.3 Initialise
- 5.4 Message_Data_Clear
- 5.5 Message_Data_Read_SPN
- 5.6 Message_Data_Set
- 5.7 Message_Data_Write_SPN
- 5.8 Process
- 5.9 Rx_Message_Check
- 5.10 Rx_Message_Data
- 5.11 Rx_Message_Source
- 5.12 Rx_Transfer_Check
- 5.13 Rx_Transfer_Data
- 5.14 Tx_Message_Send
- 5.15 Tx_Transfer_Send
 
- 6 Property reference
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
|   | 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) | |
|  - BYTE | 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 | 
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





