This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus combine 2 registers
#1
Hi,
I am doing a modbus integration of a deltaohm weatherstation. 

For rainfall we have 2 modbus adresses (24,25) unsigned 16 bits registers. To get this right the manual says "The
amount of rainfall measurements are 32-bit integer values. Two consecutive 16-bit registers
must be accessed to read a measurement."

How do I do this? Is it possible to set it up in the modbus profile? 

KR
Thomas

Attached Files Thumbnail(s)
   
.json   Weatherstation.json (Size: 4.29 KB / Downloads: 2)
Reply
#2
Set datatype field to "uint32". You can use read test feature before creating the profile to check if different byte/word swap is needed.
Reply
#3
If you read the whole data as array, you can use logic and shift to combine the two registers.
temp = bit.bor(bit.lshift(data[24], 16), data[25])
Reply


Forum Jump: