Modbus is an application layer messaging protocol that provides
client/server communication between devices connected on different
types of buses or networks.
Modbus has been industry’s serial de facto standard since 1979 and
enables millions of automation devices to communicate. Support for
the simple and elegant structure of Modbus continues to grow.
Modbus is a request/reply protocol and offers services specified by
function codes. Modbus function codes are elements of Modbus
request/reply messages.
This document describes the Modbus configuration options available
in the Passive sonar transmitter.
1.1.1 Passive Sonar Transmitters That Support MODBUS
The following transmitter model numbers will support Modbus
protocol:
•TB8-XX-XX-1X-XX where x can be any alpha-numeric
character. The ‘1’ indicates the transmitter firmware supports
Modbus communications.
1.1.2 Modbus Variants Supported by Transmitter
The passive sonar transmitter supports the following Modbus variants:
Media
•Asynchronous serial transmission over RS-232 or RS-485
Transmission modes, serial settings and other options are available
from the transmitter front panel menu.
A configuration setting is available to swap 32 bit values (for example,
floating point numbers) for compatibility with Modbus masters that
may require it.
20959-01 Rev 02 Page 1-2
1.2 CONFIGURATION SETTINGS
1.2.1 Transmission Modes
• RTU (Default)
• ASCII
1.2.1.1 RTU
In RTU (Remote Terminal Unit) mode, each 8–bit byte in a message
contains two 4–bit hexadecimal characters. The main advantage of
this mode is that its greater character density allows higher data
throughput than ASCII mode for the same baud rate. Each message
must be transmitted in a continuous stream of characters.
The default parity mode in the transmitter is EVEN parity.
1.2.1.2 ASCII
In ASCII (American Standard Code for Information Interchange)
mode, each 8–bit byte in a message is sent as two ASCII characters.
This mode is used when the physical communication link or the
capabilities of the device do not allow conformance with RTU mode
requirements.
Note: This mode is less efficient than RTU since each byte needs two
characters.
Example:
The byte 0X5B is encoded as two characters: 0x35 and 0x42
(0x35 ="5" and 0x42 ="B" in ASCII).
Even parity and no parity also are supported. The default parity mode
in the transmitter is EVEN parity.
20959-01 Rev 02 Page 1-3
1.2.2 Serial Communications Settings
1.2.2.1 Configuration
• RS-232
• RS-485 (Default)
1.2.2.2 Data Bits
• 7 bits
• 8 bits (Default)
The Data Bits setting should match the Transmission Mode as
follows. The ability to set the Data Bits independent of
Transmission Mode is to allow for maximum flexibility.
• RTU 8 Data Bits
• ASCII 7 Data Bits
1.2.2.3 Parity
• EVEN (Default)
• ODD
• NONE
1.2.2.4 Stop Bits
• 1 (Default)
• 2
1.2.2.5 Baud Rate
• 2400
• 9600 (Default)
• 19200
• 38400
• 57600
• 115200
Note: The Modbus specification requires the use of 2 Stop Bits when
No Parity is selected.
20959-01 Rev 02 Page 1-4
1.2.3 MODBUS Options
1.2.3.1 Device Address
Device Address is the address that a Modbus master will use to
communicate with the transmitter.
•Range: 1 – 247 (Default = 1)
1.2.3.2 ASCII Timeout
ASCII Timeout is the amount of time in seconds the transmitter will
wait before processing an ASCII Transmission Mode Modbus
message before a CR/LF termination. This may be increased to allow
for manual entry of an ASCII message on a terminal.
•Range: 1 – 99 Seconds (Default = 4)
20959-01 Rev 02 Page 1-5
1.3 Transmitter Menus
1.3.1 Serial Settings
Only the internal RS-232/RS-485 serial port on the transmitter
supports Modbus.
Figure 1 RS-232 / RS-485 Configuration
Figure 2 Baud Rate
Figure 3 Data Bits
Figure 4 Parity
Figure 5 Stop Bits
20959-01 Rev 02 Page 1-6
1.3.2 Modbus Options
Figure 6 Transmission Mode
Figure 7 Device Address
Figure 8 ASCII Timeout
20959-01 Rev 02 Page 1-7
2 TRANSMITTER MODBUS REGISTER OVERVIEW
2.1 Introduction
The chapter will describe the MODBUS registers available in the
transmitter, and how to read and write them.
Registers are arranged in groups by format (i.e. float, char) to facilitate
reading and writing in blocks, and function (User, Algorithm, Filter
etc.).
Multiple register values (for example, Floating Point values) by default
are arranged to conform to IEEE specifications for Floating Point
numbers. There is an option available through the meter configuration
to swap the two registers for compatibility.
2.2 Making and Saving Changes
In order to change Holding Registers, first write a value of 0x55AA to
Holding Register 4 (the ‘Run Mode’ Register to ‘Write Enabled’).
Changes to any Holding Register(s) can then be made.
In order to validate changes and commit them to FLASH, write a value
of 0xEDF1 (‘Commit Changes’) to the Run Mode register (address 4).
An error will be returned after a Commit if any of the Holding Register
changes are invalid (outside bounds, etc.).
2.3 Passwords
Password functions are available, but by default are disabled. A user
would write their password to the Password Input Holding Register
(Register 0) to set the access level for the session. Sessions timeout
after a configurable number of seconds of no valid reads or writes.
Passwords consist of single register integer values that range from 1
thru 65535 (0xFFFF hex).
All passwords are set to 0, disabling the password feature by default.
Passwords affect Read/Write access to Holding Registers. Input
Registers are always readable.
The three levels of access are:
•Administrator Ability to set any passwords, as well as read or
write Holding Registers
•Level 1 Ability to Read or Write any Holding Registers, as well
as setting Level 1 or Level 2 passwords
•Level 2 Ability to Read Holding Registers, as well as setting
the Level 2 password.
20959-01 Rev 02 Page 2-1
To use all three levels of access, set the Administrator password first,
log in as Administrator, then set Level 1, and then Level 2.
If any password is set to something other than 0, and others are set to
0, then only the non-zero password will function. If a Level 2
password is first set, you will not be able to log in as an Administrator,
but only read holding registers. In some instances this may be a
desirable mode.
20959-01 Rev 02 Page 2-2
2.4 Transmitter MODBUS Supported Function Codes
The transmitter supports these MODBUS Function Codes:
Code Sub Code Function
01 Read Coils
02 Read Discrete Inputs
03 Read holding Registers
04 Read Input Registers
05 Write Single Coil
06 Write Single Registers
07 Read Exception Status (Serial only)
08 Diagnostics (Serial only)
08 00 Return Query Data
08 01 Restart Communications Option
08 02 Return Diagnostic Register
08 03 Change ASCII Input Delimiter
08 04 Force Listen Only Mode
08 10 Clear Counters and Diagnostic Register
08 11 Return Bus Message Count
08 12 Return Bus Communications Error Count
08 13 Return Bus Exception Error Count
08 14 Return Slave Message Count
08 15 Return Slave No Response Count
08 16 Return Slave NAK Count
08 17 Return Slave Busy Count
08 18 Return Bus Character Overrun Count
08 20 Clear Overrun Counter and Flag
11 Get Communications Event Counter (Serial only)
12 Get Communications Event Log (Serial only)
15 Write Multiple Coils
16 Write Multiple Registers
17 Report Slave ID (Serial only)
22 Mask Write register
23 Read/Write Multiple registers
43 14 Read Device Identification
Table 1 Supported Modbus Function Codes
The transmitter does NOT support these MODBUS Function Codes:
Code Sub Code Function
20 Read File Record
21 Write File Record
24 Read FIFO Queue
Table 2 Non-Supported Modbus Function Codes
20959-01 Rev 02 Page 2-3
2.5 Other Registers
Coils and Discreet inputs are not used in the transmitter. All
configurations are performed with Holding Registers, and
measurements read from Input Registers.