|
|
|
@ -14,7 +14,10 @@ namespace Aucma.Core.RunPlc
|
|
|
|
|
#region 构造函数
|
|
|
|
|
public RunPlcService()
|
|
|
|
|
{
|
|
|
|
|
StartMelsecMcPlcServer();//三菱PLC
|
|
|
|
|
Task.Run(async () => {
|
|
|
|
|
await StartMelsecMcPlcServer();//三菱PLC
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//StartSiemensPlcServer();//西门子
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
@ -30,7 +33,7 @@ namespace Aucma.Core.RunPlc
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void StartMelsecMcPlcServer()
|
|
|
|
|
private static Task StartMelsecMcPlcServer()
|
|
|
|
|
{
|
|
|
|
|
// string ip = Appsettings.app("Middleware", "Scanner1", "Ip");
|
|
|
|
|
var allPlcServices = Appsettings.app<PlcModel>("PLCServer").ToList();
|
|
|
|
@ -45,6 +48,7 @@ namespace Aucma.Core.RunPlc
|
|
|
|
|
// model.IsConnect = model.plc.IsConnected;
|
|
|
|
|
PlcHelper.melsecList.Add(model);
|
|
|
|
|
}
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void StartSiemensPlcServer()
|
|
|
|
|