| | |
| | | siemensPLCClient.Port = Port; |
| | | siemensPLCClient.Slot = (byte)Slot; |
| | | siemensPLCClient.ConnectTimeOut = 1000 * 3;//瓒呮椂鏃堕棿 |
| | | siemensPLCClient.ReceiveTimeOut = 1000 * 3; |
| | | siemensPLCClient.ConnectClose(); |
| | | var coonRes = siemensPLCClient.ConnectServer(); |
| | | IsConnected = coonRes.IsSuccess; |
| | |
| | | |
| | | if (!result.IsSuccess) |
| | | { |
| | | IsConnected = false; |
| | | WriteLog.Write_Log(PLCName, $"{PLCName}_Write", $"{dbAddress}鍐欏叆澶辫触," + result.Message); |
| | | throw new Exception($"{dbAddress}鍐欏叆澶辫触," + result.Message); |
| | | } |
| | |
| | | |
| | | if (!result.IsSuccess) |
| | | { |
| | | IsConnected = false; |
| | | WriteLog.Write_Log(PLCName, $"{PLCName}_Write", $"{orderName}鍐欏叆澶辫触," + result.Message, item); |
| | | throw new Exception($"{PLCName},{orderName}鍐欏叆澶辫触," + result.Message); |
| | | } |