ZengTao
2024-03-18 3556edd0d41fbc172b2c3a99af5a8a8b70691a97
springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
@@ -18,7 +18,7 @@
    S7PLC s7PLC; // PLC通讯类实例
    private EPlcType plcType = EPlcType.S1500; // 西门子PLC类型
    private String ip = "192.168.10.1"; // plc ip地址
    private int port = 102; // plc 端口号
    private int port = 65; // plc 端口号
    private static volatile S7control instance = null;
@@ -176,7 +176,7 @@
        }
    }
    private int getIndexFromAddress(String address) {
@@ -465,4 +465,8 @@
        }
        return addresslist;
    }
    public String readStrings(String addr) {
        return s7PLC.readString(addr);
    }
}