TM-SP08-0001, Extended Modbus Slave Protocol Specification

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Original media Info class

Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 1(42)
Fördelning/To För kännedom/Copy

PROGRAMVARA – TRL2 - SPEC


Document reviewed: 2010-05-24
Review group: EPc-HK TT-TH

TANKMASTER

Extended Modbus Slave Protocol Specification

This document replace the old document “TANKMASTER Extended Modbus Slave Protocol
Issue 1

Specification” with reg. no WinOpi/SP-98.019.


Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 2(42)

Table of contents
1 DOCUMENT DEFINITION ..............................................................................4
1.1 Identification .......................................................................................................4
1.2 Difference to old protocol ...................................................................................4
1.2.1 Difference in FC02 Registers ..............................................................................4
1.2.2 Difference in FC03 Registers ..............................................................................5
1.2.3 Difference in FC06 and FC16 Registers .............................................................5
1.3 Revision history ..................................................................................................6
2 GENERAL ..........................................................................................................8
2.1 Introduction .........................................................................................................8
2.2 References ...........................................................................................................8
2.3 Definitions ...........................................................................................................9
3 ENVIRONMENT ...............................................................................................10
3.1 System .................................................................................................................10
3.2 Hardware .............................................................................................................10
3.3 Software ..............................................................................................................10
4 PROTOCOL........................................................................................................11
4.1 Introduction .........................................................................................................11
4.2 Message Description ...........................................................................................11
4.3 Slave Address ......................................................................................................11
4.4 Function Code .....................................................................................................11
4.5 Data Field ............................................................................................................12
4.6 CRC-16 ...............................................................................................................12
4.7 Inventory Registers .............................................................................................12
4.8 Tank Order ..........................................................................................................12
4.9 Property Settings .................................................................................................13
4.10 Units ....................................................................................................................14
4.11 Query Limitations ...............................................................................................15
5 FUNCTION CODE 02 READ INPUT STATUS ...............................................17
5.1 Introduction .........................................................................................................17
5.2 Query Format ......................................................................................................17
5.3 Response Format .................................................................................................17
5.4 Register Numbers ................................................................................................18
Issue 1

6 FUNCTION CODE 03 READ HOLDING REGISTER ....................................21


6.1 Introduction .........................................................................................................21
Document template: R:\SME General\PM\RTR PM eng.dot

6.2 Query Format ......................................................................................................21


6.3 Response Format .................................................................................................21
6.4 Register Numbers ................................................................................................22
7 FUNCTION CODE 04 READ INPUT REGISTER ...........................................24
7.1 Introduction .........................................................................................................24
7.2 Query Format ......................................................................................................24
7.3 Response Format .................................................................................................24
7.4 Register Numbers ................................................................................................25

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 3(42)

8 FUNCTION CODE 06 PRESET SINGLE REGISTER .....................................26


8.1 Introduction .........................................................................................................26
8.2 Query Format ......................................................................................................26
8.3 Response Format .................................................................................................26
8.4 Register Numbers ................................................................................................27
8.5 Special Considerations ........................................................................................27
9 FUNCTION CODE 16 PRESET MULTIPLE REGISTER ...............................28
9.1 Introduction .........................................................................................................28
9.2 Query Format ......................................................................................................28
9.3 Response Format .................................................................................................28
9.4 Register Numbers ................................................................................................29
9.5 Special Considerations ........................................................................................29
10 FUNCTION CODE 08 DIAGNOSTIC ..............................................................30
10.1 Introduction .........................................................................................................30
10.2 Query Format ......................................................................................................30
10.3 Response Format .................................................................................................30
10.4 Return Query Data ..............................................................................................31
10.5 Return Diagnostic Register .................................................................................31
11 REGISTER DECODING ....................................................................................32
11.1 Introduction .........................................................................................................32
11.2 Relay Status .........................................................................................................32
11.3 Level Alarm Status ..............................................................................................33
11.4 Temp Alarm Status (similar for FWL, VP and LP) ............................................33
11.5 System Redundancy Status .................................................................................33
11.6 Set-Point Alarm Status ........................................................................................34
11.7 Servo Command Status .......................................................................................34
12 ERROR HANDLING .........................................................................................35
12.1 Error Detection ....................................................................................................35
12.2 Exception Codes..................................................................................................37
13 EXAMPLE ..........................................................................................................38
13.1 Introduction .........................................................................................................38
13.2 Read input status with FC02 ...............................................................................38
13.3 Read holding registers with FC03 .......................................................................39
13.4 Read input registers with FC04 ...........................................................................40
13.5 Write single register with FC06 ..........................................................................41
Issue 1

13.6 Write multiple registers with FC16 .....................................................................42


Document template: R:\SME General\PM\RTR PM eng.dot

APPENDIX A Printer Report Function Reg. Nr: WinOpi/SP98019A

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 4(42)

1 DOCUMENT DEFINITION

1.1 Identification
This document specifies the protocol for communication between a HOST computer and
TankMaster Modbus Slave Protocol Server, using the Modbus standard protocol defined in
document Modicon Modbus Protocol Reference Guide.

This document replace the old document “TANKMASTER Extended Modbus Slave Protocol
Specification” with reg. no WinOpi/SP-98.019.
It also replace TRL/2-95.110 that described the protocol between a HOST computer and TRL/2 OPI
for OS/2.
Document TRL/2-95.110 was tested with Honeywell TDC 3000 via EPLC Gateway.
See chapter below for differences between the new and old protocol.

1.2 Difference to old protocol


The following register was supported in the old protocol and will not be supported in the
TankMaster Modbus protocol.

1.2.1 Difference in FC02 Registers

Removed registers
Address (hex) Parameter Address (hex) Parameter
1E00 - 1EFF Current input 1 status 5100 – 51FF Current input 2 L alarm status
1F00 - 1FFF Current input 2 status 5200 – 52FF Current Input 2 Blocked
2700 – 27FF Frequency input 3 status 5300 – 53FF Current Input 2 Disconnect
2800 – 28FF Frequency input 2 status 5400 – 54FF Current input 3 H alarm status
2900 – 29FF Frequency input 1 status 5500 – 55FF Current input 3 L alarm status
Issue 1

