Skip to content

Poll guide ​

Every screen and step in this guide was checked in the v1.3.4 (Windows) Release build.

In Poll mode the PC acts as the Modbus master: it connects to a device, reads its registers on a schedule, converts the values to engineering units, and writes new settings. This chapter uses a simulated "boiler controller" and goes from adding a device all the way to reading and writing, conversions, several Slave IDs and saving the project.

If you have not made your first connection yet, start with Getting started 5. First connection.

Contents ​

SectionTopic
1Setting up the practice environment: simulate a device with Slave
2A tour of the window: toolbar, status bar, device list, register table
3Adding a device and connection settings
4Defining the registers to read: function areas, Slave IDs, adding and deleting
5Names, formats and engineering values (scaling, value maps)
6Reading: auto poll and manual reads
7Writing
8Quality and errors: reading Quality and Timeout
9Several devices
10Communication log
11Saving the project and exporting devices

1. Setting up the practice environment ​

You need two windows: one runs Slave to simulate the device, the other runs Poll to read and write it.

Downloads:

The simulated device listens on 127.0.0.1:502, Slave ID 1, and holds:

Function areaAddressNameFormatValue
03 Holding Registers0x0000Temperature (0.1 °C)Signed253
0x0001Setpoint (0.1 °C)Unsigned300
0x0002Mode (0 stop, 1 auto, 2 manual)Unsigned1
0x0003Alarm bitsHex0x0005
0x0010–0x0011VoltageFloat AB CD230.5
0x0012–0x0013Energy (0.01 kWh)Long AB CD123456
01 Coils0x0000Pump—1
0x0001Fan—0

Steps:

  1. Open the first window, switch to Slave, open 07-boiler-slave.mbslave with File → Open Project..., and click Listen.
  2. Open a second window (it starts in Poll). To practise from scratch, follow sections 3–7 with the default Device 1. To just see the result, open 07-boiler-poll.mbproj with File → Open Project... and click Connect.

File → Open Project... only lists projects for the current mode: .mbproj in Poll, .mbslave in Slave. File → Open Recent switches mode by itself based on the file extension.


2. A tour of the window ​

The window after opening 07-boiler-poll.mbproj and connecting:

Poll connected and polling

Toolbar ​

ButtonWhat it does
Connect / DisconnectConnects or disconnects the device selected on the left. Polling starts by itself once connected
Auto Poll / StopStarts or stops auto polling for the selected device. Stopping does not disconnect
every N msPoll interval for the selected device, 20–600000 ms, default 1000 ms
Read F5Reads the checked rows now
Write F6Writes the checked rows; with nothing checked, writes the rows whose value you changed
RevertDiscards changes not yet written
N modifiedNumber of rows changed but not yet written (orange)
Apply formatChanges the format of the checked rows in one go (see section 5)

Status bar ​

The status bar under the toolbar shows the state of the selected device:

ItemMeaning
Offline / Connected / Polling / No responseNot connected / connected but not polling / polling / the device is not answering
1 connected of 1 device(s) · every 1 sHow many devices are connected, out of how many; the interval is added while polling
Sent NRequests sent
Errors NFailed requests (timeouts, exception responses)
Response N msTime of the latest response
Link N%Success rate of the latest requests
Last updateWhen data last arrived

Device list (DEVICES) ​

Devices are grouped by connection address, as in Slave's list: each group starts with the address (for example TCP 127.0.0.1:502, a green dot while connected, grey while not), followed by the devices using that address, each with its name and Slave ID. The state on the right of a device:

StateMeaning
Offline (grey)Not connected
Connected (blue)Connected, no read results yet
Online (green)All recent reads succeeded
N% ok (orange / red)Some recent reads failed (orange) or all of them did (red)

Header buttons: ⚙ edits the selected device, + adds one, - deletes one. Filter devices below filters by name or address. Press F2 on a selected device to rename it.

Register table ​

