Skip to content

Troubleshooting ​

Error messages here were checked on the v1.3.4 Release build, either by triggering them or from the program's own text. The Windows screens are real screenshots; the Linux, license and update messages have no screenshots, and their text comes from the program.

Each problem is laid out as symptom → cause → fix. Messages are quoted exactly as the program shows them, so you can search this page for the text on your screen.

Contents ​

AreaProblem
Connection1. A TCP device does not connect · 2. An RTU device does not connect · 3. Linux serial ports
Results4. Steps show DISCONNECT or time out · 5. Wrong values read
Scripts6. A script does not load · 7. No exit code from a command-line run
License and updates8. License problems · 9. Update fails or only offers Open download page
Linux10. The AppImage does not start
Tools11. Reading frames in the Communication Log

1. A TCP device does not connect ​

During a run, the channel card shows Not answering yet, the Log shows a message like the one below, and steps are judged DISCONNECT:

text
Channel A (TCP 192.0.2.10:502) is not answering yet: timed out. The run goes on; each step that talks to it connects again.

When the device cannot be reached

Check the reason in the Actual column (or the command-line output):

MessageCauseFix
connect failed: connection refusedThe IP answers, but nothing is listening on that portCheck the port (Modbus TCP defaults to 502); check that the device's Modbus TCP function is on; when practising with Slave, check that the Slave has Listen pressed
connect failed: timed outThe IP cannot be found, or packets are blockedCheck the IP and that the PC and device are on the same subnet; test with ping; check whether Windows Firewall or a network firewall blocks port 502
Time out or disconnectThe connection succeeded, but the device did not answer this requestCheck the Slave ID; devices behind a gateway need the right Slave ID; check that the timeout is long enough

When practising with Slave: the Slave's Listen IP defaults to 127.0.0.1, which only accepts connections made to 127.0.0.1 on this PC; connecting to another address such as 127.0.0.100 fails. To let other PCs or PLCs on the network connect, set the Listen IP to an adapter's address, or 0.0.0.0 (all adapters), in Device → Edit Device....


2. An RTU device does not connect ​

SymptomCauseFix
Before the run: Channel A (RTU COM3 9600) could not connect: the port does not exist (check the COM number in Device Manager); exit code 2 on the command lineNo such serial port: the USB-to-serial cable is not plugged in properly, or the COM number is wrongCheck the COM number under Device Manager → Ports (COM & LPT)
could not connect: the port is in use by another programAnother program has the serial port openClose the other program using the port (including another Roach Modbus Tool window)
Linux: could not connect: permission denied (add the user to the dialout group, then log in again)The account has no permission for the serial portSee section 3
Every step gives Time out or disconnectWrong serial settings or Slave ID, or wrong wiringCheck that baud rate, data bits, parity and stop bits match the device; check the Slave ID; on RS-485, check whether A/B (D+/D−) are swapped and the termination resistors
Occasional timeoutsLine noise, or a timeout that is too shortLengthen the timeout and add retries; on long RS-485 runs, add termination resistors and use shielded twisted pair

3. Linux: serial port missing or permission denied ​

No /dev/ttyUSB*

  • After plugging in the USB-to-serial cable, run ls /dev/ttyUSB* /dev/ttyACM* to check the device appears.
  • If it does not, run sudo dmesg | tail to see whether the system recognised the cable and which driver it loaded.
  • The serial port list shows /dev/ttyUSB*, /dev/ttyACM*, /dev/ttyAMA*, the /dev/ttyS* ports that actually exist, and /dev/rfcomm*. Other paths can be typed into the serial port field.

The device exists but will not open

The account must be in the dialout group:

bash
sudo usermod -aG dialout $USER

Log out and back in for it to take effect. Check with groups that the output includes dialout.


4. Steps show DISCONNECT or time out ​

ResultMeaning
DISCONNECTThe device did not respond (connection failed or timed out); see sections 1 and 2
FAIL, with a note like slow: 12.3 ms > 10 msThe device responded, but slower than the step's Max response (max_ms)
SKIP, with the note on_error skipAn earlier step failed to communicate and on_error is skip, so the rest of the case was skipped

