{ "ProjectSn": "", "Directory": "", "Snippets": [ { "ID": "20250226153120175", "Name": "业务逻辑", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "", "Children": [ { "ID": "20250323111613779", "Name": "初始化配置", "Desc": "", "Content": " if (Tag.Global.SettingsOver == 0)\r\n {\r\n SettingInit();\r\n Tag.Global.SettingsOver = 1;\r\n }\r\n else if(Settings.deviceInfos.Count == 0)\r\n {\r\n Tag.Global.SettingsOver = 0;\r\n }\r\n", "ContentCopy": " if (Tag.Global.SettingsOver == 0)\r\n {\r\n SettingInit();\r\n Tag.Global.SettingsOver = 1;\r\n }\r\n else if(Settings.deviceInfos.Count == 0)\r\n {\r\n Tag.Global.SettingsOver = 0;\r\n }\r\n", "ParentID": "20250226153120175", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 10000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.初始化配置", "ParentFullName": "业务逻辑", "Enabled": "Enabled" }, { "ID": "20250323151832119", "Name": "Program4", "Desc": "", "Content": "//Conn.默认Redis.SetValue(\"西门子2.Param3\",\"300\",\"西门子2Queue\");\r\n//return;\r\nif(false){\r\n List locs = new List() { \"vxr1l\", \"vx1r\", \"vxr1c1\", \"vxr1c2\", \"vxr2l\", \"vxr2r\", \"vxr2c1\", \"vxr2c2\" };\r\n List sites = new List() { \"196365BB283162\", \"193841BB283149\", \"198756BB287300\", \"198767BB286133\", \"206987BB282931\", \"204460BB282975\", \"209405BB287057\", \"209377BB285899\" };\r\n\r\n LocRepository locservice = new LocRepository();\r\n for (int i = 0; i < locs.Count; i++)\r\n {\r\n string loccode = locs[i];\r\n string sitesss = sites[i];\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == loccode);\r\n if (loc == null)\r\n {\r\n locservice.Insert(new LocEntity\r\n {\r\n S_ID = Guid.NewGuid().ToString(),\r\n S_STATE = \"编辑\",\r\n T_CREATE = DateTime.Now,\r\n T_MODIFY = DateTime.Now,\r\n S_DEEP = \"vxr\",\r\n\r\n S_LOC_CODE = loccode,\r\n S_AGV_SITE = sitesss,\r\n\r\n S_LOCK_STATE = \"无\",\r\n N_ROW = 1,\r\n N_COL = 1,\r\n N_AGV_CODE = 0,\r\n N_AGV_SITE_LAYER = 0,\r\n N_CAPACITY = 1,\r\n N_CURRENT_NUM = 0,\r\n S_TYPE = \"\",\r\n\r\n });\r\n }\r\n }\r\n // TaskProcess.CreateTask(\"\", locs[6], locs[7], \"test\", 9, new List { \"test\" }, 1, 1, 1);\r\n }\r\n", "ContentCopy": "//Conn.默认Redis.SetValue(\"西门子2.Param3\",\"300\",\"西门子2Queue\");\r\n//return;\r\nif(false){\r\n List locs = new List() { \"vxr1l\", \"vx1r\", \"vxr1c1\", \"vxr1c2\", \"vxr2l\", \"vxr2r\", \"vxr2c1\", \"vxr2c2\" };\r\n List sites = new List() { \"196365BB283162\", \"193841BB283149\", \"198756BB287300\", \"198767BB286133\", \"206987BB282931\", \"204460BB282975\", \"209405BB287057\", \"209377BB285899\" };\r\n\r\n LocRepository locservice = new LocRepository();\r\n for (int i = 0; i < locs.Count; i++)\r\n {\r\n string loccode = locs[i];\r\n string sitesss = sites[i];\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == loccode);\r\n if (loc == null)\r\n {\r\n locservice.Insert(new LocEntity\r\n {\r\n S_ID = Guid.NewGuid().ToString(),\r\n S_STATE = \"编辑\",\r\n T_CREATE = DateTime.Now,\r\n T_MODIFY = DateTime.Now,\r\n S_DEEP = \"vxr\",\r\n\r\n S_LOC_CODE = loccode,\r\n S_AGV_SITE = sitesss,\r\n\r\n S_LOCK_STATE = \"无\",\r\n N_ROW = 1,\r\n N_COL = 1,\r\n N_AGV_CODE = 0,\r\n N_AGV_SITE_LAYER = 0,\r\n N_CAPACITY = 1,\r\n N_CURRENT_NUM = 0,\r\n S_TYPE = \"\",\r\n\r\n });\r\n }\r\n }\r\n // TaskProcess.CreateTask(\"\", locs[6], locs[7], \"test\", 9, new List { \"test\" }, 1, 1, 1);\r\n }\r\n", "ParentID": "20250226153120175", "Children": [], "Type": "Program", "Property": { "SyncExec": "True", "RepeatExec": "Count", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.Program4", "ParentFullName": "业务逻辑", "Enabled": "Enabled" }, { "ID": "20250325083047245", "Name": "第三标段", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250226153120175", "Children": [ { "ID": "20250325083325390", "Name": "捷瞬抓臂1", "Desc": "", "Content": "var VERX = Settings.deviceInfos?.Find(x =>x.deviceType==2&& x.deviceName == \"Js捷顺1\");\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.Js1.D1212_LAST == 0 && TcpServer.GetBitdata(tag.Js1.D1212, 2) == 1)\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 4,\r\n endBit = VERX.location[0]\r\n }));\r\n LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.Js1.D1212_LAST = 1;\r\n }\r\n }\r\n if(tag.Js1.D1212_LAST == 1 &&TcpServer.GetBitdata(tag.Js1.D1212, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js1.D1212_LAST = 0;\r\n }\r\n\t\t\t\t\t\t\tif (tag.Js1.D1213_LAST == 0 && TcpServer.GetBitdata(tag.Js1.D1212, 3) == 1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequestType = 4,\r\n\t\t\t\t\t\t\t\t\tendBit = VERX.location[1]\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\tLogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n\t\t\t\t\t\t\t\tif (str.Contains(\"true\"))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.Js1.D1213_LAST = 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}if(tag.Js1.D1213_LAST == 1 &&TcpServer.GetBitdata(tag.Js1.D1212, 3) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js1.D1213_LAST = 0;\r\n }\r\n }", "ContentCopy": "var VERX = Settings.deviceInfos?.Find(x =>x.deviceType==2&& x.deviceName == \"Js捷顺1\");\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.Js1.D1212_LAST == 0 && TcpServer.GetBitdata(tag.Js1.D1212, 2) == 1)\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 4,\r\n endBit = VERX.location[0]\r\n }));\r\n LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.Js1.D1212_LAST = 1;\r\n }\r\n }\r\n if(tag.Js1.D1212_LAST == 1 &&TcpServer.GetBitdata(tag.Js1.D1212, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js1.D1212_LAST = 0;\r\n }\r\n\t\t\t\t\t\t\tif (tag.Js1.D1213_LAST == 0 && TcpServer.GetBitdata(tag.Js1.D1212, 3) == 1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequestType = 4,\r\n\t\t\t\t\t\t\t\t\tendBit = VERX.location[1]\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\tLogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n\t\t\t\t\t\t\t\tif (str.Contains(\"true\"))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.Js1.D1213_LAST = 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}if(tag.Js1.D1213_LAST == 1 &&TcpServer.GetBitdata(tag.Js1.D1212, 3) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js1.D1213_LAST = 0;\r\n }\r\n }", "ParentID": "20250325083047245", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.捷瞬抓臂1", "ParentFullName": "业务逻辑.第三标段", "Enabled": "Enabled" }, { "ID": "20250325083326611", "Name": "捷瞬抓臂2", "Desc": "", "Content": "//jsz2捷瞬抓臂2\r\n\r\n var VERX = Settings.deviceInfos?.Find(x =>x.deviceType==2&& x.deviceName == \"Js捷顺2\");\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.Js2.D1212_LAST == 0 && TcpServer.GetBitdata(tag.Js2.D1212, 2) == 1)\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 4,\r\n endBit = VERX.location[0]\r\n }));\r\n LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.Js2.D1212_LAST = 1;\r\n }\r\n } if(tag.Js2.D1212_LAST == 1 &&TcpServer.GetBitdata(tag.Js2.D1212, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js2.D1212_LAST = 0;\r\n }\r\n if (tag.Js2.D1213_LAST == 0 && TcpServer.GetBitdata(tag.Js2.D1212, 3) == 1)\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 4,\r\n endBit = VERX.location[1]\r\n }));\r\n LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.Js2.D1213_LAST = 1;\r\n }\r\n }if(tag.Js2.D1213_LAST == 1 &&TcpServer.GetBitdata(tag.Js2.D1213, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js2.D1213_LAST = 0;\r\n }\r\n }", "ContentCopy": "//jsz2捷瞬抓臂2\r\n\r\n var VERX = Settings.deviceInfos?.Find(x =>x.deviceType==2&& x.deviceName == \"Js捷顺2\");\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.Js2.D1212_LAST == 0 && TcpServer.GetBitdata(tag.Js2.D1212, 2) == 1)\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 4,\r\n endBit = VERX.location[0]\r\n }));\r\n LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.Js2.D1212_LAST = 1;\r\n }\r\n } if(tag.Js2.D1212_LAST == 1 &&TcpServer.GetBitdata(tag.Js2.D1212, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js2.D1212_LAST = 0;\r\n }\r\n if (tag.Js2.D1213_LAST == 0 && TcpServer.GetBitdata(tag.Js2.D1212, 3) == 1)\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 4,\r\n endBit = VERX.location[1]\r\n }));\r\n LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.Js2.D1213_LAST = 1;\r\n }\r\n }if(tag.Js2.D1213_LAST == 1 &&TcpServer.GetBitdata(tag.Js2.D1213, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js2.D1213_LAST = 0;\r\n }\r\n }", "ParentID": "20250325083047245", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.捷瞬抓臂2", "ParentFullName": "业务逻辑.第三标段", "Enabled": "Enabled" }, { "ID": "20250325085810885", "Name": "自流转流程", "Desc": "", "Content": "//foreach(var di in Settings.deviceInfos)\r\n//\tif (di.deviceType == 2 || di.deviceType == 1)\r\n//\tRunafterMac(di,true);\r\n\t/// TODO mes 下发。 改成机械臂监控 - 监控空的还是满的 - 联动mes 任务。", "ContentCopy": "//foreach(var di in Settings.deviceInfos)\r\n//\tif (di.deviceType == 2 || di.deviceType == 1)\r\n//\tRunafterMac(di,true);\r\n\t/// TODO mes 下发。 改成机械臂监控 - 监控空的还是满的 - 联动mes 任务。", "ParentID": "20250325083047245", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.自流转流程", "ParentFullName": "业务逻辑.第三标段", "Enabled": "Enabled" }, { "ID": "20250610002001052", "Name": "维系尔1号", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250325083047245", "Children": [ { "ID": "20250325083149366", "Name": "维希尔抓臂1L", "Desc": "", "Content": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"1\"));\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.wxr1.R44 && !tag.wxr1.R44_LAST && tag.wxr1.R10)\r\n {\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0], out string traycode))\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 1,\r\n cntrCode = traycode,\r\n startBit = VERX.location[0],\r\n endBit = \"\"\r\n }));\r\n LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.wxr1.R44_LAST = true; \r\n }\r\n }\r\n else\r\n {\r\n TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n }\r\n }\r\n else\r\n {\r\n //TaskRepository ts = new TaskRepository();\r\n if (tag.wxr1.R10_LAST) //托盘放置信号。。\r\n {\r\n \tif (tag.wxr1.R10)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.wxr1.R10_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0],out string traycode))\r\n {\r\n //上报校验。\r\n ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n {\r\n sceneType = 1,\r\n cntrCode = traycode,\r\n }));\r\n if (str.Contains(\"true\"))\r\n {\r\n //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n tag.wxr1.R10 = true;\r\n tag.wxr1.R44_LAST = false;\r\n }\r\n else\r\n {\r\n //报警。\r\n }\r\n }\r\n else { TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n }\r\n }\r\n }", "ContentCopy": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"1\"));\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.wxr1.R44 && !tag.wxr1.R44_LAST && tag.wxr1.R10)\r\n {\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0], out string traycode))\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 1,\r\n cntrCode = traycode,\r\n startBit = VERX.location[0],\r\n endBit = \"\"\r\n }));\r\n LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.wxr1.R44_LAST = true; \r\n }\r\n }\r\n else\r\n {\r\n TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n }\r\n }\r\n else\r\n {\r\n //TaskRepository ts = new TaskRepository();\r\n if (tag.wxr1.R10_LAST) //托盘放置信号。。\r\n {\r\n \tif (tag.wxr1.R10)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.wxr1.R10_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0],out string traycode))\r\n {\r\n //上报校验。\r\n ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n {\r\n sceneType = 1,\r\n cntrCode = traycode,\r\n }));\r\n if (str.Contains(\"true\"))\r\n {\r\n //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n tag.wxr1.R10 = true;\r\n tag.wxr1.R44_LAST = false;\r\n }\r\n else\r\n {\r\n //报警。\r\n }\r\n }\r\n else { TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n }\r\n }\r\n }", "ParentID": "20250610002001052", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.维系尔1号.维希尔抓臂1L", "ParentFullName": "业务逻辑.第三标段.维系尔1号", "Enabled": "Enabled" }, { "ID": "20250610002047005", "Name": "维希尔抓臂1R", "Desc": "", "Content": "var VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"1\"));\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.wxr1.R46 && !tag.wxr1.R46_LAST && tag.wxr1.R11)\r\n {\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode))\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 1,\r\n cntrCode = traycode,\r\n startBit = VERX.location[1],\r\n endBit = \"\"\r\n }));\r\n LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.wxr1.R46_LAST = true; \r\n }\r\n }\r\n else\r\n {\r\n TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n }\r\n }\r\n else\r\n {\r\n if (tag.wxr1.R11_LAST) //托盘放置信号。。\r\n {\r\n \tif (tag.wxr1.R11)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.wxr1.R11_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1],out string traycode))\r\n {\r\n //上报校验。\r\n ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n {\r\n sceneType = 1,\r\n cntrCode = traycode,\r\n }));\r\n if (str.Contains(\"true\"))\r\n {\r\n //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n tag.wxr1.R11 = true;\r\n tag.wxr1.R46_LAST = false;\r\n }\r\n else\r\n {\r\n //报警。\r\n }\r\n }\r\n else { TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n }\r\n }\r\n }", "ContentCopy": "var VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"1\"));\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.wxr1.R46 && !tag.wxr1.R46_LAST && tag.wxr1.R11)\r\n {\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode))\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 1,\r\n cntrCode = traycode,\r\n startBit = VERX.location[1],\r\n endBit = \"\"\r\n }));\r\n LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.wxr1.R46_LAST = true; \r\n }\r\n }\r\n else\r\n {\r\n TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n }\r\n }\r\n else\r\n {\r\n if (tag.wxr1.R11_LAST) //托盘放置信号。。\r\n {\r\n \tif (tag.wxr1.R11)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.wxr1.R11_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1],out string traycode))\r\n {\r\n //上报校验。\r\n ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n {\r\n sceneType = 1,\r\n cntrCode = traycode,\r\n }));\r\n if (str.Contains(\"true\"))\r\n {\r\n //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n tag.wxr1.R11 = true;\r\n tag.wxr1.R46_LAST = false;\r\n }\r\n else\r\n {\r\n //报警。\r\n }\r\n }\r\n else { TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n }\r\n }\r\n }", "ParentID": "20250610002001052", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.维系尔1号.维希尔抓臂1R", "ParentFullName": "业务逻辑.第三标段.维系尔1号", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.维系尔1号", "ParentFullName": "业务逻辑.第三标段", "Enabled": "Enabled" }, { "ID": "20250610002414741", "Name": "维系尔2号", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250325083047245", "Children": [ { "ID": "20250325083315503", "Name": "维希尔抓臂2L", "Desc": "", "Content": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"2\"));\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.wxr2.R44 && !tag.wxr2.R44_LAST && tag.wxr2.R10)\r\n {\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0], out string traycode))\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 1,\r\n cntrCode = traycode,\r\n startBit = VERX.location[0],\r\n endBit = \"\"\r\n }));\r\n LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.wxr2.R44_LAST = true; \r\n }\r\n }\r\n else\r\n {\r\n TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n }\r\n }\r\n else\r\n {\r\n if (tag.wxr2.R10_LAST) //托盘放置信号。。\r\n {\r\n \tif (tag.wxr2.R10)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\ttag.wxr2.R10_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0],out string traycode))\r\n {\r\n //上报校验。\r\n ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n {\r\n sceneType = 1,\r\n cntrCode = traycode,\r\n }));\r\n if (str.Contains(\"true\"))\r\n {\r\n //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n tag.wxr2.R10 = true;\r\n tag.wxr2.R44_LAST = false;\r\n }\r\n else\r\n {\r\n //报警。\r\n }\r\n }\r\n else { TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n }\r\n }\r\n }", "ContentCopy": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"2\"));\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.wxr2.R44 && !tag.wxr2.R44_LAST && tag.wxr2.R10)\r\n {\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0], out string traycode))\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 1,\r\n cntrCode = traycode,\r\n startBit = VERX.location[0],\r\n endBit = \"\"\r\n }));\r\n LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.wxr2.R44_LAST = true; \r\n }\r\n }\r\n else\r\n {\r\n TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n }\r\n }\r\n else\r\n {\r\n if (tag.wxr2.R10_LAST) //托盘放置信号。。\r\n {\r\n \tif (tag.wxr2.R10)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\ttag.wxr2.R10_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0],out string traycode))\r\n {\r\n //上报校验。\r\n ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n {\r\n sceneType = 1,\r\n cntrCode = traycode,\r\n }));\r\n if (str.Contains(\"true\"))\r\n {\r\n //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n tag.wxr2.R10 = true;\r\n tag.wxr2.R44_LAST = false;\r\n }\r\n else\r\n {\r\n //报警。\r\n }\r\n }\r\n else { TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n }\r\n }\r\n }", "ParentID": "20250610002414741", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.维系尔2号.维希尔抓臂2L", "ParentFullName": "业务逻辑.第三标段.维系尔2号", "Enabled": "Enabled" }, { "ID": "20250610002647095", "Name": "维希尔抓臂2R", "Desc": "", "Content": "var VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"2\"));\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.wxr2.R46 && !tag.wxr2.R46_LAST && tag.wxr2.R11)\r\n {\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode))\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 1,\r\n cntrCode = traycode,\r\n startBit = VERX.location[1],\r\n endBit = \"\"\r\n }));\r\n LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.wxr2.R46_LAST = true; \r\n }\r\n }\r\n else\r\n {\r\n TcpServer.TcpServerSend(VERX.deviceNo[2], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n }\r\n }\r\n else\r\n {\r\n if (tag.wxr2.R11_LAST) //托盘放置信号。。\r\n {\r\n \tif (tag.wxr2.R11)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\ttag.wxr2.R11_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1],out string traycode))\r\n {\r\n //上报校验。\r\n ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n {\r\n sceneType = 1,\r\n cntrCode = traycode,\r\n }));\r\n if (str.Contains(\"true\"))\r\n {\r\n //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n tag.wxr2.R11 = true;\r\n tag.wxr2.R46_LAST = false;\r\n }\r\n else\r\n {\r\n //报警。\r\n }\r\n }\r\n else { TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n }\r\n }\r\n }", "ContentCopy": "var VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"2\"));\r\n\r\n if (VERX != null)\r\n {\r\n if (tag.wxr2.R46 && !tag.wxr2.R46_LAST && tag.wxr2.R11)\r\n {\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode))\r\n {\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n {\r\n requestType = 1,\r\n cntrCode = traycode,\r\n startBit = VERX.location[1],\r\n endBit = \"\"\r\n }));\r\n LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n if (str.Contains(\"true\"))\r\n {\r\n tag.wxr2.R46_LAST = true; \r\n }\r\n }\r\n else\r\n {\r\n TcpServer.TcpServerSend(VERX.deviceNo[2], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n }\r\n }\r\n else\r\n {\r\n if (tag.wxr2.R11_LAST) //托盘放置信号。。\r\n {\r\n \tif (tag.wxr2.R11)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\ttag.wxr2.R11_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1],out string traycode))\r\n {\r\n //上报校验。\r\n ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n {\r\n sceneType = 1,\r\n cntrCode = traycode,\r\n }));\r\n if (str.Contains(\"true\"))\r\n {\r\n //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n tag.wxr2.R11 = true;\r\n tag.wxr2.R46_LAST = false;\r\n }\r\n else\r\n {\r\n //报警。\r\n }\r\n }\r\n else { TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n }\r\n }\r\n }", "ParentID": "20250610002414741", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.维系尔2号.维希尔抓臂2R", "ParentFullName": "业务逻辑.第三标段.维系尔2号", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段.维系尔2号", "ParentFullName": "业务逻辑.第三标段", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.第三标段", "ParentFullName": "业务逻辑", "Enabled": "Enabled" }, { "ID": "20250325085542733", "Name": "任务下发", "Desc": "", "Content": "ITaskRepository taskservice = new TaskRepository();\r\nvar tklist = taskservice.FindList(x => x.S_B_STATE == \"未执行\" && x.S_WORK_MODE == \"AGV\");\r\nif(tklist.Any())\r\nforeach (var tk in tklist.GroupBy(item =>\r\n{\r\n var ticks = item.T_CREATE.Ticks;\r\n return new DateTime(ticks - ticks % (10 * TimeSpan.TicksPerMinute));\r\n}).OrderBy(x => x.Key))\r\n{\r\n var ts = tk.OrderByDescending(x => x.N_PRIORITY).ToList();\r\n foreach (var t in ts)\r\n {\r\n var b = false;\r\n b = RunTask(t);\r\n\r\n if (b)\r\n {\r\n t.S_B_STATE = \"已推送\";\r\n taskservice.Update(t);\r\n }\r\n }\r\n break;\r\n}\r\n#region Rgv\r\n\r\nvar task1Isrun = false;\r\nif (tag.RGV.ReadTask1No > 0 && tag.RGV.bit1taskOver != 1)\r\n{\r\n task1Isrun = true;\r\n if (tag.RGV.bit1taskOver_LAST == 1)\r\n RedisHelper.Add($\"RGV.bit1taskOver_LAST\", \"0\", out string msg);\r\n}\r\nvar task2Isrun = false;\r\nif (tag.RGV.ReadTask2No > 0 && tag.RGV.bit2taskOver != 1)\r\n{\r\n task2Isrun = true;\r\n if (tag.RGV.bit2taskOver_LAST == 1)\r\n RedisHelper.Add($\"RGV.bit2taskOver_LAST\", \"0\", out string msg);\r\n}\r\nif (task1Isrun || task2Isrun)\r\n{\r\n string mes = \"\";\r\n if (task1Isrun)\r\n mes += tag.RGV.ReadTask1No + \"执行中...\";\r\n if (task2Isrun)\r\n mes += tag.RGV.ReadTask2No + \"执行中...\";\r\n LogHelper.Info($\"{mes} 不能下发新任务。\");\r\n throw new Exception($\"{mes} 不能下发新任务。\");\r\n //continue;\r\n}\r\nvar thisOver = 0;\r\n\r\nTaskEntity task1 = null;\r\nTaskEntity task2 = null;\r\n\r\nLogHelper.Info($\"查看RGV 1工位任务》\");\r\nif (tag.RGV.ReadTask1No > 0 && tag.RGV.bit1taskOver == 1)\r\n{\r\n var taskno = tag.RGV.ReadTask1No;\r\n LogHelper.Info($\"RGV 1工位任务{tag.RGV.ReadTask1No}\");\r\n string tno = \"TN\" + (DateTime.Now.ToString(\"yy\")) + ((taskno.ToString()).PadLeft(8, '0'));\r\n task1 = taskservice.FindEntity(x => x.S_TASK_NO == tno);\r\n\r\n LogHelper.Info($\"RGV 1工位任务{JsonConvert.SerializeObject(task1)}.bit1taskOver_LAST:{tag.RGV.bit1taskOver_LAST}\");\r\n if (tag.RGV.bit1taskOver_LAST == 0 && task1 != null)\r\n {\r\n if (task1.S_B_STATE != \"完成\")\r\n {\r\n if (task1.S_B_STATE == \"取货完成\")\r\n {\r\n task1.S_B_STATE = \"完成\";\r\n }\r\n else\r\n {\r\n task1.S_B_STATE = \"取货完成\";\r\n }\r\n LogHelper.Info($\"RGV 1工位任务{task1.S_TASK_NO} 状态切换为{task1.S_B_STATE}\");\r\n //tag.RGV.bit1taskOver_LAST = 1;\r\n RedisHelper.Add($\"RGV.bit1taskOver_LAST\", \"1\", out string msg);\r\n LogHelper.Info($\"RGV 1工位任务写处理\");\r\n taskservice.Update(task1);\r\n LogHelper.Info($\"RGV 1工位任务更新。\");\r\n }\r\n }\r\n}\r\nelse if (tag.RGV.ReadTask1No == 0)\r\n{\r\n LogHelper.Info($\"RGV 1工位没有任务》\");\r\n}\r\n\r\nLogHelper.Info($\"查看RGV 2工位任务》\");\r\nif (tag.RGV.ReadTask2No > 0 && tag.RGV.bit2taskOver == 1)\r\n{\r\n var taskno = tag.RGV.ReadTask2No;\r\n LogHelper.Info($\"RGV 2工位任务{tag.RGV.ReadTask2No}\");\r\n string tno = \"TN\" + (DateTime.Now.ToString(\"yy\")) + ((taskno.ToString()).PadLeft(8, '0'));\r\n task2 = taskservice.FindEntity(x => x.S_TASK_NO == tno);\r\n\r\n LogHelper.Info($\"RGV2工位任务{JsonConvert.SerializeObject(task2)}.bit1taskOver_LAST:{tag.RGV.bit2taskOver_LAST}\");\r\n if (tag.RGV.bit2taskOver_LAST == 0 && task2 != null)\r\n {\r\n if (task2.S_B_STATE != \"完成\")\r\n {\r\n if (task2.S_B_STATE == \"取货完成\")\r\n {\r\n task2.S_B_STATE = \"完成\";\r\n }\r\n else\r\n {\r\n task2.S_B_STATE = \"取货完成\";\r\n }\r\n LogHelper.Info($\"RGV 2工位任务{task2.S_TASK_NO} 状态切换为{task2.S_B_STATE}\");\r\n RedisHelper.Add($\"RGV.bit2taskOver_LAST\", \"1\", out string msg);\r\n LogHelper.Info($\"RGV 2工位任务写处理\");\r\n taskservice.Update(task2);\r\n LogHelper.Info($\"RGV 2工位任务更新。\");\r\n }\r\n }\r\n}\r\nelse if (tag.RGV.ReadTask2No == 0)\r\n{\r\n LogHelper.Info($\"RGV 2工位没有任务》\");\r\n}\r\n\r\n\r\n///1 有货 就2 取。 1 没货 就2 卸货, 都有货 就1卸货。 都没货 就1卸\r\ntklist = taskservice.FindList(x => x.S_B_STATE == \"未执行\" && x.S_WORK_MODE == \"RGV\").OrderBy(x => x.T_CREATE).ToList();\r\nif (task1 != null && task1.S_B_STATE != \"完成\") //1有任务\r\n{\r\n if (task2 != null && task2.S_B_STATE != \"完成\")// 1 有任务 2 有任务。 \r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 也有任务{task2.S_TASK_NO}。 开始工位1 卸货。\");\r\n tag.RGV.workMod = 1;\r\n tag.RGV.taskmod = 2;\r\n tag.RGV.taskno1 = Convert.ToUInt32(task1.S_TASK_NO.Substring(4));\r\n tag.RGV.task1do = Convert.ToUInt16(task1.S_END_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n }\r\n else //1有任务 2 没任务。\r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务。\");\r\n //1 如果有同侧取货任务。就取。没有\r\n var leftSide = new List { \"1023\", \"1020\" };\r\n var RightSide = new List { \"1002\", \"1008\", \"1010\", \"1016\" };\r\n bool creT2 = false;\r\n if (leftSide.Contains(task1.S_START_LOC))\r\n {\r\n leftSide.Remove(task1.S_START_LOC);\r\n var lsde = leftSide.FirstOrDefault();\r\n var t2 = tklist.Find(x => x.S_START_LOC == lsde && x.S_END_LOC != \"1017\");\r\n if (t2 != null) //同侧取货任务。\r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务{t2.S_TASK_NO}。\");\r\n tag.RGV.workMod = 2;\r\n tag.RGV.taskmod = 1;\r\n tag.RGV.taskno2 = Convert.ToUInt32(t2.S_TASK_NO.Substring(4));\r\n tag.RGV.task2do = Convert.ToUInt16(t2.S_START_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n t2.S_B_STATE = \"已推送\";\r\n taskservice.Update(t2);\r\n creT2 = true;\r\n }\r\n }\r\n else if (RightSide.Contains(task1.S_START_LOC))\r\n {\r\n RightSide.Remove(task1.S_START_LOC);\r\n var t2 = tklist.Find(x => RightSide.Contains(x.S_START_LOC) && x.S_END_LOC != \"1017\");\r\n if (t2 != null) //同侧取货任务。\r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务{t2.S_TASK_NO}。\");\r\n tag.RGV.workMod = 2;\r\n tag.RGV.taskmod = 1;\r\n tag.RGV.taskno2 = Convert.ToUInt32(t2.S_TASK_NO.Substring(4));\r\n tag.RGV.task2do = Convert.ToUInt16(t2.S_START_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n t2.S_B_STATE = \"已推送\";\r\n taskservice.Update(t2);\r\n creT2 = true;\r\n }\r\n }\r\n //else //1 直接卸货。 \r\n if (!creT2)\r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 没有同侧取货任务 1工位卸货。\");\r\n tag.RGV.workMod = 1;\r\n tag.RGV.taskmod = 2;\r\n tag.RGV.taskno1 = Convert.ToUInt32(task1.S_TASK_NO.Substring(4));\r\n tag.RGV.task1do = Convert.ToUInt16(task1.S_END_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n }\r\n }\r\n}\r\nelse\r\n{\r\n if (task2 != null && task2.S_B_STATE != \"完成\")// 1 没任务 2 有任务。 \r\n {\r\n LogHelper.Info($\"查看RGV 1工位没任务,工位2 有任务{task2.S_TASK_NO}。工位2卸货。。\");\r\n //2 卸货。\r\n tag.RGV.workMod = 2;\r\n tag.RGV.taskmod = 2;\r\n tag.RGV.taskno2 = Convert.ToUInt32(task2.S_TASK_NO.Substring(4));\r\n tag.RGV.task2do = Convert.ToUInt16(task2.S_END_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n }\r\n else //1mei 任务 2 没任务。\r\n {\r\n LogHelper.Info($\"查看RGV 1工位没任务,工位2 也没任务。优先1工位终点1017任务。。\");\r\n //、下 1017任务 给1号工位。\r\n var lss = tklist.Take(2).ToList();\r\n var e1017first = lss.Find(x => x.S_END_LOC == \"1017\");\r\n if (e1017first == null)\r\n {\r\n e1017first = lss.FirstOrDefault();\r\n }\r\n if (e1017first != null)\r\n {\r\n LogHelper.Info($\"查看RGV 1工位没任务,工位2 也没任务。1工位下任务{e1017first.S_TASK_NO}> 终点{e1017first.S_END_LOC}。\");\r\n try\r\n {\r\n tag.RGV.workMod = 1;\r\n tag.RGV.taskmod = 1;\r\n uint tno = Convert.ToUInt32(e1017first.S_TASK_NO.Substring(4));\r\n LogHelper.Info($\"{e1017first.S_TASK_NO}> 转换后任务号{tno} 开始写入。\");\r\n tag.RGV.taskno1 = tno;\r\n LogHelper.Info($\"{e1017first.S_TASK_NO}>开始写入 task1do>>{e1017first.S_START_LOC}。\");\r\n tag.RGV.task1do = Convert.ToUInt16(e1017first.S_START_LOC);\r\n }\r\n catch (Exception ex)\r\n {\r\n LogHelper.Error(ex.Message, ex);\r\n throw ex;\r\n }\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n LogHelper.Info($\"{e1017first.S_TASK_NO}> taskend 125\");\r\n e1017first.S_B_STATE = \"已推送\";\r\n taskservice.Update(e1017first);\r\n }\r\n }\r\n}\r\n\r\n#endregion", "ContentCopy": "ITaskRepository taskservice = new TaskRepository();\r\nvar tklist = taskservice.FindList(x => x.S_B_STATE == \"未执行\" && x.S_WORK_MODE == \"AGV\");\r\nif(tklist.Any())\r\nforeach (var tk in tklist.GroupBy(item =>\r\n{\r\n var ticks = item.T_CREATE.Ticks;\r\n return new DateTime(ticks - ticks % (10 * TimeSpan.TicksPerMinute));\r\n}).OrderBy(x => x.Key))\r\n{\r\n var ts = tk.OrderByDescending(x => x.N_PRIORITY).ToList();\r\n foreach (var t in ts)\r\n {\r\n var b = false;\r\n b = RunTask(t);\r\n\r\n if (b)\r\n {\r\n t.S_B_STATE = \"已推送\";\r\n taskservice.Update(t);\r\n }\r\n }\r\n break;\r\n}\r\n#region Rgv\r\n\r\nvar task1Isrun = false;\r\nif (tag.RGV.ReadTask1No > 0 && tag.RGV.bit1taskOver != 1)\r\n{\r\n task1Isrun = true;\r\n if (tag.RGV.bit1taskOver_LAST == 1)\r\n RedisHelper.Add($\"RGV.bit1taskOver_LAST\", \"0\", out string msg);\r\n}\r\nvar task2Isrun = false;\r\nif (tag.RGV.ReadTask2No > 0 && tag.RGV.bit2taskOver != 1)\r\n{\r\n task2Isrun = true;\r\n if (tag.RGV.bit2taskOver_LAST == 1)\r\n RedisHelper.Add($\"RGV.bit2taskOver_LAST\", \"0\", out string msg);\r\n}\r\nif (task1Isrun || task2Isrun)\r\n{\r\n string mes = \"\";\r\n if (task1Isrun)\r\n mes += tag.RGV.ReadTask1No + \"执行中...\";\r\n if (task2Isrun)\r\n mes += tag.RGV.ReadTask2No + \"执行中...\";\r\n LogHelper.Info($\"{mes} 不能下发新任务。\");\r\n throw new Exception($\"{mes} 不能下发新任务。\");\r\n //continue;\r\n}\r\nvar thisOver = 0;\r\n\r\nTaskEntity task1 = null;\r\nTaskEntity task2 = null;\r\n\r\nLogHelper.Info($\"查看RGV 1工位任务》\");\r\nif (tag.RGV.ReadTask1No > 0 && tag.RGV.bit1taskOver == 1)\r\n{\r\n var taskno = tag.RGV.ReadTask1No;\r\n LogHelper.Info($\"RGV 1工位任务{tag.RGV.ReadTask1No}\");\r\n string tno = \"TN\" + (DateTime.Now.ToString(\"yy\")) + ((taskno.ToString()).PadLeft(8, '0'));\r\n task1 = taskservice.FindEntity(x => x.S_TASK_NO == tno);\r\n\r\n LogHelper.Info($\"RGV 1工位任务{JsonConvert.SerializeObject(task1)}.bit1taskOver_LAST:{tag.RGV.bit1taskOver_LAST}\");\r\n if (tag.RGV.bit1taskOver_LAST == 0 && task1 != null)\r\n {\r\n if (task1.S_B_STATE != \"完成\")\r\n {\r\n if (task1.S_B_STATE == \"取货完成\")\r\n {\r\n task1.S_B_STATE = \"完成\";\r\n }\r\n else\r\n {\r\n task1.S_B_STATE = \"取货完成\";\r\n }\r\n LogHelper.Info($\"RGV 1工位任务{task1.S_TASK_NO} 状态切换为{task1.S_B_STATE}\");\r\n //tag.RGV.bit1taskOver_LAST = 1;\r\n RedisHelper.Add($\"RGV.bit1taskOver_LAST\", \"1\", out string msg);\r\n LogHelper.Info($\"RGV 1工位任务写处理\");\r\n taskservice.Update(task1);\r\n LogHelper.Info($\"RGV 1工位任务更新。\");\r\n }\r\n }\r\n}\r\nelse if (tag.RGV.ReadTask1No == 0)\r\n{\r\n LogHelper.Info($\"RGV 1工位没有任务》\");\r\n}\r\n\r\nLogHelper.Info($\"查看RGV 2工位任务》\");\r\nif (tag.RGV.ReadTask2No > 0 && tag.RGV.bit2taskOver == 1)\r\n{\r\n var taskno = tag.RGV.ReadTask2No;\r\n LogHelper.Info($\"RGV 2工位任务{tag.RGV.ReadTask2No}\");\r\n string tno = \"TN\" + (DateTime.Now.ToString(\"yy\")) + ((taskno.ToString()).PadLeft(8, '0'));\r\n task2 = taskservice.FindEntity(x => x.S_TASK_NO == tno);\r\n\r\n LogHelper.Info($\"RGV2工位任务{JsonConvert.SerializeObject(task2)}.bit1taskOver_LAST:{tag.RGV.bit2taskOver_LAST}\");\r\n if (tag.RGV.bit2taskOver_LAST == 0 && task2 != null)\r\n {\r\n if (task2.S_B_STATE != \"完成\")\r\n {\r\n if (task2.S_B_STATE == \"取货完成\")\r\n {\r\n task2.S_B_STATE = \"完成\";\r\n }\r\n else\r\n {\r\n task2.S_B_STATE = \"取货完成\";\r\n }\r\n LogHelper.Info($\"RGV 2工位任务{task2.S_TASK_NO} 状态切换为{task2.S_B_STATE}\");\r\n RedisHelper.Add($\"RGV.bit2taskOver_LAST\", \"1\", out string msg);\r\n LogHelper.Info($\"RGV 2工位任务写处理\");\r\n taskservice.Update(task2);\r\n LogHelper.Info($\"RGV 2工位任务更新。\");\r\n }\r\n }\r\n}\r\nelse if (tag.RGV.ReadTask2No == 0)\r\n{\r\n LogHelper.Info($\"RGV 2工位没有任务》\");\r\n}\r\n\r\n\r\n///1 有货 就2 取。 1 没货 就2 卸货, 都有货 就1卸货。 都没货 就1卸\r\ntklist = taskservice.FindList(x => x.S_B_STATE == \"未执行\" && x.S_WORK_MODE == \"RGV\").OrderBy(x => x.T_CREATE).ToList();\r\nif (task1 != null && task1.S_B_STATE != \"完成\") //1有任务\r\n{\r\n if (task2 != null && task2.S_B_STATE != \"完成\")// 1 有任务 2 有任务。 \r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 也有任务{task2.S_TASK_NO}。 开始工位1 卸货。\");\r\n tag.RGV.workMod = 1;\r\n tag.RGV.taskmod = 2;\r\n tag.RGV.taskno1 = Convert.ToUInt32(task1.S_TASK_NO.Substring(4));\r\n tag.RGV.task1do = Convert.ToUInt16(task1.S_END_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n }\r\n else //1有任务 2 没任务。\r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务。\");\r\n //1 如果有同侧取货任务。就取。没有\r\n var leftSide = new List { \"1023\", \"1020\" };\r\n var RightSide = new List { \"1002\", \"1008\", \"1010\", \"1016\" };\r\n bool creT2 = false;\r\n if (leftSide.Contains(task1.S_START_LOC))\r\n {\r\n leftSide.Remove(task1.S_START_LOC);\r\n var lsde = leftSide.FirstOrDefault();\r\n var t2 = tklist.Find(x => x.S_START_LOC == lsde && x.S_END_LOC != \"1017\");\r\n if (t2 != null) //同侧取货任务。\r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务{t2.S_TASK_NO}。\");\r\n tag.RGV.workMod = 2;\r\n tag.RGV.taskmod = 1;\r\n tag.RGV.taskno2 = Convert.ToUInt32(t2.S_TASK_NO.Substring(4));\r\n tag.RGV.task2do = Convert.ToUInt16(t2.S_START_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n t2.S_B_STATE = \"已推送\";\r\n taskservice.Update(t2);\r\n creT2 = true;\r\n }\r\n }\r\n else if (RightSide.Contains(task1.S_START_LOC))\r\n {\r\n RightSide.Remove(task1.S_START_LOC);\r\n var t2 = tklist.Find(x => RightSide.Contains(x.S_START_LOC) && x.S_END_LOC != \"1017\");\r\n if (t2 != null) //同侧取货任务。\r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务{t2.S_TASK_NO}。\");\r\n tag.RGV.workMod = 2;\r\n tag.RGV.taskmod = 1;\r\n tag.RGV.taskno2 = Convert.ToUInt32(t2.S_TASK_NO.Substring(4));\r\n tag.RGV.task2do = Convert.ToUInt16(t2.S_START_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n t2.S_B_STATE = \"已推送\";\r\n taskservice.Update(t2);\r\n creT2 = true;\r\n }\r\n }\r\n //else //1 直接卸货。 \r\n if (!creT2)\r\n {\r\n LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 没有同侧取货任务 1工位卸货。\");\r\n tag.RGV.workMod = 1;\r\n tag.RGV.taskmod = 2;\r\n tag.RGV.taskno1 = Convert.ToUInt32(task1.S_TASK_NO.Substring(4));\r\n tag.RGV.task1do = Convert.ToUInt16(task1.S_END_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n }\r\n }\r\n}\r\nelse\r\n{\r\n if (task2 != null && task2.S_B_STATE != \"完成\")// 1 没任务 2 有任务。 \r\n {\r\n LogHelper.Info($\"查看RGV 1工位没任务,工位2 有任务{task2.S_TASK_NO}。工位2卸货。。\");\r\n //2 卸货。\r\n tag.RGV.workMod = 2;\r\n tag.RGV.taskmod = 2;\r\n tag.RGV.taskno2 = Convert.ToUInt32(task2.S_TASK_NO.Substring(4));\r\n tag.RGV.task2do = Convert.ToUInt16(task2.S_END_LOC);\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n }\r\n else //1mei 任务 2 没任务。\r\n {\r\n LogHelper.Info($\"查看RGV 1工位没任务,工位2 也没任务。优先1工位终点1017任务。。\");\r\n //、下 1017任务 给1号工位。\r\n var lss = tklist.Take(2).ToList();\r\n var e1017first = lss.Find(x => x.S_END_LOC == \"1017\");\r\n if (e1017first == null)\r\n {\r\n e1017first = lss.FirstOrDefault();\r\n }\r\n if (e1017first != null)\r\n {\r\n LogHelper.Info($\"查看RGV 1工位没任务,工位2 也没任务。1工位下任务{e1017first.S_TASK_NO}> 终点{e1017first.S_END_LOC}。\");\r\n try\r\n {\r\n tag.RGV.workMod = 1;\r\n tag.RGV.taskmod = 1;\r\n uint tno = Convert.ToUInt32(e1017first.S_TASK_NO.Substring(4));\r\n LogHelper.Info($\"{e1017first.S_TASK_NO}> 转换后任务号{tno} 开始写入。\");\r\n tag.RGV.taskno1 = tno;\r\n LogHelper.Info($\"{e1017first.S_TASK_NO}>开始写入 task1do>>{e1017first.S_START_LOC}。\");\r\n tag.RGV.task1do = Convert.ToUInt16(e1017first.S_START_LOC);\r\n }\r\n catch (Exception ex)\r\n {\r\n LogHelper.Error(ex.Message, ex);\r\n throw ex;\r\n }\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n System.Threading.Thread.Sleep(750);\r\n tag.RGV.taskend = 125;\r\n LogHelper.Info($\"{e1017first.S_TASK_NO}> taskend 125\");\r\n e1017first.S_B_STATE = \"已推送\";\r\n taskservice.Update(e1017first);\r\n }\r\n }\r\n}\r\n\r\n#endregion", "ParentID": "20250226153120175", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.任务下发", "ParentFullName": "业务逻辑", "Enabled": "Enabled" }, { "ID": "20250531163653189", "Name": "处理MES任务线程", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250226153120175", "Children": [ { "ID": "20250531163716255", "Name": "ResolveMesTask", "Desc": "", "Content": "//mes 任务拆分。一段任务和 多段任务。\r\nToWMSMES.ResMesTask();", "ContentCopy": "//mes 任务拆分。一段任务和 多段任务。\r\nToWMSMES.ResMesTask();", "ParentID": "20250531163653189", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.处理MES任务线程.ResolveMesTask", "ParentFullName": "业务逻辑.处理MES任务线程", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.处理MES任务线程", "ParentFullName": "业务逻辑", "Enabled": "Enabled" }, { "ID": "20250605212104026", "Name": "SocketServer", "Desc": "", "Content": "var host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());\r\nforeach (var ip in host.AddressList)\r\n{\r\n if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)\r\n {\r\n Console.WriteLine($\"ip= {ip.ToString()}\");\r\n new TcpServer(ip.ToString());\r\n }\r\n}", "ContentCopy": "var host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());\r\nforeach (var ip in host.AddressList)\r\n{\r\n if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)\r\n {\r\n Console.WriteLine($\"ip= {ip.ToString()}\");\r\n new TcpServer(ip.ToString());\r\n }\r\n}", "ParentID": "20250226153120175", "Children": [], "Type": "Program", "Property": { "SyncExec": "True", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.SocketServer", "ParentFullName": "业务逻辑", "Enabled": "Enabled" }, { "ID": "20250611223832523", "Name": "光栅处理", "Desc": "", "Content": "// - 光栅交互处理。。\r\n var taskCOdes = new List { \"Sarrive\", \"Srelease\", \"Earrive\", \"Erelease\" };\r\n TaskActRepository taskActRepository = new TaskActRepository();\r\n TaskRepository taskRepository = new TaskRepository();\r\n var requires = taskActRepository.FindList(x => taskCOdes.Contains(x.S_ACTION_CODE) && x.N_CREATEMETHOD == 0);\r\n foreach (var item in requires)\r\n {\r\n var tin = taskCOdes.IndexOf(item.S_ACTION_CODE);\r\n if (tin == -1)\r\n {\r\n item.N_CREATEMETHOD = -1;\r\n taskActRepository.Update(item);\r\n continue;\r\n }\r\n //var task = taskRepository.FindEntity(x => x.S_TASK_NO == item.S_TASK_NO);\r\n string loc = \"\";\r\n if (tin < 2)\r\n {\r\n loc = item.S_START_LOC;\r\n }\r\n else\r\n {\r\n loc = item.S_END_LOC;\r\n } \r\n\t\t\t\t\t\t\tif (loc == null) continue; else loc = loc.Trim();\r\n bool goin = tin % 2 == 0;\r\n bool continuuuuu =false;\r\n var dev = Settings.deviceInfos.Find(x => x.location.Contains(loc));\r\n if (dev != null)\r\n {\r\n var V = dev.location.ToList().FindIndex(x => x == loc) == 0;\r\n\t\t\t\t\t\t\t\t//车走了 开光栅\r\n if (!goin)\r\n {\r\n if (dev.deviceType == 1)\r\n {\r\n LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"R02\" : \"R04\"), \"true\", dev.deviceName + \"Queue\"));\r\n Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"R02\" : \"R04\"), \"true\", dev.deviceName + \"Queue\");\r\n\r\n }\r\n else if (dev.deviceType == 2)\r\n {\r\n LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"D1222\" : \"D1223\"), \"1\", dev.deviceName + \"Queue\"));\r\n Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"D1222\" : \"D1223\"), \"1\", dev.deviceName + \"Queue\");\r\n }\r\n \r\n\t item.N_CREATEMETHOD = 1;\r\n\t taskActRepository.Update(item);\r\n\t\t\t\t\t\t\t\t}\r\n //车要进入交互。\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n if (dev.deviceType == 1)\r\n {\r\n\t\t\t\t\t\t\t\t\t\tvar tf = Conn.默认Redis.GetValue(dev.deviceName + \".\" + (V ? \"R50\" : \"R52\"));//读关闭状态\r\n\t\t\t\t\t\t\t\t\t\tif (tf?.ToLower() == \"true\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。 已经关闭!\");\r\n\t\t\t\t\t\t\t\t\t\t\tcontinuuuuu = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"R01\" : \"R03\"), \"true\", dev.deviceName + \"Queue\"));\r\n\t\t\t\t\t\t\t\t\t\t\tConn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"R01\" : \"R03\"), \"true\", dev.deviceName + \"Queue\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n }\r\n else if (dev.deviceType == 2)\r\n {\r\n var tf = Conn.默认Redis.GetValue(dev.deviceName + \".D1202\");\r\n\t\t\t\t\t\t\t\t\t\tint numm = int.Parse(string.IsNullOrEmpty(tf) ? \"0\" : tf);\r\n if (TcpServer.GetBitdata(numm,(V?0:1))==1)\r\n {\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。 已经关闭!\");\r\n continuuuuu = true;\r\n }\r\n else\r\n {\r\n LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"D1220\" : \"D1221\"), dev.deviceName + \"Queue\"));\r\n Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"D1220\" : \"D1221\"), \"1\", dev.deviceName + \"Queue\");\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n if (continuuuuu)\r\n {\r\n\t\t\t\t\t\t\t\tLogHelper.Info($\"{item.S_TASK_NO}{item.S_ACTION_CODE} 车辆发送继续任务!\");\r\n continueTask(new HaiKangOrderInfo\r\n {\r\n reqCode = item.S_ID.Replace(\"-\", \"\"),\r\n taskCode = item.S_TASK_NO\r\n });\r\n item.N_CREATEMETHOD = 1;\r\n taskActRepository.Update(item);\r\n }\r\n }\r\n System.Threading.Thread.Sleep(3000);\r\n //重置信号\r\n foreach (var dev in Settings.deviceInfos.FindAll(x => x.deviceType == 2))\r\n {\r\n var tf = Conn.默认Redis.GetValue(dev.deviceName + \".D1202\");\r\n int numm = int.Parse(string.IsNullOrEmpty(tf) ? \"0\" : tf);\r\n if (TcpServer.GetBitdata(numm, 0) == 0)\r\n {\r\n Conn.默认Redis.SetValue(dev.deviceName + \".D1220\", \"0\", dev.deviceName + \"Queue\");\r\n Conn.默认Redis.SetValue(dev.deviceName + \".D1222\", \"0\", dev.deviceName + \"Queue\");\r\n }\r\n else if (TcpServer.GetBitdata(numm, 1) == 0)\r\n {\r\n Conn.默认Redis.SetValue(dev.deviceName + \".D1221\", \"0\", dev.deviceName + \"Queue\");\r\n Conn.默认Redis.SetValue(dev.deviceName + \".D1223\", \"0\", dev.deviceName + \"Queue\");\r\n }\r\n }\r\n \r\n // 发那科下料光栅。", "ContentCopy": "// - 光栅交互处理。。\r\n var taskCOdes = new List { \"Sarrive\", \"Srelease\", \"Earrive\", \"Erelease\" };\r\n TaskActRepository taskActRepository = new TaskActRepository();\r\n TaskRepository taskRepository = new TaskRepository();\r\n var requires = taskActRepository.FindList(x => taskCOdes.Contains(x.S_ACTION_CODE) && x.N_CREATEMETHOD == 0);\r\n foreach (var item in requires)\r\n {\r\n var tin = taskCOdes.IndexOf(item.S_ACTION_CODE);\r\n if (tin == -1)\r\n {\r\n item.N_CREATEMETHOD = -1;\r\n taskActRepository.Update(item);\r\n continue;\r\n }\r\n //var task = taskRepository.FindEntity(x => x.S_TASK_NO == item.S_TASK_NO);\r\n string loc = \"\";\r\n if (tin < 2)\r\n {\r\n loc = item.S_START_LOC;\r\n }\r\n else\r\n {\r\n loc = item.S_END_LOC;\r\n } \r\n\t\t\t\t\t\t\tif (loc == null) continue; else loc = loc.Trim();\r\n bool goin = tin % 2 == 0;\r\n bool continuuuuu =false;\r\n var dev = Settings.deviceInfos.Find(x => x.location.Contains(loc));\r\n if (dev != null)\r\n {\r\n var V = dev.location.ToList().FindIndex(x => x == loc) == 0;\r\n\t\t\t\t\t\t\t\t//车走了 开光栅\r\n if (!goin)\r\n {\r\n if (dev.deviceType == 1)\r\n {\r\n LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"R02\" : \"R04\"), \"true\", dev.deviceName + \"Queue\"));\r\n Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"R02\" : \"R04\"), \"true\", dev.deviceName + \"Queue\");\r\n\r\n }\r\n else if (dev.deviceType == 2)\r\n {\r\n LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"D1222\" : \"D1223\"), \"1\", dev.deviceName + \"Queue\"));\r\n Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"D1222\" : \"D1223\"), \"1\", dev.deviceName + \"Queue\");\r\n }\r\n \r\n\t item.N_CREATEMETHOD = 1;\r\n\t taskActRepository.Update(item);\r\n\t\t\t\t\t\t\t\t}\r\n //车要进入交互。\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n if (dev.deviceType == 1)\r\n {\r\n\t\t\t\t\t\t\t\t\t\tvar tf = Conn.默认Redis.GetValue(dev.deviceName + \".\" + (V ? \"R50\" : \"R52\"));//读关闭状态\r\n\t\t\t\t\t\t\t\t\t\tif (tf?.ToLower() == \"true\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。 已经关闭!\");\r\n\t\t\t\t\t\t\t\t\t\t\tcontinuuuuu = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"R01\" : \"R03\"), \"true\", dev.deviceName + \"Queue\"));\r\n\t\t\t\t\t\t\t\t\t\t\tConn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"R01\" : \"R03\"), \"true\", dev.deviceName + \"Queue\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n }\r\n else if (dev.deviceType == 2)\r\n {\r\n var tf = Conn.默认Redis.GetValue(dev.deviceName + \".D1202\");\r\n\t\t\t\t\t\t\t\t\t\tint numm = int.Parse(string.IsNullOrEmpty(tf) ? \"0\" : tf);\r\n if (TcpServer.GetBitdata(numm,(V?0:1))==1)\r\n {\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。 已经关闭!\");\r\n continuuuuu = true;\r\n }\r\n else\r\n {\r\n LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"D1220\" : \"D1221\"), dev.deviceName + \"Queue\"));\r\n Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"D1220\" : \"D1221\"), \"1\", dev.deviceName + \"Queue\");\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n if (continuuuuu)\r\n {\r\n\t\t\t\t\t\t\t\tLogHelper.Info($\"{item.S_TASK_NO}{item.S_ACTION_CODE} 车辆发送继续任务!\");\r\n continueTask(new HaiKangOrderInfo\r\n {\r\n reqCode = item.S_ID.Replace(\"-\", \"\"),\r\n taskCode = item.S_TASK_NO\r\n });\r\n item.N_CREATEMETHOD = 1;\r\n taskActRepository.Update(item);\r\n }\r\n }\r\n System.Threading.Thread.Sleep(3000);\r\n //重置信号\r\n foreach (var dev in Settings.deviceInfos.FindAll(x => x.deviceType == 2))\r\n {\r\n var tf = Conn.默认Redis.GetValue(dev.deviceName + \".D1202\");\r\n int numm = int.Parse(string.IsNullOrEmpty(tf) ? \"0\" : tf);\r\n if (TcpServer.GetBitdata(numm, 0) == 0)\r\n {\r\n Conn.默认Redis.SetValue(dev.deviceName + \".D1220\", \"0\", dev.deviceName + \"Queue\");\r\n Conn.默认Redis.SetValue(dev.deviceName + \".D1222\", \"0\", dev.deviceName + \"Queue\");\r\n }\r\n else if (TcpServer.GetBitdata(numm, 1) == 0)\r\n {\r\n Conn.默认Redis.SetValue(dev.deviceName + \".D1221\", \"0\", dev.deviceName + \"Queue\");\r\n Conn.默认Redis.SetValue(dev.deviceName + \".D1223\", \"0\", dev.deviceName + \"Queue\");\r\n }\r\n }\r\n \r\n // 发那科下料光栅。", "ParentID": "20250226153120175", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.光栅处理", "ParentFullName": "业务逻辑", "Enabled": "Enabled" }, { "ID": "20250614173821058", "Name": "流程2热处理炉进出", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250226153120175", "Children": [ { "ID": "20250616094224396", "Name": "1020空框下线", "Desc": "", "Content": "foreach (var Bssx in new string[] { \"1020\", \"1023\" })\r\n{\r\n var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n Console.WriteLine($\"{Bssx} 空下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n if (RtaskState == 3 && RtaskState_LAST == 0)\r\n {\r\n try\r\n {\r\n foreach (var item in new string[] { \"1004\", \"1006\", \"1012\", \"1014\" })\r\n {\r\n var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n if (R5 == 5 && R5空闲_LAST == 0)\r\n {\r\n var b = TaskProcess.CreateTask(\"\", Bssx, item, \"空上RGV\", 5, new List { R托盘码 }, \"RGV\");\r\n if (b)\r\n {\r\n LogHelper.Debug($\"输送线RGV空托任务 from:{Bssx}>to {item}开始创建成功\");\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg1);\r\n //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n break;\r\n }\r\n }\r\n else if (R5 != 5 && R5空闲_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg);\r\n //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"0\", $\"S{item}ReadQueue\");\r\n }\r\n }\r\n System.Threading.Thread.Sleep(1000);\r\n }\r\n catch (Exception ex)\r\n {\r\n LogHelper.Error(ex.Message, ex);\r\n Console.WriteLine(ex.Message + ex.StackTrace);\r\n }\r\n }\r\n else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"0\", $\"S{Bssx}ReadQueue\");\r\n }\r\n System.Threading.Thread.Sleep(2000);\r\n}", "ContentCopy": "foreach (var Bssx in new string[] { \"1020\", \"1023\" })\r\n{\r\n var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n Console.WriteLine($\"{Bssx} 空下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n if (RtaskState == 3 && RtaskState_LAST == 0)\r\n {\r\n try\r\n {\r\n foreach (var item in new string[] { \"1004\", \"1006\", \"1012\", \"1014\" })\r\n {\r\n var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n if (R5 == 5 && R5空闲_LAST == 0)\r\n {\r\n var b = TaskProcess.CreateTask(\"\", Bssx, item, \"空上RGV\", 5, new List { R托盘码 }, \"RGV\");\r\n if (b)\r\n {\r\n LogHelper.Debug($\"输送线RGV空托任务 from:{Bssx}>to {item}开始创建成功\");\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg1);\r\n //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n break;\r\n }\r\n }\r\n else if (R5 != 5 && R5空闲_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg);\r\n //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"0\", $\"S{item}ReadQueue\");\r\n }\r\n }\r\n System.Threading.Thread.Sleep(1000);\r\n }\r\n catch (Exception ex)\r\n {\r\n LogHelper.Error(ex.Message, ex);\r\n Console.WriteLine(ex.Message + ex.StackTrace);\r\n }\r\n }\r\n else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"0\", $\"S{Bssx}ReadQueue\");\r\n }\r\n System.Threading.Thread.Sleep(2000);\r\n}", "ParentID": "20250614173821058", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1020空框下线", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250616094226654", "Name": "1023空框下线", "Desc": "", "Content": "//1023 空框下线", "ContentCopy": "//1023 空框下线", "ParentID": "20250614173821058", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1023空框下线", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250616094632985", "Name": "定子满下线", "Desc": "", "Content": "foreach (var Bssx in new string[] { \"1008\", \"1016\" })\r\n{\r\n var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n Console.WriteLine($\"{Bssx} 满下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n if (RtaskState == 3 && RtaskState_LAST == 0)\r\n {\r\n var item = \"1026\";\r\n var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n if (R5 == 5 && R5空闲_LAST == 0)\r\n {\r\n var b = TaskProcess.CreateTask(\"\", Bssx, item, \"满转1026\", 5, new List { R托盘码 }, \"RGV\");\r\n if (b)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg2);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n break;\r\n }\r\n }\r\n else if (R5 != 5 && R5空闲_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg2);\r\n }\r\n }\r\n else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"0\", $\"S{Bssx}ReadQueue\");\r\n }\r\n System.Threading.Thread.Sleep(2000);\r\n}", "ContentCopy": "foreach (var Bssx in new string[] { \"1008\", \"1016\" })\r\n{\r\n var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n Console.WriteLine($\"{Bssx} 满下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n if (RtaskState == 3 && RtaskState_LAST == 0)\r\n {\r\n var item = \"1026\";\r\n var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n if (R5 == 5 && R5空闲_LAST == 0)\r\n {\r\n var b = TaskProcess.CreateTask(\"\", Bssx, item, \"满转1026\", 5, new List { R托盘码 }, \"RGV\");\r\n if (b)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg2);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n break;\r\n }\r\n }\r\n else if (R5 != 5 && R5空闲_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg2);\r\n }\r\n }\r\n else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"0\", $\"S{Bssx}ReadQueue\");\r\n }\r\n System.Threading.Thread.Sleep(2000);\r\n}", "ParentID": "20250614173821058", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.定子满下线", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250616094511322", "Name": "转子满下线", "Desc": "", "Content": "//转子满下线 1002 1010 - RGV2工位不可到 1017 不可下发2工位任务。\r\nforeach (var Bssx in new string[] { \"1002\", \"1010\" })\r\n{\r\n var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n Console.WriteLine($\"{Bssx} 满下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n if (RtaskState == 3 && RtaskState_LAST == 0)\r\n {\r\n var item = \"1017\";\r\n var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n if (R5 == 5 && R5空闲_LAST == 0)\r\n {\r\n var b = TaskProcess.CreateTask(\"\", Bssx, item, \"满转1017\", 5, new List { R托盘码 }, \"RGV\");\r\n if (b)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg1);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n break;\r\n }\r\n }\r\n else if (R5 != 5 && R5空闲_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg1);\r\n }\r\n }\r\n else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n }\r\n System.Threading.Thread.Sleep(2000);\r\n}", "ContentCopy": "//转子满下线 1002 1010 - RGV2工位不可到 1017 不可下发2工位任务。\r\nforeach (var Bssx in new string[] { \"1002\", \"1010\" })\r\n{\r\n var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n Console.WriteLine($\"{Bssx} 满下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n if (RtaskState == 3 && RtaskState_LAST == 0)\r\n {\r\n var item = \"1017\";\r\n var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n if (R5 == 5 && R5空闲_LAST == 0)\r\n {\r\n var b = TaskProcess.CreateTask(\"\", Bssx, item, \"满转1017\", 5, new List { R托盘码 }, \"RGV\");\r\n if (b)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg1);\r\n //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n break;\r\n }\r\n }\r\n else if (R5 != 5 && R5空闲_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg1);\r\n }\r\n }\r\n else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n {\r\n RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n }\r\n System.Threading.Thread.Sleep(2000);\r\n}", "ParentID": "20250614173821058", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.转子满下线", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250616095605911", "Name": "下料位检测", "Desc": "", "Content": "//下料位检测。 1003 到位时 写 标识信号 并 给机械手信号。 \r\nforeach (var ssx in new string[] { \"1003\", \"1005\", \"1011\", \"1013\" })\r\n{\r\n var RArrive = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"FNK1003051113.RArrive{ssx}\"), typeof(System.UInt16));\r\n var RArriveLast = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"FNK1003051113.RArrive{ssx}_LAST\"), typeof(System.UInt16));\r\n if (RArrive == 1 && RArriveLast == 0)\r\n {\r\n if (ssx == \"1005\")\r\n {\r\n tag.FNK1.D2210 = 1;\r\n tag.SF下料位.RArrive1005_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1005 = 0;\r\n tag.SF下料位.WSafe0305 = 0;\r\n }\r\n else if (ssx == \"1003\")\r\n {\r\n tag.FNK2.D2215 = 1;\r\n tag.SF下料位.RArrive1003_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1003 = 0;\r\n tag.SF下料位.WSafe0305 = 0;\r\n }\r\n else if (ssx == \"1013\")\r\n {\r\n tag.FNK2.D2210 = 1;\r\n tag.SF下料位.RArrive1013_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1013 = 0;\r\n tag.SF下料位.WSafe1113 = 0;\r\n }\r\n else if (ssx == \"1011\")\r\n {\r\n tag.FNK2.D2215 = 1;\r\n tag.SF下料位.RArrive1011_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1011 = 0;\r\n tag.SF下料位.WSafe1113 = 0;\r\n }\r\n }\r\n else if (RArrive == 0 && RArriveLast == 1)\r\n {\r\n RedisHelper.Add($\"FNK1003051113.RArrive{ssx}_LAST\", \"0\", out string msg);\r\n }\r\n}", "ContentCopy": "//下料位检测。 1003 到位时 写 标识信号 并 给机械手信号。 \r\nforeach (var ssx in new string[] { \"1003\", \"1005\", \"1011\", \"1013\" })\r\n{\r\n var RArrive = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"FNK1003051113.RArrive{ssx}\"), typeof(System.UInt16));\r\n var RArriveLast = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"FNK1003051113.RArrive{ssx}_LAST\"), typeof(System.UInt16));\r\n if (RArrive == 1 && RArriveLast == 0)\r\n {\r\n if (ssx == \"1005\")\r\n {\r\n tag.FNK1.D2210 = 1;\r\n tag.SF下料位.RArrive1005_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1005 = 0;\r\n tag.SF下料位.WSafe0305 = 0;\r\n }\r\n else if (ssx == \"1003\")\r\n {\r\n tag.FNK2.D2215 = 1;\r\n tag.SF下料位.RArrive1003_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1003 = 0;\r\n tag.SF下料位.WSafe0305 = 0;\r\n }\r\n else if (ssx == \"1013\")\r\n {\r\n tag.FNK2.D2210 = 1;\r\n tag.SF下料位.RArrive1013_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1013 = 0;\r\n tag.SF下料位.WSafe1113 = 0;\r\n }\r\n else if (ssx == \"1011\")\r\n {\r\n tag.FNK2.D2215 = 1;\r\n tag.SF下料位.RArrive1011_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1011 = 0;\r\n tag.SF下料位.WSafe1113 = 0;\r\n }\r\n }\r\n else if (RArrive == 0 && RArriveLast == 1)\r\n {\r\n RedisHelper.Add($\"FNK1003051113.RArrive{ssx}_LAST\", \"0\", out string msg);\r\n }\r\n}", "ParentID": "20250614173821058", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.下料位检测", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250616095709155", "Name": "1号FNK机械手完成", "Desc": "", "Content": "if (tag.FNK1.D2212 == 1 && tag.FNK1.D2212_LAST == 0)\r\n{\r\n tag.FNK1.D2210 = 0;\r\n tag.FNK1.D2212_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1005 = 1;\r\n tag.SF下料位.WSafe0305 = 1;\r\n}\r\nelse if (tag.FNK1.D2212 == 0 && tag.FNK1.D2212_LAST == 1)\r\n{\r\n tag.FNK1.D2212_LAST = 0;\r\n}\r\nif (tag.FNK1.D2217 == 1 && tag.FNK1.D2217_LAST == 0)\r\n{\r\n tag.FNK1.D2215 = 0;\r\n tag.FNK1.D2217_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1003 = 1;\r\n tag.SF下料位.WSafe0305 = 1;\r\n}\r\nelse if (tag.FNK1.D2217 == 0 && tag.FNK1.D2217_LAST == 1)\r\n tag.FNK1.D2217_LAST = 0;\r\n", "ContentCopy": "if (tag.FNK1.D2212 == 1 && tag.FNK1.D2212_LAST == 0)\r\n{\r\n tag.FNK1.D2210 = 0;\r\n tag.FNK1.D2212_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1005 = 1;\r\n tag.SF下料位.WSafe0305 = 1;\r\n}\r\nelse if (tag.FNK1.D2212 == 0 && tag.FNK1.D2212_LAST == 1)\r\n{\r\n tag.FNK1.D2212_LAST = 0;\r\n}\r\nif (tag.FNK1.D2217 == 1 && tag.FNK1.D2217_LAST == 0)\r\n{\r\n tag.FNK1.D2215 = 0;\r\n tag.FNK1.D2217_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1003 = 1;\r\n tag.SF下料位.WSafe0305 = 1;\r\n}\r\nelse if (tag.FNK1.D2217 == 0 && tag.FNK1.D2217_LAST == 1)\r\n tag.FNK1.D2217_LAST = 0;\r\n", "ParentID": "20250614173821058", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1号FNK机械手完成", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250616095733680", "Name": "2号FNK机械手完成", "Desc": "", "Content": " if (tag.FNK2.D2212 == 1 && tag.FNK2.D2212_LAST == 0)\r\n {\r\n tag.FNK2.D2210 = 0;\r\n tag.FNK2.D2212_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1013 = 1;\r\n tag.SF下料位.WSafe1113 = 1;\r\n }\r\n else if (tag.FNK2.D2212 == 0 && tag.FNK2.D2212_LAST == 1)\r\n {\r\n tag.FNK2.D2212_LAST = 0;\r\n }\r\n if (tag.FNK2.D2217 == 1 && tag.FNK2.D2217_LAST == 0)\r\n {\r\n tag.FNK2.D2215 = 0;\r\n tag.FNK2.D2217_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1011 = 1;\r\n tag.SF下料位.WSafe1113 = 1;\r\n }\r\n else if (tag.FNK2.D2217 == 0 && tag.FNK2.D2217_LAST == 1)\r\n tag.FNK2.D2217_LAST = 0;", "ContentCopy": " if (tag.FNK2.D2212 == 1 && tag.FNK2.D2212_LAST == 0)\r\n {\r\n tag.FNK2.D2210 = 0;\r\n tag.FNK2.D2212_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1013 = 1;\r\n tag.SF下料位.WSafe1113 = 1;\r\n }\r\n else if (tag.FNK2.D2212 == 0 && tag.FNK2.D2212_LAST == 1)\r\n {\r\n tag.FNK2.D2212_LAST = 0;\r\n }\r\n if (tag.FNK2.D2217 == 1 && tag.FNK2.D2217_LAST == 0)\r\n {\r\n tag.FNK2.D2215 = 0;\r\n tag.FNK2.D2217_LAST = 1;\r\n\r\n tag.SF下料位.WRelease1011 = 1;\r\n tag.SF下料位.WSafe1113 = 1;\r\n }\r\n else if (tag.FNK2.D2217 == 0 && tag.FNK2.D2217_LAST == 1)\r\n tag.FNK2.D2217_LAST = 0;", "ParentID": "20250614173821058", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.2号FNK机械手完成", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250617081923670", "Name": "1019转满出输送线", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250614173821058", "Children": [ { "ID": "20250617085708084", "Name": "Program1", "Desc": "", "Content": "\r\n Console.WriteLine($\"1019任务状态:{tag.SA1019.RtaskState}- barcode:{tag.SA1019.R托盘码}- 空闲{tag.SA1019.R5空闲}\");", "ContentCopy": "\r\n Console.WriteLine($\"1019任务状态:{tag.SA1019.RtaskState}- barcode:{tag.SA1019.R托盘码}- 空闲{tag.SA1019.R5空闲}\");", "ParentID": "20250617081923670", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1019转满出输送线.Program1", "ParentFullName": "业务逻辑.流程2热处理炉进出.1019转满出输送线", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1019转满出输送线", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250617081926036", "Name": "1025agv上空", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250614173821058", "Children": [ { "ID": "20250617085712101", "Name": "Program1", "Desc": "", "Content": "\r\n Console.WriteLine($\"SA1025 任务状态:{tag.SA1025.RtaskState}- 空闲{tag.SA1025.R5空闲}\");", "ContentCopy": "\r\n Console.WriteLine($\"SA1025 任务状态:{tag.SA1025.RtaskState}- 空闲{tag.SA1025.R5空闲}\");", "ParentID": "20250617081926036", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1025agv上空.Program1", "ParentFullName": "业务逻辑.流程2热处理炉进出.1025agv上空", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1025agv上空", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250617081930010", "Name": "1022agv上空", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250614173821058", "Children": [ { "ID": "20250617085750712", "Name": "Program1", "Desc": "", "Content": "\r\n Console.WriteLine($\"SA1022 任务状态:{tag.SA1022.RtaskState}- 空闲{tag.SA1022.R5空闲}\");", "ContentCopy": "\r\n Console.WriteLine($\"SA1022 任务状态:{tag.SA1022.RtaskState}- 空闲{tag.SA1022.R5空闲}\");", "ParentID": "20250617081930010", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1022agv上空.Program1", "ParentFullName": "业务逻辑.流程2热处理炉进出.1022agv上空", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1022agv上空", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250617081932131", "Name": "1030下母托", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250614173821058", "Children": [ { "ID": "20250617085800942", "Name": "Program1", "Desc": "", "Content": "\r\n Console.WriteLine($\"SA1030 任务状态:{tag.SA1030.RtaskState}- 空闲{tag.SA1030.R5空闲}-->对应终点2001>空闲5:{tag.SA2001.R5空闲}\");", "ContentCopy": "\r\n Console.WriteLine($\"SA1030 任务状态:{tag.SA1030.RtaskState}- 空闲{tag.SA1030.R5空闲}-->对应终点2001>空闲5:{tag.SA2001.R5空闲}\");", "ParentID": "20250617081932131", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1030下母托.Program1", "ParentFullName": "业务逻辑.流程2热处理炉进出.1030下母托", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.1030下母托", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" }, { "ID": "20250617081938161", "Name": "2030输送线下定子", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "20250614173821058", "Children": [ { "ID": "20250617085809982", "Name": "Program1", "Desc": "", "Content": "\r\n Console.WriteLine($\"SA2030 任务状态:{tag.SA2030.RtaskState}- 空闲{tag.SA2030.R5空闲} - barcode:{tag.SA2030.R托盘码}\");", "ContentCopy": "\r\n Console.WriteLine($\"SA2030 任务状态:{tag.SA2030.RtaskState}- 空闲{tag.SA2030.R5空闲} - barcode:{tag.SA2030.R托盘码}\");", "ParentID": "20250617081938161", "Children": [], "Type": "Program", "Property": { "SyncExec": "False", "RepeatExec": "Until", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "View", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": { "20250306140515428": [ "Open" ] } }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.2030输送线下定子.Program1", "ParentFullName": "业务逻辑.流程2热处理炉进出.2030输送线下定子", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出.2030输送线下定子", "ParentFullName": "业务逻辑.流程2热处理炉进出", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑.流程2热处理炉进出", "ParentFullName": "业务逻辑", "Enabled": "Enabled" } ], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "业务逻辑", "ParentFullName": "", "Enabled": "Enabled" }, { "ID": "20250226153120181", "Name": "界面处理", "Desc": "", "Content": "", "ContentCopy": "", "ParentID": "", "Children": [], "Type": "Group", "Property": { "SyncExec": "False", "RepeatExec": "None", "ExceCount": 1, "ExceInternal": 3000, "StartCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} }, "EndCondition": { "Type": "None", "Event": "", "Expression": "", "Judge": "", "Command": {}, "HmiEvent": {} } }, "FullName": "界面处理", "ParentFullName": "", "Enabled": "Enabled" } ], "CreationTime": "2025-02-26 15:31:20", "LastWriteTime": "2025-06-18 23:06:58", "HasSaved": true }