Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModbusType.Rtu question #26

Open
SirJo opened this issue Jan 18, 2024 · 1 comment
Open

ModbusType.Rtu question #26

SirJo opened this issue Jan 18, 2024 · 1 comment

Comments

@SirJo
Copy link

SirJo commented Jan 18, 2024

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?

@DannielZhang
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants