Not able to execute script in Tag

I have the Tag script as below,

def valueChanged (tagPath, previousValue, currentValue, initialChange, missedEvents):

    if not "[.]IsSeries2000":
		if currentValue.value != previousValue.value:
			index = tagPath.find('RawRead')
			tagDir = tagPath[0:index]
			value = currentValue.value
			print "Yeah"
			processMessage(value, tagDir)

def processMessage(value, tagDir):
	import traceback
	TestType ="%s/TestType" % (tagDir)).value
	statusMessage = TestType + ': Not set'
	startRequired = 0

	if TestType == 'MDR':
		system.tag.write("[.]TestEnded", 1)
		statusMessage = 'End of MDR test processed.'
		indexRootDir = tagDir.find('Machine/')
		rootDir = tagDir[0:indexRootDir]

	for row in value:
		if row[0] == "ML":
			system.tag.write("%s/MLS1", row[1])
	return None

Where the value of the tag is,

Name Value
Test Time 3.0
Test Temp 145.0
Torque Range 8.0
I-Filter 6.0
ML 2.24
MH 5.8
TS2 dNm 0.63
T10 0.38
T50 0.59
T90 0.94
Max Rate 7.05
TS1 dNm 0.48
tanD@MH 0.308
tanD@ML 0.571
T25 0.46
T30 0.49
crazy result 10.27
T40 0.54
T60 0.66
TC90-TC10 0.57

Basically, I m trying to pull the particular value from this but it’s not doing anything.

What are you looking for that would tell you that the code isn’t doing anything? I assume you’re looking for a change in the MSL1 tag that you are writing to.

So long as there is no error in the script which you can find by looking in the tag diagnostics, my best guess is that currentValue.value is not returning what you think it is.

What is the type of this tag? I’m assuming that it is a string, but it could also be a dataset.

If it is a string data type then your for loop would be looping through each character in the string, as such your if statement will never be true and you will never write to the tag.

You may want to look into the split function, but I think we need a little more information to properly help with your issue.

It is a dataset and if i hit the tag outside the UDT, it will work. But the method described below is not working,

index = tagPath.find('RawRead')
			tagDir = tagPath[0:index]

even I have the tag name RawRead.

Worked. May be a syntax or Formatting Error.