Uploaded image for project: 'Apache PLC4X'
  1. Apache PLC4X
  2. PLC4X-134

S7 is terminating the connection during handshake

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 0.4.0
    • None
    • Driver-S7
    • None

    Description

      When trying to connect to my S7-300 I get the following error (stack trace attached):
       org.apache.plc4x.java.api.exceptions.PlcIoException: Connection terminated by remote

      After some debugging I found out that I can fix this issue by doing a small change in S7PlcConnection.java

       

      From

              short calledTsapId = S7TsapIdEncoder.encodeS7TsapId(DeviceGroup.OS, 0, 0);
              short callingTsapId = S7TsapIdEncoder.encodeS7TsapId(DeviceGroup.PG_OR_PC, rack, slot);

      where calledTsapId does not contain rack and slot to

              short calledTsapId = S7TsapIdEncoder.encodeS7TsapId(DeviceGroup.OS, rack, slot);
              short callingTsapId = S7TsapIdEncoder.encodeS7TsapId(DeviceGroup.PG_OR_PC, 0, 0);

      Now I can connect to the S7.

      Attachments

        1. stack_trace.txt
          4 kB
          Mirko Pohland

        Activity

          People

            cdutz Christofer Dutz
            generalkelly Mirko Pohland
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: