@ -29,5 +29,10 @@ namespace SlnMesnac.Config
/// PLC Key
/// </summary>
public string plcKey { get; set; }
/// <summary>
/// 是否启用
public bool isFlage { get; set; }
}
@ -42,10 +42,13 @@ namespace SlnMesnac.Plc
if (_appConfig.plcConfig != null)
{
foreach (var item in _appConfig.plcConfig)
if (item.isFlage)
AddPlc(item.plcType, item.plcIp, item.plcPort, item.plcKey);
else
_logger.LogInformation("PLC配置信息为空");
@ -27,14 +27,16 @@
"plcType": "MelsecBinaryPlc",
"plcIp": "127.0.0.1",
"plcPort": 6000,
"plcKey": "mcs"
"plcKey": "mcs",
"isFlage": false
},
"configId": 2,
"plcKey": "cwss"
"plcKey": "cwss",
]