# Added white space in send/receive value using Modbus strings

**URL:** <https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525>\
**Category:** Ignition\
**Created:** [January 9, 2018, 2:53pm UTC](https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525 "2018-01-09T14:53:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanbeno](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@ryanbeno](https://forum.inductiveautomation.com/u/ryanbeno)\
**Post date:** [January 9, 2018, 2:53pm UTC](https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525/1 "2018-01-09T14:53:58Z")

</div>

I am using an Opto 22 SNAP PAC system. I am trying to read and write an odd number of characters in a string to/from my SNAP PAC. However Ignition adds an additional piece of white space to the end of the string when the string is an odd number of characters. Has anyone come up with a work around or fix for this? If I send or read an even number of characters I have no issue. I know that Modbus in Ignition uses a 2 character storage system.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 9, 2018, 4:02pm UTC](https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525/2 "2018-01-09T16:02:05Z")

</div>

You can use a derived tag and the [`trim()`](https://docs.inductiveautomation.com/display/DOC79/trim) function around the value read.

---

<div class="post-metadata">

**Author:** ![ryanbeno](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@ryanbeno](https://forum.inductiveautomation.com/u/ryanbeno)\
**Post date:** [January 9, 2018, 6:13pm UTC](https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525/3 "2018-01-09T18:13:40Z")

</div>

I am not using a 7.9 instance. I am using a 7.7 gateway that does not have derived tags

---

<div class="post-metadata">

**Author:** ![bruno.nunes](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@bruno.nunes](https://forum.inductiveautomation.com/u/bruno.nunes)\
**Post date:** [February 28, 2023, 3:38pm UTC](https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525/4 "2023-02-28T15:38:33Z")

</div>

Hello,

I have what seems to be a similar problems with modbus strings. We are in the proccess of updating all SCADA from old citect to Ignition, and we do have 4 modbus LED displays.

Those display are configured to scroll text when it's bigger then the window, but show it fixed whenever the text fits the window.

This is the behaviour that everyone expects. However when we write a small string to the display, it assumes blank spaces and the text ALWAYS scrolls.

Any tip to solve this problem, or are we doing something wrong?

Thank you.

---

<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:** [February 28, 2023, 3:48pm UTC](https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525/5 "2023-02-28T15:48:53Z")

</div>

Interesting. The IA native driver is space-padding instead of null-padding, and your device obviously expects null-padding strings.

My [alternate/expanded driver](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-advanced-modbus) uses null-padding. You could try it, or, perhaps, try to null-pad your strings yourself before writing.

---

<div class="post-metadata">

**Author:** ![bruno.nunes](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@bruno.nunes](https://forum.inductiveautomation.com/u/bruno.nunes)\
**Post date:** [February 28, 2023, 4:14pm UTC](https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525/6 "2023-02-28T16:14:23Z")

</div>

Once again, a perfect pointer in the right direction. Problem solved by null-padding the string.

Thank you.

---

<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:** [February 28, 2023, 4:27pm UTC](https://forum.inductiveautomation.com/t/added-white-space-in-send-receive-value-using-modbus-strings/16525/7 "2023-02-28T16:27:02Z")

</div>

> [@bruno.nunes](#):
>
> Problem solved by null-padding the string

Darn! You'll have to forgive me for hoping IA's driver choked on those.... 😇
