qinqi 2 vuotta sitten
vanhempi
commit
2aae50e35e
1 muutettua tiedostoa jossa 10 lisäystä ja 8 poistoa
  1. 10 8
      wwwroot/API/PLC/cipin3_plc/cipin6100.ashx

+ 10 - 8
wwwroot/API/PLC/cipin3_plc/cipin6100.ashx

@@ -17,11 +17,11 @@ public class cipin6100 : IHttpHandler
 
     public static class PLC
     {
-        public static string dbstatus = "100.0";   //状态
-        public static string dbabnormal = "100.2";//通信异常标识
-        public static string dbBarcode = "100.6";  //产品条码 
-        public static string dbworkshop = "100.3044";  //车间 
-        public static string dbgoodslevelname = "100.3046";//养水 
+        public static string dbstatus = "120.0";   //状态
+        public static string dbabnormal = "120.2";//通信异常标识
+        public static string dbBarcode = "120.6";  //产品条码 
+        public static string dbworkshop = "120.3044";  //车间 
+        public static string dbgoodslevelname = "120.3046";//养水 
     }
 
     //public static class API
@@ -81,19 +81,21 @@ public class cipin6100 : IHttpHandler
             //xuwei 2024-01-19 重写===================
             if (barCode == null || workshop == null || goodslevelname == null)
             {
-                bool statusflag = PlcWriteRepeat<short>(PLC.dbstatus, Convert.ToInt16(0));
+                
                 //bool barcodeflag = PlcWriteRepeat<string>(PLC.dbBarcode, barCode);
                 bool abnormalflag = PlcWriteRepeat<short>(PLC.dbabnormal, Convert.ToInt16(1));
                 //bool workshop1flag = PlcWriteRepeat<string>(PLC.dbworkshop, workshop);
                 //bool goodslevelnameflag = PlcWriteRepeat<short>(PLC.dbgoodslevelname, goodslevelname);
+                //bool statusflag = PlcWriteRepeat<short>(PLC.dbstatus, Convert.ToInt16(0));
             }
             else
             {
-                bool statusflag = PlcWriteRepeat<short>(PLC.dbstatus, Convert.ToInt16(1));
+                
                 bool barcodeflag = PlcWriteRepeat<string>(PLC.dbBarcode, barCode);
-                bool abnormalflag = PlcWriteRepeat<short>(PLC.dbabnormal, Convert.ToInt16(0));
+                //bool abnormalflag = PlcWriteRepeat<short>(PLC.dbabnormal, Convert.ToInt16(0));
                 bool workshop1flag = PlcWriteRepeat<short>(PLC.dbworkshop, Convert.ToInt16(workshop));
                 bool goodslevelnameflag = PlcWriteRepeat<short>(PLC.dbgoodslevelname, Convert.ToInt16(goodslevelname));
+                bool statusflag = PlcWriteRepeat<short>(PLC.dbstatus, Convert.ToInt16(1));
             }
             result.Add(new JObject(new JProperty("PLC读出(核对)", PLC.dbstatus + " = " + s7.Read<short>(PLC.dbstatus) + ";" + PLC.dbabnormal + " = " + s7.Read<short>(PLC.dbabnormal) + ";" + PLC.dbBarcode + " = " + s7.Read<string>(PLC.dbBarcode, 11), PLC.dbworkshop + " = " + s7.Read<short>(PLC.dbworkshop) + ";" , PLC.dbgoodslevelname + " = " + s7.Read<short>(PLC.dbgoodslevelname) + ";" )));
             //========================================