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.

convert decimal to binary and contrary !
#6
This can and should be done via a profile. Mapping entry should look like this. I'm not sure about the address 42014, it might be 2014 or 2013.
Code:
{
  "manufacturer": "Manufacturer name",
  "description": "Model name",
  "mapping": [
    {
      "name": "mode",
      "bus_datatype": "int16",
      "datatype": "uint8",
      "type": "register",
      "address": 42014,
      "writable": true,
      "write_bitmask": true,
      "value_bitmask": 7
    }
  ]
}

Later you can assign custom values to the mapped object to convert numerical values to text.

You can use Windows calculator in programmer mode to get bitmasks for certain bits. Switch to bit input mode, then select the required bits (0..2 in this example). Use the decimal value ask value_bitmask (7 in this example).
   
Reply


Messages In This Thread
RE: convert decimal to binary and contrary ! - by admin - 24.03.2022, 07:51

Forum Jump: