From 8f392cc88b0768b74efca3b68785cf5aa1c38e70 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期三, 06 十一月 2024 14:28:20 +0800 Subject: [PATCH] 代码更新 --- wcs-server-hbf/WIDESEA_WCS/WCSClient/Omron/OmronPLCClient.cs | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wcs-server-hbf/WIDESEA_WCS/WCSClient/Omron/OmronPLCClient.cs b/wcs-server-hbf/WIDESEA_WCS/WCSClient/Omron/OmronPLCClient.cs index 14a3ae7..111c2e5 100644 --- a/wcs-server-hbf/WIDESEA_WCS/WCSClient/Omron/OmronPLCClient.cs +++ b/wcs-server-hbf/WIDESEA_WCS/WCSClient/Omron/OmronPLCClient.cs @@ -58,18 +58,21 @@ public string Connect() { OmronFinsNetClient = new OmronFinsNet(PLCIPAddress, Port); + + this.OmronFinsNetClient.ConnectTimeOut = 2000; + this.OmronFinsNetClient.ReceiveTimeOut = 2000; //閾炬帴plc var result = OmronFinsNetClient.ConnectServer(); if (!result.IsSuccess) { - WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Error锛歿PLCName}杩炴帴澶辫触{Environment.NewLine}閿欒淇℃伅锛歿result.Message}", PLCName); + WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Error锛歿PLCName}杩炴帴澶辫触---{DateTime.Now}{Environment.NewLine}閿欒淇℃伅锛歿result.Message}", PLCName); IsConnected = false; return $"杩炴帴澶辫触,閿欒淇℃伅锛歿result.Message}"; } else { IsConnected = true; - WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Info锛歿PLCName}杩炴帴鎴愬姛锛�", PLCName); + WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Info锛歿PLCName}杩炴帴鎴愬姛锛�---{DateTime.Now}", PLCName); return $"杩炴帴鎴愬姛"; } -- Gitblit v1.9.3