pymodbus

pymodbus: request creation and response receiving

自作多情 提交于 2019-12-02 00:57:11
Can anyone explain how to create the request and get the response in right way using pymodbus via Modbus TCP/IP? I have the PLC wich I want to use as slave and PC - as master. I trying to do it in such way: from pymodbus.client.sync import ModbusTcpClient host = '192.168.56.9' port = 502 client = ModbusTcpClient(host, port) client.connect() #Register address 0x102A (4138dec) with a word count of 1 #Value - MODBUS/TCP Connections #Access - Read #Description - Number of TCP connections request = client.read_holding_registers(4138, 1) response = client.execute(request) print response >>>

重新安装centos6.4,用virtualenvwapper配置开发环境

懵懂的女人 提交于 2019-12-01 14:58:00
因为开发了多个Django项目,有CMS,ERP,SCADA。分别用的不同版本,搞的virtualenv有些混乱,所以重新安装,用virtualenvwapper隔离开。 1.virtualbox安装 WIN7下下载安装virtualbox,4.3.8,安装很简单。 2.新建centos6.4 新建centos6.4,分配2G 内存,安装也很顺利。最后一步崩溃收集那步老失败,CTL+ALT+BACKSPACE直接进入系统,然后System-administration-kernel crash dump禁用就好了。 配置好简单应用,如文件夹打开方式,网络配置等 3.安装中文输入法 参考另外一篇关于中文输入法安装的,用的ibus拼音输入法。 4.安装pycharm 下载pycharm3,安装时需要jdk支持。yum安装的只是openjdk不能用,据说时oracle授权的问题,新的linux都没有jdk了。 Ubuntu: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer centos: 从官网下载rpm,rpm -ivh安装,默认到/usr/java. 配置下环境变量: sudo vim /etc/profile

Modbus Error: [Input/Output] No Response received from the remote unit

蹲街弑〆低调 提交于 2019-11-29 08:13:56
I' trying to connect from my Mac laptop to a Modbus device ( MR-SI4 ) using a serial connection using a USB RS485 converter that gets "mounted" to /dev/cu.SLAB_USBtoUART . This is my code: import logging logging.basicConfig() log = logging.getLogger() log.setLevel(logging.DEBUG) from pymodbus.constants import Endian from pymodbus.constants import Defaults from pymodbus.payload import BinaryPayloadDecoder from pymodbus.client.sync import ModbusSerialClient as ModbusClient from pymodbus.transaction import ModbusRtuFramer # settings for USB-RS485 adapter SERIAL = '/dev/cu.SLAB_USBtoUART' BAUD =

Pymodbus - Read input register of Energy meter over rs485 on uart of raspberry pi3

主宰稳场 提交于 2019-11-28 01:45:23
I have one energy meter and i am trying to retrieve voltage, freq values from meter on raspberry pi uart over RS485 My connections for raspberry pi and rs485 are as follows Rs485 DI - Tx of raspberry pi Rs485 R0 - Rx of raspberry pi Rs485 DE/RE -Pin 7 of raspberry pi my code is as follows: import serial import RPi.GPIO as GPIO from pymodbus.client.sync import ModbusSerialClient as ModbusClient from pymodbus.register_read_message import ReadInputRegistersResponse from pymodbus.register_read_message import ReadInputRegistersRequest import logging logging.basicConfig() log = logging.getLogger()

Pymodbus - Read input register of Energy meter over rs485 on uart of raspberry pi3

假装没事ソ 提交于 2019-11-27 04:49:53
问题 I have one energy meter and i am trying to retrieve voltage, freq values from meter on raspberry pi uart over RS485 My connections for raspberry pi and rs485 are as follows Rs485 DI - Tx of raspberry pi Rs485 R0 - Rx of raspberry pi Rs485 DE/RE -Pin 7 of raspberry pi my code is as follows: import serial import RPi.GPIO as GPIO from pymodbus.client.sync import ModbusSerialClient as ModbusClient from pymodbus.register_read_message import ReadInputRegistersResponse from pymodbus.register_read