Hex array question

I have a data string that comes from a Modbus module that is ([0x6F, 0x03, 0x01, 0x02, 0x03, 0x01, 0x8C, 0x84]), what I want is to take bytes 3 and 4 and join them like this:
0x02 and 0x03 = 203 and transform those 203 from hexadecimal to decimal, which would be = 515.

In conclusion, what we need is to join those 2 bytes and then transform them to decimal.

Thank you.

Node-red-contrib-buffer-parser is designed for this type of task.

Send your data array to a buffer-parser node, set an entry to read
Type: int16be, offset 3, length 1.

You can convert as many parts of the byte array as required.

Edit: I assume this hex array is actually a buffer? you can confirm this by looking at the debug panel

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