RS485/ Modbus 16Bit Buffer conversion to different Datatypes from Finder-Meter 7M38

Hi all,
I'm new to node red. I want to automate my pv charging system with node red. I'm still at the very beginning but able to read out the registers from the Finder 7M38. But I'm in trouble now by converting the received 16Bit Buffers into the corresponding datatypes.

First, the normal 16Bit Datatypes with only 2Bytes are correctly displayed. Thats fine and I assume the correct reading of the Meter.

Now I tryed Register 30105-30106, it contains the Frequency in Hz, so I assume a value of about 50,000.

Modbus Response shows me data[65024, 5010] and buffer: fe 00 13 92.

The datasheet tels me its unsigned measurement 32Bit and
bits 31...24 are decade exponent signed 8bit and
bits 23...0 are binary unsigned value 24bit

I read that modbus sends MSB first, so we get here:

Exponent Value
11111110 000000000001001110010010
(1) minus?
1111110

DEC: 126 DEC: 5010

I think the value of 5010 could be correct, but how should DEC126 give me the decade exponent? I can't see it...

I also tryed to use the buffer parser, but this also did not give me the result i assumed:

Thank you very much for your help!

BR
Chris

The issue is the way the manufacturer has packed the data is NOT IEE 754 compliant float. Therefore you need to grab the parts and calculate the T5 value yourself.

e.g:

msg.payload.T5 = msg.payload.uint24 * Math.pow(10, msg.payload.exponent)
return msg

Demo flow (use CTRL+I to import it)

[{"id":"df02b668d9229bd3","type":"buffer-parser","z":"fe471bfa726693b8","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"uint24","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"0x00FFFFF"},{"type":"int8","name":"exponent","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":2030,"y":820,"wires":[["6b746531a8fdd309","72f1ab990ea48fc4"]]},{"id":"67f19a5bdfba2ea7","type":"inject","z":"fe471bfa726693b8","name":"[65024, 5010]","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[65024, 5010]","payloadType":"json","x":1850,"y":820,"wires":[["df02b668d9229bd3"]]},{"id":"6b746531a8fdd309","type":"debug","z":"fe471bfa726693b8","name":"debug 306","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2370,"y":820,"wires":[]},{"id":"6430740824aa88ce","type":"inject","z":"fe471bfa726693b8","name":"123456*10-3 (FD 01 E2 40)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[\"0xfd\",\"0x01\",\"0xe2\",\"0x40\"]","payloadType":"bin","x":1800,"y":880,"wires":[["df02b668d9229bd3"]]},{"id":"72f1ab990ea48fc4","type":"function","z":"fe471bfa726693b8","name":"Calc T5","func":"msg.payload.T5 = msg.payload.uint24 * Math.pow(10, msg.payload.exponent)\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2200,"y":880,"wires":[["db7a8a8e5698eea9"]]},{"id":"db7a8a8e5698eea9","type":"debug","z":"fe471bfa726693b8","name":"debug 307","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2370,"y":880,"wires":[]}]

1 Like

Hi Steve,
thank you so much! Your example does exactly what I needed. I was able to do some minor modification due too differnt datatypes of the meter because it is more than selfexplaning!

BR
Chris

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.