2F00 - 2FFF Digital input status 5600 – 56FF Current Input 3 Blocked
4C00 – 4CFF Current input 1 H alarm 5700 – 57FF Current Input 3 Disconnect
status
Document template: R:\SME General\PM\RTR PM eng.dot

4D00 – 4DFF Current input 1 L alarm status 5800 – 58FF Current input 4 H alarm status
4E00 - 4EFF Current Input 1 Blocked 5900 – 59FF Current input 4 L alarm status
4F00 - 4FFF Current Input 1 Disconnect 5A00 – 5AFF Current Input 4 Blocked
5000 – 50FF Current input 2 H alarm 5B00 - 5BFF Current Input 4 Disconnect
status

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 5(42)

1.2.2 Difference in FC03 Registers

Removed registers
Address (hex) Parameter Address (hex) Parameter
0200 – 02FF RTG Status 2800 – 28FF Frequency input 2
1A00 – 1AFF Temp block status 2900 – 29FF Frequency input 1
1B00 - 1BFF Temp error status 2C00 – 2CFF Digital input status
1D00 – 1DFF Current status 4200 – 42FF Current input 1 alarm status
1E00 - 1EFF Current input 1 4300 – 43FF Current input 2 alarm status
1F00 - 1FFF Current input 2 4400 – 44FF Current input 3 alarm status
2700 – 27FF Frequency input 3 4500 – 45FF Current input 4 alarm status

1.2.3 Difference in FC06 and FC16 Registers

Removed registers
Address (hex) Parameter
1E00 - 1EFF Current input 1
1F00 - 1FFF Current input 2

Added registers
Address (hex) Parameter
0400 – 04FF Level
1C00 – 1CFF Average Temperature
2300 – 23FF Sediment & Water
2400 – 24FF Free Water Level
2500 – 25FF Pressure Liquid
2600 – 26FF Pressure Vapor
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 6(42)

1.3 Revision history


Issue Date / Issued by Modifications
0a 1998-11-06 / GU-HK Review issue. Removed frequency inputs from old document
TRL/2 OPI Extended Modbus Host Protocol with reg. no TRL/2-
95.110 and added some examples and new information.
0b 1998-12-02 / GU-HK Updated after review 1998-11-19
New chapter 1.2 Difference to old protocol added.
Chapter 11.2 RTG Statue removed.
Chapter 11.3 Temperature in liquid removed.
Chapter 11.4 Temperature Status Blocked removed.
Chapter 11.5 Temperature Status Error removed.
Chapter 11.6 Current Status removed.
Chapter 11.7 Digital Input Status removed.
Chapter 11.11 Current Sensor Alarm Status removed.
Chapter 13.3 Example with RTG Status removed.
1 1998-12-02 / GU-HK First Issue. Review group: GU-SJ GST GSP
1a 2000-02-15 / GU-EE-P New registers for FC6 and FC16 added: 0400-04FF (Level) and
1C00-1CFF (Avg Temp).
Chapter “Query Limitations” added.
1b 2000-02-17 / GU-HK Changed chapter 4.10 Units (Sediment and Water as double
word)
Changed chapter 4.11 Query Limitations
Updated chapter 5.4 Register Number changed Parameter text for
Leak alarm to Level Leak alarm
2 2000-02-21 / GU-HK Second Issue.
Review group: GU-HK GU-SJ GSP-MN
3 2000-10-30 / GU-HK Changed chapter
4.11 Query Limitations
Added chapter 10.4 Diagnostic sub function 0 and chapter 10.5
Diagnostic sub function 2
Review group: GU-HK GU-SJ GSS-MR
Issue 1

4 2002-05-16 / GU-HK Added Appendix A with Printer Report functionality.


Changed: Chapter 4.10 Units Added density units.
Review group: GU-SS, GU-HK, GST-OE
Document template: R:\SME General\PM\RTR PM eng.dot

5 2004-09-21 / GU-HK Added Hart input to FC02 and FC03.


The value in FC03 equal to (tank value / 10000). The value can
be presented as signed with 4 decimals in the host.
6 2007-05-10 /GU-AB-P Servo command status support was added for FC02, FC03.
Implemented in TM 4.H1 build5.

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 7(42)

7 2007-12-28 / ESs-AB-R New code for servo command status C (motor limit) was added.
The code for “unknown” status was changed to 100 (before it
was 5).
Implemented in TM 4.H1 build7.
8 2008-01-28 / TT-TH Register old WinOpi/SP-98.019 doc as TM document.
9 2010-05-24 / EPc-HK Added Roof Tilt as FC02 and FC03 register.
Added Redundancy status as FC03 register, CR20445.
Added WIV as FC03 and FC04 register, CR20381
Added Set-Point alarm as FC02 and FC03 register, CR20383.
Review group: EPc-HK, TT-TH
10 2012-08-07 / ESs-AB-R Product support added for FC02 and FC03
11 2015-11-10 / ESs-AB-R FWL, VP, LP alarm statuses were added for FC02 and FC03
12 2017-08-07 / ESs-PK-R Vapor Temperature added for FC02, FC03, FC06 and FC16
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 8(42)

2 GENERAL

2.1 Introduction
The communication between the HOST and the TankMaster is done on a standard RS-232C serial
link. The transmission mode is RTU, which means that all transferred data will be in binary. The
HOST computer will be the MASTER in the communication and requests data from the
TankMaster. TankMaster will be the SLAVE in the communication.
In RTU mode messages includes an error-checking field that is based on a CRC method. The CRC
field is two bytes and is added to the end of each message.

When a sensor failure or communication failure has occurred, then the value is unchanged.
The HOST must ask for sensor status.
E.g. if status for the level is set to error or to no response the value isn't changed.

2.2 References
1. Modicon Modbus Protocol Reference Guide, Modicon Inc. PI-MBUS-300 Rev. G
2. The Modbus Protocol applied to the TRL2 Communication TRL2-89.28 Issue 2
Systems
3 TRL/2 OPI Extended Modbus Host Protocol TRL/2-95.110 Issue 2
4 TankMaster Functional Specification WinOpi/SP-97.002 Issue 1
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 9(42)

