cptjackwu opened a new issue, #1174:
URL: https://github.com/apache/plc4x/issues/1174

   ### What happened?
   
   
   An exception occurs when I call the following method,  
    PlcReadResponse response = plcReadRequest.execute().get(10, 
TimeUnit.SECONDS);
   
   
   java.util.concurrent.ExecutionException: 
org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Disconnected
        at 
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
        at 
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
        at com.wh.subscription.S7Client.execute(S7Client.java:392)
        at com.wh.subscription.S7Client.readValues(S7Client.java:328)
        at 
com.wh.subscription.PlcSubscription.sendRequest(PlcSubscription.java:83)
        at 
com.wh.subscription.PlcSubscription$WatchdogTimer.lambda$kick$0(PlcSubscription.java:126)
        at 
com.wh.subscription.PlcSubscription$WatchdogTimer.lambda$runnableNullThrowWrapper$1(PlcSubscription.java:134)
        at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at 
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at 
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
   
   
   
   I want to use  S7HDefaultNettyPlcConnection isConnected equal to false and 
then reconnect. This method doesn’t work. What should I do?
   
    if (this.plcConnection == null || !this.plcConnection.isConnected()) {
                   this.plcConnection = 
PlcDriverManager.getDefault().getConnectionManager().getConnection(url);
               }
   
   ### Version
   
   v0.11.0
   
   ### Programming Languages
   
   - [X] plc4j
   - [ ] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [ ] OPC-UA
   - [X] S7


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to