9
0

2 Коммиты 18d3a13c4c ... 18ed22c5c3

Автор SHA1 Сообщение Дата
  hzd 18ed22c5c3 修改时间 1 неделя назад
  hzd 3aff1d0e93 优化 1 неделя назад
2 измененных файлов с 8 добавлено и 4 удалено
  1. 7 3
      src/com/mes/ui/MesClient.java
  2. 1 1
      src/resources/config/config.properties

+ 7 - 3
src/com/mes/ui/MesClient.java

@@ -91,8 +91,8 @@ public class MesClient extends JFrame {
     public static JTextField param3;
     public static JTextField param4;
 
-    public static ModbusTcp plcA = new ModbusTcp(1, "192.168.0.6");
-//    public static ModbusTcp plcB = new ModbusTcp(1, "192.168.1.8");
+    public static ModbusTcp plcA = new ModbusTcp(1, "192.168.0.7"); // 210B
+//    public static ModbusTcp plcA = new ModbusTcp(1, "192.168.0.6"); // 210A
 
     public static Timer cjTimer;
 
@@ -131,6 +131,7 @@ public class MesClient extends JFrame {
 
     public static Integer jrFlag = 0; // 是否已加热 0=未处理 1=加热中 2=已加热
 
+    public static long timer_max = 45;
     public static JLabel timer_label; // 倒计时显示
     public static boolean timer_flag = false; // 开始计时标志
     public static long timer_nums = 0; // 秒数
@@ -158,6 +159,8 @@ public class MesClient extends JFrame {
 
                     updateTime();
 
+//                    plcA.writeInt16(4160, (short)2);
+
 //                    setDeviceStart();
 
                     getMaterailData();
@@ -197,6 +200,7 @@ public class MesClient extends JFrame {
                     }
 
                 } catch (Exception e){
+                    e.printStackTrace();
                     System.out.println("心跳A执行失败: " + e.getMessage());
                 }
             }
@@ -219,7 +223,7 @@ public class MesClient extends JFrame {
                     String time = CommonUtil.formatSecondsToHMS(timer_nums);
                     timer_label.setText("加热:"+time);
 
-                    if(timer_nums >= 90){
+                    if(timer_nums >= timer_max){
                         timer_label.setForeground(Color.GREEN);
 //                        ModbusUtil.setPowerOn(plcA);
                         MesClient.heartBeatFlag = true;

+ 1 - 1
src/resources/config/config.properties

@@ -1,4 +1,4 @@
-mes.gw=OP210A
+mes.gw=OP210B
 #mes.server_ip=127.0.0.1
 mes.server_ip=192.168.22.99
 mes.tcp_port=3000