2.3 Definitions
EPLCG Enhanced Programmic Logic Computer Gateway ( Honeywell TDC 3000
gateway )
HOST Host Computer
TankMaster Tank interface programs, on a PC with Windows NT
RTU Remote Terminal Unit
CRC Cyclic Redundancy Check
DC Diagnostic Code
TRL2 TankRadar L/2
TRL2 Units DAU, FCU, OPI, RTG
FCU Field Connection Unit
RTG Radar Tank Gauge
DAU Data Acquisition Unit
Register Signed or unsigned word (2 byte).
Word Unsigned word, same size as a register (2 byte).
Unsigned word 16 bit unsigned integer (2 byte).
Signed word 16 bit signed integer (2 byte).
Unsigned double 32 bit unsigned integer (4 byte).
word
Signed double 32 bit signed integer (4 byte).
word
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 10(42)

3 ENVIRONMENT

3.1 System

TankMaster

HOST RS-232C link COM 2 Modbus Slave


Computer Protocol Server

COM 3 COM 1

Other bus

TRL/2 bus

Other Units
TRL/2 Units

3.2 Hardware
Hardware Description
PC All TankMaster programs should run on the IBM PC and compatible
computers with Intel or compatible processors.
Hardware key (Dongle) A hardware key is connected to the TankMaster PC to enable functions,
which is not free of charge.
1. Slave protocol option must be enabled in the key.
Issue 1

2. Volume calculation option must be enabled in the key to enable


the volume and inventory registers in this protocol.
RS-232 port It might be required to have more than one (1) RS-232 port. Each
Document template: R:\SME General\PM\RTR PM eng.dot

protocol channel requires one serial port.


See ref[4] for more info on hardware requirements.

3.3 Software
See ref[4].

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 11(42)

4 PROTOCOL

4.1 Introduction
The communication between the HOST and the TankMaster will use a half-duplex link protocol. It
is a master / slave protocol where the TankMaster is the slave.
When the slave receives the query from the master it will process the query, when the query is
processed the slave will send the response to the master.

4.2 Message Description


The general format of a message packet:

Byte no. Content


1 Slave address
2 Function code
3 First byte of data field.

n Last byte of data field.
n+1 CRC (high byte)
n+2 CRC (low byte)

4.3 Slave Address


The slave address in the message is an address in the range 0 to 247 decimal.
All Modbus slave has a unique address and will only process messages with it’s own address or
broadcast messages with address zero (0).
TankMaster Slave Protocol Server will not process broadcast messages.
Issue 1

4.4 Function Code


Document template: R:\SME General\PM\RTR PM eng.dot

The function code in the message defines what actions are to be performed or what data is to be
transmitted. There are a number of different Modbus function codes, each one assigned to a specific
function. Only function codes 02, 03, 04, 06, 08 and 16 are supported. The rest of the functions will
be answered by exception code 1 (see page 37 below).

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 12(42)

4.5 Data Field


Contains query information from HOST to TankMaster or response data from TankMaster in
response to the query from HOST.

4.6 CRC-16
Contains the CRC-16 word, the high order byte is sent first. The high order byte is defined as the
MSB of the CRC calculation but is the lower part of the CRC-16 word (see page 35 below).

4.7 Inventory Registers


The registers that involve inventory calculations are only accessible if the “Inventory” option in the
hardware key is enabled. If not the “Inventory” option is enabled the TankMaster will send
exception code 2 (Illegal data address) as response to the host on questions for inventory registers.
All inventory registers are marked with * in the chapters below.

If the “WinView” option is enabled in the hardware key then the following inventory registers are
accessible (even if the “Inventory” option is disabled): Total Observed Volume, Weight in Vacuum
(mass) and Set-Point Alarms.

4.8 Tank Order


The tank positions in the protocol are configured in the mapping table for the slave protocol.
The configuration of the mapping table is done with help of the Set-Up program for TankMaster.
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 13(42)

4.9 Property Settings


The protocol supports the following property settings.
These properties can be changed with help of the Set-Up program for TankMaster.

Property Value range Default Description


Modbus address 1 – 247 1 TankMaster will only process queries with
the configured address.
Baudrate 1200, 2400, 4800, 4800
9600, 14400, 19200
Databits 8 8 Fixed for Modbus RTU.
Stopbits 1, 2 1
Parity None, Odd or Even Even
Handshake None, RTS/CTS, None
DTR/DSR,
RTS/CTS/DTR/DSR
Com port COM1 – COM8 COM2 Communication port on PC.
Maximum > 0 ms 800 ms If the query took more than X ms to process
response time then TankMaster will not send the response.
Query to > 0 ms 10 ms TankMaster will delay the response with X
response delay ms.
Query interval. > 0 ms 100 ms Subtract 100 ms from the interval that the
HOST will send queries.
Read query > 0 ms 400 ms Used to set the total read timeout for the
timeout communication device.
The time TankMaster will wait for a message
to receive. If no message has received within
this time a timeout will occur and the
TankMaster will try again after
approximately 30 ms if no other task must be
processed e.g. change of configuration.
Write response > 0 ms 400 ms Used to set total write timeout for the
Issue 1

timeout communication device.


The time TankMaster will wait for the CTS
signal. If not the CTS are set within this time
Document template: R:\SME General\PM\RTR PM eng.dot

timeout will occur and the TankMaster will


discard the response message.

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 14(42)

4.10 Units
The units of the supported protocol parameters are as shown in the table below.

Unit Unit of the response value Description


m 1/10 mm Level as signed double word.
m mm Level and Ullage as unsigned word.
FWL and Roof Tilt as signed word.
feet inch inch/16 1/256 inch Level as signed double word.
feet inch inch/16 1/16 inch Level and ullage as unsigned word.
m/h 1/100 m/h Level rate as signed word.
f/h 1/10 f/h Level rate as signed word.
°C 1/10 °C Temperature as signed word.
°F 1/10 °F Temperature as signed word.
m³ litre Volume in signed double word.
bbls 1/100 bbls Volume in signed double word.
gal (US) 1/10 gal (US) Volume in signed double word.
ton kg Weight in signed double word.
kg kg Weight in signed double word.
lb lb (pound) Weight in signed double word.
% 10 −3 Sediment & Water as signed word.
% 10 −5 Sediment & Water as signed double word.
[VCF] 10 −4 VCF as unsigned word (FC03)
or as signed word (FC06).
[VCF] 10 −5 VCF as signed double word.
kg/m³ 1/10 kg/m³ Density as signed double word (FC04)
or as signed word (FC06).
°API 1/10 °API Density as signed double word (FC04)
or as signed word (FC06).
60/60 °F 1/10000 60/60 °F Density as signed double word (FC04)
(Relative density) or as signed word (FC06).
Issue 1

