Defining CAN and SAE J1939/NMEA 2000

 

Configurations for SAE J1939 communication protocol are done in CAN and J1939 tabs.  

NMEA 2000NMEA 2000 messages are defined in NMEA 2000 tab.

NMEA 2000 is communication protocol for marine industry. It is based on SAE J1939 protocol, but it defines own messages. It contains also own transfer method “NMEA 2000 fast packet” for multi-frame parameter groups. The fast packet transfer is implemented in Epec J1939 library.

MultiTool Creator’s offers possibility to configure NMEA 2000 rx and tx PGNs for Epec control units.

 

This topic describes

 

J1939 General Settings

J1939 general settings are defined in CAN tab's J1939 subtab. Currently it contains only one setting.

 

 

Supported features are product specific depending on the used libraries. In CODESYS 3.5, device description defines the used library.

 

First select the CAN channel from the tabs and then select J1939 subtab.

 

Property

Description

Request Message (PGN 0xEA00) Receiving

Enable J1939 Request Message receiving. Should be enabled if some other device uses Request PGN message to request specific PGN transmission from this unit.

Note! Selection is enabled automatically if Address Claiming is defined to use.  

Max number of request callbacks

The maximum number of request callbacks that are allowed

DM1 producer

Enables DM1 producer (currently active)

Number of DTCs

The maximum number of simultaneousely active Diagnostic Trouble Codes. 

DM2 producer

Enables DM2 producer (history)

DM2 saving to non volatile memory

Enables saving DM2 to non volatile memory

Source

Source address to use for the DM producer

Manual Address

If Source is sent to manual address, this field defines the address.

 

Receive and Transmit J1939 or NMEA 2000 Messages

1. Add a J1939/NMEA 2000 device. To add the J1939/NMEA 2000 device, select  icon on the Network Editor.

 

2. Selecting the created J1939/NMEA 2000 device opens J1939 Device Properties on the left. Give a descriptive name and J1939/NMEA 2000 address for the device.

 

 

If the J1939 device uses Address Claiming protocol double click the J1939 device to open the configuration window. Note that the configuration window is available only if J1939/NMEA 2000 device is connected to a network which contains at least one programmable unit with Address Claiming procol support.

 

3. Add the J1939/NMEA 2000 device into network if not already added.

 

4. Configure the CAN bus

 

Since the J1939 protocol uses extended identifiers (29 bit) in messages, make sure that the device has CAN > Send and Receive > Extended ID Messages property selected for the CAN channel.

CODESYS 3.5 programmable devices always receive both Short and Extended ID messages.

 

5. After the CAN configuration, J1939 PGN messages can be configured to be transmitted or received on the J1939 tab. To add a receive PGN,

 

 

 

 

 

6. NMEA 2000 PGN messages can be configured to be transmitted or received on the NMEA 2000 tab.

 

 

 

User PGN Sets

User list contains the user specified list, directory paths for the list is defined in Settings. Both J1939 and NMEA 2000 have own user PGN sets.

 

To create user PGN sets:

  1. Select messages from Transmit PGN or Receive PGN table (press CTRL to select multiple messages)

  2. Right-click and select Add to PGN Set.

  3. Select a set or give a name for a new set and click OK

  4. For a new PGN Set: MultiTool Creator creates a new PGN file to the default directory given in Settings.

For existing PGN Set: The messages are added to the end of the set.

 

The xml file for a PGN set can also be created manually.

 

It is possible drag-and-drop complete PGN sets from User list to Transmit PGN or Receive PGN table

 

J1939 Message Properties

The J1939 Message Properties are described in the following table:

 

J1939 Message Property

Description

Name

Full name of the PGN.

 

Short Name

Short name of the PGN to be used as an identifier in the PGN list. The short name has to be unique.

 

Cycle Time (ms)

Cycle time can be selected from range 0-65535 ms. Cycle Time 0 ms means that the message is not automatically sent.

When configuring

- a transmit PGN, the cycle time defines the time that must elapse between two consecutive messages.

