|
|
@ -48,6 +48,18 @@ namespace SlnMesnac.Extensions
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
do
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!HslCommunication.Authorization.SetAuthorizationCode("1839541f-8fb4-42c4-a13f-733b027fe5af"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.Information("HslCommunication激活失败,可用时长为24小时");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.Information("HslCommunication激活成功");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (appConfig.plcConfig != null)
|
|
|
|
if (appConfig.plcConfig != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var item in appConfig.plcConfig)
|
|
|
|
foreach (var item in appConfig.plcConfig)
|
|
|
@ -62,7 +74,7 @@ namespace SlnMesnac.Extensions
|
|
|
|
Log.Information($"PLC:{item.plcIp}:{item.plcPort};连接成功,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
|
|
|
|
Log.Information($"PLC:{item.plcIp}:{item.plcPort};连接成功,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
|
|
|
|
_plc.ConfigKey = item.plcKey;
|
|
|
|
_plc.ConfigKey = item.plcKey;
|
|
|
|
|
|
|
|
|
|
|
|
if(absractFactories.Contains(_plc))
|
|
|
|
if (absractFactories.Contains(_plc))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
absractFactories.Remove(_plc);
|
|
|
|
absractFactories.Remove(_plc);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -76,6 +88,7 @@ namespace SlnMesnac.Extensions
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}while(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|