Update PLC4X S7 adapter
@@ -213,13 +213,8 @@ public class Plc4xS7Adapter extends PullAdapter {
protected void pullData() {
// Create PLC read request
-
- PlcConnection plcConnection = null;
try {
- plcConnection = this.driverManager.getConnection("s7://" + this.ip);
- } catch (PlcConnectionException e) {
- this.LOG.error("Could not establish connection to S7 with ip " + this.ip, e);
- }
+ PlcConnection plcConnection = this.driverManager.getConnection("s7://" + this.ip);
PlcReadRequest.Builder builder = plcConnection.readRequestBuilder();
for (Map<String, String> node : this.nodes) {
@@ -250,6 +245,11 @@ public class Plc4xS7Adapter extends PullAdapter {
} catch (InterruptedException | ExecutionException e) {
LOG.error(e.getMessage());
}
+ } catch (PlcConnectionException e) {
+ this.LOG.error("Could not establish connection to S7 with ip " + this.ip, e);
+ }
+
+
}
/**
