|
|
@ -24,26 +24,6 @@ public class UpsClient: ModbusTcpMaster
|
|
|
|
//TODO::加解码方式
|
|
|
|
//TODO::加解码方式
|
|
|
|
ByteSeq = EndingConst.ByteSeq.BA;
|
|
|
|
ByteSeq = EndingConst.ByteSeq.BA;
|
|
|
|
WordSeq= EndingConst.WordSeq.CD;
|
|
|
|
WordSeq= EndingConst.WordSeq.CD;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string hexString01 = "08FD08FD08F708F500000000000013891389138900640064006408FF08F908F70012001700111388138813880027001D003008B008AF08AE00020000000313871387138700000000000000000000000100000000000100000000000000080000000D00FA086908660000000000FA7FF803E8000000000E0E0E0F08AD08AD08AD0876087800000000000000000000000F08B008AF08AE08FD08F708F500040001";
|
|
|
|
|
|
|
|
string hexString02 = "00010909090609030012001800111388138813880027001C00360E100E0F0869086508760874000000000000000008AD08AE08AD00020000000313881388138800000000000008B008AF08AE090A0908090500000000000100000000000100000000000000080000000D00000000000000000000000000000000000000080000000D0000000000000000000000000000000000200020000000000000FFFF000000000270000704C00100FFFF1BFF00807EFF00000001000183440A66000000000000014501AE015A014F014301660166016600000000000001AE0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001003700050029000200370005";
|
|
|
|
|
|
|
|
string hexString03 = "0001000100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000030000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte[] bytes01=Convert.FromHexString(hexString01);
|
|
|
|
|
|
|
|
byte[] bytes02=Convert.FromHexString(hexString02);
|
|
|
|
|
|
|
|
byte[] bytes03=Convert.FromHexString(hexString03);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ModbusDecoder.Decode<UpsRemoteComm>(bytes01, UpsMgr.UpsRemoteComm, EndingConst.ByteSeq.AB, EndingConst.WordSeq.DC);
|
|
|
|
|
|
|
|
ModbusDecoder.Decode<UpsTelemetering>(bytes03, UpsMgr.UpsTelemetering, EndingConst.ByteSeq.AB, EndingConst.WordSeq.DC);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void BatchRead(ModbusTcpMaster master)
|
|
|
|
private void BatchRead(ModbusTcpMaster master)
|
|
|
|