[
https://issues.apache.org/jira/browse/PLC4X-134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16883765#comment-16883765
]
Mirko Pohland commented on PLC4X-134:
-------------------------------------
Hi everyone,
I tried the same with an S7 1200 and it worked like expected. What worked for
both, the S7 300 and the S7 1200 was to add rack and slot to both, the calling-
and the calledTsapId.
short calledTsapId = S7TsapIdEncoder.encodeS7TsapId(DeviceGroup.OS,
rack, slot);
short callingTsapId =
S7TsapIdEncoder.encodeS7TsapId(DeviceGroup.PG_OR_PC, rack, slot);
I am not familiar enough with the IsoTPProtocol to know why this works. But it
still might be of some interest for you.
Regards,
Mirko
> S7 is terminating the connection during handshake
> -------------------------------------------------
>
> Key: PLC4X-134
> URL: https://issues.apache.org/jira/browse/PLC4X-134
> Project: Apache PLC4X
> Issue Type: Bug
> Components: Driver-S7
> Affects Versions: 0.5.0
> Reporter: Mirko Pohland
> Priority: Critical
> Attachments: stack_trace.txt
>
>
> When trying to connect to my S7-300 I get the following error (stack trace
> attached):
> {color:#FF0000} org.apache.plc4x.java.api.exceptions.PlcIoException:
> Connection terminated by remote{color}
> 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.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)