- a receive PGN, the cycle time defines the monitoring interval for the messages by multiplying the given cycle time by three. For example if the given cycle time is 100 ms, the device waits for 300 ms before giving a time out flag.

 

COB-ID

Shows the whole message ID that contains the given Priority, Data Page, PDU Format, PDU Specific/Destination address.

 

Priority (hex)

Select a priority for the message. Number 0 is the highest priority and 7 the lowest.

 

Data Page

This doubles the number of possible parameter groups that can be represented by the identifier.

 

PDU Format

The PDU Format (PDUF) defines whether the message is transmitted with a destination address or if the message is always transmitted as a broadcast message. The interpretation of the PDU Specific (PDUS) field depends on the PDU Format value. If the PDUF value is

  • <   F0h (0-EFh), the message is addressable (PDU1) and the PDUS field contains the Destination Address (DA)

  • >= F0h (F0-FFh), the message is broadcast (PDU2) and the PDUS field contains a Group Extension (GE)

 

PDU Specific

The interpretation of the PDU Specific (PDUS) field depends on the PDU Format (PDUF) value. If the PDUF value is

  • <   F0h (0-EFh), the message is addressable (PDU1) and the PDUS field contains the Destination Address (DA)

  • >= F0h (F0-FFh), the message is broadcast (PDU2) and the PDUS field contains a Group Extension (GE)

 

Destination

Select the destination of the message from the Destination drop-down list.

In case of a

  • Transmit PGN message, the drop-down list contains J1939 devices that are added to the network and Broadcast address (255).  Entries can be added to the list by adding J1939 devices to the network. The selection in the drop-down list shows the name of the source device and also the address number in parentheses. The device names have to be valid variable names. Duplicates are not allowed.

  • Receive PGN message, the Destination can be selected to be "Manual Address" or one of the Address Claimings defined in Address Claiming page.  In case the "Manual Address" is selected from the drop down list the destination address is defined in Manual Address field (value from 0 to 255). In case the Address Claiming is used the destination address is defined according the Address Claiming Procedure. Note that the destination address is significant only if the message is addressable (see. PDU format field).

Source

Select the source of the message from the Source drop-down list.

In case of a

  • Transmit PGN message, the Source can be selected to be "Manual Address" or one of the Address Claimings defined in Address Claiming page.  In case the "Manual Address" is selected from the drop down list the source address is defined in Manual Address field (value from 0 to 254). In case the Address Claiming is used the source address is defined according the Address Claiming Procedure.

  • Receive PGN message, the Source is selected from the Source drop-down list. The list contains J1939 devices that are added to the network. Entries can be added to the list by adding J1939 devices to the network. The selection in the drop-down list shows the name of the source device and also the address number in parentheses. The device names have to be valid variable names. Duplicates are not allowed.

Manual Address

In case of a

  • Transmit PGN message, select the correct source address according to the J1939 device specification. The field is disabled if the Address Claiming is used.

  • Receive PGN message, select the correct destination address according to the J1939 device specification. The field is disabled if the Address Claiming is used.

Generate SPNs to fill 8 bytes

If selected, dummy variables are created to make the PGN 8 bytes long.

Set unused bits to 1

If selected, all bits of the dummy variables are set to 1. 

Variable Alignment

Variable Alignment diagram indicates if some of the variables are overlapping each other. Adjust the Start Bit or Length if needed to prevent overlapping.

 

 

 

 

NMEA 2000 Message Properties

NMEA 2000 Message Property

Description

Name

Full name of the PGN.

 

Cycle Time (ms)

Cycle time can be selected from range 0-65535 ms. Cycle Time 0 ms means that the message is not automatically sent.

When configuring

- a transmit PGN, the cycle time defines the time that must elapse between two consecutive messages.

- a receive PGN, the cycle time defines the monitoring interval for the messages by multiplying the given cycle time by three. For example if the given cycle time is 100 ms, the device waits for 300 ms before giving a time out flag.

 

