11-22-2022 08:11 AM - edited 11-22-2022 08:12 AM
Typecast the data (32 bits) to a SGL. Create a 32 bit value with the join number function
See page 12 of the manual. Float32 is a SGL
Kees
11-22-2022 09:10 AM
If I do that I get a number E+111
Where can I see the manual?
11-22-2022 09:49 AM
You posted the manual here 😀
Can you show me what the register values are
11-23-2022 02:18 AM
The power meter manual ok, I thought you were talking about some LabView manual 😅. I need to translate the data to 32-bit float big-endian
For example, for the frequency that should be 50 Hz, I get these two values16968 and 3146 and if I use the VIs in the photo I get -3,07245E+244
11-23-2022 03:07 AM
Hi,
Don't know how you converted it but I get 50.012 Hz with these values.
11-23-2022 03:16 AM
Like this, the blue wire is directly the output of the read holding registers
11-23-2022 03:52 AM
Converting the array will also work. But these values do not produce a valid number.
Sure that this is a Float32 value ?
The values you gave before seems to be Ok (50 Hz)
11-23-2022 04:21 AM
That is what the user manual says, from 3000 to 3110 all are float32. Using the values I gave you for the frequency I get 50 Hz using what you posted.
11-23-2022 04:30 AM
Ok, I got it.
I don't know why, but I have to put the register address minus 1, if I do that I get the values perfectly using what you posted.
Many many thanks K C
11-23-2022 04:57 AM
Great that it works !!
ModBus has a long history and not everything is that obvious when you look at now.
At some process steps the ModBus addressing does not start at 0 but at 1. So called DCS notation.
In that case you have to subtract one of the given address to get the real ModBus address.
Most of the times they also use the ModBus function as a prefix.
In that case notation like 403764 is actually ModBus code 3 or 4 and address 3763.
Kees