lb/gal (US) 1/1000 lb/gal (US) Density as signed double word (FC04) or as
(Pound/gallon(US)) signed word (FC06).
m³/h 1/10 m³/h Flow rate as signed double word.
Document template: R:\SME General\PM\RTR PM eng.dot

bbls/h bbls/h Flow rate as signed double word.


gal/h gal/h Flow rate as signed double word.
bar 1/1000 bar Pressure as signed word (FC03 and FC06)
or as signed double word (FC04).
psi 1/100 psi Pressure as signed word (FC03 and FC06)
or as signed double word (FC04).

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 15(42)

4.11 Query Limitations

1. If the HOST query for registers that not correspond to mapped tanks the system will respond
with exception 2 (illegal data address).

2. If the HOST query for registers and some of them correspond to mapped tanks and some of
them do not then the system will return zero (0) values for the registers that not correspond to
any tanks except for query FC02. Returned bit values for query FC02 registers not
corresponding to any tanks will be one (1) to indicate alarm or invalid data.

3. If FC03 or FC04 query requests registers corresponding to a parameter that have double word
format then first register number must be even. Number of queried registers must also be even
in this case.

4. Query FC06 and FC16 must specify registers corresponding to a mapped tank.

5. Queries with register range that crosses parameter boundary (e.g. queries with register range
3FE – 401) are not supported. Such queries will be answered with exception 2 (illegal data
address).

6. All queries for parameters sent to the server the first 5 seconds after start up will be return with
exception 6 (slave device busy). It is possible to monitor the server status with help of FC08
queries to determine when it is ready (see FC08 chapter for more information).

7. The first query for a parameter will return zero value (except for FC02 that will return value
one), even if the value is not actually zero. Subsequent queries (approx. 5 seconds after the first
query) will return valid data. The HOST can use the FC02 query to check if the data is valid.
The most common parameters are preloaded during start up to reduce the above delay.
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 16(42)

The following table provides some examples (it is assumed that tank mapping table contains 3
entries):
Register
Function ModbusSlave Response Comments
range
FC02 404 – 410
Exception 2 (illegal data No queried registers correspond to
FC03 404 – 410
address) mapped tanks
FC04 406 – 410
FC02 402 – 406 Correct status bit for register 402
, 1 bits for registers 403 – 406
and 0 bits for 407- 409.
FC03 400 – 406 Level for 3 tanks(register 400 -
Only a part of queried registers
402) and zero values for
correspond to mapped tanks.
registers 403 – 406
FC04 404 – 407 GSV for the 3rd tank (registers
404, 405) and zero values for
registers 406 and 407
FC03 1–2 The parameter has double word
FC04 1–2 format. First register number must
be even.
Exception 2
FC03 2–4 The parameter has double word
FC04 2–4 format. Number of queried
registers must be even.
FC06 410 The register 410 doesn’t
Exception 2
correspond to a mapped tank.
FC16 402 – 406 All registers in FC16 must
Exception 2
correspond to mapped tanks.
FC02 3FE – 401
Register range crosses parameter
FC03 3FE – 401 Exception 2
boundary
FC04 3FE – 401
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 17(42)

5 FUNCTION CODE 02 READ INPUT STATUS

5.1 Introduction
The response data will be packed and the requested parameters are represented with one bit each.
The first bit in the low order byte in the response contains the addressed parameter, and the
remainder follows. For requested quantities that are not even multiples of eight, the last character
will be filled in with zeros at high order end.

Sensor data: a '0' means valid data, a '1' means invalid data.
Alarm data: a '0' means normal, a '1' means alarm.
See example chapter below.

5.2 Query Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (2)
3 Start address (high byte).
4 Start address (low byte).
5 Number of registers to read (high byte).
6 Number of registers to read (low byte).
7 CRC (high byte)
8 CRC (low byte)

5.3 Response Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (2)
Issue 1

3 Byte count (n -3)


4 First data byte
Document template: R:\SME General\PM\RTR PM eng.dot


n Last data byte
n+1 CRC (high byte)
n+2 CRC (low byte)

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 18(42)

5.4 Register Numbers


The register number listed below, are the register number as contained in the query.
Add 10001 decimal or 2711 in hex to get the reference format of the register.

Register Address Parameter Description


(hex)
0000 - 00FF TOV status *
0100 - 01FF NSV status *
0200 - 02FF Spare
0300 - 03FF Level Rate status
0400 - 04FF Level status
0500 - 05FF Ullage status
0600 - 06FF Analog input 1 status
0700 - 07FF Analog input 2 status
0800 - 08FF TOV status *
0900 - 0DFF Spare
0E00 - 0EFF NSV status *
0F00 - 0FFF Spare
1000 - 1BFF Spare
1C00 - 1CFF Temp avg. status
1D00 – 1DFF Roof Tilt status ** 0 = OK, 1 = Disabled or bad value
1E00 – 1EFF Roof Tilt H alarm
1F00 – 1FFF Roof Tilt L alarm
2000 – 23FF Spare
2400 – 24FF FWL status 0 = OK, 1 = Disabled or bad value
2500 – 25FF Pressure Liquid status 0 = OK, 1 = Disabled or bad value
2600 – 26FF Pressure Vapor status 0 = OK, 1 = Disabled or bad value
2700 – 27FF Product 0 = OK, 1 = Disabled or bad value
2800 – 2AFF Spare
2B00 - 2BFF Relay 1 status
2C00 - 2CFF Relay 2 status
Issue 1

2D00 - 2DFF Relay 3 status


2E00 - 2EFF Relay 4 status
Document template: R:\SME General\PM\RTR PM eng.dot

