Steve-Mcl / node-red-contrib-buffer-parser

A node-red node to convert values in a buffer, integer array or hex string into many different data type(s). Supports Big/Little Endian, BCD, byte swapping and much more.
MIT License
24 stars 8 forks source link

Is type double here 4 bytes or 8 bytes? #21

Open thkfighter opened 6 months ago

thkfighter commented 6 months ago

Ubuntu 22.04 Node-RED 3.1.3 node v20.10.0

I am parsing a buffer with lots of double values, which are 8-byte IEEE754Double. I add double(le) items to node buffer-parser, but it seems that they are 4 bytes long. Screenshot from 2023-12-23 23-45-03

Steve-Mcl commented 6 months ago

@thkfighter

double is a 64 bit (8 byte) value.

All types in the node use/adhere to the NodeJS buffer specification: https://nodejs.org/api/buffer.html#bufreaddoublebeoffset

There looks to be a bug in the auto calculate next offset.

Just adjust your offsets manually until it is fixed :)