Modbus returns only zeros. Any ideas?

Topics about the Software of Revolution Pi
Post Reply
noel_drew
Posts: 4
Joined: 21 Jul 2020, 15:06

Modbus returns only zeros. Any ideas?

Post by noel_drew »

I have a RevPi Connect + set up as a Modbus slave in PiCtory. I have a UR3e robot arm set up as the client polling the RevPi every second or so on port 502. The IP address is correct and the slave id is set to 1. But whenever I request data from the registers it always comes back as 0. Even if I set default values in piCtory or write values manually using piTest.

I have a python implementation of modbus running on the revPi and that works fine over the same network.

Any help would be greatly appreciated.
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: Modbus returns only zeros. Any ideas?

Post by Amar »

The UR3e robot arm polling the RevPi must execute following modbus funtion codes.
Read Input Registers (0x04) to read Output_1 to Output_n registers of Modbus TCP slave on RevPi.
Write Multiple Registers (0x10) to write to Input_1 to Input_n registers of Modbus TCP slave on RevPi.

You can also verify this with QModMaster
https://sourceforge.net/projects/qmodmaster/
KUNBUS
noel_drew
Posts: 4
Joined: 21 Jul 2020, 15:06

Re: Modbus returns only zeros. Any ideas?

Post by noel_drew »

Can you check the piModbusSlave log with command:
tail -f /var/log/daemon.log
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: Modbus returns only zeros. Any ideas?

Post by Amar »

Can you check the piModbusSlave log with command:
tail -f /var/log/daemon.log
KUNBUS
noel_drew
Posts: 4
Joined: 21 Jul 2020, 15:06

Re: Modbus returns only zeros. Any ideas?

Post by noel_drew »

it just constantly prints the following:

Jul 22 15:21:53 RevPi38654 piModbusSlave[2860]: read access to process image failed: -14
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: Modbus returns only zeros. Any ideas?

Post by Amar »

Can you first update the RevPi device with:
sudo apt-get update && sudo apt-get upgrade && sudo reboot

Then try out again and send me following data:
_config.rsc file from /var/www/pictory/projects/
kernel log $ dmesg
KUNBUS
noel_drew
Posts: 4
Joined: 21 Jul 2020, 15:06

Re: Modbus returns only zeros. Any ideas?

Post by noel_drew »

Weirdly after that update/upgrade (which was the first thing I did when I turned it on) MODBUS seems to be working now. Have been able to read/write to the registers.
etienne1984
Posts: 11
Joined: 25 Nov 2020, 17:24

Re: Modbus returns only zeros. Any ideas?

Post by etienne1984 »

Hello, I had the same problem.

I also already processed the apt-get update / upgrade when first configuring product (but at this time modbus was still not configured in pictory), but after some hours trying to understand, I read this forum thread and the second update fixed the problem.

I noticed that amongst updated packages, there was indeed :
Get:3 http://packages.revolutionpi.de stretch-backports/main armhf libmodbus5 armhf 3.1.6-2~bpo10+2 [30.2 kB]
Last edited by etienne1984 on 03 Dec 2020, 17:40, edited 1 time in total.
Post Reply