Today I have an EM24 and an SDM120 so part of an Openhab system where I can see A, V, W etc.
I want to change ID and Baud as I am currently using 2 Serial for Usb key, and want to assemble this.
SDM120 current: id = 1, baud = 2400, stopBits = “1.0”, parity = “none”, dataBits = 8, encoding = “rtu”]
Em24 current: id = 2, baud = 9600, stopBits = “1.0”, parity = “none”, dataBits = 8, encoding = “rtu”
EM24 = id = 1, baud = 9600, stopBits = “1.0”, parity = “none”, dataBits = 8, encoding = “rtu”
SDM = id = 2, baud = 9600, stopBits = “1.0”, parity = “none”, dataBits = 8, encoding = “rtu”]
In addition, I have an EM23 that I do not know the connection to yet.
EM23 = id = 3, baud = 9600, stopBits = “1.0”, parity = “none”, dataBits = 8, encoding = “rtu”
I tried in the program Modbus Poll without success.
So I hope someone can guide me
Why, what did you do and what happened?
Some devices will start work at new serial settings after a power off cycle.
first I connect to SDM120 and tested that I got data return. then I went under 06 and set ID = 1
(I assume this is current id) address = 40021
Value = 2
But the docs tell you to use FC10 (multi register) not FC06 (single register)
10 hex = 16 decimal
i continued the confusion from the docs! It is FC16 in ordinary use, write multiple holding registers (even though you only want to write one)
Well, you only want to write one register, not ten.
You’ll want to choose the simplest number system that you are thinking in, probably Unsigned.
EDIT oh wait, looking more closely at docs it says “4 byte float”. That’s going to be Float big- or little-
You’ll have to try reading some registers first to see if you get sensible answers.
Apart from that, I’m not familiar with the tool you are using there, Modbus Poll I suppose.
Check first by reading some registers for expected contents, whether your makers docs are giving register addresses in hex or decimal. They look like decimal, but other parts of docs are certainly in hex.
It’s quantity two, two registers make 4 bytes, to write a single 4-byte float.
I would recommend doing one parameter at a time here.
The 01 illegal is a response code from the device.
Hurrah it communicates with you!
Boo, it does not like what you asked it to do.
I really appreciate your help. Modbus coding is completely new to me. I have now corrected quantity to 2. under value I write 2 should this be converted to another format?
Looks good to me. As said, I know nothing about Modbus Poll tool.
Device data sheets are quite often poorly written or translated. It certainly seems to say that you should write 4 bytes to address decimal 40021 in float format of one kind or another using function 16 (hex FC10).
But we might be mistaken. Much of that can be confirmed by reading that address with similar params and FC03, and seeing if you get the expected “1”
You might read the other registers too, for confidence.
Apart from that, it will be trial and error.