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.

HELP! How to read this kind of register
#5
Hi Admin I don't have my LM for testing the result, but what do you think if I use this kind of .json for reading every single bit?

Code:
{
                              [
      {
        "name": "Alarm - bit 0 - Error flow temperature",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask": 0x1,
        "value_custom": {"01": "OK", "1": "Alarm"}
      },
      {
        "name": "Alarm - bit 1 - Error return temperature",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask": 0x2,
        "value_custom": {"01": "OK", "1": "Alarm"}
      },
      {
        "name": "Alarm - bit 6 - Low battery alarm",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask": 0x40,
        "value_custom": {"01": "OK", "1": "Alarm"}
      },
      {
        "name": "Alarm - bit 8 - Measurament unit mismatch on main counter",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask": 0x100,
        "value_custom": {"01": "OK", "1": "Alarm"}
      },
      {
        "name": "Alarm - bit 9 - Measurament unit mismatch on counter 1",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask": 0x200,
        "value_custom": {"01": "OK", "1": "Alarm"}
      },
      {
        "name": "Alarm - bit 10 - Measurament unit mismatch on counter 2",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask": 0x400,
        "value_custom": {"01": "OK", "1": "Alarm"}
      },
      {
        "name": "Alarm - bit 11 - Measurament unit mismatch on counter 3",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask": 0x800,
        "value_custom": {"01": "OK", "1": "Alarm"}
      },
      {
        "name": "Alarm - bit 12 - Measurament unit mismatch on counter 4",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask": 0x1000,
        "value_custom": {"01": "OK", "1": "Alarm"}
      },                 
     
                ]
}

If it will work I'll post my .json for Caleffi Conteca.

(07.10.2024, 08:20)admin Wrote: Use this. I've also fixed incorrect value_custom (should be "0" instead of "01").
Code:
{
  "name": "Alarm Status - bit 0 - Error flow temperature",
  "bus_datatype": "bool",
  "datatype": "uint16",
  "type": "register",
  "address": 119,
  "value_bitmask": 0x01,
  "value_custom": {"0": "OK", "1": "Alarm"}
},
{
  "name": "Alarm Status - bit 1 - Error return temperature",
  "bus_datatype": "bool",
  "datatype": "uint16",
  "type": "register",
  "address": 119,
  "value_bitmask": 0x02,
  "value_custom": {"0": "OK", "1": "Alarm"}
},

Ok, perfect. I will try as soon as possible. Thanks in advance for your help Admin.
Reply


Messages In This Thread
RE: HELP! How to read this kind of register - by Tuwat47 - 07.10.2024, 08:34

Forum Jump: