Issue With writeBlocking Boolean Array

Ignition version 8.1.16

Problem
The tag doesn’t update…array elements remain False (watching them in the Designer tag browser)

Code
The code is in a button mouse onClick event.

logMsg = system.util.getLogger("SCADA")
esidTagPath   = "[default]DataMap/esid"
esidQualityArray = system.tag.readBlocking([esidTagPath + "/igPwrBlkArrayQuality"])[0]
index = 0
for index in range (0,12):
	esidQualityArray.value[index] = True
	index = index + 1
try:
	list = system.tag.writeBlocking([esidTagPath + "/igPwrBlkArrayQaulity"], esidQualityArray)
	logMsg.debug("SCADA:  The esid bool set True")
except:
	logMsg.debug("SCADA:  exception")

logMsg.debug("SCADA:  list isGood = " + str(list[0].isGood()))
logMsg.debug("SCADA:  list isError = " + str(list[0].isError()))
logMsg.debug("SCADA:  list getCode= " + str(list[0].getCode()))
logMsg.debug("SCADA:  list getDiagnosticMessage= " + list[0].getDiagnosticMessage())

Weirdness
isGood() returns False
isError() returns False
getDiagnosticMessage() throws an exception

Status Log

Most likely something wrong with what I’m doing but I can’t find it. I’m doing similar things with Float arrays with no issues. Any suggestions?

Thank you.

Typo in the tag path? (“Qaulity”)

ARRRGGGHHHHH!!! #(##111%%$
Dang it.

@Kevin.Herron Thank you! I must’ve read that code 50 times. Embarrassing. Can I delete this post? :slight_smile:

On an aside, this code:

index = 0
for index in range (0,12):
	esidQualityArray.value[index] = True
	index = index + 1

Is really ugly. I think a comprehension would do the same work and be cleaner, but if the for loop is really needed you shouldn’t have differently scoped variables named the same.

esidQualityArray.value = [True for index in range(12)]

or

for index in range(12):
    esidQualityArray.value[index] = True

Psssst!

esidQualityArray.value = [True] * 12
3 Likes

It’s obvious I’m new to Python, thanks for the tips.