ColumnMeaning
☐Check box. Read, Write, Revert, Apply format and delete all work on the checked rows. The ☐ in the header checks or clears all
Monitor★ means auto poll reads this row, ☆ means it does not. Click the Monitor header to toggle all
AddressThe address. View → Hexadecimal address switches between hex and decimal
Name / DescriptionThe name; double-click to edit
FormatThe raw format. A trailing · RO means read-only; Signed → Float AB CD means another format is used to decode before conversion
RawThe raw value decoded with Format. Double-click to edit (see section 7)
Eng. ValueThe converted engineering value (see section 5)
QualityRead quality (see section 8)

Above the table are the function-area tabs (for example 03 Holding Registers 6, the number is the row count) and the Slave ID tabs. The search box filters by address or name, and Monitored only shows just the ★ rows. Under the table, Showing 6 of 6 · Monitored 8 · 0x0000-0x0013 gives the rows shown, the total rows, how many ★ the whole device has, and the address range shown.


3. Adding a device and connection settings ​

Click + next to DEVICES (or Device → Add Device):

Add device

FieldMeaning
NameThe device name
ModeModbus TCP or Modbus RTU
Slave IDThe first Slave ID, 0–255. More can be added later in the Slave ID tabs
TCP IP / TCP PortThe device's IPv4 address (for example 192.168.1.10; host names such as localhost are not accepted) and port
COM Port / Baud / Data bits / Parity / Stop bitsSerial settings (RTU); they must match the device
TimeoutHow long to wait for a reply
RetriesHow many times to retry when there is no reply

The window is pre-filled with the selected device's connection settings and first Slave ID (Boiler's 127.0.0.1:502 in the screenshot). Click OK as is and the new device becomes another watch list for the same equipment, sharing its connection (see section 9). To add a different piece of equipment, change the IP and port (or COM port) to that equipment's.

After OK:

  • If the new device's address is already connected (a device on that address is online), the new device joins that connection by itself.
  • If that address has no connection right now (all its devices offline, or a new address), the new device stays offline and does not connect on its own; click Connect when you need it.

A new device has an empty register table, and polling starts only once you add registers (see section 4). Until then a connected device shows a blue Connected.

To change an existing device, select it and click ⚙, or double-click its card (Device → Edit Device...). A connected device only lets you change its name; Disconnect first to change connection settings.

Practice: use the default Device 1 (127.0.0.1:502). Click ⚙ and rename it to Boiler.


4. Defining the registers to read ​

Function areas ​

TabFunction codesContentsWritable
01 CoilsRead FC01, write FC05 / FC15Coils (0 / 1)Yes
02 Discrete InputsRead FC02Discrete inputs (0 / 1)No
03 Holding RegistersRead FC03, write FC06 / FC16Holding registers (16-bit)Yes
04 Input RegistersRead FC04Input registers (16-bit)No

A new device only has 03 Holding Registers. To add another area use Device → Add Function Area..., pick the area and click OK. To remove a tab you do not need, right-click it → Close; its rows stay in the project and come back when you add that area again. At least one area must remain.

Adding registers ​

Click + Add register:

Add registers

FieldMeaning
AddressStart address. 0x means hex, anything else is decimal. The default is the address after the table's last row
(hint)Monitors wire address 20: the address actually sent (decimal)
QuantityHow many consecutive rows to add. Up to 125 for registers, 2000 for coils and discrete inputs

New rows default to Signed (Unsigned for coils and discrete inputs), ★ auto poll, and no name. The address here is the address in the frame: it starts at 0 and is not reduced by 1. When a device manual uses addresses like 40001 (counted from 1, with an area prefix), convert them yourself, to 0x0000 in that case.

To delete, check the rows and click - Delete register, then confirm.

Practice:

  1. The default device's 03 Holding Registers already has 0x0000–0x0009. Check 0x0004–0x0009 and delete them, then add 0x0010 with Quantity 4.
  2. Add 01 Coils with Device → Add Function Area..., then add 0x0000 with Quantity 2.

