[
https://issues.apache.org/jira/browse/PLC4X-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17188193#comment-17188193
]
Christofer Dutz commented on PLC4X-246:
---------------------------------------
Now I would really love to use the :facepalm: emoji ... just found the problem
... update is coming ;)
{code:java}
09:08:54.218 [nioEventLoopGroup-2-1] TRACE o.a.plc4x.java.spi.Plc4xNettyWrapper
- Decoding
TPKTPacket[payload=COTPPacketData[parameters={},payload=S7MessageResponse[tpduReference=10,parameter=<null>,payload=<null>,errorClass=129,errorCode=4],eot=true,tpduRef=0]]09:08:54.218
[nioEventLoopGroup-2-1] TRACE o.a.plc4x.java.spi.Plc4xNettyWrapper - Decoding
TPKTPacket[payload=COTPPacketData[parameters={},payload=S7MessageResponse[tpduReference=10,parameter=<null>,payload=<null>,errorClass=129,errorCode=4],eot=true,tpduRef=0]]09:08:54.219
[nioEventLoopGroup-2-1] TRACE o.a.plc4x.java.spi.Plc4xNettyWrapper - Checking
handler HandlerRegistration#3 for Object of type TPKTPacket09:08:54.219
[nioEventLoopGroup-2-1] TRACE o.a.plc4x.java.spi.Plc4xNettyWrapper - Handler
HandlerRegistration#3 has right expected type TPKTPacket, checking
condition09:08:54.219 [nioEventLoopGroup-2-1] TRACE
o.a.plc4x.java.spi.Plc4xNettyWrapper - Handler HandlerRegistration#3 accepts
element
TPKTPacket[payload=COTPPacketData[parameters={},payload=S7MessageResponse[tpduReference=10,parameter=<null>,payload=<null>,errorClass=129,errorCode=4],eot=true,tpduRef=0]],
calling handle method09:08:54.219 [nioEventLoopGroup-2-1] WARN
o.a.p.j.s.r.protocol.S7ProtocolLogic - Got an error response from the PLC. This
particular response code usually indicates that PUT/GET is not enabled on the
PLC.09:08:54.223 [main] ERROR o.a.p.j.e.helloplc4x.HelloPlc4x - Error[value-0]:
ACCESS_DENIED09:08:54.223 [main] ERROR o.a.p.j.e.helloplc4x.HelloPlc4x -
Error[value-1]: ACCESS_DENIED09:08:54.223 [main] ERROR
o.a.p.j.e.helloplc4x.HelloPlc4x - Error[value-2]: ACCESS_DENIED09:08:54.223
[main] ERROR o.a.p.j.e.helloplc4x.HelloPlc4x - Error[value-3]:
ACCESS_DENIED09:08:54.223 [main] ERROR o.a.p.j.e.helloplc4x.HelloPlc4x -
Error[value-4]:
ACCESS_DENIEDorg.apache.plc4x.java.api.exceptions.PlcRuntimeException: Field
'value-0' could not be fetched, response was ACCESS_DENIED at
org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse.getFieldInternal(DefaultPlcReadResponse.java:690)
at
org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse.getObject(DefaultPlcReadResponse.java:114)
at
org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse.lambda$getAsPlcValue$0(DefaultPlcReadResponse.java:63)
at
java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:178)
at
java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) at
java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at
java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at
org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse.getAsPlcValue(DefaultPlcReadResponse.java:63)
at
org.apache.plc4x.java.examples.helloplc4x.HelloPlc4x.main(HelloPlc4x.java:76)
{code}
> S7 driver hangs on read
> -----------------------
>
> Key: PLC4X-246
> URL: https://issues.apache.org/jira/browse/PLC4X-246
> Project: Apache PLC4X
> Issue Type: Bug
> Components: Driver-S7
> Affects Versions: 0.7.0
> Reporter: Sebastian Voss
> Priority: Major
> Attachments: s7_capture.pcapng
>
>
> I’m trying to read a value from an Siemens S7-1200 PLC). When I try to read a
> value the read request is not being executed (I also do not receive an error
> message or timeout).
> This is the simple program I created:
> {code:java}
> String url = "s7://172.29.118.20:102?controller-type=S7_1200";
> PlcDriverManager manager = new PlcDriverManager();
> PlcConnection connection = manager.getConnection(url);
> boolean isConnected = connection.isConnected();
> boolean canRead = connection.getMetadata().canRead();
> System.out.println(isConnected); // prints true
> System.out.println(canRead); // prints true
> String field = "%DB20:5.0:BOOL";
> PlcReadRequest request = connection
> .readRequestBuilder()
> .addItem("value-1", field)
> .build();
> PlcReadResponse response = request.execute().get(); // here is hangs forever
> System.out.println(response.getFieldNames());
> connection.close();{code}
> I created a Wireshark capture and it seems the PLC is reporting:
> {code:java}
> [Error code: This service is not implemented on the module or a frame error
> was reported (0x8104)]{code}
> Thanks to the help of [~cdutz] I figured out this is related to the
> protection settings of the PLC. I will try to adjust those settings and
> report back the result. Maybe the driver can be improved to report back those
> error codes to the user.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)