2F00 – 2FFF Vapor temperature status


3000 – 30FF Vapor temperature H alarm
3100 – 31FF Vapor temperature L alarm
3200 – 32FF Vapor temperature Blocked 0 = Not blocked, 1 = Blocked
3300 – 33FF Vapor temperature Disconnected 0 = Connected, 1 = Disconnected
3400 – 37FF Spare
3800 – 38FF Hart Input 1 status
3900 – 39FF Spare

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 19(42)

3A00 – 3AFF Hart Input 2 status


3B00 – 3BFF Spare
3C00 – 3CFF Hart Input 3 status
3D00 – 3DFF Spare
3E00 – 3EFF Hart Input 4 status
3F00 – 3FFF Spare
4000 - 40FF Level HH alarm
4100 - 41FF Level H alarm
4200 - 42FF Level L alarm
4300 - 43FF Level LL alarm
4400 - 44FF Level Blocked 0 = Not blocked, 1 = Blocked
4500 - 45FF Level Disconnect 0 = Connect, 1 = Disconnect
4600 - 46FF Level Leak alarm
4700 - 47FF Level Leak alarm 0 = Disable, 1 = Enable
4800 - 48FF Temp avg. H alarm
4900 - 49FF Temp avg. L alarm
4A00 - 4AFF Temp avg. Blocked 0 = Not blocked, 1 = Blocked
4B00 - 4BFF Temp avg. Disconnect 0 = Connect, 1 = Disconnect
4C00 - 4CFF Some servo command is 0 = Empty, 1 = Not empty
performed. Servo command
status is not empty.
4D00 - 4DFF Level Set-Point HH alarm *
4E00 - 4EFF Level Set-Point H alarm *
4F00 - 4FFF Level Set-Point L alarm *
5000 - 50FF Level Set-Point LL alarm *
5100 - 51FF Level Set-Point status * 0 = OK, 1 = Disabled or bad value
5200 - 52FF Level Set-Point Disconnect * 0 = Connect, 1 = Disconnect
5300 - 53FF Volume Set-Point HH alarm *
5400 - 54FF Volume Set-Point H alarm *
5500 - 55FF Volume Set-Point L alarm *
5600 - 56FF Volume Set-Point LL alarm *
5700 - 57FF Volume Set-Point status * 0 = OK, 1 = Disabled or bad value
5800 - 58FF Volume Set-Point Disconnect * 0 = Connect, 1 = Disconnect
Issue 1

5900 - 59FF Weight Set-Point HH alarm *


5A00 - 5AFF Weight Set-Point H alarm *
5B00 - 5BFF Weight Set-Point L alarm *
Document template: R:\SME General\PM\RTR PM eng.dot

5C00 - 5CFF Weight Set-Point LL alarm *


5D00 - 5DFF Weight Set-Point status * 0 = OK, 1 = Disabled or bad value
5E00 - 5EFF Weight Set-Point Disconnect * 0 = Connect, 1 = Disconnect

* See chapter Inventory Registers on page 12.

** Function that require specific hardware key option.

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 20(42)
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 21(42)

6 FUNCTION CODE 03 READ HOLDING REGISTER

6.1 Introduction
The requested parameters below are represented with one or two registers.

6.2 Query Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (3)
3 Start address (high byte).
4 Start address (low byte).
5 Number of registers to read (high byte).
6 Number of registers to read (low byte).
7 CRC (high byte)
8 CRC (low byte)

6.3 Response Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (3)
3 Byte count (n -3)
4 First register data (high byte).
First register data (low byte).


Last register data (high byte).
Issue 1

n Last register data (low byte).


n+1 CRC (high byte)
n+2 CRC (low byte)
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 22(42)

6.4 Register Numbers


The register number listed below, are the register number as contained in the query.
Add 40001 decimal or 9C41 in hex to get the reference format of the register.
Register number Parameter Description
(hex)
0000 – 01FF Level Signed double word.
0200 – 02FF Spare
0300 – 03FF Level Rate Signed word.
0400 – 04FF Level Unsigned word.
0500 – 05FF Ullage Unsigned word.
0600 – 06FF Analog input 1 Signed word.
0700 – 07FF Analog input 2 Signed word.
0800 – 09FF Total Observed Volume See page 32 for value decoding alt. 4. *
0A00 - 0BFF Gross Observed Volume See page 32 for value decoding alt. 4. *
0C00 – 0DFF Gross Standard Volume See page 32 for value decoding alt. 4. *
0E00 - 0FFF Net Standard Volume See page 32 for value decoding alt. 4. *
1000 – 11FF Weight In Air See page 32 for value decoding alt. 4. *
1200 – 13FF Pumpable Volume See page 32 for value decoding alt. 4. *
1400 – 15FF Available Room See page 32 for value decoding alt. 4. *
1600 – 17FF Free Water Volume See page 32 for value decoding alt. 4. *
1800 – 19FF Flow Rate See page 32 for value decoding alt. 4. *
1A00 – 1BFF Weight In Vacuum See page 32 for value decoding alt. 4. *
1C00 – 1CFF Average temperature Signed word.
1D00 – 1DFF Roof Tilt Signed word. **
1E00 – 1EFF System redundancy status See page 33 for decoding info. **
1F00 – 1FFF Vapor temperature Signed word.
2000 – 20FF Volume Correction Factor Unsigned word. *
2100 – 21FF Reference Density Signed word. *
2200 – 22FF Observed Density Signed word. *
2300 – 23FF Sediment & Water Signed word. *
2400 – 24FF Free Water Level Signed word.
2500 – 25FF Pressure Liquid Signed word.
2600 – 26FF Pressure Vapor Signed word.
Issue 1

2700 – 27FF Product (index in product table) Signed word


2800 – 28FF Vapor temperature alarm status See page 33 for decoding info.
Document template: R:\SME General\PM\RTR PM eng.dot

2900 – 2AFF Spare


