Bug Writing to Too Many Modbus TCP Tags At Once

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:

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:

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:

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.

As a work around I’m calling writeBlocking per folder

Are you missing a forward slash?

1 Like

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

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

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