# Combine two tags

**URL:** <https://forum.inductiveautomation.com/t/combine-two-tags/64666>\
**Category:** Ignition\
**Created:** [September 29, 2022, 3:50pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666 "2022-09-29T15:50:40Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 29, 2022, 3:50pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/1 "2022-09-29T15:50:40Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 29, 2022, 3:59pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/2 "2022-09-29T15:59:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 29, 2022, 4:08pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/3 "2022-09-29T16:08:24Z")

</div>

{ _Psssst! Enron!_ }

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 29, 2022, 4:12pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/4 "2022-09-29T16:12:31Z")

</div>

> [@pturmel](#):
>
> { _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.

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 29, 2022, 4:16pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/5 "2022-09-29T16:16:33Z")

</div>

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.

 ![Screenshot 2022-09-29 111509](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4df983b00978874781c190c68b1b70886d151db1.jpeg)

Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 29, 2022, 4:20pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/6 "2022-09-29T16:20:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 29, 2022, 4:25pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/7 "2022-09-29T16:25:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 29, 2022, 4:27pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/8 "2022-09-29T16:27:05Z")

</div>

You may be off by one register.

edit: also what Phil said next.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 29, 2022, 4:27pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/9 "2022-09-29T16:27:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 29, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/10 "2022-09-29T16:28:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 29, 2022, 4:29pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/11 "2022-09-29T16:29:25Z")

</div>

Use one of the addresses I suggested.

> [@Kevin.Herron](#):
>
> 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`.

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 29, 2022, 4:36pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/12 "2022-09-29T16:36:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 29, 2022, 4:38pm UTC](https://forum.inductiveautomation.com/t/combine-two-tags/64666/13 "2022-09-29T16:38:03Z")

</div>

> [@Billy\_Elliott](#):
>
> 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.
