如何将带RS485输出的电压监测仪连接到带Modbus RTU的计算机上?我是否应该使用RS232转换器并连接到计算机的串行COM端口?我应该使用RS485到USB的转换器来连接吗?我可以使用D9连接器引脚从RS485的A、B和地直接连接到串行COM端口吗?然后A、B和地连接到Modbus RTU中D9的哪些引脚?ND20 pinout RS485 Details
发布于 2016-11-07 20:04:09
发布于 2019-01-09 22:18:17
选项1: PC --> U盘到RS232 --> RS232到RS485 --> RS485设备
选项2: PC --> U盘转RS485 --> RS485设备
选项3: PC --> RS232 to RS485 --> RS485设备
您需要usb转rs485 / rs232转rs485转换器。
由于rs485是浮动的,您可能需要连接接地才能进行可靠的通信
发布于 2019-07-30 00:39:00
您可以使用USB-RS485转换器进行连接。不知道其他方法,但它对我有效。有关如何从头到尾进行沟通的详细信息,请查看此视频:https://www.youtube.com/watch?v=X3RW-0e_PSI
这个程序工作的windows和raspbian唯一的区别是端口名称在这两个…
#THIS IS MY PYTHON PROGRAM
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
client = ModbusClient(method='rtu', port='COM4', baudrate=2400, timeout=1)
client.connect()
read=client.read_holding_registers(address = 222 ,count =10,unit=1)
//Address is register address e.g 30222,
//and count is number of registers to read,
//so it will read values of register 30222 to 30232
//unit is slave address, for 1 device leave it 1
data=read.registers[int(2)] #reading register 30223
print(data) #printing value read in above line
https://stackoverflow.com/questions/40437931
复制相似问题