|
@@ -25,6 +25,7 @@ using System.Text;
|
|
|
using IMCS.CCS.Entitys.Dto;
|
|
|
using System.IO.Pipelines;
|
|
|
using Microsoft.IdentityModel.Tokens;
|
|
|
+using StackExchange.Redis;
|
|
|
|
|
|
namespace IMCS.CCS.Service.Impl
|
|
|
{
|
|
@@ -83,6 +84,7 @@ namespace IMCS.CCS.Service.Impl
|
|
|
|
|
|
private string imcs_redis_key = "IMCS_CCS:";
|
|
|
|
|
|
+
|
|
|
private string RFID = "RFID:";
|
|
|
|
|
|
private string LOG_RESOURCE_STATE = "设备状态";
|
|
@@ -1669,8 +1671,10 @@ namespace IMCS.CCS.Service.Impl
|
|
|
}catch (Exception ex)
|
|
|
{
|
|
|
Log.Instance.WriteLogAdd("心跳写入异常" + ex.Message, LOG_HEART_PLC);
|
|
|
+ Console.WriteLine("心跳写入异常");
|
|
|
return "心跳写入异常" + ex.Message;
|
|
|
}
|
|
|
+ Console.WriteLine("心跳写入成功");
|
|
|
return "心跳写入成功";
|
|
|
}
|
|
|
|
|
@@ -1773,5 +1777,43 @@ namespace IMCS.CCS.Service.Impl
|
|
|
return "MonitorEquipmentStatusJob : " + ex.Message;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 采集数据S7报警数据
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<List<string>> DataCollectS7JobWarn()
|
|
|
+ {
|
|
|
+
|
|
|
+ var data = await _redisService.Database.StringGetAsync("PLC_COSTOM_ADDRESS");
|
|
|
+ List<string> returnList=new List<string>();
|
|
|
+ List<string> dataList = data.ToString().Split(',').ToList();
|
|
|
+ /*SiemensS7Net s7 = DevicePlcS7.SiemensS7("10.161.30.248");
|
|
|
+ OperateResult ConnectionResult = s7.ConnectServer();
|
|
|
+ if (!ConnectionResult.IsSuccess)
|
|
|
+ {
|
|
|
+
|
|
|
+ s7.ConnectClose();
|
|
|
+ Log.Instance.WriteLogAdd("S7采集异常,plc连不上==>10.161.30.248" , LOG_TITLE_S7);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ foreach(string st in dataList)
|
|
|
+ {
|
|
|
+ string operateResult = s7.ReadBool(st).Content.ToString();
|
|
|
+ returnList.Add(operateResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ s7.ConnectClose();*/
|
|
|
+ returnList.Add("True");
|
|
|
+ return returnList;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|