Slave ID tabs ​

One device can read several Slave IDs, for example a TCP gateway with several RTU devices behind it. Each Slave ID tab has its own register table.

ActionHow
Add a Slave IDClick + at the right end of the tabs, type the ID (0–255) and click Add
Change a Slave IDRight-click the tab → Set Slave ID...
Delete a Slave IDClick × on the tab and confirm; that ID's rows are deleted with it

Add Slave ID

Auto poll reads the ★ rows in every Slave ID tab and every function area; Read F5 reads only the checked rows in the current tab.


5. Names, formats and engineering values ​

Name ​

Double-click the Name / Description column and type.

Engineering settings ​

Click a row's Format or Eng. Value column to open the Engineering window. The raw value currently read is shown at the top right (Not read yet if it has not been read).

Engineering: scale

POINT

FieldMeaning
NameThe name
AccessRead / Write (RW), Read only (RO), Write only (WO). Read-only rows cannot be written; write-only rows are never read, including by auto poll. Discrete Inputs and Input Registers are always read-only
Raw formatThe raw value's format, see the table below
Write FCThe function code for writes: Auto (06 / 16), FC06 single register, FC16 multiple registers (05 / 15 for coils)

Raw format:

FormatSizeMeaning
Signed, Unsigned1 registerSigned (-32768 to 32767), unsigned (0 to 65535)
Hex, Binary1 registerShown in hexadecimal or binary
Long AB CD / CD AB / BA DC / DC BA2 registers32-bit integer, four byte orders
Float AB CD / CD AB / BA DC / DC BA2 registers32-bit float, four byte orders
Double AB CD EF GH and others4 registers64-bit float, four byte orders

Coils and discrete inputs only offer Unsigned, Hex and Binary. Take the byte order from the device manual. If the manual does not say, read a value you know and try the orders until it shows correctly; see Script examples 6.

CONVERSION decides how Eng. Value is shown.

ModeMeaning
No conversionShows the decoded value as is
ScaleEng = value × factor + offset unit. For example × 0.1 + 0 °C shows 253 as 25.3 °C. The factor cannot be 0
Value mapMaps numbers to text, for example 0 → Stop, 1 → Auto. Values not in the table show Unknown

Decode as is the format used to decode before conversion, usually the same as Raw format. The green box at the bottom is a preview: Current value: 253 → 25.3 °C. If a setting is wrong the box turns red with the reason, and OK is disabled.

Engineering: value map

In a value map, + Add row adds a row and Remove row removes the selected one. Each Value must be a whole number and must not repeat.

Engineering values are for display only. To write, type the raw value in the Raw column: to set the setpoint to 35.0 °C, type 350 in Raw.

Practice: set the rows up as below.

AddressNameRaw formatAccessConversion
0x0000TemperatureSignedROScale × 0.1, °C
0x0001SetpointUnsignedRWScale × 0.1, °C
0x0002ModeUnsignedRWValue map: 0 Stop, 1 Auto, 2 Manual
0x0003Alarm bitsHexRONo conversion
0x0010VoltageFloat AB CDRONo conversion
0x0012EnergyLong AB CDROScale × 0.01, kWh
Coils 0x0000, 0x0001Pump, FanUnsignedRWValue map: 0 Off, 1 On

Once 0x0010 is a Float it takes 0x0010–0x0011, so delete the now-redundant 0x0011 row; the same goes for 0x0013.

Changing several rows at once: Apply format ​

Check several rows and click Apply format:

Apply format

Each item is applied only when it is checked; unchecked settings stay as they are. The drop-downs start at the first checked row's current settings.

  • Format changes Raw format (checked by default). Rows whose Decode as matched their Raw format get Decode as changed too.
  • Engineering changes Decode as.
  • Access changes the access mode.

