29.11.2024, 08:28
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?
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?