Hi guys,
I’m tinkering with the modbus TCP slave example from GitHub - br-automation-community/modbusTCP-Automation-Studio: modbusTCP library for Automation Studio · GitHub
I can connect the plc X20CP1584 but neither read from nor write to it has been working. Everything in the example is in default state, no changes whatsoever except in physical view → X20CP1584 → ETH.
I changed:
Input Register → Channels → Channel 1 → Input register → Number of registers: before: 1, after 10
Holding Register → Channels → Channel 1 → Holding Register → Number of register: before: 1, after: 10
All others settings are untouched.
I use QModMaster as a tool to communicate with the plc.
Any idea?
Hi,
the library you linked is a pure software implementation. This implementation does not use any Automation Studio settings. The ModbusTCP “memory” of this library are arrays which are connected to the function blocks.
The Automation Studio screenshot you’ve posted is the configuration area for Automation Runtime integrated ModbusTCP functionality.
Those both ModbusTCP functions are independent from each other, so I’m not sure what you’ve configured in detail.
Both solutions would run on TCP port 502 by default, so I assume one of the solutions is not active if you have both in the system. But it’s not clear to me right now which one?
So or so, you need just one of them: either the integrated solution configured by Automation Studio, or the open source library configured by code.
Best regards!
Hello Alex,
thanks a lot for your help. You were right. For some reason the PLC onfiguration was messed up. I had an earlier half-broken config and I think these old remnants and the new one strangled each other like the proverbial frog and the stork. I set up a new project and now the plc runs smoothly.
Regards,
Joachim