From 3ec3e0c1913bc902dbbcaeae2959897df6212ec2 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期四, 28 十一月 2024 15:41:23 +0800
Subject: [PATCH] 更新
---
WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs b/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
index ce35fed..7ffe969 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
@@ -161,7 +161,7 @@
for (int i = 0; i < 5; i++)
{
T readValue = Read<T>(address);
- stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, readValue, value));
+ stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, address, value));
obj = readValue;
if (readValue.Equals(value))
{
@@ -186,7 +186,6 @@
{
LogNet.WriteInfo(Name, stringBuilder.ToString());
}
-
}
/// <summary>
@@ -311,7 +310,6 @@
{
try
{
-
//瀹炰緥鍖栦竴涓タ闂ㄥ瓙鐨凷7鍗忚鐨勯�氳瀵硅薄
plc = new SiemensS7Net(SiemensPLCS.S1500)
{
@@ -427,7 +425,7 @@
catch (Exception ex)
{
//鍐欏叆寮傚父鏃舵姏鍑鸿嚜瀹氫箟閫氳寮傚父绫�
- throw new CommunicationException($"鍐欏叆鏁版嵁寮傚父,鍦板潃:銆恵address}銆�,閿欒淇℃伅: {ex.Message}", CommunicationErrorType.ReadFailed, innerException: ex);
+ throw new CommunicationException($"鍐欏叆鏁版嵁寮傚父,鍦板潃:銆恵address}銆�,閿欒淇℃伅: {ex.Message}", CommunicationErrorType.WriteFailed, innerException: ex);
}
}
@@ -592,7 +590,6 @@
LogNet.WriteException(Name, $"銆恵Name}銆慞LC璇诲彇寮傚父锛屽湴鍧�锛氥�恵address}銆戯紝閿欒淇℃伅锛氥�恵ex.Message}銆�", ex);
throw new CommunicationException(ex.Message, CommunicationErrorType.ReadException, innerException: ex);
}
-
}
#endregion
@@ -648,7 +645,6 @@
{
LogNet.WriteInfo(Name, stringBuilder.ToString());
}
-
}
#endregion
--
Gitblit v1.9.3