adccommunitymod (AutomationDirect) asked a question.

Working before, mysteriously stopped

Created Date: July 25,2013

Created By: arao6

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I am using the modbus protocol to connect my C# program to a D4-450 slave. I have two D4-450s in two different companies using this same program without problems. Mysteriously, the same unmodified c# program is not able to connect to a third D4-450 I bought for an entirely different company. I tried to set various baud rates, parities, etc for the secondary COM port (via DirectSoft), modified my c# application to match the changes, and updated the windows xp port settings. Nothing I do works. The station number (which I assume is the slave id) is set to 1 for both port 1 and port 3, so I messed around with those values to no avail. Does anyone have any experience with this? Why would the PLC not respond to any modbus messages? I am using a standard RS232 cable...


  • adccommunitymod (AutomationDirect)

    Created Date: July 25,2013

    Created by: Do-more PE

    One reason might be a grounding differential between the PLC and the PC. RS-232 is a ground based signal so both devices must be at the same potential.

  • adccommunitymod (AutomationDirect)

    Created Date: July 25,2013

    Created by: arao6

    I was able to connect to the previous two PLCs fine, even without ground. One thing different between the last two projects and this one is the serial cable (I bought a different brand 9-pin to 25-pin cable). Do you think the cable could be the problem?

  • adccommunitymod (AutomationDirect)

    Created Date: July 25,2013

    Created by: Tinker

    "Do you think the cable could be the problem? "

    It certainly "could " be a problem, I have seen a cable be the problem more than once.If using RS232 one needs to be aware of the difference between DTE and DCE (actualy while I'm "aware " of the diference, it gives me a headache so I try to keep a "null modem " adapter handy and use trial and error)

    If you have the wrong type of cable it won't work even if the cable is "good " (for it's type)

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 25,2013

    Created by: Do-more PE

    If both of the pieces of equipment are not at the same ground potential, RS-232 devices will never communicate. RS-232 is a voltage based system referenced from ground.

    Just because one device in one part of a building works, or has worked, doesn't mean that any other device or that same device will continue to work ungrounded. Both the PC and PLC MUST be at the same ground potential.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 25,2013

    Created by: arao6

    Thanks for the help everyone! I finally solved the problem, and I will detail it here if anyone runs into this problem in the future. The D4-450's Port 1 and 3 are two ports in one. If using a normal RS232 cable, the cable will end up connecting to both ports at the same time, and nothing will communicate. You can enable a hardware handshake by jumping CTS and RTS on the serial cable and using a null modem (the PLC will then assume one port over the other). Magically, everything started blinking as expected. Cheers!

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 25,2013

    Created by: arao6

    I am using the modbus protocol to connect my C# program to a D4-450 slave. I have two D4-450s in two different companies using this same program without problems. Mysteriously, the same unmodified c# program is not able to connect to a third D4-450 I bought for an entirely different company.

    I tried to set various baud rates, parities, etc for the secondary COM port (via DirectSoft), modified my c# application to match the changes, and updated the windows xp port settings. Nothing I do works. The station number (which I assume is the slave id) is set to 1 for both port 1 and port 3, so I messed around with those values to no avail.

    Does anyone have any experience with this? Why would the PLC not respond to any modbus messages? I am using a standard RS232 cable...

    Expand Post