I have to write/send values to my energy analyzer which is 2 bytes in size. I can write data in a 1-byte holding register but I can not in 2 bytes register.
I want to send 11000 values to the registered address starting from 786 and as I mentioned it is 2 bytes in size.
Please see my attached snippet and suggest me.
Solved! Go to Solution.
oh yes, thanks for the correction. so, in this case, I have 2 words 32 bits where I want to write values (11000) it is decimal values please don't confuse them with binary.
any help, please
You can use two Holding Registers where you can splitt into 2 (16 bits)
11000 (dec) is 0x2AF8 (hex)
16 bits max. value is 65535. The 11000 fits in one register. If it must be two registers the high register is 0
After looking at your snippet I am going to give you some very pointed advice.
That will vastly improve your code and reduce debugging time.
Finally, your array constant to write to the holding register is empty so, you are literally writing nothing to it.