04.10.2022, 15:09
(02.10.2022, 10:48)tthamm Wrote:(24.01.2022, 07:14)admin Wrote: LM does not have D0/D1 markings, but A/B/GND. A is positive, B is negative. Try swapping A/B lines and also check that the serial port settings match.
now the communikation works!
I´ve found the manufactur manual with chapter 9 (Communication with Modbus) inside.
Here are the fields: Quantity, Details, Start reg (hex), Size, Res., Unit, Data type,
for Example:
Quantity: Active import, Details: Tariff 1, Start reg (hex): 5170, Size: 4, Res.: 0,01, Unit: kWh, Data type: Unsigned
When i try reading Active import with these settings:
- Function: Holding register (#3)
- Address: 20480
- Data type: uint64
- Read swap: Word
the Answer is 94425 (i think its 944,25 kWh), that is correct.
but how i have to "translate" for the Logicmachine? I know, that i have to calculate hex into dec (like 5000 in hex is 20480 in dec). In the Modbus Profile Generater are Fields like bus_datatype, datatype, value_custom, read_swap...
Can you give me an example? Thankx
I have the ABB B21 and have the next script what is working, maybe this can help you?
Code:
{
"product_code": "ABB_B21",
"mapping": [
{
"bus_datatype": 14,
"address": 20480,
"value_multiplier": 0.01,
"type": "register",
"units": " kWh",
"name": "Active import",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20484,
"value_multiplier": 0.01,
"type": "register",
"units": " kWh",
"name": "Active export",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20488,
"value_multiplier": 0.01,
"type": "register",
"units": "kWh",
"name": "Active Net",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20489,
"value_multiplier": 0.01,
"type": "register",
"units": "Kvarh",
"name": "Reactive Import",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20496,
"value_multiplier": 0.01,
"type": "register",
"units": "Kvarh",
"name": "Reactive Export",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20500,
"value_multiplier": 0.01,
"type": "register",
"units": "Kvarh",
"name": "Reactive Net",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20504,
"value_multiplier": 0.01,
"type": "register",
"units": "Kvarh",
"name": "Apparent Import",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20505,
"value_multiplier": 0.01,
"type": "register",
"units": "Kvarh",
"name": "Apparent Export",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20512,
"value_multiplier": 0.01,
"type": "register",
"units": "Kvarh",
"name": "Apparent Net",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20516,
"value_multiplier": 0.001,
"type": "register",
"units": "kg",
"name": "Active Import CO2",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 20532,
"value_multiplier": 0.001,
"type": "register",
"units": "currency",
"name": "Active Import Currency",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 23296,
"value_multiplier": 0.1,
"type": "register",
"units": "currency",
"name": "Volatage",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 23316,
"value_multiplier": 0.01,
"type": "register",
"units": " W",
"name": "Active power",
"datatype": "int64"
},
{
"bus_datatype": 14,
"address": 23296,
"value_multiplier": 0.1,
"type": "register",
"units": " V",
"name": "Voltage L1-N",
"datatype": "int32"
},
{
"bus_datatype": 14,
"address": 23308,
"value_multiplier": 0.01,
"type": "register",
"units": " A",
"name": "Current Ampere L1",
"datatype": "int32"
},
{
"bus_datatype": 14,
"address": 23316,
"value_multiplier": 0.01,
"type": "register",
"units": " W",
"name": "Active Total Power",
"datatype": "int32"
},
{
"bus_datatype": 14,
"address": 23340,
"value_multiplier": 0.01,
"type": "register",
"units": " Hz",
"name": "Frequency",
"datatype": "uint16"
},
{
"bus_datatype": 10,
"address": 35328,
"value_multiplier": 0,
"type": "register",
"units": " time",
"name": "date / time",
"datatype": "int64"
}
],
"manufacturer": "ABB",
"name": "B21",
"product_range": "PM",
"description": "Power Meter P21 1 fase",
"read_delay": 1
}
The last read_delay is because is had 2 devices and the next device i activate didn't work
link to post from Admin