Technical White Paper
Modbus is a serial communications protocol originally published by Modicon (now Schneider Electric) in 1979 for use with its programmable logic controllers (PLCs). Modbus has become a widely adopted de facto standard in the industrial measurement sector and is now the most common protocol for industrial measurement applications. It is implemented in the NRL as a partial implementation of the full Modbus protocol. The Unidata approach to this partial implementation is to provide only two NRL functions
- 1. Function 1 is to extract (get) data from specified registers within a Modbus RTU.
- 2. Function 2 is to place data (put) into a specified register within a Modbus RTU.
When the NRL logging scheme is created, the specific register information and its corresponding encoding and decoding information required for interpretation are defined. There are five ways that this register information can be set up using the NRL logger support software Starlog V4:
- Generic Modbus Instrument scheme, typically for 25 Modbus Channels. The register entries appear as logger Registers on the Neon Server. When the logger next communicates with the Neon Server, it transmits new values typed into the Neon Server Logger Register fields to the logger. Modbus reads and Writes are both supported.
- Large Modbus Builder schemes, typically for 250 Modbus Channels. Modbus writes are not supported at this time, but an arbitrary number (hundreds) of Modbus data channels is supported.
- Starlog V4 MODBUSSLAVE2 instrument. Configures a NRL logger as a Modbus instrument.
- Starlog V4 MODBUSWRITE instrument. Configure NRL to push data to a Modbus instrument.
- Modbus TCP Server, typically for 250 Modbus Channels. The Neon Server provides a Modbus TCP Server (Slave) interface that may be written to directly. Written Register values are transmitted to the logger when it next communicates with the Neon Server. Modbus Read and Writes are both supported.
NRL Modbus Implementation
The NRL Modbus implementation follows the recommendations of the Modbus-IDA specifications (www.modbus.org) for the Basic Implementation of a Modbus Master.
SPECIFICATION AND IMPLEMENTATION GUIDE V1.02 20/12/2006 CHAPTER 5
- Modbus Master – Basic Implementation RTU Transmission Mode
- Baud rate: 1200, 2400, 4800, 9600, 19200 (CDT adjustable)
- Parity: None/Even/Odd (CDT adjustable)
- Data Bits: 7/8 (CDT adjustable)
- Stop Bits: 1/2 (CDT adjustable)
Or if a single spec line is preferred
- Parity / Data / Stop: None or Even or Odd / 7 or 8 / 1 or 2 (CDT adjustable)
- No Line Termination provided
- No Line Polarisation/Biasing required (or provided)
The NRL Basic Modbus implementation will Read Coils, Discrete Inputs and Registers (Functions 01, 02, 03, 04) and Write Coils and Registers (Function codes 05/15, 06/16)
- Request Timeout: 250 ms (CDT adjustable)
- Failed Request – number of retries: 3 (CDT adjustable)
- Frame turnaround delay: 3.5 chars (fixed in driver code)
- Buffer size: 20 bytes (fixed in Modbus code)
- RS-485 3V (meets specs, could be 5V)
1. Using the Generic Modbus Instrument in Starlog V4

RTU Address = Address number of the RTU on the BUS (1..247). Note: Addr = 0 is the broadcast address and is supported by the NRL. Various sampling interval methods are available:
- Log Interval Modbus registers are read at the scheme log interval
- Fixed Interval Modbus registers are read every “n” seconds
- Continuous Modbus registers are read at the scheme Scan interval
- Manual Modbus register reads are triggered by scheme Events
Refresh Rate (Fixed Interval only) is the number of seconds before the next Scheme Log Interval.
This defines the number of seconds between each Modbus interrogation, allowing the RTU readings to be collected and placed into the Logger Channels.
WARNING: The Refresh Rate must be a multiple of the scan rate. For example, if the scan rate is 5 seconds, then the Refresh Rate must be in multiples of 5 seconds; otherwise, NRL MODBUS will not activate.
New Modbus registers are added to the scheme using the “Add” button. The scheme memory limits the number of registers to a total of 70 bytes, providing 35 registers if integers are used or around 15 registers if they are floats, or a mixture of the two.
2. Using the Modbus Builder Instrument in Starlog V4
This option does not allow for Writes; however, it allows for interrogation of an arbitrary number of (hundreds of) Modbus registers by a Starlog V4 scheme. The Modbus Builder Instrument uses a wizard to configure the instrument. A CSV, Comma Separated Variable, text file lists and configures each Modbus register in the scheme. Each line of the CSV file configures an individual Modbus register using the following fields: Description, Tag Name, MODBUS Address, Type, Eng Unit and Read/Write. The meaning of each parameter is as follows.
- Description – A textual description of the Modbus register’s function
- TAG – The exported Modbus register TAG as it appears on the Neon Servers
- Modbus Address – Address number of the RTU on the BUS (1..247)
- Type - Modbus register type. One of {REAL, INT or BOOL}
- Eng Units – The register’s engineering units. E.g. kPa, C°, Volts, etc
- Read/Write - Modbus writes are currently not supported by this instrument

