Just as an update.
I was struggling with multiple registers which are used i.e. for the AO1.1 port of my Neuron M103.
So for the AO registers 3000 and 3001 are given as "real".
I extended the above union as follows:
union {
uint16_t word[2];
uint32_t dword;
float fl;
} counter;
And I am reading the register like this:
modbus_read_registers(modbusglob, 3000, 2, &counter.word[0]);
It reads 2 registers starting at 3000 and writes the result in the word array where it is automatically converted to "float" by the union structure.
Works fine!
/KNEBB