Convert signed int to unsigned int

It depends what you mean by needing to convert it to an unsigned int. If you’re reading a value in from an Adam 6017 I assume it’s a 16-bit integer. A signed 16-bit integer will have a range of −32,768 to 32,767. An unsigned 16-bit integer will have a range of 0 to 65,535. To change from signed to unsigned you would simply add 32,768 to the number.

To do this in Ignition, read your input in to a SQLTag (say tag1), then create an Expression SQLTag and make its expression something like {[~]tag1}+32768This does mean you need 2 SQLTags for each input, but they’re free :slight_smile: and if you’re creative with SQLTag names and folders it should still be clear what you’re doing.

Let us know if this is not what you are meaning.