From 91adcbb1b813198d0a81ca03257bf94d43d4ef60 Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期五, 22 十一月 2024 13:42:16 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 44 insertions(+), 2 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" index 865a824..ea508ed 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.Eventing.Reader; using System.Linq; using System.Reflection.Metadata; using System.Text; @@ -259,6 +260,7 @@ int B_Event_Test = GetLine(conveyorLine, deviceProDTO.DeviceProDataBlock); //鍒ゆ柇杈撻�佺嚎鏄惁鍏佽鏀捐揣淇″彿 if (B_Event_Test == 1) { + if (Releasespermitted(commonStackerCrane, task.TargetAddress,true)) //鍐欏叆鍫嗗灈鏈哄厑璁告斁璐т俊 { WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鍏佽鏀捐揣淇″彿鎴愬姛锛歵rue", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}"); @@ -305,6 +307,9 @@ if (B_TAKE == 1) { + + + //鍫嗗灈鏈哄啓瀹屾垚 if (Releasespermitted4(commonStackerCrane, task.TargetAddress, true)) { @@ -313,6 +318,43 @@ else { WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鏀句笅淇″彿澶辫触:true", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}"); + } + + if (task.TargetAddress == "R02-002-027-011-01" || task.TargetAddress == "R01-002-041-011-01") //鍐欏叆杈撻�佺嚎鍘诲悜 + { + byte PLCtost = (byte)task.PLCTo; + while (true) + { + if (PLCSignal2(conveyorLine, task.TargetAddress, "W_Destination", PLCtost)) + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ幓鍚戞垚鍔燂紝鍘诲悜涓猴細{PLCtost}", $"鍑烘枡鍙e幓鍚�"); + DeviceProDTO? deviceProDTO3 = GetDeviceProDTO(conveyorLine, task.TargetAddress, "R_Destination"); + if (deviceProDTO3 != null) + { + int PLCwcstost = GetLine(conveyorLine, deviceProDTO3.DeviceProDataBlock); + if (PLCwcstost == PLCtost) + { + if (PLCSignal2(conveyorLine, task.TargetAddress, "W_Destination", 0)) + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭竻闄ゅ幓鍚戞垚鍔�", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}"); + break; + } + else + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭竻闄ゅ幓鍚戝け璐�", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}"); + } + } + else + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬幓鍚戞瘮瀵逛笉涓�鑷达紝杈撻�佺嚎鍘诲悜涓猴細{PLCwcstost}锛寃cs鍐欏叆鍘诲悜涓猴細{PLCtost}", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}"); + } + } + } + else + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ幓鍚戝け璐ワ紝鍘诲悜涓猴細{PLCtost}", $"鍑烘枡鍙e幓鍚�"); + } + } } // 娓呴櫎杈撻�佺嚎 if (PLCSignal(conveyorLine, task.TargetAddress, 0)) @@ -329,11 +371,11 @@ // 娓呴櫎杈撻�佺嚎 if (PLCSignal(conveyorLine, task.TargetAddress, 0)) { - WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙锋垚鍔�", $"锛堟斁璐э級璇诲彇{task.TargetAddress}"); + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭湭璇诲彇鍒拌緭閫佺嚎鍙嶉鍫嗗灈鏈哄畬鎴愬弽棣堜俊鍙凤紝閲嶇疆涓�0", $"锛堟斁璐э級璇诲彇{task.TargetAddress}"); } else { - WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙峰け璐�", $"锛堟斁璐э級璇诲彇{task.TargetAddress}"); + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭湭璇诲彇鍒拌緭閫佺嚎鍙嶉鍫嗗灈鏈哄畬鎴愬弽棣堜俊鍙凤紝閲嶇疆涓�0", $"锛堟斁璐э級璇诲彇{task.TargetAddress}"); } } } -- Gitblit v1.9.3