Finding registers to read/write.
Hi,
(I couldn't find a forum to ask questions and an AI suggested the issues here as a place to ask questions)
I have a modbus temperature/humidity sensor. It works, and returns data when I ask it to report two 16bit registers starting at 0. It also came with reasonable documentation that explains what registers there are and what they do.
Apparently the manufacturer of the other modbus device thought it would be obvious, but as this is my first modbus experience, it is not obvious to me....
So I have a relay module, and in modbus mode I see it respond with an error when it is addressed, and I've tried a few commands and addresses but I don't see any one working. How do I find out what to do with this device?
Honestly, this is a bug tracker for libmodbus - not a general purpose forum. Your post is not related to this library at all at the moment. Additionally, you provided absolutely nothing to work with: when your device comes with a documentation, then you could share it or maybe link it. You could also just mention the vendor and the model. Then you just mention a random relay module module. Here the same... nothing to work with... vendor, model, maybe a link where to buy?
I was not hoping you'd tell me what the actual numbers ARE, but for a way to figure them out. For example, "download the examples/tools from there, and it has a scanner for registers" is the type of answer i was looking for. Edit/PS: (and the one step less reliable answer is to write the scanner myself. But I can't imagine that it isn't universally useful, so I can't imagine that it doesn't yet exist).
Is it normal for a modbus device to react with an error on say "read coil" and not at all on "read bit" ? when I write a program for libmodbus I get the return code "-1" for both the "no reaction" and the "got an error reply" cases. This makes scanning difficult for me. I read that libmodbus has extra error codes I can convert to human readable strings with modbus_strerror (or something like that), but what do I feed into that function? Where is that extra error code???
This is the relay board. https://nl.aliexpress.com/item/32486027375.html And this is the IO board that's next after I get the relay working: https://nl.aliexpress.com/item/1005008478482486.html Edit: The IO board is properly documented. Lets move on to that one first....