Sebastian Voss created PLC4X-246:
------------------------------------

             Summary: 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
         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)

Reply via email to