Questions tagged [pymodbus]

Pymodbus is a python implementation of modbus protocol providing both client and slave features.

PYMODBUS is a full modbus implementation of modbus protocol using python. It provides both client and server features and supports Modbus over RTU, ASCII, TCP, UDP protocols. The library also supports both synchronous and asynchronous variants of both client and server features.

Pymodbus is supported on both on python 2.7 and python 3.x

For more info refer

290 questions
0
votes
0 answers

Retrieving pyModbus Data into a list

I'm using pymodbus to read the data from my equipment. Here's the code I use and it works! import pymodbus import serial from pymodbus.pdu import ModbusRequest from pymodbus.client.sync import ModbusSerialClient as ModbusClient #initialize a…
0
votes
2 answers

What's the reason for getting the result for the second try in ModbusTcp reading?

Sometimes I get an error response immediately when I read from a Modbus device at the first time, but when I try again this responded as the expected result. This is the error message at first…
Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
0
votes
1 answer

Reading Response message in modbus using python

I am trying send the query and get the response message (data) through modbus using python with the help of pymodbus module. response=client.read_holding_registers(19200,126,unit=135) print(response) The response that is being printed is the…
0
votes
0 answers

Remove trailing bits from hex pyModBus

I want to built a function that sends a request from ModBus to serial in hex. I more o less have a working function but have two issues. Issue 1 [b'\x06', b'\x1c', b'\x00!', b'\r', b'\x1e', b'\x1d\xd3', b'\r', b'\n', b'\x1e', b'\x1d'] I cant remove…
victorR
  • 129
  • 1
  • 13
0
votes
1 answer

Stop python script aborting when there is no internet connection

I have a python script running on a revPi which uses Azure IOT SDK. The script basically accepts a bunch of modbus registers from a .json file, adds a few properties and sends it to Azure IOT hub for analysis. The script is currently too dependent…
Inception
  • 455
  • 1
  • 9
  • 32
0
votes
2 answers

Test request Modbus TCP

I have a question, I do a communication test by Modbus TCP and each request takes approximately 200ms, is it possible to improve these times? This is the code that I use for the tests: from pymodbus.client.sync import ModbusSerialClient as…
MM87
  • 41
  • 6
0
votes
1 answer

Should I ever use write_register() when write_registers() is more general (pyModbus)?

I'm starting to use pyModbus with Python 3.7. In pyModbus.client.sync.ModbusTcpClient there are two methods for writing: write_register() write_registers() Is there any benefit to using write_register() over write_registers() with a register list…
Akash Sharma
  • 89
  • 3
  • 10
0
votes
0 answers

Python centralized information

I am currently doing a development in Pyhton (Kivy) for some machines that will be installed in various parts of the city, I wish that all the information of the machines is centralized and updated in real time. Example: User X registers on machine…
MM87
  • 41
  • 6
0
votes
1 answer

Modbus TCP Client does not connect

Background info: I am trying to read data from my energy meter. I have connected a gprs modem to the meter(via rs485) port. This modem sends data via tcp-ip protocol to a specified server and port. On the server(aws ec2 instance) I can see a…
iamjoebloggs
  • 46
  • 1
  • 8
0
votes
1 answer

How to get rid of LoopingCall in python code

I'm using Modbus server example code from pymodbus library to make a data forwarder (reading some serial data, formatting and then assigning data to modbus registers for Modbus master to read). My issue is serial delay (reading from 6 different…
coddr
  • 29
  • 1
  • 5
0
votes
0 answers

Read multiple holding register in pymodbus

I'm using ModbusSerialClient of pymodbus library. I've multiple registers that I want to read. I'm able to read one register at a time, but not able to figure out how to read all the registers at a single time for better performance. registers =…
Hardik Sondagar
  • 4,347
  • 3
  • 28
  • 48
0
votes
0 answers

Issue while master is trying to read few registers via modbus serial console using python in raspberry Pi

I am using RasPi connected to other system via serial console. My other system is running modbus master and Raspi is acting as modbus slave. Raspi has written to some register values and master is continuously asking for some register values. Below…
Sumit
  • 1,953
  • 6
  • 32
  • 58
0
votes
0 answers

Proper python program sequence/timing

I have a python program that reads serial port and then acting as ModbusTCP server updates Modbus registers. I have a problem with reading Modbus registers with Modbus client, if I set time = 5 # Update delay it doesn't even show values, if I set it…
coddr
  • 29
  • 1
  • 5
0
votes
1 answer

Pymodbus and async serial client

I'm trying to read/write some registers to some modbus devices. My software uses Python 3.4 and Twisted, so I wanted a library that integrates with such stack and allows async communications. I'm trying to use pymodbus to implement a modbus serial…
Alan Franzoni
  • 3,041
  • 1
  • 23
  • 35
-1
votes
1 answer

PyModbus - trigger an action/function when holding register is read

I've setup a running Pymodbus server based on the 'Updating Server' (v2.5.3) example. https://pymodbus.readthedocs.io/en/v2.5.3/source/example/updating_server.html Everything works ok. Now i want to trigger a function (which will simply increment a…
1 2 3
19
20