COB-ID

Shows the whole message ID that contains the given Priority, Data Page, PDU Format, PDU Specific/Destination address.

 

Priority (hex)

Select a priority for the message. Number 0 is the highest priority and 7 the lowest.

 

Data Page

This doubles the number of possible parameter groups that can be represented by the identifier.

Fast Packet Transfer

NMEA 2000 fast transfer protocol selection.

PDU Format

The PDU Format (PDUF) defines whether the message is transmitted with a destination address or if the message is always transmitted as a broadcast message. The interpretation of the PDU Specific (PDUS) field depends on the PDU Format value. If the PDUF value is

  • <   F0h (0-EFh), the message is addressable (PDU1) and the PDUS field contains the Destination Address (DA)

  • >= F0h (F0-FFh), the message is broadcast (PDU2) and the PDUS field contains a Group Extension (GE)

 

PDU Specific

The interpretation of the PDU Specific (PDUS) field depends on the PDU Format (PDUF) value. If the PDUF value is

  • <   F0h (0-EFh), the message is addressable (PDU1) and the PDUS field contains the Destination Address (DA)

  • >= F0h (F0-FFh), the message is broadcast (PDU2) and the PDUS field contains a Group Extension (GE)

 

Destination

Select the destination of the message from the Destination drop-down list.

In case of a

  • Transmit PGN message, the drop-down list contains J1939 devices that are added to the network and Broadcast address (255).  Entries can be added to the list by adding J1939 devices to the network. The selection in the drop-down list shows the name of the source device and also the address number in parentheses. The device names have to be valid variable names. Duplicates are not allowed.

  • Receive PGN message, the Destination can be selected to be "Manual Address" or one of the Address Claimings defined in Address Claiming page.  In case the "Manual Address" is selected from the drop down list the destination address is defined in Manual Address field (value from 0 to 255). In case the Address Claiming is used the destination address is defined according the Address Claiming Procedure. Note that the destination address is significant only if the message is addressable (see. PDU format field).

Source

Select the source of the message from the Source drop-down list.

In case of a

  • Transmit PGN message, the Source can be selected to be "Manual Address" or one of the Address Claimings defined in Address Claiming page.  In case the "Manual Address" is selected from the drop down list the source address is defined in Manual Address field (value from 0 to 254). In case the Address Claiming is used the source address is defined according the Address Claiming Procedure.

  • Receive PGN message, the Source is selected from the Source drop-down list. The list contains J1939 devices that are added to the network. Entries can be added to the list by adding J1939 devices to the network. The selection in the drop-down list shows the name of the source device and also the address number in parentheses. The device names have to be valid variable names. Duplicates are not allowed.

Manual Address

In case of a

  • Transmit PGN message, select the correct source address according to the J1939 device specification. The field is disabled if the Address Claiming is used.

  • Receive PGN message, select the correct destination address according to the J1939 device specification. The field is disabled if the Address Claiming is used.

Variable Alignment

Variable Alignment diagram indicates if some of the variables are overlapping each other. Adjust the Start Bit or Length if needed to prevent overlapping.

 

 

 

Adding PGN manually

Transmit and Receive PGNs can also be added manually:

  1. Select icon from Transmit PGN section or icon from Receive PGN section

  2. Select the added PGN and define the Message Properties

  3. Add PGN variables by selecting  icon.

 

PGN variable configuration

To add a new variable into a PGN, select the message and select icon. The configurable properties for PGN variables are described in the following table:

 

PGN variable properties

Description

Name

Variable name used in CODESYS with the prefix J1939_

Start Bit

The variable's defined start bit.

Length (bits)

Variable's length in bits.

Data Type

Variable type. The variable type selection depends on the given bit length.

 

 

Removing PGN

To remove a PGN message, select the PGN and press icon or click DELETE.

 

 

 

 

 

Epec Oy reserves all rights for improvements without prior notice.

 

Source file topic200010.htm

Last updated 26-Nov-2024