Logic Machine Forum
HELP! How to read this kind of register - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: HELP! How to read this kind of register (/showthread.php?tid=5653)



HELP! How to read this kind of register - Tuwat47 - 04.10.2024

Hi everyone,

I've integrated a Caleffi Conteca device on my LM and everything works well. I'll share my .json just after I'll solve this problem.

I would like to  add the register in attached and have a different GA output for every kind of alarm. For example:

- bit0 - Errore on Flow Temperature - 0/5/0
- bit1 - Errore on return temperature - 0/5/1
- bit6 - Low Battery Alarm - 0/5/2

and go on for the other bit of alarm.

Can someone explain me how to do? 

Thanks in advance.


RE: HELP! How to read this kind of register - Daniel - 04.10.2024

see this
https://forum.logicmachine.net/showthread.php?tid=839&pid=6729#pid6729


RE: HELP! How to read this kind of register - Tuwat47 - 07.10.2024

(04.10.2024, 15:59)Daniel Wrote: see this
https://forum.logicmachine.net/showthread.php?tid=839&pid=6729#pid6729

Hi Admin and thanks for your answer.

My LogicMachine knowledge is not so pro to let me know how go on with this issue. Can you halp me a little bit more?

Code:
{
        "name": "Alarm Status - bit 0 - Error flow temperature",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask" : what can I use for reading bit0?
        "value_custom": {"01": "OK", "1": "Alarm"}
      },
{
        "name": "Alarm Status - bit 1 - Error return temperature",
        "bus_datatype": "bool",
        "datatype": "uint16",
        "type": "register",
        "address": 119,
        "value_bitmask" : what can I use for reading bit1?
        "value_custom": {"01": "OK", "1": "Alarm"}
      },

Please consider to help me.


RE: HELP! How to read this kind of register - admin - 07.10.2024

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"}
},



RE: HELP! How to read this kind of register - Tuwat47 - 07.10.2024

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.


RE: HELP! How to read this kind of register - admin - 07.10.2024

Fixed profile attached.


RE: HELP! How to read this kind of register - nhemtman - 11.03.2025

Hi,

Could any of you help me? I need help with registers 138-139. It's a BITMAP32 register, where 0-15 are read as LSW and 16-31 are read as MSW (see example below), how are these parameterized in the modbus profile? I also attached the manual and the modbus profile I made. Thanks!


 
0x00100071 > Byte 1  ( 0x00 ), Byte 2 (0x71), Byte 3 (0x00), Byte 4 (0x10)
MSB, LSW                   


MSB: Most significant byte first
LSW: Least significant word first
 
In That example the following bits are set(counting starting at 0):
  • 0 sensor error
  • 5 pump 1 alarm
  • 6 pump 2 alarm
  • 7 pump 3 alarm
  • 20 net supply



RE: HELP! How to read this kind of register - admin - 11.03.2025

Use profiler app: https://forum.logicmachine.net/showthread.php?tid=5911

Use Value bitmask option. Click the calculator icon to select the required bits. Set Modbus data type to uint32 and Object data type to 1 bit.


RE: HELP! How to read this kind of register - nhemtman - 11.03.2025

(11.03.2025, 07:18)admin Wrote: Use profiler app: https://forum.logicmachine.net/showthread.php?tid=5911

Use Value bitmask option. Click the calculator icon to select the required bits. Set Modbus data type to uint32 and Object data type to 1 bit.

Thanks!