# Modbus ASII Read to String value

**URL:** <https://forum.inductiveautomation.com/t/modbus-asii-read-to-string-value/37474>\
**Category:** Ignition\
**Created:** [August 6, 2020, 6:40pm UTC](https://forum.inductiveautomation.com/t/modbus-asii-read-to-string-value/37474 "2020-08-06T18:40:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DSI600](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DSI600](https://forum.inductiveautomation.com/u/DSI600)\
**Post date:** [August 6, 2020, 6:40pm UTC](https://forum.inductiveautomation.com/t/modbus-asii-read-to-string-value/37474/1 "2020-08-06T18:40:04Z")

</div>

I have looked around the forum but can’t find my exact problem.

I need to read a ASCII string from a device (It is not a PLC) It is a standalone machine with control boards on it that does have Modbus TCP. I can read integer values and floating point just having issues with the ASCII part of it.

All the company gave me is the register for the string.

Address=31050 - Size=50 Type=String - Range=ASCII

How would I read this using the Ignition Modbus driver?

I have used WW to read from the same type of machine at another facility using  
31050-31075 M  
in WW MBTCP driver. So I know the value is there.

---

<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:** [August 6, 2020, 6:50pm UTC](https://forum.inductiveautomation.com/t/modbus-asii-read-to-string-value/37474/2 "2020-08-06T18:50:33Z")

</div>

If the ‘3’ prefix indicates Input Registers, you might be stuck. For Holding Registers, it would be `HRS1050:50`. For other variants, `HR` can be replaced with `IR` to get the corresponding Input Registers, but that’s not documented to work. Worth a try, I would think: `IRS1050:50`.

@Kevin.Herron ?

---

<div class="post-metadata">

**Author:** ![DSI600](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DSI600](https://forum.inductiveautomation.com/u/DSI600)\
**Post date:** [August 6, 2020, 6:54pm UTC](https://forum.inductiveautomation.com/t/modbus-asii-read-to-string-value/37474/3 "2020-08-06T18:54:21Z")

</div>

They are def Input Registers - I did try the I am kinda confused on how I should do the modbus mapping for it in the device settings before I could even apply the IRS or HFS(Which I tried even knowing it is not a holding register)

Do I set it up as Input Register INT32 for 25 words?

---

<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:** [August 6, 2020, 6:57pm UTC](https://forum.inductiveautomation.com/t/modbus-asii-read-to-string-value/37474/4 "2020-08-06T18:57:37Z")

</div>

No. Modbus Input Registers and Holding Registers are 16-bits each at the device. They can be used in pairs for 32-bit data types. Multiple sequential registers can be treated as two 8-bit ASCII characters each. But it looks like that usage for Input Registers may not exist in the IA driver.

---

<div class="post-metadata">

**Author:** ![DSI600](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DSI600](https://forum.inductiveautomation.com/u/DSI600)\
**Post date:** [August 6, 2020, 7:07pm UTC](https://forum.inductiveautomation.com/t/modbus-asii-read-to-string-value/37474/5 "2020-08-06T19:07:48Z")

</div>

Thanks! The IRS1050:50 worked… Though the string is coming in backward I think I need to change one of the Modbus settings to swap bytes.

There are 7 strings - 5 50 in length and 2 7 and they all come in. Just got to figure out the byte swapping.

Thanks @pturmel

edit. ModbusTcpDriverSettings.ReverseStringByteOrder.Name? Turning that on fixed the strings - Thanks again.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [August 6, 2020, 7:11pm UTC](https://forum.inductiveautomation.com/t/modbus-asii-read-to-string-value/37474/6 "2020-08-06T19:11:32Z")

</div>

In the device settings in the Gateway, under show advanced properties, there is both reverse word order and reverse string byte order, try those they may help…
