# Bug Writing to Too Many Modbus TCP Tags At Once

**URL:** <https://forum.inductiveautomation.com/t/bug-writing-to-too-many-modbus-tcp-tags-at-once/55378>\
**Category:** Ignition\
**Created:** [January 25, 2022, 9:24pm UTC](https://forum.inductiveautomation.com/t/bug-writing-to-too-many-modbus-tcp-tags-at-once/55378 "2022-01-25T21:24:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [January 25, 2022, 9:24pm UTC](https://forum.inductiveautomation.com/t/bug-writing-to-too-many-modbus-tcp-tags-at-once/55378/1 "2022-01-25T21:24:40Z")

</div>

Hello,

I need to turn on/off all tags (boolean) within 2 folders (52 total).

If all tags are off and I try this, it turns on all 26 tags in the first folder:

```auto
paths = []
folder1tags = system.tag.browse(path = '[default]folder1')
for folder1tag in folder1tags.getResults():
	paths.append(str("[default]folder1/" + folder1tag['name']))
values = [1] * len(paths)
qualityCodes = system.tag.writeBlocking(paths, values, 5000)

```

If all tags are off and I try this, it turns on all 26 tags in the second folder:

```auto
paths = []
folder2tags = system.tag.browse(path = '[default]folder2')
for folder2tag in folder2tags.getResults():
	paths.append(str("[default]folder2/" + folder2tag['name']))
values = [1] * len(paths)
qualityCodes = system.tag.writeBlocking(paths, values, 5000)

```

But if all tags are off and I try this, it only turns on the first 19 tags in the first folder:

```auto
paths = []
folder1tags = system.tag.browse(path = '[default]folder1')
for folder1tag in folder1tags.getResults():
	paths.append(str("[default]folder1/" + folder1tag['name']))
folder2tags = system.tag.browse(path = '[default]folder2')
for folder2tag in folder2tags.getResults():
	paths.append(str("[default]folder2/" + folder2tag['name']))
values = [1] * len(paths)
qualityCodes = system.tag.writeBlocking(paths, values, 5000)

```

Any ideas? I’ve been scratching my head for a while on this and am thinking there is a bug when writing to too many tags in one call.

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [January 25, 2022, 9:43pm UTC](https://forum.inductiveautomation.com/t/bug-writing-to-too-many-modbus-tcp-tags-at-once/55378/2 "2022-01-25T21:43:20Z")

</div>

As a work around I’m calling writeBlocking per folder

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [January 25, 2022, 9:49pm UTC](https://forum.inductiveautomation.com/t/bug-writing-to-too-many-modbus-tcp-tags-at-once/55378/3 "2022-01-25T21:49:07Z")

</div>

Are you missing a forward slash?

> [@dion.botha](#):
>
> `[default]folder2`

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [January 25, 2022, 10:23pm UTC](https://forum.inductiveautomation.com/t/bug-writing-to-too-many-modbus-tcp-tags-at-once/55378/4 "2022-01-25T22:23:29Z")

</div>

Thanks, I simplified my code for the forum and this was a typo in my original post - fixed

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [January 25, 2022, 10:54pm UTC](https://forum.inductiveautomation.com/t/bug-writing-to-too-many-modbus-tcp-tags-at-once/55378/5 "2022-01-25T22:54:34Z")

</div>

Hmm, i just made a bunch of Modbus OPC tags and ran your code, it worked perfectly.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 25, 2022, 10:56pm UTC](https://forum.inductiveautomation.com/t/bug-writing-to-too-many-modbus-tcp-tags-at-once/55378/6 "2022-01-25T22:56:40Z")

</div>

How about:

1. print the results of the writeBlocking call
2. a Wireshark capture of the traffic between Ignition and your Modbus device when you do the writes