2B00 – 2BFF Relay status See page 32 for decoding info.
2C00 – 2CFF FWL status See page 33 for decoding info.
2D00 – 2DFF Pressure Liquid status See page 33 for decoding info.
2E00 – 2EFF Pressure Vapor status See page 33 for decoding info.
2F00 – 37FF Spare
3800 – 39FF Hart Input 1 Signed double word. (tank value/10000)
3A00 – 3BFF Hart Input 2 Signed double word. (tank value/10000)

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 23(42)

3C00 – 3DFF Hart Input 3 Signed double word. (tank value/10000)


3E00 – 3FFF Hart Input 4 Signed double word. (tank value/10000)
4000 – 40FF Level alarm status See page 33 for decoding info.
4100 – 41FF Average temp alarm status See page 33 for decoding info.
4200 – 42FF Level Set-Point alarm status See page 34 for decoding info. *
4300 – 43FF Volume Set-Point alarm status See page 34 for decoding info. *
4400 – 44FF Weight Set-Point alarm status See page 34 for decoding info. *
4500 – 4BFF Spare
4C00 – 4CFF Servo command status See page 34 for decoding info.

* See chapter Inventory Registers on page 12.

** Function that require specific hardware key option.


Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 24(42)

7 FUNCTION CODE 04 READ INPUT REGISTER

7.1 Introduction
Each value in the response is divided into two registers for maximum resolution.

7.2 Query Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (4)
3 Start address (high byte).
4 Start address (low byte).
5 Number of registers to read (high byte).
6 Number of registers to read (low byte).
7 CRC (high byte)
8 CRC (low byte)

7.3 Response Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (4)
3 Byte count (n -3)
4 First register data (high byte).
First register data (low byte).


Last register data (high byte).
Issue 1

n Last register data (low byte).


n+1 CRC (high byte)
n+2 CRC (low byte)
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 25(42)

7.4 Register Numbers


The register number listed below, are the register number as contained in the query.
Add 30001 decimal or 7531 in hex to get the reference format of the register.

Register number Parameter Description


(hex)
0000 – 01FF Total Observed Volume See page 32 for value decoding alt. 4. *
0200 – 03FF Gross Observed Volume See page 32 for value decoding alt. 4. *
0400 – 05FF Gross Standard Volume See page 32 for value decoding alt. 4. *
0600 – 07FF Net Standard Volume See page 32 for value decoding alt. 4. *
0800 – 09FF Weight In Air See page 32 for value decoding alt. 4. *
0A00 – 0BFF Pumpable Volume See page 32 for value decoding alt. 4. *
0C00 – 0DFF Available Room See page 32 for value decoding alt. 4. *
0E00 – 0FFF Free Water Volume See page 32 for value decoding alt. 4. *
1000 – 11FF Volume Correction Factor See page 32 for value decoding alt. 4. *
1200 – 13FF Reference Density See page 32 for value decoding alt. 4. *
1400 – 15FF Observed Density See page 32 for value decoding alt. 4. *
1600 – 17FF Sediment & Water See page 32 for value decoding alt. 4. *
1800 – 19FF Flow Rate See page 32 for value decoding alt. 4. *
1A00 – 1BFF Free Water Level See page 32 for value decoding alt. 4.
1C00 – 1DFF Liquid Pressure See page 32 for value decoding alt. 4.
1E00 – 1FFF Vapor Pressure See page 32 for value decoding alt. 4.
2000 – 21FF Weight in Vacuum See page 32 for value decoding alt. 4. *
2200 – 26FF Spare
2700 – 270F Reserved
• See chapter Volume Registers on page 12.
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 26(42)

8 FUNCTION CODE 06 PRESET SINGLE REGISTER

8.1 Introduction
This function is used to set a single data value for a tank in the TankMaster.

8.2 Query Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (6)
3 Data register address (high byte).
4 Data register address (low byte).
5 Data value (high byte).
6 Data value (low byte).
7 CRC (high byte)
8 CRC (low byte)

8.3 Response Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (6)
3 Data register address (high byte).
4 Data register address (low byte).
5 Data value (high byte).
6 Data value (low byte).
7 CRC (high byte)
8 CRC (low byte)
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 27(42)

8.4 Register Numbers


The register number listed below, are the register number as contained in the query.
Add 40001 decimal or 9C41 in hex to get the reference format of the register.

Register number Parameter Description


(hex)
0000 – 03FF Reserved
0400 – 04FF Level Signed word.
0500 – 05FF Reserved
0600 – 06FF Analog input 1 Signed word.
0700 – 07FF Analog input 2 Signed word.
0800 – 19FF Reserved
1A00 – 1BFF Reserved
1C00 – 1CFF Average Temperature Signed word.
1D00 – 1DFF Vapor Temperature Signed word.
1E00 – 1FFF Reserved
2000 – 20FF Volume Correction Factor Signed word. *
2100 – 21FF Reference Density Signed word. *
2200 – 22FF Reserved
2300 – 23FF Sediment & Water Signed word. *
2400 – 24FF Free Water Level Signed word.
2500 – 25FF Pressure Liquid Signed word.
2600 – 26FF Pressure Vapour Signed word.

* See chapter Volume Registers on page 12.

8.5 Special Considerations


These registers are considered as manual entered when executed and are also stored on disk. They
can only be updated with a new write or by the operator. The register value will remain as a manual
Issue 1

value until it is set back to automatic by the operator of TankMaster.


Note that VCF is entered as 10 −4 see difference with FC04.
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 28(42)

9 FUNCTION CODE 16 PRESET MULTIPLE REGISTER

9.1 Introduction
This function is used to set a multiple data values for tanks in the TankMaster.

9.2 Query Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (1016)
3 Start address (high byte).
4 Start address (low byte).
5 Number of registers to write (00) (high byte).
6 Number of registers to write (01 <= n <=7D16) (low byte).
7 Byte count ( 02 <= n-7 <= F716)
8 First data register value (high byte).
9 First data register value (low byte).

Last data register value (high byte).


n Last data register value (low byte).
n+1 CRC (high byte)
n+2 CRC (low byte)

9.3 Response Format


Byte no. Content
1 Slave address (01-F716)
Issue 1

2 Function code (1016)


3 Start address (high byte).
4 Start address (low byte).
Document template: R:\SME General\PM\RTR PM eng.dot

5 Number of registers (high byte).


6 Number of registers (low byte).
7 CRC (high byte)
8 CRC (low byte)

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 29(42)