For example, to make a few rows read-only: uncheck Format, check Access and pick Read only (RO). With nothing checked, OK is disabled.


6. Reading: auto poll and manual reads ​

Auto poll ​

Once Connect succeeds, polling starts by itself and the status bar shows Polling. Auto poll:

  • Reads the ★ rows in every Slave ID tab and every function area of the device.
  • Merges neighbouring addresses into one request. In the practice project, the holding registers become two FC03 requests, 0x0000–0x0003 and 0x0010–0x0013, and the coils one FC01 request.
  • Uses the toolbar's every N ms interval, set per device and saved in the project.
  • Skips write-only (WO) rows.

Stop stops polling but keeps the connection, and the state becomes Connected; Auto Poll resumes. With no ★ rows at all, Auto Poll says No monitored points. Click ★ to include points in Auto Poll.

Fewer ★ rows, and addresses closer together, mean fewer requests per round. On a slow RTU device, mark only the points you need to watch live and read the rest by hand when needed.

Manual reads ​

Check the rows to read and click Read F5 (or press F5) to read them once. A manual read covers only the checked rows in the current function area and current Slave ID tab, and works while polling too.

When the mouse is over a row, two small buttons appear on the right: ↓ reads just that row, ↑ writes just that row.


7. Writing ​

  1. Double-click the Raw column, type the new value and press Enter.
  2. The row turns orange, Quality shows Changed, EDIT appears after Eng. Value, and the toolbar shows 1 modified. Nothing has been sent yet.
  3. Click Write F6 (or the ↑ on the right of the row) to send it.

Value changed, not yet written

After the write, 0x0001 in the Slave window becomes 350, and Writes in its status bar goes up by 1:

Slave received the write

RuleDetails
Input formatType values to match Raw format: negative numbers for Signed, 0x1234 for Hex, 230.5 for Float. Coils and discrete inputs take 0 or 1
Invalid valuesNot kept; a note says Not written: "..." is not valid. and gives the accepted range
Editing while pollingChanged values not yet written are not overwritten by poll results
Write F6With rows checked, writes the checked rows (changed or not); with nothing checked, writes only the changed rows. It never writes out the whole table
RevertDiscards changes in the checked rows, or all changes when nothing is checked. While connected, those rows are read again at once
Read-only rowsThe Raw column cannot be edited; Discrete Inputs and Input Registers tabs cannot be written at all

Write FC picks the function code:

SettingBehaviour
Auto (06 / 16)Neighbouring rows written together are merged into one multiple write
FC06 single registerEach row is written on its own with a single write, never merged
FC16 multiple registersAlways a multiple write; some devices only accept FC16

Practice: change Setpoint to 350 (35.0 °C), click Write F6, and check in the Slave window that 0x0001 is 350. Change Mode to 2 and Eng. Value shows Manual.


8. Quality and errors ​

The Quality column:

ShownMeaning
Good (green)The latest read succeeded
Changed (orange)Changed, not yet written
Stale (grey)The device is not connected right now; the value is from an earlier read
Timeout (red)The device did not answer within Timeout
Error 02 and so on (red)The device answered with an exception code, for example 02 illegal address, 01 illegal function
Error (red)Another communication error; hover over it for the reason
-Not read yet

Practice: add a Slave ID tab ID 2 to Boiler with two registers. The simulated device only has Slave ID 1, so every ID 2 row shows Timeout, the device card turns into an orange N% ok, and Errors and Link in the status bar show the failures:

Slave ID 2 not answering

A Slave ID that never answers makes every round wait the full Timeout, which slows down polling for the whole device. Once you are sure the ID does not exist, delete its tab or clear its ★ rows.

For devices that will not connect, wrong values and similar problems, see Troubleshooting sections 1, 2 and 5.


9. Several devices ​

