Supported platforms: CODESYS 2.3, CODESYS 3.5

 

J1939 library description

This internal library contains J1939 protocol related functions.

 

Public functions

CODESYS 2.3CODESYS 2.3

POU

Description

J1939 (FB)

J1939 Main function block, which runs J1939 protocol.

J1939_SPNFMI_Convert (FUN)

Function to convert SPNFMI alarms.

J1939_AddPgn (FUN)

Adds PGN to J1939 on runtime.

J1939_AddRequestPGNCallback (FUN)

Adds a user callback for received request.

J1939_ChangePGNConfiguration (FUN)

Changes PGN source/destination address on runtime.

 

Optional Functionality

 

POU

Description

J1939_BuildPGN (FUN)

Copies data from PGN structure to tx buffer.

J1939_MessageCheckSum (FUN)

Calculates checksum from message data and COB-ID.

J1939_ConstructCobID (FUN)

Constructs COB-ID for given PGN.

J1939_SPNFMI_Convert (FUN)

Function to convert SPN/FMI alarms.

 

 

CODESYS 3.5CODESYS 3.5

POU

Description

J1939 (FB)

J1939 Main function block, which runs J1939 protocol.

 

J1939 FB public methods

 

POU

Description

AddPGN

Add PGNs on runtime. Rx PGNs get also a CANVXD callback for their COB-IDs.

AddRequestPGNCallback

Add callback for received EA00 request.

ChangePGNConfiguration

Change PGN source or destination address (or both) on runtime.

EnableRequestPGNs

This method enables use of RQST PGNs.

 

Optional Functionality

 

POU

Description

J1939_BuildPGN (FUN)

Copies data from PGN structure to tx buffer.

J1939_MessageCheckSum (FUN)

Calculates checksum from message data and COB-ID.

J1939_ConstructCobID (FUN)

Constructs COB-ID for given PGN.

J1939_SPNFMI_Convert (FUN)

Function to convert SPN/FMI alarms.

 

 

Internal functions

CODESYS 2.3CODESYS 2.3

POU

Description

J1939_MessageChecksum (FUN)

Calculates a J1939 PGN message checksum according to the J1939 standard

J1939_ConstructCobID (FUN)

Calculates Cob-ID for PGN

J1939_InitVXD (FUN)

Initializes J1939 to selected CANbus.

J1939_DataTransferHandler (PRG)

Handler for received TP and ETP protocol messages (internal callback)

J1939_ExtractPGN (FUN)

Extract PGN  data, which is received from CANbus, to SPN data buffers

J1939_MonitorMessages (FUN)

Monitors all Rx PGN's data timeouts, handles validity flag (reset)

J1939_RequestPGNHandler (PRG)

Handles received request PGN messages (internal callback)

J1939_ShortMessageHandler (PRG)

Receives short messages from CANbus. (internal callback)

J1939_BuildPGN (FUN)

Build's PGN data to CANbus from the SPN's data of the PGN.

J1939_SendHandler (PRG)

Send handler for J1939 Tx messages.

J1939_SendMultiPacketHandler (PRG)

Send handler for J1939 Tx long(>8 bytes) messages.

J1939_Send_TP_Messages (FUN)

Function sends transport protocol connection management messages and data transfer messages

 

 

Supported message protocols

Protocol

CODESYS 2.3

CODESYS 3.5

Short PGN send

x

x

Short PGN receive

x

x

TP Broadcast send

x

x

TP Broadcast receive

x

x

TP Destination specific send

x

x

TP Destination specific receive

x

x

ETP Destination specific send

x

x

ETP Destination specific receive

 

 

NMEA 2000 Fast-packet send

x

x

NMEA 2000 Fast-packet receive

x

x

 

Dependencies

 

 

 

 

Source file Topic000379.htm

Last updated 13-Jun-2024