Questions tagged [pymodbustcp]

A simple Modbus/TCP client library for Python. pyModbusTCP is pure Python code without any extension or external module dependency.

44 questions
0
votes
0 answers

from pyModbusTCP.client import ModbusClient ModuleNotFoundError: No module named 'pyModbusTCP'

I am trying to get the values from the registers using pymodbus but i am facing issues with import pymodule .Please help me on this? I tried pip install pymodbus and pip install but still getting the error. I tried this too from pymodbus.client.sync…
0
votes
0 answers

How to use write_single_register function in pymodbustcp library

Using RTDS's MODBUS communication protocol, we intend to communicate with Python using the pyModbusTCP library. The register was assigned by mapping the components of the system modelled by RTDS as follows # RIR: Read Input Registers (16 bit word,…
0
votes
0 answers

PyModbusTCP module installation on windows pc

Last year, I made a program using the PyModbusTCP module on a raspberry Pi. Now I want to try my programs again on a windows pc but I can't seem to get my installations correct. Here is some info: project has a venv folder and a main.py next to it.…
IGDT
  • 3
  • 2
0
votes
0 answers

How can I determine the return function code being sent from a Modbus response using Python

For clarity I am using Python and pyModbusTCP to communicate via modbus. If I am using function code 1 to read coil status, how can I determine the function code of the message that was sent back? Below is an example of how I sent messages to a…
0
votes
1 answer

Pymodbus write_registers : Working with bytes vs words

When writing to multiple registers using Pymodbus it seems that the encode method on the class WriteMultipleRegistersRequest creates a word to add to the packet from the list of values using this packet += struct.pack('>H', value) I have registers…
timoh
  • 37
  • 4
0
votes
0 answers

ValueError: source code string cannot contain null bytes when importing a package in python

from pyModbusTCP.client import ModbusClient I am using pycharm and I have a class file which uses methods from pyModbusTCP package to communicate with devices over modbus. This class files exists as part of a directory in my project, where under…
0
votes
0 answers

class DataBank python modbus

I would like help to interpret the DataBank. If there was an update. I don't know how to apply it. from servidormodbus2 import ServidorMODBUS s = ServidorMODBUS('127.0.0.1',502) s.run() from pyModbusTCP.server import DataBank, ModbusServer from…
0
votes
1 answer

Modbus Server failure in combination with tkinter

I am currently trying to write data to a modbus server via the UI tkinter. To do this, I'm using tkinter to create the UI and implement a button that internally calls me a function called print_entry(), starts the Modbus and writes the entered…
Hotte
  • 11
  • 2
0
votes
1 answer

Problem with kivyMD TCPModbus app not reading from the server

I created an app, based on a teacher's videoclass program. It turned out I had some issues, returning me the following exceptions and Id badly apreciate your attention: Error during data status reading. Error during data setpoint reading. Error…
caio_alBR
  • 27
  • 5
0
votes
0 answers

recv_MBAP error output by write_single_coil()

I am encountering this error on the output : _recv MBAP error My code is like this from pyModbusTCP.client import ModbusClient c = ModbusClient('192.168.0.7', port=502, debug=True, auto_open=True, auto_close=False) if c.is_open == False: …
Jun
  • 49
  • 6
0
votes
1 answer

unkown cause of pyModbusTCP timeout

I have a device connected via ethernet cable to the network. Its manual says it accepts modbusTCP communication protocol and indeed nmap in the configured port shows that a modbus service is open (nmap output at the end). I am no modbus expert but i…
0
votes
2 answers

Modbus master cannot update the data written by second client

We have been trying to integrate a conveyor into our application. The supplier told us that they have a modbus master that updates the values every 10ms and that we should have a slave on our end on a certain IP/port. Upon investigating, we…
0
votes
0 answers

No Output priniting after read_input_registers

I cannot print anything on pi terminal Please help from pymodbus.client.sync import ModbusSerialClient import serial.rs485 import time import logging import pprint pp= pprint.PrettyPrinter(indent=4) FORMAT = ('%(asctime)-15s %(threadName)-15s' '…
0
votes
0 answers

Script Python to log values from modbus tcp to Mysql

I'm trying to make a script to read holding registers from modbus TCP devices and insert the UINT32 decoded into MySQL : Read 2 registers with pymodbus Decode into uint32 Insert decoded values into mySQL Start again every x minutes I'm not a…
Makimax
  • 13
  • 2
0
votes
1 answer

Using Pymodbus, I want to tie coil states to GPIO pins within my server not from a client

I am writing a PyModbus asynchronous updating server based on the example on the Pymodbus Asynchronous Server Example and I want to link the states of the coils to GPIO pin states, such as when coil 1 is True pin 21 is high and when coil 1 is False…
Michael H.
  • 93
  • 3
  • 13