I have a modbus tcp device which outputs two ascii characters as a 16-bit unsigned int at one of its addresses. The rest of the address in this block are ordinary int16s. For the life of me I cannot find a way to cleanly treat the value of that tag associated with that HR or any derived tag as ascii characters. The closest I’ve come is using a transform script on a bound component in Perspective, but that does not feel ideal when, say, I might want to access that tag’s value in multiple places. What am I missing? Is there just no clean way to turn “01101000 01101001“ into “hi”? Do I need to write a somewhat complex expression to do this? What if I had 8 characters, or 16? What if I have to read a dozen different ascii values?
Try [device]1.HRSxxxx:2 maybe?
Check your OPC Item Path to make sure it is addressed properly for a string.
Next check the appropriate advanced device settings on the gateway
toString(char({[.]modbusregister} >> 8)) + toString(char({[.]modbusregister} & 255))
this “worked” in an expression tag for whatever value of “worked” you assign to this only covering the two-character case.
Show us the OPC Item Path, you shouldn't need to do this.
Don't use modbus address mapping in Ignition, only use direct modbus addressing.
This will give you much more control to define addresses easily and correctly for your tags.
Using the 1.HRSxxx:2 notation will automatically read ascii from the register as characters.
Awesome ![]()

