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.

Modbus profiles examples
#61
(03.10.2022, 07:54)Daniel Wrote: Try this:
Code:
{   
      "bus_datatype": "int64",
      "address": 20480,
      "type": "register",
      "units": "kWh",
      "value_multiplier": 0.01,
      "name": "Active import",
      "datatype": "uint64"
    },
Try using profile generator if this is simpler.
https://forum.logicmachine.net/showthrea...8#pid19678

I´ve tested it but it doesnt work. Here are some pictures. I always get a "operation time out", but the read test works!

                   

Attached Files Thumbnail(s)
   
Reply
#62
What are the RTU settings?
------------------------------
Ctrl+F5
Reply
#63
(02.10.2022, 10:48)tthamm Wrote:
(24.01.2022, 07:14)admin Wrote: LM does not have D0/D1 markings, but A/B/GND. A is positive, B is negative. Try swapping A/B lines and also check that the serial port settings match.

now the communikation works!

I´ve found the manufactur manual with chapter 9 (Communication with Modbus) inside.

Here are the fields: Quantity, Details, Start reg (hex), Size, Res., Unit, Data type,

for Example:

Quantity: Active import, Details: Tariff 1, Start reg (hex): 5170, Size: 4, Res.: 0,01, Unit: kWh, Data type: Unsigned

