From d2d403dc2e33dc07970b0b69934c572b70b1f3d1 Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期五, 25 七月 2025 15:58:25 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs | 41 +++++++++++++++++++++++------------------ 1 files changed, 23 insertions(+), 18 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" index 853fae7..5941f21 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" @@ -67,6 +67,12 @@ /// 3 鍏ㄥ紑 /// </summary> public static readonly int _type = 1; + /// <summary> + /// 1 modbus + /// 2 -24 vxr 25 S7 + /// 3 MC + /// </summary> + public static readonly string tys = "1 2 24 25 3"; private static AutoThread _instance; @@ -2513,25 +2519,24 @@ tag.ssx杈撻�绾�s2008.wEbit = 0; tag.ssx杈撻�绾�s2008.R鎵樼洏鐮�= ""; tag.ssx杈撻�绾�s2008.wTaskNo = 0; - RedisHelper.Add<string>($"Arrive{2008}BarcodeLast", ntr, out msg); - if (!string.IsNullOrEmpty(ntr) /*&& rdisTcode != ntr*/) + } + if (!string.IsNullOrEmpty(ntr) && rdisTcode != ntr) + { + var str = Settings.apiHelper.Post(Settings.MESbaseUrl + "mom-basic/dataTransmission/json/service/224", JsonConvert.SerializeObject(new { - var str = Settings.apiHelper.Post(Settings.MESbaseUrl + "mom-basic/dataTransmission/json/service/224", JsonConvert.SerializeObject(new - { - cntrCode = ntr, - type = 1 - })); - var strr = JsonConvert.DeserializeObject<MES2234>(str); - if (strr.success && strr.data != null) - { - var end = (ushort)(strr.data.lineNum == 1 ? 2027 - : strr.data.lineNum == 2 ? 2020 : 2013); - tag.ssx杈撻�绾�s2008.wTaskNo = (uint)(20080000 + end); - tag.ssx杈撻�绾�s2008.wEbit = end; - tag.ssx杈撻�绾�s2008.R鎵樼洏鐮�= ntr; - LogHelper.Info($"2008 鎵樼洏鍙穥ntr} 鍐欎换鍔★紝wTaskNo={(uint)(20080000 + end)} wEbit={end} R鎵樼洏鐮�{ntr} Arrive{2008}BarcodeLast={ntr} "); - RedisHelper.Add<string>($"Arrive{2008}BarcodeLast", ntr, out msg); - } + cntrCode = ntr, + type = 1 + })); + var strr = JsonConvert.DeserializeObject<MES2234>(str); + if (strr.success && strr.data != null) + { + var end = (ushort)(strr.data.lineNum == 1 ? 2027 + : strr.data.lineNum == 2 ? 2020 : 2013); + tag.ssx杈撻�绾�s2008.wTaskNo = (uint)(20080000 + end); + tag.ssx杈撻�绾�s2008.wEbit = end; + tag.ssx杈撻�绾�s2008.R鎵樼洏鐮�= ntr; + LogHelper.Info($"2008 鎵樼洏鍙穥ntr} 鍐欎换鍔★紝wTaskNo={(uint)(20080000 + end)} wEbit={end} R鎵樼洏鐮�{ntr} Arrive{2008}BarcodeLast={ntr} "); + RedisHelper.Add<string>($"Arrive{2008}BarcodeLast", ntr, out msg); } } } -- Gitblit v1.9.1