|
|
|
@ -15,7 +15,7 @@ namespace Aucma.Core.HwPLc
|
|
|
|
|
{
|
|
|
|
|
private readonly log4net.ILog log = LogManager.GetLogger(typeof(MelsecPlc));
|
|
|
|
|
private SiemensS7Net siemensS7Net;
|
|
|
|
|
private SiemensPLCS siemensPLCS = SiemensPLCS.S1200;
|
|
|
|
|
private SiemensPLCS siemensPLCS = SiemensPLCS.S1500;
|
|
|
|
|
|
|
|
|
|
#region 构造函数
|
|
|
|
|
//public MelsecPlc()
|
|
|
|
@ -37,6 +37,7 @@ namespace Aucma.Core.HwPLc
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
Console.WriteLine("HwCommunication激活成功!");
|
|
|
|
|
|
|
|
|
|
siemensS7Net = new SiemensS7Net(siemensPLCS);
|
|
|
|
|
siemensS7Net.ConnectTimeOut = 2000;
|
|
|
|
|
Connect(iP, port);//建立连接
|
|
|
|
@ -75,7 +76,7 @@ namespace Aucma.Core.HwPLc
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public bool Connect(string iP, int port)
|
|
|
|
|
{
|
|
|
|
|
//siemensS7Net.IpAddress = iP;//正式环境开启
|
|
|
|
|
siemensS7Net.IpAddress = iP;//正式环境开启
|
|
|
|
|
siemensS7Net.Port = port;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|