9.4 Register Numbers


The same as for FC6 see chapter Register Numbers.

9.5 Special Considerations


The same as for FC6 see chapter Special Considerations.
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 30(42)

10 FUNCTION CODE 08 DIAGNOSTIC

10.1 Introduction
Only sub function 0 and 2 will be answered. Exception code 7 will be returned for all other sub
functions.

10.2 Query Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (8)
3 Sub function (high byte).
4 Sub function (low byte).
5 Data (high byte).
6 Data (low byte).
7 CRC (high byte)
8 CRC (low byte)

10.3 Response Format


Byte no. Content
1 Slave address (01-F716)
2 Function code (8)
3 Sub function (high byte).
4 Sub function (low byte).
5 Data (high byte).
6 Data (low byte).
7 CRC (high byte)
Issue 1

8 CRC (low byte)


Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 31(42)

10.4 Return Query Data


The diagnostic sub function return query data (loop back test) (sub function 00 00) returns the data
in the query unchanged to the HOST. This is a useful method to confirm correct communication.

10.5 Return Diagnostic Register


The diagnostic sub function return diagnostic register (sub function 00 02) returns the server
diagnostic register value according to the table below.

Returned data Server status


(diagnostic register)
value
0 Normal
1 Start up phase
2 Configuration error, no tanks in mapping table.
3 OPC communication failure with TankServer (one or more if network)
4 Out of memory (the server cannot allocate more memory.)
5 Other Errors
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 32(42)

11 REGISTER DECODING

11.1 Introduction
There are four alternatives of value representation:

Representation Alt. Bits Min value Max value


Unsigned single word 1 16 0 65535
Signed single word 2 16 –32768 32767
Signed double word. 3 32 –2147483648 2147483647
The first register contains the high word and the
second register contains the low word.
Each value is divided into two registers. 4 32 –2147483648 2147483647
The first register contains the value modulo 10000
and the second register contains the value divided
by 10000.
Unsigned double word. 5 32 0 4294967295
The first register contains the high word and the
second register contains the low word.

11.2 Relay Status


If the device does not answer then TankMaster will set the status =4Fxx16.
Bit # Value Description
0 1 Relay 1 on
1 1 Relay 1 off
2 1 Relay 2 on
3 1 Relay 2 off
4 1 Relay 3 on
5 1 Relay 3 off
Issue 1

6 1 Relay 4 on
7 1 Relay 4 off
8 1 Relay 1 failure
Document template: R:\SME General\PM\RTR PM eng.dot

9 1 Relay 2 failure
10 1 Relay 3 failure
11 1 Relay 4 failure
12 Not used
13 Not used
14 1 Sets if the device does not answer.
15 Not used

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 33(42)

11.3 Level Alarm Status


Status Value Description
0 Normal
1 Not used
2 L alarm
3 H alarm
4 L leak alarm
5 H leak alarm
6 LL alarm
7 HH alarm
8 Blocked
9 Sensor error
10 Communication failure
11 Disconnect

11.4 Temp Alarm Status (similar for FWL, VP and LP)


Status Value Description
0 Normal
2 L alarm
3 H alarm
4 Blocked
5 Sensor error
10 Communication failure
11 Disconnect

11.5 System Redundancy Status


Status Value Description
Issue 1

0 Redundancy not supported


1 Primary is active and Backup is running
Document template: R:\SME General\PM\RTR PM eng.dot

2 Backup is active and Primary is running


3 Primary is active and Backup is not running
4 Backup is active and Primary is not running
5 Reserved
6 Reserved
7 Redundancy not configured

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 34(42)

11.6 Set-Point Alarm Status


Status Value Description
0 Normal
1 Not used
2 L alarm
3 H alarm
4 Not used
5 Not used
6 LL alarm
7 HH alarm
8 Not used
9 Invalid value or Sensor error
10 Communication failure
11 Set-Point alarm function not enabled (Disconnect).

11.7 Servo Command Status


Status Value Description
0 No servo command in operation
1 W (water level)
2 T (test)
3 P (park)
4 F (freeze)
5 C (Motor limit switch)
100 Other “unknown” servo command in operation
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 35(42)

12 ERROR HANDLING

12.1 Error Detection


The CRC-16 error check sequence is implemented as follows:
The data bits (disregarding start/stop and parity bits) in the message is considered as one continuous
binary number, the most significant bit (MSB) is transmitted first. The message is pre multiplied by
x**16 (shifted left 16 steps), then divided by x**16 + x**15 + x**2 + 1 expressed as a binary
number (11000000000000101). The integer quotient digits are ignored and the 16-bit remainder
(initialized to all ones at the start to avoid the case of all zeroes being an accepted message) is
appended to the message (MSB first) as the two CRC check bytes.

The resulting message including CRC, when divided by the same polynomial at the receiver will
give a zero remainder if no errors have occurred. The receiving unit recalculates the CRC and
compares it to the transmitted CRC. All arithmetic is performed modulo two (no carry).
An example of the CRC-16 error check is found in the Modicon Modbus Protocol reference guide.
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 36(42)

Example for Intel's PL/M 86 compiler.


Input:
BUF - Pointer to message buffer.
BYTE_NUM - Number of bytes in message (exclusive CRC bytes)
Declarations:
BUF_IDX word,
IDX byte,
FLAG byte,
CRC word;
Code:
CRC = 65535;
BUF_IDX = 0; /* Pointer in message */
do while BYTE_NUM > 0;
CRC = CRC xor BUF(BUF_IDX); /* Update CRC */
do IDX = 0 to 7;
FLAG = CRC AND 1; /* Save shift flag */
CRC = shr(CRC, 1); /* Shift one bit right */
if FLAG then /* If flag is one */
CRC = CRC xor 0A00116; /* Update CRC register */
end;
BYTE_NUM = BYTE_NUM - 1;
BUF_IDX = BUF_IDX + 1;
end;
return CRC;

When you append the CRC-16 check word to the message do it as follows:
Declarations:
MESSAGE (LENGHT) BYTE;
Code:
MESSAGE(LENGHT-2) = BYTE(CRC AND 0FF16); /* Low order */
MESSAGE(LENGHT-1) = BYTE(shr(CRC,8)); /* High order */
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 37(42)

