modbus-tk

Need help using modbus_tk library

走远了吗. 提交于 2021-02-10 14:14:29
问题 I'm using modbus_tk library to use as a Modbus RTU slave. I have an off the shelf Modbus RTU master simulator running on another PC through a usb to 485 converter. I cannot see my holding register in the Master. I have verified that the serial link is good because I can send strings to the slave using a serial program. I have tried setting up the Master for 16 and 32 bit ints the response is always 83 04. I have tried using a few different masters with staring address of 0, this one happens

Can't connect to slave with Python's modbus_tk

六眼飞鱼酱① 提交于 2020-06-27 16:48:07
问题 I'm currently trying to develop an application that uses the Modbus-RTU protocol, and I have to use modbus_tk in Python 2.7. I'm supposed to use bits of code from another application which is able to communicate with the micro-controller via modbus. It works on that app when I run the following code, but I get an error when I run the same lines in my app. import modbus_tk import modbus_tk.defines as cst import modbus_tk.modbus_rtu as modbus_rtu import serial MB_Add_Status = 8 + 5001 def MB

Modbus-tk RTU Slave holding register read signed integer

泪湿孤枕 提交于 2019-12-24 03:32:15
问题 I created a modbus slave using modbus-tk as below. I use Simply modbus master software(http://www.simplymodbus.ca/RTUmaster.htm) as the master. How to set the slave to represent a signed integer instead of an unsigned. For example, when I send a 16 bits data, (FC19) HEX should represent -999 decimal , but now I get 64537. Try to use the example here https://github.com/ljean/modbus-tk/blob/master/examples/tcpmaster_example.py. It seems to only work for Master. import sys import modbus_tk