24.03.2022, 07:51
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.
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).
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).