This document explains how to follow a network address (NAD) on the NMEA2000 CAN bus.
One of the secondary CAN bus protocols that can be set on a Master LV
, Master HV
, SmartLink Connect
or SmartLink MX
is NMEA2000
.
NMEA2000
is a plug-and-play communication standard that transmits its data over CAN bus. It is often used in the marine sector for sensors, displays and other compatible devices. All devices on this bus must have an unique network address (NAD)
to identify them self.
To avoid that multiple devices have the same NAD
, an Address Claim procedure must be executed for each device.
Before a device is allowed to join the NMEA2000 CAN bus and send messages, it must have a NAD
. To get and claim one, an ACL-message must be send by this device first.
This message contains some device specific information together with the NAD
it wants to claim:
PGN: ISO Address Claim, 060928 (0xEE00)
Name | Bits | Value |
---|---|---|
Unique Number (ISO Identity Number) | 21 | Unique number subtracted from serial number |
Manufacturer Code | 11 | 1160 (MG Energy Systems B.V.) |
Device Instance Lower (ISO ECU Instance) | 3 | 0 (Can be changed by user) |
Device Instance Upper (ISO Function Instance) | 5 | 0 (Can be changed by user) |
Device Function (ISO Function) | 8 | 170 (Function battery) |
NMEA Reserved | 1 | - |
Device Class | 7 | 35 (Class electrical generation) |
System Instance (ISO Device Class Instance) | 4 | 0 (ISO Function Instance) |
Industry Group | 3 | 4 (Industry marine) |
NMEA Reserved (ISO Self Configurable) | 1 | 1 |
Example message: (MG SmartLink MX with NAD 0x50)
CAN-ID | Data |
---|---|
0x18EEFF50 | 0xAE 0x00 0x10 0x91 0x00 0xAA 0x46 0xC0 |
Once such a message is transmitted by a new device and there is no conflict with this NAD
, the device will official claim it after 250ms. After that, the device is allowed to transmit its data onto the bus.
But if another device already has claimed this NAD
, they need to find out which device is allowed to have it; the device with the highest priority device name will get the NAD
. The device that lost this conflict needs to send an ACL-message again with this time another NAD
.
In some situations, it might be required to listen to a specific device. This can be done by keeping track of the NAD of this specific device.
Below a example how to do this.
Device MG(NAD: 0x50) = MG SmartLink MX
Device X (NAD: 0x20) = The device that needs to track Device MG and read its data.
If Device X joins the CAN bus, it first needs to discover all available devices and there NAD's. This can be achieved in 2 different way's:
ACL-Request from Device X to Device MG will look like this:
CAN-ID | Data |
---|---|
0x18EA5020 | 0x00 0xEE 0x00 |
Device MG will transmit its ACL once it has received this request. a ACL is always broadcasted:
CAN-ID | Data |
---|---|
0x18EEFF50 | 0xAE 0x00 0x10 0x91 0x00 0xAA 0x46 0xC0 |
Now that Device X is (probably) aware of the NAD of Device MG, it needs to know its device type (Master LV, Master HV or SmartLink MX).
Therefor the following VeREG-request(0x0001) for product-ID(0x0100) can be used:
CAN-ID | Data |
---|---|
0x1CEF5020 | 0x66 0x99 0x01 0x00 0x00 0x01 0xFF 0xFF |
Device MG will answer this request with its device information as broadcast:
CAN-ID | Data |
---|---|
0x1CEFFF50 | 0x66 0x99 0x00 0x01 0x00 0xE0 0xB0 0xFF |
Only after receiving this information, it is confirmed that NAD: 0x50 belongs to Device MG.
If there are multiple devices available with the same
Product ID
, an extra filter can be added in Step 1 to separate them by theirDevice Instance
orUnique Number
.
If all devices on the bus have claimed their NAD and Device MG was found with the steps above, then it safe to read all the data.
The available data for each device can be found in the Communication Guide
:
It sometimes happens that device NAD's change in a running system. This can be caused by multiple events:
Example:
If Device New wants to claim NAD 0x50, and it wins, then Device MG needs to claim another NAD by sending an ACL-message again:
ACL-message of Device New
CAN-ID | Data |
---|---|
0x18EEFF50 | 0x0C 0x00 0x04 0x91 0x00 0xAA 0x46 0xC0 |
Then Device MG needs to claim another NAD:
CAN-ID | Data |
---|---|
0x18EEFF51 | 0xAE 0x00 0x10 0x91 0x00 0xAA 0x46 0xC0 |
If the conflict has been solved after 250ms(the time it needs to officialy claim the NAD), Device X needs to do Step 2 again to verify if this is still Device MG