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.

How to convert received modbus LM value?
#1
Hi! I have a little problem and need everyone's help.
I am using a power meter and it returns a 4byte value, but I see that the 4byte value of LM received is not quite correct, while I use Test mode it gives the correct value (for example here is 9600), but the actual value I receive is 17942.000.
Does anyone know why? I would appreciate it very much.

Attached Files Thumbnail(s)
       
.json   demo cam bien DDM18SD.json (Size: 984 bytes / Downloads: 4)
Reply
#2
You need to add "datatype":"float32" to all profile entries.

Do you have documentation for this meter? Data type might be integer not floating point.
Reply
#3
(05.03.2025, 06:51)admin Wrote: You need to add "datatype":"float32" to all profile entries.

Do you have documentation for this meter? Data type might be integer not floating point.
Am I writing this right? Or am I missing something?
{
  "manufacturer": "Cảm biến đo điện",
  "description": "04 input registers,kết nối 9600,E,8,1",
  "mapping": [
    { "name": "Baud rate", "bus_datatype": "float32", "type": "register", "address": 0},
    { "name": "Check digit", "bus_datatype": "float32", "type": "register", "address": 2},
    { "name": "Address", "bus_datatype": "float32", "type": "register", "address": 8},
    { "name": "Điện áp V", "bus_datatype": "float32", "type": "inputregister", "address": 0, "units": "V" },
    { "name": "Dòng điện A", "bus_datatype": "float32", "type": "inputregister", "address": 8, "units": "A" },
    { "name": "Công suất Kwh", "bus_datatype": "float32", "type": "inputregister", "address": 18, "units": "W" },
    { "name": "Tần số Hz", "bus_datatype": "float32", "type": "inputregister", "address": 54, "units": "Hz" },
    { "name": "Tổng công suất Kwh", "bus_datatype": "float32", "type": "inputregister", "address": 256, "units": "Kwh" }
  ]
}

Attached Files
Reply
#4
Try this:
Code:
{
  "manufacturer": "Cảm biến đo điện",
  "description": "04 input registers,kết nối 9600,E,8,1",
  "mapping": [
    { "name": "Baud rate", "datatype": "float32", "bus_datatype": "float32", "type": "register", "address": 0},
    { "name": "Check digit", "datatype": "float32", "bus_datatype": "float32", "type": "register", "address": 2},
    { "name": "Address", "datatype": "float32", "bus_datatype": "float32", "type": "register", "address": 8},
    { "name": "Điện áp V", "datatype": "float32", "bus_datatype": "float32", "type": "inputregister", "address": 0, "units": "V" },
    { "name": "Dòng điện A", "datatype": "float32", "bus_datatype": "float32", "type": "inputregister", "address": 8, "units": "A" },
    { "name": "Công suất Kwh", "datatype": "float32", "bus_datatype": "float32", "type": "inputregister", "address": 18, "units": "W" },
    { "name": "Tần số Hz", "datatype": "float32", "bus_datatype": "float32", "type": "inputregister", "address": 54, "units": "Hz" },
    { "name": "Tổng công suất Kwh", "datatype": "float32", "bus_datatype": "float32", "type": "inputregister", "address": 256, "units": "Kwh" }
  ]
}
Reply
#5
oh, it works fine!
thank so much !
Reply


Forum Jump: