# Convert signed to unsigned int

**URL:** <https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572>\
**Category:** Ignition\
**Created:** [June 4, 2012, 11:02pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572 "2012-06-04T23:02:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [June 4, 2012, 11:02pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572/1 "2012-06-04T23:02:00Z")

</div>

Is there a way to convert the OPC integer from signed to 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:** [June 4, 2012, 11:04pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572/2 "2012-06-04T23:04:44Z")

</div>

Do you mean a SQLTag and its datatype? SQLTags doesn’t currently have any support for unsigned values.

What are you trying to accomplish?

---

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [June 4, 2012, 11:14pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572/3 "2012-06-04T23:14:52Z")

</div>

I’m getting data back from the PLC that is interpreted by the OPC server as signed. Is there way to convert it to unsigned. I need to store data over 32K. The data in the PLC is 16 bit.

---

<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:** [June 4, 2012, 11:25pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572/4 "2012-06-04T23:25:29Z")

</div>

What driver are you using? (I assume you are using the Ignition OPC-UA server)

---

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [June 4, 2012, 11:32pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572/5 "2012-06-04T23:32:51Z")

</div>

IOServer using Kingfisher series II protocol. In the Wonderware system, I just checked, the OPC path is appended by , uword. Need to look further into this. Just thouth that the Ignition could do the conversion.

---

<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:** [June 4, 2012, 11:33pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572/6 "2012-06-04T23:33:42Z")

</div>

Make your SQLTag datatype for that tag an Int4. If it’s still getting treated as a signed int you’ll need to convert it before it gets to Ignition. You’ll need the SQLTag to be Int4 in either case.

---

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [June 4, 2012, 11:42pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572/7 "2012-06-04T23:42:20Z")

</div>

Ok it works now by changing it to I4 with uword. Is I4 4 bytes? I never got that straight.

---

<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:** [June 4, 2012, 11:47pm UTC](https://forum.inductiveautomation.com/t/convert-signed-to-unsigned-int/4572/8 "2012-06-04T23:47:07Z")

</div>

Yep.
