wangxichen hace 5 días
padre
commit
e3aaa13baa
Se han modificado 2 ficheros con 6 adiciones y 4 borrados
  1. 1 2
      src/com/mes/ui/MesClient.java
  2. 5 2
      src/com/mes/ui/PlcUtil.java

+ 1 - 2
src/com/mes/ui/MesClient.java

@@ -123,8 +123,7 @@ public class MesClient extends JFrame {
 
     public static Integer lastpage = 0;     //标记是否是首次进入设备运行状态,0表示首次进入运行状态,1表示非首次进入运行状态
 
-    public static S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.7.100"); // CD 北边
-//    public static S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.0.41"); // AB 中间
+    public static S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.7.100");
 
     public static List<String> hjparams = new ArrayList<>();
 

+ 5 - 2
src/com/mes/ui/PlcUtil.java

@@ -244,7 +244,8 @@ public class PlcUtil {
     // 修改设备的禁用开关
     public static Boolean changeEnable(S7PLC s7PLC,Boolean result){
         try{
-            s7PLC.writeBoolean("DB9.30.4",result); // AB
+            s7PLC.writeBoolean("DB9.18.3",result); // AB
+//            s7PLC.writeBoolean("DB9.30.4",result); // CD
             return true;
         }catch (Exception e){
             e.printStackTrace();
@@ -256,7 +257,9 @@ public class PlcUtil {
     public static Boolean getEnable(S7PLC s7PLC){
         Boolean ret = false;
         try{
-            ret = s7PLC.readBoolean("DB9.30.4");
+            ret = s7PLC.readBoolean("DB9.18.3");  // AB
+//            ret = s7PLC.readBoolean("DB9.30.4");  // CD
+
         }catch (Exception e){
             e.printStackTrace();
         }