Each device connects and polls on its own:

  1. Select a device under DEVICES and click Connect; select the next one and click Connect. The toolbar's Connect / Disconnect only acts on the selected device.
  2. The toolbar's Connect / Stop / every, the status bar and the register table all belong to the selected device. When you switch to another device, the previous one keeps polling.
  3. 2 connected of 2 device(s) in the status bar shows how many are connected; the Log's Source column shows which device each exchange belongs to.
  4. One window handles up to 32 connections at once (devices on the same address count as one).
  5. Disconnect a device before deleting it; the last device cannot be deleted.

Several devices for one piece of equipment (shared connection) ​

When the register table is large and you only want to watch a few points for a while, leave the original device alone: select it, click +, click OK as is (if the original is connected, the new device joins by itself), and add only the registers you need to the new device.

Devices with the same IP and port (or the same COM port) share one connection and are listed under the same address header:

Two devices sharing a connection

RuleDetails
One connection onlyThe equipment sees a single master connection, so its connection limit is never hit. A COM port is opened only once too
Connect and poll separatelyThe first device to Connect opens the connection; devices that connect later share it. Each device's ★ rows, interval and Slave ID tabs are its own; requests go out one after another on the shared connection
Closed by the last to leaveDisconnect only takes the selected device off; while other devices still use the connection, it stays open
Whole group on or offRight-click the address header → Connect All or Disconnect All to act on every device under that address, or use Connection → Connect All on This Connection / Disconnect All on This Connection (for the group the selected device is in). Connect All is greyed out when all are connected, Disconnect All when all are offline
Matching settingsDevices sharing a connection must have the same Timeout, Retries and serial settings (baud, data bits, parity, stop bits). Editing one in Edit device asks whether to change the others too; while any of them is connected the settings cannot change, so disconnect them all first
Imported devicesAn imported device on the same address as an existing one takes the existing device's connection settings; the existing device is not changed

Address header's right-click menu

Connect All starts auto polling on every device, selected or not. If one of them cannot connect (for example its settings differ from the rest of the group), the others connect anyway, and the devices that failed are listed with the reason.

When the connection drops (the equipment loses power, for example), every device sharing it shows errors together.

Another approach is to stay on one device and use Monitored only or the search box to show just the rows you want, without adding a device.

For two devices polling at the same time, see Getting started. For one device reading two Slave IDs while another reads a different port, see Slave guide 5.


10. Communication log ​

The Log at the bottom shows every exchange:

ColumnMeaning
TimeTime (milliseconds)
TypeTX sent, RX received, WARN error, INFO message
SourceThe device it belongs to
EventFor example Read Holding ..., FC03 · unit 1
Raw frame (hex)The raw frame
ControlWhat it does
Filter drop-downAll traffic, TX, RX, WARN, INFO
Auto-scrollKeeps the newest entry in view
ClearClears the log
Save logSaves to .txt, one entry per line, tab-separated
Arrow on the rightFolds or unfolds the Log

The Log keeps the latest 500 entries. View → Communication Log hides it completely. To read the frames, see Troubleshooting 11. Reading frames in the Communication Log.


11. Saving the project and exporting devices ​

Projects (.mbproj) ​

A project keeps every device's connection settings, poll interval, function areas and Slave ID tabs, and each row's name, format, engineering settings and ★. Values read are not saved.

MenuWhat it does
File → New ProjectNew project (one default device)
File → Open Project...Opens a .mbproj
File → Open RecentRecently opened projects; Clear Recent clears the list
File → Save Project (Ctrl+S)Saves
File → Save Project As...Saves under a new name

A * after the file name in the window title means there are unsaved changes. Starting a new project, opening another one or closing the program asks whether to save first; opening a project disconnects everything.

Exporting and importing one device (.mbdev) ​

To share one device's register table, or copy it into another project:

  • Device → Export Device... saves the selected device as .mbdev.
  • Device → Import Device... adds a .mbdev to the current project. An imported device on the same address as an existing one takes that device's connection settings; the existing device is not changed (see section 9).

Next steps ​

Roach Modbus Tool by Mr.Roach