Reading unsigned OPC values

I have a 2 word unsigned integer in my PLC that has a value 0xAAAA00A8. But is being reported as a large negative number. Is there anyway to at least get this reported as an unsigned value, and also display the value as a hex number in the tag browser?

What driver are you using? What’s the tag type in Ignition?

Using the standard OPC UA driver, and the type is currently set to Integer

There isn’t a “standard OPC UA driver”. What kind of PLC is it? Or are you connected to another OPC UA server and not the built in one?

It’s a standard OPC tag type collecting data from the OPC UA server exposed in an Emerson RX3i PLC

Okay, you can try changing the Ignition tag type to a Long / Int8 value, but it’s really up to the server to use the correct datatype if it’s not already using an unsigned type.

You may need to use an expression tag and force it to be unsigned yourself by doing value & 0xFFFFFFFF or something. And then you might also need to use an expression to turn it to a hex value for display.

You mentioning the server using the correct data type made me realize where the issue might be. My PLC data choices are DINT or DWORD. I had it at DINT. Changing to DWORD and going to Long fixed the negative issue (which is face palm on my end - they have INT and UINT, but DINT and DWORD)

Is there a format string for Hex values?

An expression something like this would work: stringFormat("%08X", {[~]SomeTag} & 0xFFFFFFFF).

I can’t figure out how to get the Format String tag property to do hex formatting :confused:

Well this is for tag browsing and not visualization, so its the Format String property of course!

I don’t think its you. /: