Skip to content

Modbus TCP connection problem

Hi everyone,
I have a AXC F 2152 PLC and I try to use ModBus TCP library without success. My initial purpose is checking the examples library (server and client) to understand the performance. However, It doesn't work for me. I am trying to run Modbus_TCP_client example to connect with a localhost server (I use for that EasyModbusTCP Server Simulator) but client doesn't connect to the server, nothing happens.
In the other hand, I tried to do on the other way around, Modbus_TCP_server example running on the PLC, but same result, nothing happens. At this time, error 9000 appears and the port seems closed (using netstat).

Anyone can help me please?

Regards,

Comments

  • Starting with the Modbus TCP Server in the PLC - can you please post screen shots showing:
    1. your Function Block instance with connected variables, preferably in Debug mode so we can see the variable values, and
    2. your variable sheet showing the variables that are connected to the function block instance? So we can see the type of each variable.

    What version of (a) PLCnext Engineer and (b) PLC firmware are you using?
    What is the IP address of the PLC and the Modbus client machine?
    Can you successfully ping the IP address of the PLC from the modbus client machine, and vice-versa?
  • Thanks for the response.
    Attached you can find the screen shots.

    Versiion PLCNext Engineer: 2021.3
    Firmware: 2021.0.3 LTS (21.0.3.35554)

    The IP address of the PLC is 192.168.1.10 and Modbus client machine is a simulator, running on the localhost.
    I can succesfully ping the IP address of the PLC from the localhost. I have worked correctly with digital I/O even inside HMI interface.

    Regards,
  • The Modbus TCP library has only been released up to PLCnext Engineer version 2021.0.x.
    The next version - which will be compatible with PLCnext Engineer 2021.3 - is currently in development.
    This probably explains the unexpected behaviour that you are seeing, which I can also reproduce with PLCnext Engineer version 2021.3.
    If the problem also happens with PLCnext Engineer version 2021.0.x, please let us know.
    ~ Martin.
  • Hello,
    It's working well now, the problem was the version of the firmware.

    Thank you for the help.

    Regards.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.