严智鑫
2024-05-22 06a852184f2711e72ae06650a793e52334bdefe0
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java
@@ -13,8 +13,8 @@
 */
public class S7object extends Thread {
    public S7control plccontrol; // PLC通讯类实例
    private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型
    private String ip = "192.168.10.1"; // plc ip地址
    private EPlcType plcType = EPlcType.S200_SMART; // 西门子PLC类型
    private String ip = "192.168.10.100"; // plc ip地址
    private int port = 102; // plc 端口号
@@ -24,9 +24,7 @@
    private S7object() {
        if (plccontrol == null) {
            plccontrol = new S7control(plcType, ip, port, 0, 0);
            String PlcLoadGlass = S7object.class.getResource("/JsonFile/PlcLoadGlass.json").getPath();
            //log.info(PLCAutoMes.class.getResource("").getPath());
            String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcLoadGlass.json";
            PlcMesObject = InitUtil.initword(PlcLoadGlass);
        }
    }