Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Codesys Modbus Comport

2022-10-11
2022-10-12
  • happychappy - 2022-10-11

    Brief background:
    Hardware: Wago 750-8214
    PLC Wago FW: 16-21
    Codesys Runtime: V4.4
    Modbus RTU

    I have a issue where I have a number of the same type of modbus slave device connected to my PLC, which is the master of the network. Between 1-10 hours, I would get a CRC or a Timeout Error report from the a random slave device in the device tree on the left hand side inside codesys,

    When I just use Wago Ecockpit as the runtime on the PLC, I do not experience any modbus issues on the network.

    The obvious difference between the 2 runtimes is the library that is being used for the communication. Wago has its own Library for modbus communication in e!Cockpit, and in codesys the library that I see being used by the device tree on the left hand side is 3S - Smart Software Solutions GmbH.

    I have contacted Wago about this problem, and they of course they mentioned if it works on e!Cockpit then it must be a codesys issue.

    The only way I can get rid off the modbus CRC and timeouts inside codesys, is to configure the modbus communication as TCP, and then use a Modbus TCP to RTU gateway between the PLC and slave devices. This is not what I want to do.

    Is there any suggestions/recommendations on what I can try to do to get the Modbus RTU stable?

     
  • eschwellinger

    eschwellinger - 2022-10-11

    not really a clue -
    if you use the exact same device (plc) and slaves and wiring this works like charm with Ecockpit (or is it a different application other slaves other pfc)
    I just want to verify if it is physical problem on wiring or slaves.
    For Modbus RTU and CODESYS you need to set RS485 in the plcshell, this is what you have already done?
    What about the busend resitors on end of the line (last device)

     
    • happychappy - 2022-10-12
      1. Exactly the same hardware setup on Ecockpit.
      2. the port is configured as RS485 via the PLC shell
      3. So there is a 120ohm resistor at the PLC and a 120 ohm resistor at the busend (between A and B). I also tried adding pull up and pull down resistors, since the wago Engineer advised me to try that since it is mentioned in the Wago manual on page 40.
        https://www.wago.com/wagoweb/documentation/750/eng_manu/coupler_controller/m07508212_xxxxxxxx_0en.pdf
      4. I am also running shielded cable, and have tried to connect the shield to PE/GND only on the PLC side, then I tried to only connect it to PE/GND at the bus end. I have also tried connecting the shield on both the PLC and the bus end at the same time, but nothing solved the issue.
      5. I can also reproduce the issue with a a replacement PLC and replacement slave devices.
      6. Like i menntioned, the only way I can get completely rid of the errors is using a TCP to RS485 gateway in between or using Ecockpit
       

Log in to post a comment.