Combine two tags

Ok I have two registers I need to read and combine into one, and not really sure how to do it.
Total Apparent Power High Register is register 6170 and it says it’s a Int32
Total Apparent Power Low Register is register 6171 and it says it’s a Uint32

I assume the 1st tag is a IRI6170 or HRI6170 and maybe an Integer type
and the 2nd tag is HRUS6171 or IRUS6170 and again an Integer type
and then I need to create a memory tag that I guess combines them with a bit shift?
I guess it would need to be a Double type?

Stupid question, why would they store the data this way? I guess I can see why you seperate them into two words vs one 64 bit word, but why one Int32 and one Uint32
Sorry for my ignorance!

This doesn’t really make sense. All Modbus registers are 16-bit. You can only make larger types by combining 16-bit registers.

What they’re probably trying to tell you is to combine 6170 and 6171 into 32-bit integer or uinteger. Our Modbus driver can do this without any extra effort to combine them, just use the right address syntax: HRI6170 or HRUI6170.

You may find the actual address is +/- 1 (or you need to toggle the one/zero-based address setting to get them to line up), and that you might need to use the “Reverse Word Order” setting.

{ Psssst! Enron! }

Arrgh, fine fine.

@Billy_Elliott it would be helpful if you could provide information about what hardware you're connected to and a user manual if possible so we can rule out the possibility of it actually using 32-bit registers, which are not supported and are not actually Modbus.

Here is the page from the manual. It’s an Eaton ATC-900 Transfer Switch.
I’m looking at Total Apparent Power high/low registers.

Thanks

Yeah I think you just read that wrong. It’s probably saying you can interpret the combined registers as either.

1 Like

Hmmm, again I’m kinda ignorant, but wouldn’t it make a big difference on what number you would end up with if you interpret it as the wrong type? I did try a 64 bit Signed or Unsigned and get pretty much the same numbers. But either way I get a huge number that just doesn’t make sense. It’s generating a number like 42,376,755,077,744. Which is just too much power! I’m not sure the whole country is using that much power, so I assume I must be doing something wrong. I guess I will call them and see if they can tell me what this means? Sorry to be a pain.

You may be off by one register.

edit: also what Phil said next.

1 Like

It isn’t 64-bit. It’s just 32-bit.

1 Like

I don’t think so, it should be 1 based, everything else seems correct. But I’m on the phone and trying to see what they can tell me. So far I’m getting a lot of Hmmmm’s.

Use one of the addresses I suggested.

Yeah your probably correct, the tech said he would have to contact an engineer and let me know. I was thinking 64 bit for some reason. So reading it as a 64 bit would have gotten me too much data, the 32 bit looks more correct at about 9835 VA or about 9kw. I guess I’m gonna have to go pull out my books and read up on signed/unsigned conversions. I know signed is like -2 billion to +2 billion and unsigned is 0 to +4 billion, but it’s just been too long since I had to do that manually to recall how it works. I guess until the number gets sufficiently big enough it doesn’t matter how you interpret it as signed/unsigned?

Yeah. Or if you need negative numbers.