My first test is with a Delta DVP-12SE11R PLC and the connection is with the Modbus TCP/IP protocol. I have a python code written using pymodbustcp module. I have tested that code with a modbus slave simulator and it is working properly. Reading and wriying required registers on simulator. My question is when i connect a plc hardware to PC and provide ip address of plc and port number to python code and it will start reading and writing the registers i specified in code?
This is what i am using:
from pyModbusTCP.client import ModbusClient
c=ModbusClient(host='localhost',port=9999,auto_open=True)
regs=c.read_holding_registers(403705,1)
print("reading register values")
if regs:
print(regs)
else:
print("error")
print("write value to register")
a=int(input())
c.write_single_register(403705,a)
--
You received this message because you are subscribed to the Google Groups "pymodbus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymodbus+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pymodbus/b857dede-9d84-4401-b1ed-a7149dacfd1f%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pymodbus+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pymodbus/bc1e806e-d03b-4b5a-b0aa-b25d9e033f32%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "pymodbus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymodbus+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pymodbus/0252d9d9-5c79-41ed-8aad-995f7c4fecbf%40googlegroups.com.
v = client.read_holding_registers('addresss', 'size', unit='unint_id')
```
But how can i write to holding registers as write function only supports input regs and not holding registers