The second wizard screen specifies the Modbus data conversion method to be applied to the received data and the Modbus address mappings for each Modbus function.

The third wizard screen summarises the results of processing the input CSV file. Blank lines and comment lines generate errors that may be ignored.

The fourth wizard screen allows for the inclusion of standard scheme data channels into the Modbus Builder scheme. Ticking each instrument allows those data channels to be logged by the scheme.

The fifth wizard screen lists the Modbus registers that have been included in the scheme. This screen is where the Modbus poll rate (Read Rate) and Modbus address are specified.

Pressing the Finish button causes Starlog V4 to generate the Modbus data channels for use with the scheme.
3. Using Modbus Slave V2 Instrument in Starlog V4

The Modbus slave instrument allows internal channels from the NRL to be read by an external logger/RTU using Modbus protocol, either RS-485 RTU or RS-485 ASCII. These channels can be selected in the instrument, and the start address can be defined. The channels can also be separated if required. This can be useful in situations where a sensor has an SDI-12 interface, but the RTU can only use Modbus, so the logger can be used as a simple translator. The data will be updated according to the scan rate set in the scheme and the frequency at which the instrument’s readings are updated.
Name = Name of the instrument
Description = A textual description of the Modbus register’s function
RTU Address = Address number of the RTU on the BUS (1..247)
Logger Port = The Modbus port of the logger to use
Frame Format = RTU or ASCII
4. Using Modbus Write Instrument in Starlog V4

This instrument allows logger channels to be selected and then be written out to a Modbus slave. Various sampling interval methods are available:
- Log Interval Modbus registers are read at the scheme log interval
- Fixed Interval Modbus registers are read every “n” seconds
- Continuous Modbus registers are read at the scheme Scan interval
- Manual Modbus register reads are triggered by scheme Events.
The slave could potentially be a Modbus-enabled LCD. Channels can be selected in the instrument, and Modbus addresses can be defined manually. The data will be updated according to the scan rate set in the scheme and the frequency at which the instrument’s readings are updated.
RTU Address = Address number of the RTU on the BUS (1..247)
5. Using the Modbus TCP Server Interface
The Neon Server provides a Modbus TCP Server (Slave) interface that may be written to directly by a Modbus Master. E.g. DeltaV
A standard Generic Modbus Instrument scheme must be operating on the NRT. The logger’s Node Type must be set as “Modbus Server” on the Neon Server.

The Neon Server provides a Modbus TCP Server (Slave) interface that can be written to directly by a Modbus Master, such as DeltaV. A standard Generic Modbus Instrument scheme must be operating on the NRL. The logger’s Node Type must be set as “Modbus Server” on the Neon Server.
The Neon Server uses the list of data channels in the logger’s scheme to pass Modbus register information to the Modbus TCP Server interface. When polled by a Modbus Master, the Modbus TCP Server interface immediately returns the last value received from the NRL in the data channel. Data channel values are updated as and when the NRL communicates with the Neon Server according to the NRL’s Communications Frequency.
Modbus Register values written to the Modbus TCP Server interface are transmitted as custom commands to the logger when it next communicates with the Neon Server, according to the NRL’s communications frequency.
Scheme memory limits the number of registers to a total of 70 bytes, providing 35 registers if integers are used or around 15 registers if they are floats, or a mixture of the two.