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 Json datatypes
#1
Hi, 

I am, for the first time, creating a modbus json profile. And I have a question regarding how to correctly map a value of 20 bytes (10 registers) as a float.
When reading the product pdf manual I map all 4-byte values. See following example:
From pdf:
Address: 30001,
Descrption: "Line to neutral volts"
Lenght (bytes): 4
Data format: Float
Units: V
Hi byte: 00
Lo byte: 00

This would be mapped as such:
        {
            "address": 30001,
            "name": "Line to neutral volts",
            "read_count": 2,
            "bus_datatype": "float32",
            "type": "inputregister",
            "units": "V"
        }


But there are some values that have "Lenght" of 20 bytes. See example:
Address: 38193,
Descrption: "Total Last 1 month active Energy (Total, Rate1, Rate2, Rate3, Rate4)"
Lenght (bytes): 20
Data format: Float
Units: kWh
Hi byte: 20
Lo byte: 00

How would I mapp that? Should I create 5 separate mappings for  Total, Rate1, Rate2, Rate3 and Rate4. Assuming the addresses would be 38193 for Total and 38193+2 for Rate1 etc?
Or is there a way to map a large 10-register value?

Attached Files
.pdf   DCM230 user manual.pdf (Size: 1.15 MB / Downloads: 7)
.json   dcm230_mapping.json (Size: 5.18 KB / Downloads: 2)
Reply
#2
Start by using Read test to find correct settings. In your example do not use read_count only add "datatype": "float32", This defines how many registers will be read. One register is 2Bytes.
The 20Byte registers - check in read test if you can divide them in a smaller chunks.
------------------------------
Ctrl+F5
Reply


Forum Jump: