NSE-5000-013-E - NSE Embedded Protocol Description - Customer Version
NSE-5000-013-E - NSE Embedded Protocol Description - Customer Version
NSE-5000-013-E - NSE Embedded Protocol Description - Customer Version
Product:
NSE-5000-013
PAGES DOCUMENT: 14
REV A – 2017.06.27
- Initial – Replaces document NSE-500105-061 – Protocol Description
REV B – 2017.11.08
- Added Framing Scheme for RS485/UART TTL interface.
- Added Extended CAN ID Header description for CAN interface.
REV C – 2018.07.23
- pC1 - Corrected substitute characters in RS485/UART framing format.
- Removed misleading section header.
- Added CAN/UART Gateway description.
REV D – 2020.01.10
- Added LOG DATA message command/identifier description
REV E – 2021.05.12
- pE1 - Added PERIODIC B (one additional periodic message) message command/identifier
description.
- pE2 - Updated message command/identifier list with NSEE Log related command ids and
oscilloscope data identifier.
- pE3 - Updated message command/identifier list with NSEE internal broadcast id (0x08).
Table of Contents
1 ABBREVIATIONS ........................................................................................................................ 4
2 COMMUNICATION METHODOLOGY .................................................................................. 5
2.1 DATA AND CONTROL REGISTERS ............................................................................................. 5
2.2 COMMUNICATION INTERFACE (CAN, RS-485, TTL-UART) ................................................... 5
2.3 ADDRESSING OF UNITS ............................................................................................................. 5
2.4 PERIODIC STATUS ..................................................................................................................... 5
2.5 NON-VOLATILE/FLASH BASED REGISTERS ............................................................................... 5
3 PROTOCOL DESCRIPTION...................................................................................................... 6
3.1 MESSAGE COMMAND/IDENTIFIER ............................................................................................ 6
3.2 RS485/TTL-UART INTERFACE................................................................................................ 7
3.2.1 Message Format without Framing .................................................................................... 7
3.2.2 Typical Messages without Framing .................................................................................. 7
3.2.3 Message Format with Framing ......................................................................................... 8
3.2.4 Message Examples with Framing ..................................................................................... 9
3.3 CAN INTERFACE..................................................................................................................... 10
3.3.1 Message Format (Base ID, CAN 2.0A) ........................................................................... 10
3.3.2 CAN Header Description (Base ID, CAN 2.0A) ............................................................. 11
3.3.3 CAN Header Description (Extended ID, CAN 2.0B) ...................................................... 12
3.3.4 Typical Messages ............................................................................................................ 13
3.4 CAN/UART GATEWAY .......................................................................................................... 14
3.4.1 CAN/UART relation ........................................................................................................ 14
1 Abbreviations
NSE North Sea Electronics
bps Bit Per Second
CRC Cyclic Redundancy Check
UART Universal Asynchronous Receiver/Transmitter
TTL Transistor-Transistor Logic
CAN Controller Area Network
lsb Least Significant Byte
msb Most Significant Byte
SOF Start-Of-Frame
EOF End-Of-Frame
DLE Data-Link-Escape
DH Downhole
TS Topside
2 Communication Methodology
2.1 Data and Control Registers
The unit can be configured and controlled through several control registers. Measured data are
available through data registers. Each NSE product has its own “Register Description” document.
The address of a unit can be changed by writing to the unit’s ADDRESS register. However, the ADDRESS
register is locked by an additional 4-byte key to protect it from unintentional write operations.
Whenever a write command is issued to the ADDRESS register, this key must also be included in the
command. The key is located at the end of the message. Refer the unit’s “Register description”
document for more information.
3 Protocol Description
3.1 Message Command/Identifier
Standard NSEE protocol
Message/command name Cmd ID Description
Periodic status message 0x01 Periodically generated message containing register data (when in
RS485 configuration these messages will only occur as a response of a
0x28 command).
Read register response 0x02 Message containing requested register data.
Log data message 0x03 Log data message. Implemented to ease readout of log data.
Periodic status message B 0x04 Additional periodic message, if available on device. Periodically
generated message containing register data (when in RS485
configuration these messages will only occur as a response of a 0x28
command).
High res. buffered data 0x07 High resolution buffered data. Only supported by some device
(oscilloscope feature) families.
Internal broadcast 0x08 Broadcast message used for node-node communication. Typically,
used if a node needs to share some status information to other nodes
on the network e.g. output balancing of two DCDCs.
Write register 0x10 Write to addressed register.
Set register bit mask 0x14 Set all bit(s) determined by input bit mask e.g. 0x0001 will set bit 0.
Clear register bit mask 0x15 Clear all bit(s) determined by input bit mask e.g. 0x0001 will clear bit
0.
Write/verify register 0x18 Write to addressed register. Node will issue a read response of
addressed register.
Set bit mask/verify register 0x1C Set all bit(s) determined by input bit mask. Node will issue a read
response of addressed register.
Clear bit mask/verify register 0x1D Clear all bit(s) determined by input bit mask. Node will issue a read
response of addressed register.
Read register 0x20 Read request of addressed register.
Poll periodic messages(RS485 only) 0x28 Poll status registers defined in STATUS CONTROL register.
NSEE Log protocol
Message/command name Cmd ID Description
Trip counter read 0x44 Read request of a trip counter. Only supported by some device
families.
Trend graph read 0x45 Read request of a trend graph. Only supported by some device
families.
Histogram read 0x46 Read request of a histogram. Only supported by some device families.
Trip counter read response 0x64 Read response of a trip counter read request. Only supported by some
device families.
Trend graph read response 0x65 Read response of a trend graph read request. Only supported by some
device families.
Histogram read response 0x66 Read response of a histogram read request. Only supported by some
device families.
Byte 5:(n-2) data Payload data, starting with least significant byte. Data
payload is typically 16 bits (2 bytes) or 32 bits (4 bytes).
In some cases framing the message with SOF/EOF characters can be an advantage. This is typically the
case when data is going via a modem, where a single message can be divided by a time gap. The
protocol is of binary type i.e. any byte value can occur at any time in the data field of a message, thus
an escape character (DLE) is also introduced in the framing scheme. Whenever a data byte which has
the same binary value as SOF/EOF character occurs in the data stream, it is substituted by two
character i.e. DLE character and the SOF/EOF substitute character. Similarly, when a data byte which
has the same binary value as a DLE character is present in the data flow, it also needs to be substituted
in order not to be interpreted as a DLE character by the receiver. By following this framing scheme the
message will only include SOF character in the start of the message and EOF at the end of the message.
Data substitution:
Hex Value Substitute
SOF 0x02 DLE 0x12
EOF 0x03 DLE 0x13
DLE 0x10 DLE 0x10
Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 … Byte Byte Byte Byte n
n-3 n-2 n-1
SOF dest src. length cmd reg. lsb data … msb lsb msb EOF
addr. addr. addr. data data crc crc
Byte location may vary, depending on number of DLE character(s) in the message.
Byte 6:(n-3) data Payload data, starting with least significant byte. Data
payload is typically 16 bits (2 bytes) or 32 bits (4 bytes).
CAN Header can id, rtr, ide, r0, dlc p Part of CAN ID, don’t care
ddddd Part of CAN ID, 5-bits dest. address (address of
receiving node)
sssss Part of CAN ID, 5-bits source address (address of
transmitting node)
r RTR bit
i IDE bit
a R0 bit
llll Data length code (number of bytes of data)
Byte 2:n data Payload data, starting with least significant byte.
CRC/ack/eof crc, ack, eof Cyclic redundancy check, acknowledge and end of
frame bits (most CAN controllers will handle this part
automatically).
Bit 17 Priority (part of CAN id) Don’t care. However setting bit to 1 will lower the
message priority on the CAN bus.
Bit 16:12 Dest. address (part of CAN id) 5-bits destination address field.
Bit 11:7 Src. address (part of CAN id) 5-bits source address field.
Bit 3:0 DLC Data length code. Total number of payload bytes in the
CAN message.
Bit 37:35 Priority (part of CAN id) Don’t care. However, higher values will lower the
message priority on the CAN bus.
Bit 34:27 Message identifier(part of CAN id) Don’t care. However, can be used as an additional
message identifier.
Bit 24:23 Message identifier(part of CAN id) Don’t care. However, can be used as an additional
message identifier.
Bit 22:15 Dest. address (part of CAN id) 8-bits destination address field.
Bit 14:7 Source address (part of CAN id) 8-bits source address field.
Bit 3:0 DLC Data length code. Total number of payload bytes in the
CAN message.
DEST. SRC. REG. PARAM. PARAM. PARAM. PARAM. PARAM. PARAM. CRC CRC
SOF LENGTH CMD EOF
ADDR. ADDR. ADDR. 0 1 2 3 4 5 CCITT-16 CCITT-16
UART MESSAGE
DEST. SRC. REG. PARAM. PARAM. PARAM. PARAM. PARAM. PARAM. CRC CRC
SOF LENGTH CMD EOF
ADDR. ADDR. ADDR. 0 1 2 3 4 5 CCITT-16 CCITT-16
UART MESSAGE
DLC/LENGTH: DLC (data length code) field represents number of data byte in CAN message. LENGTH
byte in UART message represent total number of bytes in UART message, excluding SOF/EOF/DLE
characters.
DESTINATION ADDRESS: To distinguish an extended format CAN message from a base format CAN
message on the UART side, the most significant bit in the DESTINATION ADDRESS byte in the UART
message is used. If this bit is ‘1’, the message originates from an extended CAN message. Similarly, to
make a UART message translate to an extended frame CAN message, the most significant bit in the
DESTINATION ADDRESS byte must be set to ‘1’.
DESTINATION ADDRESS
CAN BASE/
EXTENDED
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
CAN ID 28:15: Extended CAN messages which uses CAN ID 28:15 bits is not supported i.e. these CAN
ID bits will not be visible on the UART side.