Whether to carry on after a communication failure: with On comm error at the bottom left set to Skip rest of case (skip), one communication failure skips the rest of that case, and the next case runs as usual. With Continue (continue), the next step runs. Tests that expect disconnections, such as power cycling, should use Continue; see Concepts › 4. Handling communication failures.

Occasional timeouts: lengthen the timeout in the channel settings, or add retries (how many times each failed step is retried).

The device is still booting: make the first step a Wait Until (compare: false) so the run starts once the device responds. See the example in Power-cycle test.


5. Wrong values read ​

SymptomCauseFix
A float reads as a tiny (such as -2.4178e-41) or huge numberWrong byte orderTry float_cdab or another format; see Floats, longs and byte order
The values are off by one addressThe manual counts from 1 (40001, 400001) or uses PLC addresses, while the tool uses 0-based protocol addresses40001 in the manual is address 0x0000; subtract 1 as the manual describes
Negative numbers read as large numbers near 65535The Unsigned format is in useUse the signed format
The write PASSes but the read-back gives the old valueThe device takes a while to update after a writeAdd a Wait after the write, or use Wait Until to wait for the value
Reads 0 where the value written on the other side was expectedThe gateway is not forwardingSee Gateway forwarding

6. A script does not load ​

Opening the script shows Failed to load file name, and the script is not loaded:

Script failed to load

MessageCauseFix
invalid JSON at line 6, column 51: ...JSON syntax error: an extra or missing comma, unmatched brackets, or a string missing a quoteOpen the file in a text editor and look at the line and column given (or just before them). The most common cause is a comma after the last item, such as { "address": "0x0000", } in the screenshot
Goto was removed: every case runs once per round, in list order. ...An older script uses gotoUse If/Else for branching, Call for shared steps, and End Case or End Round for ending early; see Unsupported syntax
main_case is not the first case ...: cases now run in list order, so move that case to the top and remove main_caseAn older script names a main_case that is not the first caseMove that case to the top and delete main_case
case "name" has a malformed step at index N: ...The step at position N+1 has a field error (the index counts from 0)Fix it as the text after the colon says; how each field is written is in the command reference

On the command line, the same messages start with The script is not valid: ... and the exit code is 2.


7. No exit code from a command-line run ​

Symptom: RoachModbusTool --run-script test.json returns to the prompt at once, and %ERRORLEVEL% or $LASTEXITCODE is always 0.

Cause: the Windows version is a GUI program, so Command Prompt and PowerShell do not wait for it to finish after starting it.

Fix: wait for the program to finish explicitly.

