dev
liuwf 1 year ago
parent 04237b6b7c
commit b6cbd8dde9

@ -214,11 +214,11 @@
"Port": 102
},
{
"Id": 2,
"Id": 3,
"EquipName": "foamMachinePlc",
"PlcType": "Siemens",
"Enabled": true,
"IP": "127.0.0.1",
"IP": "10.10.93.180",
"Port": 102
}
],

@ -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
{

Loading…
Cancel
Save