Modbus.Net icon indicating copy to clipboard operation
Modbus.Net copied to clipboard

ModbusType.Rtu question

Open SirJo opened this issue 2 years ago • 1 comments

my code var comPort = GetComPort(); //COM5 var slaveAddress = GetSlaveAddress(); //3 //var registerAddresses = GetRegisterAddresses();

var _utility = new ModbusUtility(ModbusType.Rtu, comPort, slaveAddress, 0, Endian.BigEndianLsb); await _utility.ConnectAsync();

while (true) { object[] receivedBytes = (await _utility.GetDatasAsync("4X 0", new KeyValuePair<Type, int>(typeof(ushort), 2))).Datas;

}

question receivedBytes is always null and I am sure I get this data by serialPort 10 00 00 00 02 04 04 80 00 00 F8 CF

What am i doing wrong?

SirJo avatar Jan 18 '24 15:01 SirJo

I didn't working on this for a long time… did u fixed it?

DannielZhang avatar May 09 '24 23:05 DannielZhang

There are no "4X 0” or "40000" in Modbus.

parallelbgls avatar Jun 03 '24 02:06 parallelbgls