bat
start /wait "" RoachModbusTool.exe --run-script test.json --report out.xlsx
echo %ERRORLEVEL%
powershell
$p = Start-Process RoachModbusTool.exe -ArgumentList '--run-script test.json --report out.xlsx' `
     -Wait -PassThru -NoNewWindow
$p.ExitCode

What each exit code means is in Command-line runs. The Linux AppImage needs nothing special: echo $? gives the exit code.


8. License problems ​

The license status is shown on the license label at the bottom left (see Getting started › 3. License).

MessageCauseFix
Your trial has ended / Your 30-day trial has ended (or the trial record was altered).The 30-day trial has endedBuy with Help → License → Buy License..., then enter the key with Help → License → Enter License...
This license needs an online check before it can be used.Licensed, but not verified online for more than 14 daysConnect the PC to the internet and restart the app, or enter the key again with Help → License → Enter License...
License server unreachable. Offline use continues for N day(s).The license server could not be reached at startup (a reminder only)Nothing to do; go online once within N days
Could not reach the license server. Check your internet connection and try again.The server could not be reached while entering a keyCheck the network, and whether a company firewall or proxy blocks HTTPS
This license is already active on 3 computers, the most it allows.One key works on at most 3 PCs at a timeRelease one with Help → License → Remove License... on that PC, or remove a device in the Polar customer portal, then enter the key on this PC
That license key was not accepted.The key was mistyped, or is not a valid keyCopy the full key from the purchase confirmation email and paste it
That license key is not for Roach Modbus Tool.The key belongs to another productCheck which product was bought
This license is no longer active on this computer.This PC was removed in the customer portalEnter the key again to activate it

A temporary network outage does not invalidate the license: when the server cannot be reached or is busy, a license that was verified keeps working, as long as the connection returns within 14 days.


9. Update fails or only offers Open download page ​

MessageCauseFix
Could not check for updates.The update server cannot be reachedCheck the network, then try Help → Check for Updates... again. A failed automatic check at startup shows no message
Only Open download page, with Automatic update is not available: The folder ... is not writable. belowThe app's folder is not writable (for example, it is in C:\Program Files)Click Open download page and download by hand; or move the app to a writable folder (such as D:\Tools\RoachModbusTool), after which Update now works
Only Open download page, with This copy is not running as an AppImage. belowOn Linux, the app is not running as an AppImage (it was extracted, for example)Run the AppImage, or download the new version by hand
... You can download the new version from the website instead.Downloading or installing the update failedDownload the new version from the website as the message says. A download that fails verification is not installed, and the current version keeps working

10. The Linux AppImage does not start ​

SymptomCauseFix
Permission deniedThe AppImage is not executablechmod +x RoachModbusTool-x86_64.AppImage
AppImages require FUSE to run. or errors about libfuse.so.2The system has no FUSE 2 (not installed by default since Ubuntu 22.04)Ubuntu 22.04: sudo apt install libfuse2; Ubuntu 24.04: sudo apt install libfuse2t64. Or, without installing it, run ./RoachModbusTool-x86_64.AppImage --appimage-extract-and-run
Roach Modbus Tool needs a graphical desktop: no display was found (DISPLAY and WAYLAND_DISPLAY are not set).The window was started without a desktop (over SSH, for example)Start it from a desktop session, or use ssh -X. To only run scripts, --run-script needs no desktop
libOpenGL.so.0: cannot open shared object fileAn older AppImage on a system without OpenGL libraries (a server or minimal install)Update to the latest version: the AppImage now bundles the OpenGL libraries and uses them when the system lacks them

11. Reading frames in the Communication Log ​

When you suspect the device is answering wrongly, look at the raw frames sent and received.

  • Script mode: turn on View → Communication Log, and a Traffic tab appears at the bottom.
  • Poll/Slave mode: the Log panel at the bottom of the window.

Traffic tab

ColumnMeaning
TimeTime
TypeTX sent, RX received, INFO connection events
SourceWhich channel (A/B) or device
EventRequest, Response and so on
Raw frame (hex)The raw frame in hex

The drop-down at the top filters to TX, RX or INFO only.

Reading a Modbus TCP frame ​

Taking "read 2 registers from 0x0000" in the screenshot as the example:

text
TX  00 02 00 00 00 06 01 03 00 00 00 02
RX  00 02 00 00 00 07 01 03 04 12 34 10 01
BytesTX (request)RX (response)
1–200 02 transaction ID; the response carries the same ID00 02
3–400 00 protocol (always 0)00 00
5–600 06 6 more bytes follow00 07 7 more bytes follow
701 Slave ID01
803 function code (read holding registers)03
After that00 00 start address, 00 02 count04 data byte count, 12 34 = 0x1234, 10 01 = 0x1001

Common readings

  • TX with no RX: the device did not respond. Check the Slave ID and the connection; see sections 1 and 2.
  • The RX function code has 0x80 added (such as 83): the device returned an exception, and the next byte is the exception code: 01 function not supported, 02 address does not exist, 03 invalid value, 04 device failure.
  • The RX Slave ID differs from the TX one: another device on the line uses the same Slave ID, or the gateway is misconfigured.

RTU frames have no first 6 bytes: they start at the Slave ID and end with 2 extra CRC bytes.

Roach Modbus Tool by Mr.Roach