I am very good in PLC logic & programming, but new to python.
I have mitsubishi make PLC which is GOC35.
want to connect via mosbustcp using python pymodbus library.
i am already test this PLC connection via Tcpip modbus with SCADA.
but now want to connect using python script & pymodbus library.
I started this but not getting any response from PLC & also check ping from PLC in CMD it is working ok.
below is my code.
from pymodbus.client.sync import ModbusTcp lient
client = ModbusTcpClient('192.268.1.11')
client.read_holding_registers(0,3).registers
it gives me 'modbusioexception' & registers in not module.
Please guide me to solve this.
so, please guide me where to start.
In your case you need to provide proper count value and plc unit number and client. read_holding_registers reads multiple registers and stores in a list so use .registers[0]
This will display content of register at position 0.
And in connection string provide proper port number.
You can go to www.nakshautomation.live for more details
For direct PLC supporting Modbus/TCP, set the Unit ID to zero (or
one). The PLC likely ignores it.
now can i connect this script with mysql database?
if possible please give steps overhyere or suggest other link.
Thank you.