Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
0.4.0
-
None
-
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.