LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from a Power Meter with Modbus

Solved!
Go to solution

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

 

KC_0-1669126250826.png

 

Kees

 

Message 31 of 43
(1,206 Views)

If I do that I get a number E+111

Where can I see the manual?

0 Kudos
Message 32 of 43
(1,195 Views)

You posted the manual here 😀

 

Can you show me what the register values are 

Message 33 of 43
(1,179 Views)

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

0 Kudos
Message 34 of 43
(1,152 Views)

Hi,

 

Don't know how you converted it but I get 50.012 Hz with these values.

 

KC_0-1669194408196.png

 

Message 35 of 43
(1,135 Views)

Like this, the blue wire is directly the output of the read holding registers

 

 

Wavicle_1-1669194926603.png

 

0 Kudos
Message 36 of 43
(1,130 Views)

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)

 

KC_0-1669197132299.png

 

Message 37 of 43
(1,110 Views)

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.

0 Kudos
Message 38 of 43
(1,104 Views)

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

0 Kudos
Message 39 of 43
(1,095 Views)

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

 

Message 40 of 43
(1,087 Views)