FHEM Forum

FHEM => Sonstiges => Thema gestartet von: student101 am 10 September 2015, 12:25:05

Titel: Modbus Module: reading data stored in two registers
Beitrag von: student101 am 10 September 2015, 12:25:05
Hallo,

I am trying to setup FHEM to communicate with a device that stores its data in holding registers. Each data point is a floating point number stored in two sequential registers (eg. one piece of data is in registers 16384 and 16385). I have been trying to use the builtin FHEM module "98_ModbusAttr.pm" however it is only reading the high byte of data (eg. if I have the data "0xFFFF FFFF" it will display 65535 instead of 4294967295 on every poll). I have set the length of the register to 2 (eg. run command "attr builtin_test obj-h16384-len 2") and also 4 and 8 with no change to the data at all. See the attached screenshot for my module configuration.

To confirm that all the communications are happening correctly I have setup a monitor on the line and I can confirm that FHEM is sending the data correctly and the device is replying to FHEM correctly. I was wondering if anyone else has successfully setup a Modbus device that stores its data in two registers and if so could they offer me some advice?

Best regards,
Lachlan

PS. Entschuldigung für schreiben auf Englisch, mein Deutsch ist nicht gut. Also, wenn du verstehst etwas ich gesage nicht, ich kann versuchen zu schreiben auf Deutsch.
Titel: Antw:Modbus Module: reading data stored in two registers
Beitrag von: student101 am 10 September 2015, 15:01:49
I have managed to solve my problem. The attribute 'unpack' needed to be set to handle floats.

Lachlan