|
|
@ -34,7 +34,7 @@ public static class ClientMgr
|
|
|
|
NetAddr = "192.168.3.20",
|
|
|
|
NetAddr = "192.168.3.20",
|
|
|
|
NetPort = "2000",
|
|
|
|
NetPort = "2000",
|
|
|
|
//NetPort = "10000",
|
|
|
|
//NetPort = "10000",
|
|
|
|
Code = PlcConst.ChargeEqpCode,
|
|
|
|
Code = PlcConst.PlcEqpCode,
|
|
|
|
DestAddr = "132,208,208,224"
|
|
|
|
DestAddr = "132,208,208,224"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Log.Info($"begin to connect {netInfo.Code} {netInfo.NetAddr}:{netInfo.NetPort}");
|
|
|
|
Log.Info($"begin to connect {netInfo.Code} {netInfo.NetAddr}:{netInfo.NetPort}");
|
|
|
@ -43,7 +43,7 @@ public static class ClientMgr
|
|
|
|
Log.Info($"plc client Id={PlcClient.GetHashCode()}");
|
|
|
|
Log.Info($"plc client Id={PlcClient.GetHashCode()}");
|
|
|
|
|
|
|
|
|
|
|
|
PlcClient.AutoReconnect = true;
|
|
|
|
PlcClient.AutoReconnect = true;
|
|
|
|
PlcClient.Sn = PlcConst.ChargeEqpCode;
|
|
|
|
PlcClient.Sn = PlcConst.PlcEqpCode;
|
|
|
|
PlcClient.ConnectedEventHandler += (sender, b) =>
|
|
|
|
PlcClient.ConnectedEventHandler += (sender, b) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PlcClient.SessionAttr(netInfo.Code, netInfo.DestAddr);
|
|
|
|
PlcClient.SessionAttr(netInfo.Code, netInfo.DestAddr);
|
|
|
|