LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with read 64bit holding register

Hi guys,

 

I need to log data from 25 devices using Schneider Acti9 PowerTag Link. I made application in LabVIEW which works well while I reading 32 bit Holding Registers (upload picture) with big endian transfer, but when I need to read Total Active Energy I have problem because it consist of 64 bit Holding Registers because I am not sure how to make correctly big endian format (as I made with 32 bit Holding Register) . 

So please help!

 

0 Kudos
Message 1 of 6
(1,676 Views)

readdata%20labview

A single is 4 bytes (32 bits), so you definitely want to cast to a (8 byte, 64 bit) double.

 

IIRC, 64 bit floats (floats in general) are underspecified [EDIT: for modbus].

 

There's not just the byte ordering (big\little endian) but also the ordering of the words. So you can have 4 flavors, combining the byte ordering and word ordering:

 

1st word \ 2nd word (LE)

2nd word \ 1st word (LE)

1st word \ 2nd word (BE)

2nd word \ 1st word (BE)

 

If you post some data (and expected value) we can help.

0 Kudos
Message 2 of 6
(1,665 Views)

Simply read 4 registers and then combine them together with Join Numbers.

In your code, on the other hand, the decimate function is useless; furthermore, it only works for 32 bit values.

See the example below for both 32 and 64 bits:

pincpanter_0-1643106627322.png

 

EDIT: the device manual specifies it's an INT64 value, so you don't need to cast to a double.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 6
(1,663 Views)

@pincpanter wrote:

Simply read 4 registers and then combine them together with Join Numbers.

In your code, on the other hand, the decimate function is useless; furthermore, it only works for 32 bit values.


The decimate is only useless if you have 1 64 bit value. Once you want 2 (or more) 64 bit values, it's quite convenient.

0 Kudos
Message 4 of 6
(1,652 Views)

EDIT: nevermind
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 6
(1,644 Views)

I'd try this:

Modbus 64 bit registers.png

The 3 options can exist (should be tried) in all combinations. This information should be in the spec, but those can be cryptic.

 

If you need I64's, you can change the cast to I64.

0 Kudos
Message 6 of 6
(1,615 Views)