12.2 Exception Codes


If TankMaster detects an operation error the response will be an exception code.
The Exception response from TankMaster to HOST has the following format:
Byte no. Description
1 Slave address
2 Function code (8016 + received function code)
3 Exception code (01-07), see below
4 High byte of CRC-16
5 Low byte of CRC-16

Exception code Description


1 Illegal function
TankMaster detects a function code that it does not support.
2 Illegal data address
The request address is higher then the end address.
3 Illegal data value
The data is greater then number of values in the system.
4 Slave Device Failure
Error in TankMaster.
5 Acknowledge.
The slave has accepted a command that will take time to process
6 Slave Device Busy.
TankMaster is busy and reject the message.
7 Negative Acknowledge.
Issued in response to a command that cannot be executed

If not all of the requested memory addresses are valid, only the valid words are returned.
If no address is valid, exception code 2 is returned.
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 38(42)

13 EXAMPLE

13.1 Introduction
Below is an example of how the request from the HOST and the response from TankMaster will
look like.

13.2 Read input status with FC02


Request for level status for 5 tanks:
Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 02 Function code
3 04 Start address (high byte).
4 00 Start address, ask for register 40016 (low byte).
5 00 Number of registers (high byte).
6 05 Number of registers, ask for 5 status data (low byte).
7 BE CRC (high byte)
8 6A CRC (low byte)

The response from TankMaster:


Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 02 Function code
3 01 Number of bytes in response
4 0C Level status data
5 AA CRC (high byte)
6 09 CRC (low byte)

The status will be decoded as:


Issue 1

Bit no. Bit Value Description


0 0 First value OK
1 0 Second value OK
Document template: R:\SME General\PM\RTR PM eng.dot

2 1 3:rd value not OK


3 1 4:th value not OK
4 0 5:th value OK
5 0 Not used.
6 0 Not used.
7 0 Not used.

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 39(42)

13.3 Read holding registers with FC03


Request for 5 levels:
Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 03 Function code
3 04 Start address (high byte).
4 00 Start address, ask for register 40016 (low byte).
5 00 Number of registers (high byte)
6 05 Number of register, ask for 5 registers (low byte).
7 83 CRC (high byte)
8 AA CRC (low byte)

Response from TankMaster:


Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 03 Function code
3 0A Number of bytes in response (2*5 bytes)
4 03 First level data (high byte)
5 E8 First level data (3E816 = 1000 mm) (low byte)
6 07 Second level data (high byte)
7 D0 Second level data (7D016 = 2000 mm) (low byte)
8 0B 3:d level data (high byte)
9 B8 3:d level data (BB816 = 3000 mm) (low byte)
10 0F 4:th level data (high byte)
11 A0 4:th level data (FA016 = 4000 mm) (low byte)
12 13 5:th level data (high byte)
13 88 5:th level data (128816 = 5000 mm) (low byte)
14 3F CRC (high byte)
15 35 CRC (low byte)
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 40(42)

13.4 Read input registers with FC04


Request Net Standard Volume for 2 tanks:
Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 04 Function code
3 06 Start address (high byte).
4 00 Start address, register 40016 (low byte)
5 00 Number of registers (high byte)
6 04 Number of register, ask for 4 registers (low byte).
7 F6 CRC (high byte)
8 12 CRC (low byte)

Response from TankMaster:


Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 04 Function code
3 08 Byte count (4*2 data bytes)
4 10 First tanks first register high byte (100E hex = 4110 dec.).
5 0E First tanks first register low byte.
6 00 First tanks second register high byte (00BD hex = 189 dec.).
7 BD First tanks second register low byte.
First tanks NSV data 1894110 = (189 * 10000) + 4110 liters.
8 23 Second tanks first register high byte (23B4 hex = 9140 dec.).
9 B4 Second tanks first register low byte.
10 00 Second tanks second register high byte (0013 hex = 19 dec.).
11 13 Second tanks second register low byte.
Second tanks NSV data 199140 = (19 * 10000) + 9140 liters.
12 08 CRC (high byte)
13 31 CRC (low byte)
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 41(42)

13.5 Write single register with FC06


TankMaster values can be updated by function code 06.
Request to store VCF for one tank.
Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 06 Function code
3 20 Register address (high byte).
4 00 Register address (register 200016) (low byte)
5 26 Register data value (high byte)
6 94 Register data value( set value to 0.9876) (low byte)
7 9E CRC (high byte)
8 96 CRC (low byte)

The response from TankMaster:


Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 06 Function code
3 20 Register address (high byte)
4 00 Register address (low byte)
5 26 Register data value (high byte).
6 94 Register data value (0.9876) (low byte).
7 9E CRC (high byte)
8 96 CRC (low byte)
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc
Original media Info class
Electronic I
Document type
Specifikation/Specification
Approved by Reg. No.
EPc-HK TM-SP08-0001
Issued by Date Issue Page
EPc-HK Håkan Kjellström 2017-07-13 12 42(42)

13.6 Write multiple registers with FC16


TankMaster values can be updated by function code 1016.
Request to store VCF for two tanks.
Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 10 Function code
3 20 Start address (high byte).
4 00 Start address (register 200016) (low byte)
5 00 Number of registers (high byte)
6 02 Number of registers (low byte)
7 04 Byte count (2*2 data bytes)
8 23 First register data (high byte)
9 10 First register data(e.g. 0.8976) (low byte)
10 22 Second register data (high byte)
11 C4 Second register data(e.g. 0.8900) (low byte)
12 DD CRC (high byte)
13 98 CRC (low byte)

The response from TankMaster:


Byte no. Byte Value (hex) Description
1 22 TankMaster address
2 10 Function code
3 20 Start address (high byte)
4 00 Start address (register 200016) (low byte)
5 00 Number of registers (high byte)
6 02 Number of registers (low byte)
7 4D CRC (high byte)
8 5B CRC (low byte)
Issue 1
Document template: R:\SME General\PM\RTR PM eng.dot

Stored at Rosemount Tank Radar AB


L:\TankMaster\Doc\SP08\TM-SP08-0001.doc

You might also like