You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
using HybirdFrameworkCore.Const;
|
|
|
|
|
using HybirdFrameworkDriver.ModbusTcpMaster;
|
|
|
|
|
|
|
|
|
|
namespace Service.Humiture.Client;
|
|
|
|
|
|
|
|
|
|
[Scope]
|
|
|
|
|
public class HumiturePlcClientLeft:ModbusTcpMaster
|
|
|
|
|
{
|
|
|
|
|
public HumiturePlcClientLeft()
|
|
|
|
|
{
|
|
|
|
|
ReadAction = BatchRead;
|
|
|
|
|
Ip = "172.0.20.52";
|
|
|
|
|
Port = 502;
|
|
|
|
|
Duration = 1000;
|
|
|
|
|
AutoReConnect = true;
|
|
|
|
|
ByteSeq = EndingConst.ByteSeq.BA;
|
|
|
|
|
WordSeq= EndingConst.WordSeq.CD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool BatchRead(ModbusTcpMaster master)
|
|
|
|
|
{
|
|
|
|
|
//var bytes01 = master.BatchReadHolderRegister(0, 32);
|
|
|
|
|
//if (bytes01 != null)
|
|
|
|
|
//{
|
|
|
|
|
// ModbusDecoder.Decode<HumitureMsg>(bytes01, HumiturePlcMgr.HumitureMsg2, EndingConst.ByteSeq.AB,
|
|
|
|
|
// EndingConst.WordSeq.DC);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|