# Error writing to tag Bad\_Unsupported

**URL:** <https://forum.inductiveautomation.com/t/error-writing-to-tag-bad-unsupported/25263>\
**Category:** Ignition\
**Created:** [May 23, 2019, 3:34pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-bad-unsupported/25263 "2019-05-23T15:34:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwingert](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@kwingert](https://forum.inductiveautomation.com/u/kwingert)\
**Post date:** [May 23, 2019, 3:34pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-bad-unsupported/25263/1 "2019-05-23T15:34:01Z")

</div>

I’m writing a script to iterate through an array and write the tags to an array in a Rockwell PLC using the OPC server.

The tag values do write (most of the time, some don’t write the first pass but will the second) but for every write I get

“11:17:31.354 [Thread-16572] ERROR com.inductiveautomation.ignition.client.script.LegacyClientTagUtilities - Error writing to tag ‘[default]PEM Tags/PEM\_Data/PEM\_Data\_103\_/PEM\_Type.value’: Bad\_Unsupported”

Code:

```auto
import csv

with open('C:\\Users\image\Desktop\pems csv1.csv') as csvfile:
    readCSV = csv.reader(csvfile, delimiter=',')
    names = []
    x = []
    y = []
    z = []
    i = 0
    nameTag1 = "[default]PEM Tags/PEM_Data/PEM_Data_0_/PEM_Type.value"
    xTag1 = "[default]PEM Tags/PEM_Data/PEM_Data_0_/X_Location"
    yTag1 = "[default]PEM Tags/PEM_Data/PEM_Data_0_/Y_Location"
    zTag1 = "[default]PEM Tags/PEM_Data/PEM_Data_0_/Z_Location"
    for row in readCSV:
    	if i > 3:
        	if (i % 2) == 0:
        		name = row[0]
        		names.append(name)
        		#system.tag.write(nameTag1.replace("0", str(i - 4)),name)
        		#print(i)
        	if (i % 2) == 1:
        		x1 = row[2]
        		y1 = row[3]
        		z1 = row[4]
        		#system.tag.write(xTag1.replace("0", str(i - 4)),x1)
        		#system.tag.write(yTag1.replace("0", str(i - 4)),y1)
        		#system.tag.write(zTag1.replace("0", str(i - 4)),z1)
        		x.append(float(x1))
        		y.append(float(y1))
        		z.append(float(z1))
        i = i + 1
        #print(row)
    print(names)
    print(x)
    print(len(names))
    print(len(x))
    
    for j in range(len(names)):
    	system.tag.write(nameTag1.replace("0", str(j)),names[j])
    	system.tag.write(xTag1.replace("0", str(j)),x[j])
    	system.tag.write(yTag1.replace("0", str(j)),y[j])
    	system.tag.write(zTag1.replace("0", str(j)),z[j])

```

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [May 23, 2019, 3:45pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-bad-unsupported/25263/2 "2019-05-23T15:45:31Z")

</div>

Why do you have “.value” in the tag path?

---

<div class="post-metadata">

**Author:** ![kwingert](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@kwingert](https://forum.inductiveautomation.com/u/kwingert)\
**Post date:** [May 23, 2019, 4:25pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-bad-unsupported/25263/3 "2019-05-23T16:25:55Z")

</div>

I’ve used that before and it worked, is it not needed?

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [May 23, 2019, 6:41pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-bad-unsupported/25263/4 "2019-05-23T18:41:38Z")

</div>

If you read a tag using system.tag.read() you will receive a fully qualified tag object that has a property named value that can be referenced using “.value”.

When writing a value to a tag you must provide a path. The path will be a string and strings do not have a value property.

[Reading and Writing to Tags](https://docs.inductiveautomation.com/display/DOC79/Reading+and+Writing+to+Tags)
