浏览代码

恒轮不转换位置

zhuhao 1 年之前
父节点
当前提交
0f8057e77c
共有 1 个文件被更改,包括 11 次插入11 次删除
  1. 11 11
      IMCS_CCS/Service/Impl/HttpRequestService.cs

+ 11 - 11
IMCS_CCS/Service/Impl/HttpRequestService.cs

@@ -695,20 +695,20 @@ namespace IMCS.CCS.Services
                 }
                 //放入恒轮工位,作为启动
                 string currentWorkStation = "";
-                if (req.url == "192.168.11.150" && req.data.Location == "127")
+                if (req.url == "192.168.11.150" && (req.data.Location == "127" || req.data.Location == "128"))
                 {
                     string workStationAddress = ToolUtils.AddressConvertDBW("DB200.332");
                     currentWorkStation = ((ushort)s7.Read(workStationAddress)).ConvertToShort().ToString();
                     //string currentWorkStation = s7.ReadInt16("DB200.332").Content.ToString();
-                    string writeValue = "128";
-                    if (currentWorkStation == "1")//工作台1
-                    {
-                        writeValue = "128";
-                    }
-                    else if (currentWorkStation == "2")//工作台2
-                    {
-                        writeValue = "127";
-                    }
+                    //string writeValue = req.data.Location;
+                    //if (currentWorkStation == "1")//工作台1
+                    //{
+                    //    writeValue = "128";
+                    //}
+                    //else if (currentWorkStation == "2")//工作台2
+                    //{
+                    //    writeValue = "127";
+                    //}
                     if (string.IsNullOrEmpty(req.data.fileName))
                     {
                         s7.Close();
@@ -720,7 +720,7 @@ namespace IMCS.CCS.Services
                     string proNo = Path.GetFileNameWithoutExtension(req.data.fileName); 
                     s7.Write("DB200.334", Convert.ToInt16(proNo));
                     Thread.Sleep(SLEEP_TIME);
-                    s7.Write("DB200.46", Convert.ToInt16(writeValue)); 
+                    s7.Write("DB200.46", Convert.ToInt16(req.data.Location)); 
                     Thread.Sleep(SLEEP_TIME);
                     s7.Write("DB200.50", Convert.ToInt16("4"));
                 }