Logic Machine Forum
Modbus profie Satec PM130 Plus - 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: Modbus profie Satec PM130 Plus (/showthread.php?tid=204)



Modbus profie Satec PM130 Plus - Desislav - 26.01.2016

Hi
I read data from Satec power meter PM130 and map Modbus register to knx addresses. I have a problem with reading and mapping int32 registers.
For example:
Power factor L2
Range: -1000-1000
Units:×0.001
Type:INT32
R/W: R 
Can someone help me with example how to read this type of registers and map to knx address.

Desislav


RE: Modbus profie Satec PM130 Plus - admin - 26.01.2016

Are you using scripts or creating a modbus profile?


RE: Modbus profie Satec PM130 Plus - Desislav - 26.01.2016

(26.01.2016, 13:55)admin Wrote: Are you using scripts or creating a modbus profile?

I create Modbus profile.


RE: Modbus profie Satec PM130 Plus - admin - 27.01.2016

Try this, since the resulting value has to be multiplied by 0.001, bus_datatype field has to be set to float32, but datatype field (which tells what kind of data is read from ModBus) should be set to int32.

Code:
{
   "manufacturer": "satec",
   "description": "PM",
   "mapping": [
      {
         "name": "PF_L1",
         "bus_datatype": "float32",
         "datatype": "int32",
         "type": "register",
         "value_multiplier": 0.001,
         "address": 13342
      }
   ]
}



RE: Modbus profie Satec PM130 Plus - Desislav - 27.01.2016

(27.01.2016, 07:12)admin Wrote: Try this, since the resulting value has to be multiplied by 0.001, bus_datatype field has to be set to float32, but datatype field (which tells what kind of data is read from ModBus) should be set to int32.

Code:
{
   "manufacturer": "satec",
   "description": "PM",
   "mapping": [
      {
         "name": "PF_L1",
         "bus_datatype": "float32",
         "datatype": "int32",
         "type": "register",
         "value_multiplier": 0.001,
         "address": 13342
      }
   ]
}

Thanks for fast reply. I think now the received value is not real ( screenshot in attachment). Value for power factor must be from -1000 to 1000 when is not multiplied.


RE: Modbus profie Satec PM130 Plus - admin - 27.01.2016

It might have different register/byte order. Try reading registers 13342 and 13343 as uint16 and post what values you get here.


RE: Modbus profie Satec PM130 Plus - Desislav - 01.02.2016

(27.01.2016, 16:49)admin Wrote: It might have different register/byte order. Try reading registers 13342 and 13343 as uint16 and post what values you get here.

I think the problem is not reading Modbus register 13342 as int32. May be the value going wrong when transfer it to 4 byte knx variable.


RE: Modbus profie Satec PM130 Plus - admin - 01.02.2016

You can set bus_datatype to int32 and remove value_multiplier field. This way you can get the raw value that is being read.


RE: Modbus profie Satec PM130 Plus - Desislav - 01.02.2016

(01.02.2016, 14:23)admin Wrote: You can set bus_datatype to int32 and remove value_multiplier field. This way you can get the raw value that is being read.

I try but again the value is not true. I made other test with script. I create a script that read value from slave and map this value to Modbus register (LM work as Modbus tcp gateway) , then read the value with Modbus poll. Now the read value is ok (-974). But I need to map the register not to Modbus but to knx.


RE: Modbus profie Satec PM130 Plus - admin - 03.02.2016

Here you are reading a single register, not a pair and then converting it to int32.


RE: Modbus profie Satec PM130 Plus - Desislav - 04.02.2016

(03.02.2016, 06:33)admin Wrote: Here you are reading a single register, not a pair and then converting it to int32.


Yes in the attached screenshot I read a single register. But also I try to read two uint16 registers and store them in int32 knx address again I read wrong value. Can you post the example , may be make a mistake somewhere .