When i try reading Active import with these settings:
- Function: Holding register (#3)
- Address: 20480
- Data type: uint64
- Read swap: Word

the Answer is 94425 (i think its 944,25 kWh), that is correct.

but how i have to "translate" for the Logicmachine? I know, that i have to calculate hex into dec (like 5000 in hex is 20480 in dec). In the Modbus Profile Generater are Fields like bus_datatype, datatype, value_custom, read_swap...

Can you give me an example? Thankx

I have the ABB B21 and have the next script what is working, maybe this can help you?

Code:
{
  "product_code": "ABB_B21",
  "mapping": [
    {
      "bus_datatype": 14,
      "address": 20480,
      "value_multiplier": 0.01,
      "type": "register",
      "units": " kWh",
      "name": "Active import",
      "datatype": "int64"
    },
    {
      "bus_datatype": 14,
      "address": 20484,
      "value_multiplier": 0.01,
      "type": "register",
      "units": " kWh",
      "name": "Active export",
      "datatype": "int64"
    },
    {
      "bus_datatype": 14,
      "address": 20488,
      "value_multiplier": 0.01,
      "type": "register",
      "units": "kWh",
      "name": "Active Net",
      "datatype": "int64"
    },
      {
      "bus_datatype": 14,
      "address": 20489,
      "value_multiplier": 0.01,
      "type": "register",
      "units": "Kvarh",
      "name": "Reactive Import",
      "datatype": "int64"
    },
     {
      "bus_datatype": 14,
      "address": 20496,
      "value_multiplier": 0.01,
      "type": "register",
      "units": "Kvarh",
      "name": "Reactive Export",
      "datatype": "int64"
    },
     {
      "bus_datatype": 14,
      "address": 20500,
      "value_multiplier": 0.01,
      "type": "register",
      "units": "Kvarh",
      "name": "Reactive Net",
      "datatype": "int64"
    },
         {
      "bus_datatype": 14,
      "address": 20504,
      "value_multiplier": 0.01,
      "type": "register",
      "units": "Kvarh",
      "name": "Apparent Import",
      "datatype": "int64"
    },       
     {
      "bus_datatype": 14,
      "address": 20505,
      "value_multiplier": 0.01,
      "type": "register",
      "units": "Kvarh",
      "name": "Apparent Export",
      "datatype": "int64"
    },
         {
      "bus_datatype": 14,
      "address": 20512,
      "value_multiplier": 0.01,
      "type": "register",
      "units": "Kvarh",
      "name": "Apparent Net",
      "datatype": "int64"
    },      
     {
      "bus_datatype": 14,
      "address": 20516,
      "value_multiplier": 0.001,
      "type": "register",
      "units": "kg",
      "name": "Active Import CO2",
      "datatype": "int64"
    },
         {
      "bus_datatype": 14,
      "address": 20532,
      "value_multiplier": 0.001,
      "type": "register",
      "units": "currency",
      "name": "Active Import Currency",
      "datatype": "int64"
     },
              {
      "bus_datatype": 14,
      "address": 23296,
      "value_multiplier": 0.1,
      "type": "register",
      "units": "currency",
      "name": "Volatage",
      "datatype": "int64"
     },
                   {
      "bus_datatype": 14,
      "address": 23316,
      "value_multiplier": 0.01,
      "type": "register",
      "units": " W",
      "name": "Active power",
      "datatype": "int64"
     },
                        {
      "bus_datatype": 14,
      "address": 23296,
      "value_multiplier": 0.1,
      "type": "register",
      "units": " V",
      "name": "Voltage L1-N",
      "datatype": "int32"
     },
    {
      "bus_datatype": 14,
      "address": 23308,
      "value_multiplier": 0.01,
      "type": "register",
      "units": " A",
      "name": "Current Ampere L1",
      "datatype": "int32"
     },
     {
      "bus_datatype": 14,
      "address": 23316,
      "value_multiplier": 0.01,
      "type": "register",
      "units": " W",
      "name": "Active Total Power",
      "datatype": "int32"
     },
     {
      "bus_datatype": 14,
      "address": 23340,
      "value_multiplier": 0.01,
      "type": "register",
      "units": " Hz",
      "name": "Frequency",
      "datatype": "uint16"
     },
     {
      "bus_datatype": 10,
      "address": 35328,
      "value_multiplier": 0,
      "type": "register",
      "units": " time",
      "name": "date / time",
      "datatype": "int64"
     }
    ],
  "manufacturer": "ABB",
  "name": "B21",
  "product_range": "PM",
  "description": "Power Meter P21 1 fase",
  "read_delay": 1
}


The last read_delay is because is had 2 devices and the next device i activate didn't work
link to post from Admin
Reply
#64
(04.11.2020, 20:56)stemic01 Wrote: FYI: I've just implemented and written a modbus JSON profile for the FLEXIT NORDIC S4 ventilation system. Now I can retrieve vital information and change certain parameters. PM if you are in need of this for your flexit. (PS! The CI66 JSON did not work for me).

Hello, I have also tried the CI66 JSON with no success. Are you interested in sharing your file that would be great Smile

My unit is a Flexit Uni 4

Regards
Reply
#65
Hallo,
I created this modbus profile, but if I try to import it in LM, it show me "invalid profile":

{
  "manufacturer": "Rehom",
  "description": "Unità Master",
  "product_code": "REH11001",
  "mapping":
[
    {
      "name": "richiesta_lettura_dati",
      "bus_datatype": 7,
      "type": "register",
      "address": 6,
      "writable": "true"
    },
    {
      "name": "richiesta_lettura_contatore",
      "bus_datatype": 7,
      "type": "register",
      "address": 7,
      "writable": "true"
    },
    {
      "name": "consumo_calorie",
      "bus_datatype": 14,
      "units": "kWh",
      "type": "register",
      "address": 3015,
      "value_multiplier": 1
    },
    {
      "name": "consumo_frigorie",
      "bus_datatype": 14,
      "units": "kWh",
      "type": "register",
      "address": 3017
      "value_multiplier": 1
    }
  ]
}

Can someone help me please

Best regards
Fabio Rusconi
Reply
#66
(27.12.2022, 14:48)fabiorusco Wrote: Hallo,
I created this modbus profile, but if I try to import it in LM, it show me "invalid profile":

{
  "manufacturer": "Rehom",
  "description": "Unità Master",
  "product_code": "REH11001",
  "mapping":
[
    {
      "name": "richiesta_lettura_dati",
      "bus_datatype": 7,
      "type": "register",
      "address": 6,
      "writable": "true"
    },
    {
      "name": "richiesta_lettura_contatore",
      "bus_datatype": 7,
      "type": "register",
      "address": 7,
      "writable": "true"
    },
    {
      "name": "consumo_calorie",
      "bus_datatype": 14,
      "units": "kWh",
      "type": "register",
      "address": 3015,
      "value_multiplier": 1
    },
    {
      "name": "consumo_frigorie",
      "bus_datatype": 14,
      "units": "kWh",
      "type": "register",
      "address": 3017
      "value_multiplier": 1
    }
  ]
}

Can someone help me please

Best regards
Fabio Rusconi

Hi Fabio,
After "address":3017 there's no the ,
BR Cristian
Reply
#67
(28.12.2022, 05:47)CristianAgata Wrote:
(27.12.2022, 14:48)Thank you,Fabiofabiorusco Wrote: Hallo,
I created this modbus profile, but if I try to import it in LM, it show me "invalid profile":

{
  "manufacturer": "Rehom",
  "description": "Unità Master",
  "product_code": "REH11001",
  "mapping":
[
    {
      "name": "richiesta_lettura_dati",
      "bus_datatype": 7,
      "type": "register",
      "address": 6,
      "writable": "true"
    },
    {
      "name": "richiesta_lettura_contatore",
      "bus_datatype": 7,
      "type": "register",
      "address": 7,
      "writable": "true"
    },
    {
      "name": "consumo_calorie",
      "bus_datatype": 14,
      "units": "kWh",
      "type": "register",
      "address": 3015,
      "value_multiplier": 1
    },
    {
      "name": "consumo_frigorie",
      "bus_datatype": 14,
      "units": "kWh",
      "type": "register",
      "address": 3017
      "value_multiplier": 1
    }
  ]
}

Can someone help me please

Best regards
Fabio Rusconi

Hi Fabio,
After "address":3017 there's no the ,
BR Cristian
Reply
#68
Profile is missing datatype fields, most likely kWh readings will be incorrect. Can you provide documentation for this device?
Reply
#69
(28.12.2022, 07:30)admin Wrote: Profile is missing datatype fields, most likely kWh readings will be incorrect. Can you provide documentation for this device?

Hello,
I inserted them like uint32.

Thank you
Reply
#70
Hi all!
I made and checked the profile for the Haier YCJ-A002 module (for connecting Haier air conditioners via Modbus).
For writing, I used the site https://jsoneditoronline.org/
And modbus profile generator https://forum.logicmachine.net/showthrea...8#pid19678

Attached Files
.json   Haier YCJ-A002.json (Size: 2.06 KB / Downloads: 36)
Reply
#71
Dears,

attached the Modbus RTU direct connection profile of LG AWHP to logic machine incl all custom values.

Attached Files
.json   MB_RTU_LG_AWHP.json (Size: 12.01 KB / Downloads: 37)
Reply
#72
Hello everbody,

attached the Modbus RTU direct connection profile of LG PMBUSB00A LG Modbus Gateway to logic machine incl all custom values..

Attached Files
.json   LG_PMBUSB00A.json (Size: 103.72 KB / Downloads: 6)
.xlsx   (MemoryMap) Modbus Gateway_210122.xlsx (Size: 19.8 KB / Downloads: 30)
.pdf   MFL62179518 _IM_1220_English.pdf (Size: 2.4 MB / Downloads: 37)
Reply
#73
Hi, small script, which will help to create json profile for daikin modbus interface DIII (D3)
Code:
require('json')
data = {
  manufacturer = "daikin",
  description = "modbus gateway",
  mapping = {
    {
      }
    }
  }



str = json.encode(data)
--log(str)
--io.writefile('home/ftp/modbus.json', str)
ac_zones = {
  [1] ={
    [0] = '2_15 Мастер спальня',
    [1] = '2_01 Прихожая',
    [2] = '2_07 Cпальня 2',
    [3] = '2_02 Cпальня 1'   
    },
  [2] ={
    [0] = '1_18 Каминная',
    [1] = '1_16 Холл 2',
    [2] = '1_09 Массажная',
    [3] = '1_08 Спортзал',
    [4] = '1_04 Гостиная',
    [5] = '1_05 кухн'   
    },
  [3] ={
    [0] = '0_06-1 Бар',
    [1] = '0_06-2 Бар',
    [2] = '0_03 ДК'   
    },
  }
function ac_mapping_create (zones_table)
  mapping_table = {}
  for line, zones in pairs(zones_table) do
    for unit, name in pairs(zones) do
      -- статус подключения
      table.insert(mapping_table,
        {
          name = name.." - connection",
          type = "inputregister",
          bus_datatype = "bool",
          address = 1 + (line-1),
          datatype =  "int16",
          value_bitmask = 2^(unit)
          }
        )
      -- ошибка коммуникации
      table.insert(mapping_table,
        {
          name = name.." - communication error",
          type = "inputregister",
          bus_datatype = "bool",
          address = 5 + (line-1),
          datatype =  "int16",
          value_bitmask = 2^(unit)
          }
        )
      -- уставка
      table.insert(mapping_table,
        {
          name = name.." - setpoint ctrl",
          type = "register",
          bus_datatype = "temperature",
          address = 2002 + (line-1)*16*3 + unit*3,
          datatype =  "int16",
          writable = 1,
            write_only = 1,
          value_multiplier = 0.1
          }
        )
        table.insert(mapping_table,
        {
          name = name.." - setpoint status",
          type = "inputregister",
          bus_datatype = "temperature",
          address = 2002 + (line-1)*16*6 + unit*6,
          datatype =  "int16",
          value_multiplier = 0.1
          }
        )
      -- текущая
      table.insert(mapping_table,
          {
          name =  name.." - Room temp",
          type = "inputregister",
          bus_datatype = "temperature",
          address = 2004 + (line-1)*16*6 + unit*6,
          datatype = "int16",
          value_multiplier = 0.1
        }
        )
      -- opermode
      table.insert(mapping_table,
          {
          name =  name.." - Operation mode status",
          type = "inputregister",
          bus_datatype = "uint8",
          address = 2001 + (line-1)*16*6 + unit*6,
          datatype = "int16",
          value_bitmask = 15
        }
        )
      table.insert(mapping_table,
        {
          name = name.." - Operation mode ctrl",
          type = "register",
          bus_datatype = "uint8",
          address = 2001 + (line-1)*16*3 + unit*3,
          datatype =  "int16",
          writable = 1,
            write_only = 1,
          value_bitmask = 15,
          write_bitmask = true
          }
        )
      --fan st
      table.insert(mapping_table,
          {
          name =  name.." - fan speed status",
          type = "inputregister",
          bus_datatype = "uint8",
          address = 2000 + (line-1)*16*6 + unit*6,
          datatype = "int16",
          value_bitmask = 28672
        }
        )
      table.insert(mapping_table,
          {
          name =  name.." - fan status",
          type = "inputregister",
          bus_datatype = "uint8",
          address = 2000 + (line-1)*16*6 + unit*6,
          datatype = "int16",
          value_bitmask = 32
        }
        )
      -- power st
      table.insert(mapping_table,
          {
          name =  name.." - onoff status",
          type = "inputregister",
          bus_datatype = "uint8",
          address = 2000 + (line-1)*16*6 + unit*6,
          datatype = "int16",
          value_bitmask = 1
        }
        )
      -- controls
      table.insert(mapping_table,
        {
          name = name.." - fan speed ctrl",
          type = "register",
          bus_datatype = "uint8",
          address = 2000 + (line-1)*16*3 + unit*3,
          datatype =  "int16",
          writable = 1,
            write_only = 1,
          value_bitmask = 28672,
          write_bitmask = true
          }
        )
      table.insert(mapping_table,
        {
          name = name.." - fan flag ctrl",
          type = "register",
          bus_datatype = "uint8",
          address = 2000 + (line-1)*16*3 + unit*3,
          datatype =  "int16",
          writable = 1,
            write_only = 1,
          value_bitmask = 240,
          write_bitmask = true
          }
        )
      table.insert(mapping_table,
        {
          name = name.." - onoff ctrl",
          type = "register",
          bus_datatype = "bool",
          address = 2000 + (line-1)*16*3 + unit*3,
          datatype =  "int16",
          writable = 1,
            write_only = 1,
          value_bitmask = 1,
          write_bitmask = true
          }
        )
      end
    end
  return mapping_table
  end
data.mapping = ac_mapping_create(ac_zones)

str = json.encode(data)
log(io.writefile('home/ftp/KP1_DAIKIN_modbus.json', str))
just fill the ac_zones table according to your room names
ac_zones[i][j]
i - line(1-4)
j - ac unit (00-15)

and then download profile fromlocal ftp server using "ftp" login. you can add more registers if it is needed

Attached Files
Reply
#74
Hello,
I used a scheduled script to read the modbus register. In the device instructions it's indicated that I must repeat the reading in case of error. I attach the script that I used to detect if there is an error. It doesn't work. Can someone help me, please?

nappartamento = grp.getvalue('32/1/2')
nappartamento = nappartamento + 1
if (nappartamento > 211 ) then
nappartamento = 200
end
grp.update('32/1/2', nappartamento)
log(nappartamento)
require('luamodbus')
mb = luamodbus.rtu()

mb:open('/dev/ttyUSB0', 9600, 'N', 8, 1, 'H')
mb:connect()
mbConfusedetslave(32) --CENTRALINA MASTER
--IMPOSTO LETTURA NAPPARTAMENTO
contatore1=1
mb:writeregisters(7, nappartamento)
os.sleep(10)
--RIPETO SE RISPONDE CON ERRORE 5 VOLTE
contatore1=1
while (contatore1 > 0) do
  res, err = mb:readregisters(7, nappartamento)
if not res then
    os.sleep(30)
    mb:writeregisters(7, nappartamento)
  contatore1 = contatore1 + 1
  if contatore1 > 5 then
      alert('errore1')
    return
  end
else -- TUTTO OK
contatore1=0
  end
end

mb:writeregisters(6, nappartamento)
os.sleep(35)
--RIPETO SE RISPONDE CON ERRORE 5 VOLTE
contatore2=1
while (contatore2 > 0) do
  res, err = mb:readregisters(6, nappartamento)
if not res then
    os.sleep(30)
    mb:writeregisters(6, nappartamento)
  contatore2 = contatore2 + 1
  if contatore2 > 5 then
      alert('errore2')
    return
  end
else -- TUTTO OK
contatore2=0
  end
end




-- LEGGO VALORI
--log(mb:readregisters(3015,8))
os.sleep(1)
calorieh,caloriel,frigorieh,frigoriel,acs_lo,afs_lo,acs_hi,afs_hi = mb:readregisters(3015,8)
calorie = caloriel + (calorieh*65535)
log(calorie)
frigorie=frigoriel + (frigorieh*65535)
log(frigorie)
acs=acs_lo+(acs_hi*65535)
log(acs)
--afs=afs_lo+(afs_hi*65535)
--RIPETO SE RISPONDE CON ERRORE 5 VOLTE
mb:close()
Reply
#75
Looked quickly and noticed this already:

res, err = mb:readregisters(6, nappartamento)

Where nappartamento seems to be a value around 200 resulting in a command where you try to read register 6 to 206 at once and those 200 registers probably don’t even exist (consecutive), given the “res, err =“ you probably want to read only register 6..

I think your command needs to be:
res, err = mb:readregisters(6)
Reply
#76
I'm trying to figure out how to combine two registers as one. I want to read register 11(high) and 12(low) as one value. value_bitmask?
Reply
#77
Same question as yesterday..

https://forum.logicmachine.net/showthrea...3#pid32303

Change datatype and swap as needed ..
Reply
#78
Hello,
here is modbus profile for NIBE S1155 heat pump.

Attached Files
.json   Nibe_S1155.json (Size: 14.49 KB / Downloads: 20)
.pdf   NIBE Modbus OK.pdf (Size: 1.1 MB / Downloads: 13)
.pdf   Modbus S-series EN M12676EN-1.pdf (Size: 1.11 MB / Downloads: 8)
.xlsx   NIBE_ALL.xlsx (Size: 72.05 KB / Downloads: 6)
Reply
#79
.pdf   Board controller.pdf (Size: 1.61 MB / Downloads: 5)
.json   DAIKIN_EWYT.json (Size: 3.98 KB / Downloads: 8)

Hello everbody,

attached the Modbus RTU connection profile for Daikin EWYT to logic machine. Not all the Modbus address are compiled so in attached you can find also all the documentation you could need for implementing more registers.

Hello everbody,

attached the Modbus RTU connection profile for KWB Multifire to logic machine. Not all the Modbus address are compiled so in attched you can find also all the documentation you could need for implementing more registers.

Attached Files
.pdf   Modbus Manual.pdf (Size: 480.14 KB / Downloads: 2)
.xlsx   ModbusInfo-en-V22.4.0.xlsx (Size: 184.79 KB / Downloads: 1)
.json   KWB Multifire.json (Size: 4.45 KB / Downloads: 2)
Reply
#80
Hello everyone,

want to share some Modbus profiles.
We implement this devices in the last few years.
Hope it helps.

Kind regards 
Epps

Attached Files
.json   Eastron_SDM630_V2.json (Size: 7.15 KB / Downloads: 9)
.json   Janitza_UMG-605-Pro.json (Size: 11.63 KB / Downloads: 4)
.json   Mennekes_Amedio_Modbus.json (Size: 2.17 KB / Downloads: 1)
.json   oekofen_modbus_V3.json (Size: 1.2 KB / Downloads: 1)
.json   SMA_TCP_Hybrid_V2.json (Size: 2.99 KB / Downloads: 1)
.json   SMA_Webbox.json (Size: 413 bytes / Downloads: 1)
.json   SMA_Sunny_Island.json (Size: 1.91 KB / Downloads: 1)
.json   SMA_TCP_Core_ONE_ready_and_tested.json (Size: 889 bytes / Downloads: 1)
.json   Wolf_CWL_V2.json (Size: 2.8 KB / Downloads: 1)
.json   Siemens_PAC4200.json (Size: 5.39 KB / Downloads: 1)
.json   Siemens_PAC3120.json (Size: 5.39 KB / Downloads: 2)
.json   Siemens_PAC2200.json (Size: 5.39 KB / Downloads: 1)
Reply


Forum Jump: