# Why is there a red squiggly under the d in def valueChanged on tag script?

**URL:** <https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570>\
**Category:** Ignition\
**Created:** [January 13, 2023, 2:11pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570 "2023-01-13T14:11:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 2:11pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/1 "2023-01-13T14:11:59Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7a0f2bc80faadc321a81a89dcdb42be8ea62d5e6.png)  
I have a feeling this is going to be a really simple fix, but I've been stumped for a few days now.

Please see the photo I have attached. Ignition is telling me I have an error with the def function. I'm not sure what this error means as it does not give me any insight when I hover over the red mark all the way to the right like normal. You also cannot edit a pre defined function like the one listed, so I'm not sure why there would be an error on something you cant edit and now it wont run the tag.

Is this an error with the script in the function? Any help with this would be greatly appreciated. Thank you!

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 13, 2023, 2:23pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/2 "2023-01-13T14:23:30Z")

</div>

Is there actual code in the function?

---

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/3 "2023-01-13T14:29:32Z")

</div>

Edited: to give a bit more detail.

Yes, there is. We have a tag like this for all lines in this project, so there are other lines that have this tag working (although the code is a bit different depending on the machines found on the line.)

The tag expression is equal to now() and the code pretty much looks at the lines Preventative Maintenance status and if the PM status in not selected and there is no "Green" value in the table (means check is completed) , it marks the value red meaning the check for that specific machine on this specific line was missed. A quick snap shot of the code can be found below:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/e/8e89bf884e6142dc8397e0ffc62c644942a4fc8a.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/5/1541e6c8cb642a7feb2aec668a1a64c00de0e832.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 13, 2023, 2:40pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/4 "2023-01-13T14:40:01Z")

</div>

My first guess is going to be an indentation error.

Screenshots are not too conducive to troubleshooting. Copy your code, including the def, if possible and post it here. Click the Preformatted Text button, then paste your code in. Then we can take a closer look for you. 🙂

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8c3cb9162acd44f45a61166c907071ca468f7c68.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4ecc8582d6e821d25c209260de59deafadfb620f.png)

---

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 2:57pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/5 "2023-01-13T14:57:30Z")

</div>

Ah I see. It is a very long script, over 1600\* lines, however its extremely redundant. I have to post it in three\* parts as I was well above the character limit when trying to post in one comment. However the code will be posted exactly as it is written.

Thank you in advance for all the help!

**Lines 1-642**

```auto
	#define the beginning of shift 1 and where 0(midnight) is 
	a = 6  
	b = a+1 
	c = b+1
	d = c+1
	e = d+1
	f = e+1
	g = f+1
	h = g+1 
	i = h+1
	j = i+1
	k = j+1
	l = k+1
	
	m = l+1
	n = m+1
	o = n+1
	p = o+1
	q = p+1
	r = q+1
	s = 0
	t = s+1
	u = t+1
	v = u+1
	w = v+1
	x = w+1 
	
#	min1 = 30
	
#	part = system.tag.read("[.]ShiftInfo").value.getValueAt(0,1)
	timeTag = currentValue.value
#	minuteTag = system.date.getMinute
	if system.tag.read("[.]PMStatus").value == 0:
		if system.date.getHour24(timeTag) == b:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,1) =="" and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,1, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,1) =="":
				newData1 = system.dataset.setValue(table, 0,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,1)== "":
				newData2 = system.dataset.setValue(table, 1,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,1) =="":
				newData3 = system.dataset.setValue(table, 2,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,1) =="":
				newData4 = system.dataset.setValue(table, 3,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,1) =="":
				newData4 = system.dataset.setValue(table, 4,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,1) =="":
				newData4 = system.dataset.setValue(table, 5,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,1) =="":
				newData4 = system.dataset.setValue(table, 6,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,1) =="":
				newData4 = system.dataset.setValue(table, 7,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,1) =="":
				newData4 = system.dataset.setValue(table, 8,1, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
# table3 = system.tag.read("[.]EveryTwiceAnHourShift1").value
# if minuteTag < 30:
# if table3.getValueAt(0,1) =="":
# newData1 = system.dataset.setValue(table, 0,1, "Red")
# system.tag.write("[.]EveryTwiceAnHourShift1",newData1)
# else:
# if table3.getValueAt(0,1) =="":
# newData1 = system.dataset.setValue(table, 0,1, "Red")
# system.tag.write("[.]EveryTwiceAnHourShift1",newData1)
				
		elif system.date.getHour24(timeTag) == c:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,2) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,2, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
# elif table.getValueAt(0,2) =="":
# newData1 = system.dataset.setValue(table, 0,2, "Blue")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,2)== "":
				newData1 = system.dataset.setValue(table, 0,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,2)== "":
				newData2 = system.dataset.setValue(table, 1,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,2) =="":
				newData3 = system.dataset.setValue(table, 2,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,2) =="":
				newData4 = system.dataset.setValue(table, 3,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,2) =="":
				newData4 = system.dataset.setValue(table, 4,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,2) =="":
				newData4 = system.dataset.setValue(table, 5,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,2) =="":
				newData4 = system.dataset.setValue(table, 6,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,2) =="":
				newData4 = system.dataset.setValue(table, 7,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,2) =="":
				newData4 = system.dataset.setValue(table, 8,2, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,1) =="":
				twoData1 = system.dataset.setValue(table2, 0,1, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,1) =="":
				twoData1 = system.dataset.setValue(table2, 1,1, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == d:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,3) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,3, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,3) =="":
				newData1 = system.dataset.setValue(table, 0,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,3)== "":
				newData2 = system.dataset.setValue(table, 1,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,3) =="":
				newData3 = system.dataset.setValue(table, 2,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,3) =="":
				newData4 = system.dataset.setValue(table, 3,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,3) =="":
				newData4 = system.dataset.setValue(table, 4,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,3) =="":
				newData4 = system.dataset.setValue(table, 5,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,3) =="":
				newData4 = system.dataset.setValue(table, 6,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,3) =="":
				newData4 = system.dataset.setValue(table, 7,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,3) =="":
				newData4 = system.dataset.setValue(table, 8,3, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == e:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,4) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,4, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,4) =="":
				newData1 = system.dataset.setValue(table, 0,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,4)== "":
				newData2 = system.dataset.setValue(table, 1,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,4) =="":
				newData3 = system.dataset.setValue(table, 2,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,4) =="":
				newData4 = system.dataset.setValue(table, 3,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,4) =="":
				newData4 = system.dataset.setValue(table, 4,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,4) =="":
				newData4 = system.dataset.setValue(table, 5,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,4) =="":
				newData4 = system.dataset.setValue(table, 6,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,4) =="":
				newData4 = system.dataset.setValue(table, 7,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,4) =="":
				newData4 = system.dataset.setValue(table, 8,4, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,2) =="":
				twoData1 = system.dataset.setValue(table2, 0,2, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,2) =="":
				twoData1 = system.dataset.setValue(table2, 1,2, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == f:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,5) =="" and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,5, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,5) =="":
				newData1 = system.dataset.setValue(table, 0,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,5)== "":
				newData2 = system.dataset.setValue(table, 1,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,5) =="":
				newData3 = system.dataset.setValue(table, 2,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,5) =="":
				newData4 = system.dataset.setValue(table, 3,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,5) =="":
				newData4 = system.dataset.setValue(table, 4,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,5) =="":
				newData4 = system.dataset.setValue(table, 5,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,5) =="":
				newData4 = system.dataset.setValue(table, 6,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,5) =="":
				newData4 = system.dataset.setValue(table, 7,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,5) =="":
				newData4 = system.dataset.setValue(table, 8,5, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			
		elif system.date.getHour24(timeTag) == g:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,6) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,6, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,6) =="":
				newData1 = system.dataset.setValue(table, 0,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,6)== "":
				newData2 = system.dataset.setValue(table, 1,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,6) =="":
				newData3 = system.dataset.setValue(table, 2,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,6) =="":
				newData4 = system.dataset.setValue(table, 3,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,6) =="":
				newData4 = system.dataset.setValue(table, 4,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,6) =="":
				newData4 = system.dataset.setValue(table, 5,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,6) =="":
				newData4 = system.dataset.setValue(table, 6,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,6) =="":
				newData4 = system.dataset.setValue(table, 7,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,6) =="":
				newData4 = system.dataset.setValue(table, 8,6, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,3) =="":
				twoData1 = system.dataset.setValue(table2, 0,3, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,3) =="":
				twoData1 = system.dataset.setValue(table2, 1,3, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == h:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,7) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,7, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,7) =="":
				newData1 = system.dataset.setValue(table, 0,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,7)== "":
				newData2 = system.dataset.setValue(table, 1,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,7) =="":
				newData3 = system.dataset.setValue(table, 2,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,7) =="":
				newData4 = system.dataset.setValue(table, 3,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,7) =="":
				newData4 = system.dataset.setValue(table, 4,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,7) =="":
				newData4 = system.dataset.setValue(table, 5,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,7) =="":
				newData4 = system.dataset.setValue(table, 6,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,7) =="":
				newData4 = system.dataset.setValue(table, 7,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,7) =="":
				newData4 = system.dataset.setValue(table, 8,7, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == i:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,8) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,8, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,8) =="":
				newData1 = system.dataset.setValue(table, 0,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,8)== "":
				newData2 = system.dataset.setValue(table, 1,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,8) =="":
				newData3 = system.dataset.setValue(table, 2,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,8) =="":
				newData4 = system.dataset.setValue(table, 3,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,8) =="":
				newData4 = system.dataset.setValue(table, 4,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,8) =="":
				newData4 = system.dataset.setValue(table, 5,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,8) =="":
				newData4 = system.dataset.setValue(table, 6,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,8) =="":
				newData4 = system.dataset.setValue(table, 7,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,8) =="":
				newData4 = system.dataset.setValue(table, 8,8, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,4) =="":
				twoData1 = system.dataset.setValue(table2, 0,4, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,4) =="":
				twoData1 = system.dataset.setValue(table2, 1,4, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == j:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,9) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,9, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,9) =="":
				newData1 = system.dataset.setValue(table, 0,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,9)== "":
				newData2 = system.dataset.setValue(table, 1,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,9) =="":
				newData3 = system.dataset.setValue(table, 2,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,9) =="":
				newData4 = system.dataset.setValue(table, 3,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,9) =="":
				newData4 = system.dataset.setValue(table, 4,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,9) =="":
				newData4 = system.dataset.setValue(table, 5,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,9) =="":
				newData4 = system.dataset.setValue(table, 6,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,9) =="":
				newData4 = system.dataset.setValue(table, 7,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,9) =="":
				newData4 = system.dataset.setValue(table, 8,9, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == k:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,10) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,10, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,10) =="":
				newData1 = system.dataset.setValue(table, 0,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,10)== "":
				newData2 = system.dataset.setValue(table, 1,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,10) =="":
				newData3 = system.dataset.setValue(table, 2,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,10) =="":
				newData4 = system.dataset.setValue(table, 3,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,10) =="":
				newData4 = system.dataset.setValue(table, 4,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,10) =="":
				newData4 = system.dataset.setValue(table, 5,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,10) =="":
				newData4 = system.dataset.setValue(table, 6,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,10) =="":
				newData4 = system.dataset.setValue(table, 7,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,10) =="":
				newData4 = system.dataset.setValue(table, 8,10, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,5) =="":
				twoData1 = system.dataset.setValue(table2, 0,5, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,5) =="":
				twoData1 = system.dataset.setValue(table2, 1,5, "Red")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == l:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,11) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,11, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,11) =="":
				newData1 = system.dataset.setValue(table, 0,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,11)== "":
				newData2 = system.dataset.setValue(table, 1,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,11) =="":
				newData3 = system.dataset.setValue(table, 2,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,11) =="":
				newData4 = system.dataset.setValue(table, 3,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,11) =="":
				newData4 = system.dataset.setValue(table, 4,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,11) =="":
				newData4 = system.dataset.setValue(table, 5,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,11) =="":
				newData4 = system.dataset.setValue(table, 6,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,11) =="":
				newData4 = system.dataset.setValue(table, 7,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,11) =="":
				newData4 = system.dataset.setValue(table, 8,11, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == m:
			table = system.tag.read("[.]EveryHourShift1").value
# if table.getValueAt(0,12) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,12, "Red")
# system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(0,12) =="":
				newData1 = system.dataset.setValue(table, 0,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,12)== "":
				newData2 = system.dataset.setValue(table, 1,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,12) =="":
				newData3 = system.dataset.setValue(table, 2,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,12) =="":
				newData4 = system.dataset.setValue(table, 3,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,12) =="":
				newData4 = system.dataset.setValue(table, 4,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,12) =="":
				newData4 = system.dataset.setValue(table, 5,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,12) =="":
				newData4 = system.dataset.setValue(table, 6,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,12) =="":
				newData4 = system.dataset.setValue(table, 7,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,12) =="":
				newData4 = system.dataset.setValue(table, 8,12, "Red")
				system.tag.write("[.]EveryHourShift1",newData4)

		elif system.date.getHour24(timeTag) ==n:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,1) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,1, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,1)== "":
				newData1 = system.dataset.setValue(table, 0,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,1)== "":
				newData2 = system.dataset.setValue(table, 1,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,1) =="":
				newData3 = system.dataset.setValue(table, 2,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,1) =="":
				newData4 = system.dataset.setValue(table, 3,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,1) =="":
				newData4 = system.dataset.setValue(table, 4,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,1) =="":
				newData4 = system.dataset.setValue(table, 5,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,1) =="":
				newData4 = system.dataset.setValue(table, 6,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,1) =="":
				newData4 = system.dataset.setValue(table, 7,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,1) =="":
				newData4 = system.dataset.setValue(table, 8,1, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == o:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,2) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,2, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,2)== "":
				newData1 = system.dataset.setValue(table, 0,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,2)== "":
				newData2 = system.dataset.setValue(table, 1,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,2) =="":
				newData3 = system.dataset.setValue(table, 2,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,2) =="":
				newData4 = system.dataset.setValue(table, 3,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,2) =="":
				newData4 = system.dataset.setValue(table, 4,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,2) =="":
				newData4 = system.dataset.setValue(table, 5,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,2) =="":
				newData4 = system.dataset.setValue(table, 6,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,2) =="":
				newData4 = system.dataset.setValue(table, 7,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,2) =="":
				newData4 = system.dataset.setValue(table, 8,2, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,1) =="":
				twoData1 = system.dataset.setValue(table2, 0,1, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,1) =="":
				twoData1 = system.dataset.setValue(table2, 1,1, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == p:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,3) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,3, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,3)== "":
				newData1 = system.dataset.setValue(table, 0,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,3)== "":
				newData2 = system.dataset.setValue(table, 1,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,3) =="":
				newData3 = system.dataset.setValue(table, 2,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,3) =="":
				newData4 = system.dataset.setValue(table, 3,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,3) =="":
				newData4 = system.dataset.setValue(table, 4,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,3) =="":
				newData4 = system.dataset.setValue(table, 5,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,3) =="":
				newData4 = system.dataset.setValue(table, 6,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,3) =="":
				newData4 = system.dataset.setValue(table, 7,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,3) =="":
				newData4 = system.dataset.setValue(table, 8,3, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == q:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,4) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,4, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,4)== "":
				newData1 = system.dataset.setValue(table, 0,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,4)== "":
				newData2 = system.dataset.setValue(table, 1,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,4) =="":
				newData3 = system.dataset.setValue(table, 2,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,4) =="":
				newData4 = system.dataset.setValue(table, 3,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,4) =="":
				newData4 = system.dataset.setValue(table, 4,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,4) =="":
				newData4 = system.dataset.setValue(table, 5,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,4) =="":
				newData4 = system.dataset.setValue(table, 6,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,4) =="":
				newData4 = system.dataset.setValue(table, 7,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,4) =="":
				newData4 = system.dataset.setValue(table, 8,4, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,2) =="":
				twoData1 = system.dataset.setValue(table2, 0,2, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,2) =="":
				twoData1 = system.dataset.setValue(table2, 1,2, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == r:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,5) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,5, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,5)== "":
				newData1 = system.dataset.setValue(table, 0,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,5)== "":
				newData2 = system.dataset.setValue(table, 1,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,5) =="":
				newData3 = system.dataset.setValue(table, 2,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,5) =="":
				newData4 = system.dataset.setValue(table, 3,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,5) =="":
				newData4 = system.dataset.setValue(table, 4,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,5) =="":
				newData4 = system.dataset.setValue(table, 5,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,5) =="":
				newData4 = system.dataset.setValue(table, 6,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,5) =="":
				newData4 = system.dataset.setValue(table, 7,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,5) =="":
				newData4 = system.dataset.setValue(table, 8,5, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)

```

---

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 2:59pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/6 "2023-01-13T14:59:07Z")

</div>

**Line 643 to 1243**

```auto
		elif system.date.getHour24(timeTag) == s:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,6) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,6, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,6)== "":
				newData1 = system.dataset.setValue(table, 0,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,6)== "":
				newData2 = system.dataset.setValue(table, 1,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,6) =="":
				newData3 = system.dataset.setValue(table, 2,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,6) =="":
				newData4 = system.dataset.setValue(table, 3,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,6) =="":
				newData4 = system.dataset.setValue(table,4,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,6) =="":
				newData4 = system.dataset.setValue(table,5,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,6) =="":
				newData4 = system.dataset.setValue(table, 6,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,6) =="":
				newData4 = system.dataset.setValue(table, 7,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,6) =="":
				newData4 = system.dataset.setValue(table, 8,6, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,3) =="":
				twoData1 = system.dataset.setValue(table2, 0,3, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,3) =="":
				twoData1 = system.dataset.setValue(table2, 1,3, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == t:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,7) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,7, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,7)== "":
				newData1 = system.dataset.setValue(table, 0,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,7)== "":
				newData2 = system.dataset.setValue(table, 1,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,7) =="":
				newData3 = system.dataset.setValue(table, 2,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,7) =="":
				newData4 = system.dataset.setValue(table, 3,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,7) =="":
				newData4 = system.dataset.setValue(table, 4,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,7) =="":
				newData4 = system.dataset.setValue(table, 5,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,7) =="":
				newData4 = system.dataset.setValue(table, 6,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,7) =="":
				newData4 = system.dataset.setValue(table, 7,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,7) =="":
				newData4 = system.dataset.setValue(table, 8,7, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == u:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,8) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,8, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,8)== "":
				newData1 = system.dataset.setValue(table, 0,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,8)== "":
				newData2 = system.dataset.setValue(table, 1,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,8) =="":
				newData3 = system.dataset.setValue(table, 2,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,8) =="":
				newData4 = system.dataset.setValue(table, 3,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,8) =="":
				newData4 = system.dataset.setValue(table, 4,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,8) =="":
				newData4 = system.dataset.setValue(table, 5,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,8) =="":
				newData4 = system.dataset.setValue(table, 6,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,8) =="":
				newData4 = system.dataset.setValue(table, 7,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,8) =="":
				newData4 = system.dataset.setValue(table, 8,8, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,4) =="":
				twoData1 = system.dataset.setValue(table2, 0,4, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,4) =="":
				twoData1 = system.dataset.setValue(table2, 1,4, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == v:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,9) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,9, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,9)== "":
				newData1 = system.dataset.setValue(table, 0,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,9)== "":
				newData2 = system.dataset.setValue(table, 1,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,9) =="":
				newData3 = system.dataset.setValue(table, 2,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,9) =="":
				newData4 = system.dataset.setValue(table, 3,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,9) =="":
				newData4 = system.dataset.setValue(table, 4,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,9) =="":
				newData4 = system.dataset.setValue(table, 5,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,9) =="":
				newData4 = system.dataset.setValue(table, 6,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,9) =="":
				newData4 = system.dataset.setValue(table, 7,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,9) =="":
				newData4 = system.dataset.setValue(table, 8,9, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == w:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,10) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,10, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,10)== "":
				newData1 = system.dataset.setValue(table, 0,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,10)== "":
				newData2 = system.dataset.setValue(table, 1,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,10) =="":
				newData3 = system.dataset.setValue(table, 2,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,10) =="":
				newData4 = system.dataset.setValue(table, 3,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,10) =="":
				newData4 = system.dataset.setValue(table, 4,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,10) =="":
				newData4 = system.dataset.setValue(table, 5,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,10) =="":
				newData4 = system.dataset.setValue(table, 6,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,10) =="":
				newData4 = system.dataset.setValue(table, 7,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,10) =="":
				newData4 = system.dataset.setValue(table, 8,10, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,5) =="":
				twoData1 = system.dataset.setValue(table2, 0,5, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,5) =="":
				twoData1 = system.dataset.setValue(table2, 1,5, "Red")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == x:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,11) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,11, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,11)== "":
				newData1 = system.dataset.setValue(table, 0,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,11)== "":
				newData2 = system.dataset.setValue(table, 1,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,11) =="":
				newData3 = system.dataset.setValue(table, 2,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,11) =="":
				newData4 = system.dataset.setValue(table, 3,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,11) =="":
				newData4 = system.dataset.setValue(table, 4,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,11) =="":
				newData4 = system.dataset.setValue(table, 5,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,11) =="":
				newData4 = system.dataset.setValue(table, 6,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,11) =="":
				newData4 = system.dataset.setValue(table, 7,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,11) =="":
				newData4 = system.dataset.setValue(table, 8,11, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == a:
			table = system.tag.read("[.]EveryHourShift2").value
# if table.getValueAt(0,12) ==""and part =="16.9oz, 20.8g, Propel ":
# newData1 = system.dataset.setValue(table, 0,12, "Red")
# system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(0,12)== "":
				newData1 = system.dataset.setValue(table, 0,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,12)== "":
				newData2 = system.dataset.setValue(table, 1,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,12) =="":
				newData3 = system.dataset.setValue(table, 2,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,12) =="":
				newData4 = system.dataset.setValue(table, 3,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,12) =="":
				newData4 = system.dataset.setValue(table, 4,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,12) =="":
				newData4 = system.dataset.setValue(table, 5,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,12) =="":
				newData4 = system.dataset.setValue(table, 6,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,12) =="":
				newData4 = system.dataset.setValue(table, 7,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,12) =="":
				newData4 = system.dataset.setValue(table, 8,12, "Red")
				system.tag.write("[.]EveryHourShift2",newData4)
	else:
		if system.date.getHour24(timeTag) == b:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,1) =="":
				newData1 = system.dataset.setValue(table, 0,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,1)== "":
				newData2 = system.dataset.setValue(table, 1,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,1) =="":
				newData3 = system.dataset.setValue(table, 2,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,1) =="":
				newData4 = system.dataset.setValue(table, 3,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,1) =="":
				newData4 = system.dataset.setValue(table, 4,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,1) =="":
				newData4 = system.dataset.setValue(table, 5,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,1) =="":
				newData4 = system.dataset.setValue(table, 6,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,1) =="":
				newData4 = system.dataset.setValue(table, 7,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,1) =="":
				newData4 = system.dataset.setValue(table, 8,1, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == c:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,2) =="":
				newData1 = system.dataset.setValue(table, 0,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,2)== "":
				newData2 = system.dataset.setValue(table, 1,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,2) =="":
				newData3 = system.dataset.setValue(table, 2,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,2) =="":
				newData4 = system.dataset.setValue(table, 3,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,2) =="":
				newData4 = system.dataset.setValue(table, 4,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,2) =="":
				newData4 = system.dataset.setValue(table, 5,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,2) =="":
				newData4 = system.dataset.setValue(table, 6,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,2) =="":
				newData4 = system.dataset.setValue(table, 7,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,2) =="":
				newData4 = system.dataset.setValue(table, 8,2, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,1) =="":
				twoData1 = system.dataset.setValue(table2, 0,1, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,1) =="":
				twoData1 = system.dataset.setValue(table2, 1,1, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == d:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,3) =="":
				newData1 = system.dataset.setValue(table, 0,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,3)== "":
				newData2 = system.dataset.setValue(table, 1,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,3) =="":
				newData3 = system.dataset.setValue(table, 2,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,3) =="":
				newData4 = system.dataset.setValue(table, 3,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,3) =="":
				newData4 = system.dataset.setValue(table, 4,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,3) =="":
				newData4 = system.dataset.setValue(table, 5,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,3) =="":
				newData4 = system.dataset.setValue(table, 6,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,3) =="":
				newData4 = system.dataset.setValue(table, 7,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,3) =="":
				newData4 = system.dataset.setValue(table, 8,3, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == e:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,4) =="":
				newData1 = system.dataset.setValue(table, 0,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,4)== "":
				newData2 = system.dataset.setValue(table, 1,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,4) =="":
				newData3 = system.dataset.setValue(table, 2,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,4) =="":
				newData4 = system.dataset.setValue(table, 3,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,4) =="":
				newData4 = system.dataset.setValue(table, 4,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,4) =="":
				newData4 = system.dataset.setValue(table, 5,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,4) =="":
				newData4 = system.dataset.setValue(table, 6,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,4) =="":
				newData4 = system.dataset.setValue(table, 7,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,4) =="":
				newData4 = system.dataset.setValue(table, 8,4, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,2) =="":
				twoData1 = system.dataset.setValue(table2, 0,2, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,2) =="":
				twoData1 = system.dataset.setValue(table2, 1,2, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == f:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,5) =="":
				newData1 = system.dataset.setValue(table, 0,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,5)== "":
				newData2 = system.dataset.setValue(table, 1,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,5) =="":
				newData3 = system.dataset.setValue(table, 2,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,5) =="":
				newData4 = system.dataset.setValue(table, 3,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,5) =="":
				newData4 = system.dataset.setValue(table, 4,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,5) =="":
				newData4 = system.dataset.setValue(table, 5,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,5) =="":
				newData4 = system.dataset.setValue(table, 6,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,5) =="":
				newData4 = system.dataset.setValue(table, 7,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,5) =="":
				newData4 = system.dataset.setValue(table, 8,5, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == g:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,6) =="":
				newData1 = system.dataset.setValue(table, 0,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,6)== "":
				newData2 = system.dataset.setValue(table, 1,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,6) =="":
				newData3 = system.dataset.setValue(table, 2,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,6) =="":
				newData4 = system.dataset.setValue(table, 3,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,6) =="":
				newData4 = system.dataset.setValue(table, 4,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,6) =="":
				newData4 = system.dataset.setValue(table, 5,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,6) =="":
				newData4 = system.dataset.setValue(table, 6,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,6) =="":
				newData4 = system.dataset.setValue(table, 7,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,6) =="":
				newData4 = system.dataset.setValue(table, 8,6, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,3) =="":
				twoData1 = system.dataset.setValue(table2, 0,3, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,3) =="":
				twoData1 = system.dataset.setValue(table2, 1,3, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == h:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,7) =="":
				newData1 = system.dataset.setValue(table, 0,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,7)== "":
				newData2 = system.dataset.setValue(table, 1,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,7) =="":
				newData3 = system.dataset.setValue(table, 2,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,7) =="":
				newData4 = system.dataset.setValue(table, 3,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,7) =="":
				newData4 = system.dataset.setValue(table, 4,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,7) =="":
				newData4 = system.dataset.setValue(table, 5,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,7) =="":
				newData4 = system.dataset.setValue(table, 6,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,7) =="":
				newData4 = system.dataset.setValue(table, 7,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,7) =="":
				newData4 = system.dataset.setValue(table, 8,7, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == i:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,8) =="":
				newData1 = system.dataset.setValue(table, 0,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,8)== "":
				newData2 = system.dataset.setValue(table, 1,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,8) =="":
				newData3 = system.dataset.setValue(table, 2,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,8) =="":
				newData4 = system.dataset.setValue(table, 3,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,8) =="":
				newData4 = system.dataset.setValue(table, 4,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,8) =="":
				newData4 = system.dataset.setValue(table, 5,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,8) =="":
				newData4 = system.dataset.setValue(table, 6,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,8) =="":
				newData4 = system.dataset.setValue(table, 7,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,8) =="":
				newData4 = system.dataset.setValue(table, 8,8, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,4) =="":
				twoData1 = system.dataset.setValue(table2, 0,4, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,4) =="":
				twoData1 = system.dataset.setValue(table2, 1,4, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == j:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,9) =="":
				newData1 = system.dataset.setValue(table, 0,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,9)== "":
				newData2 = system.dataset.setValue(table, 1,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,9) =="":
				newData3 = system.dataset.setValue(table, 2,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,9) =="":
				newData4 = system.dataset.setValue(table, 3,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,9) =="":
				newData4 = system.dataset.setValue(table, 4,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,9) =="":
				newData4 = system.dataset.setValue(table, 5,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,9) =="":
				newData4 = system.dataset.setValue(table, 6,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,9) =="":
				newData4 = system.dataset.setValue(table, 7,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,9) =="":
				newData4 = system.dataset.setValue(table, 8,9, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
		elif system.date.getHour24(timeTag) == k:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,10) =="":
				newData1 = system.dataset.setValue(table, 0,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,10)== "":
				newData2 = system.dataset.setValue(table, 1,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,10) =="":
				newData3 = system.dataset.setValue(table, 2,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,10) =="":
				newData4 = system.dataset.setValue(table, 3,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,10) =="":
				newData4 = system.dataset.setValue(table, 4,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,10) =="":
				newData4 = system.dataset.setValue(table, 5,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,10) =="":
				newData4 = system.dataset.setValue(table, 6,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,10) =="":
				newData4 = system.dataset.setValue(table, 7,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,10) =="":
				newData4 = system.dataset.setValue(table, 8,10, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			table2 = system.tag.read("[.]Every2HourShift1").value
			if table2.getValueAt(0,5) =="":
				twoData1 = system.dataset.setValue(table2, 0,5, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
			if table2.getValueAt(1,5) =="":
				twoData1 = system.dataset.setValue(table2, 1,5, "Blue")
				system.tag.write("[.]Every2HourShift1",twoData1)
		elif system.date.getHour24(timeTag) == l:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,11) =="":
				newData1 = system.dataset.setValue(table, 0,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,11)== "":
				newData2 = system.dataset.setValue(table, 1,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,11) =="":
				newData3 = system.dataset.setValue(table, 2,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,11) =="":
				newData4 = system.dataset.setValue(table, 3,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,11) =="":
				newData4 = system.dataset.setValue(table, 4,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,11) =="":
				newData4 = system.dataset.setValue(table, 5,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,11) =="":
				newData4 = system.dataset.setValue(table, 6,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,11) =="":
				newData4 = system.dataset.setValue(table, 7,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,11) =="":
				newData4 = system.dataset.setValue(table, 8,11, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)

```

---

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 2:59pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/7 "2023-01-13T14:59:47Z")

</div>

**Lines 1244-1663**

```auto
		elif system.date.getHour24(timeTag) == m:
			table = system.tag.read("[.]EveryHourShift1").value
			if table.getValueAt(0,12) =="":
				newData1 = system.dataset.setValue(table, 0,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData1)
			if table.getValueAt(1,12)== "":
				newData2 = system.dataset.setValue(table, 1,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData2)
			if table.getValueAt(2,12) =="":
				newData3 = system.dataset.setValue(table, 2,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData3)
			if table.getValueAt(3,12) =="":
				newData4 = system.dataset.setValue(table, 3,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(4,12) =="":
				newData4 = system.dataset.setValue(table, 4,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(5,12) =="":
				newData4 = system.dataset.setValue(table, 5,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(6,12) =="":
				newData4 = system.dataset.setValue(table, 6,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(7,12) =="":
				newData4 = system.dataset.setValue(table, 7,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
			if table.getValueAt(8,12) =="":
				newData4 = system.dataset.setValue(table, 8,12, "Blue")
				system.tag.write("[.]EveryHourShift1",newData4)
# table2 = system.tag.read("[.]Every2HourShift1").value
# if table2.getValueAt(0,6) =="":
# twoData1 = system.dataset.setValue(table2, 0,6, "Blue")
# system.tag.write("[.]Every2HourShift1",twoData1)
# if table2.getValueAt(1,6) =="":
# twoData1 = system.dataset.setValue(table2, 1,6, "Blue")
# system.tag.write("[.]Every2HourShift1",twoData1)

		elif system.date.getHour24(timeTag) ==n:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,1) =="":
				newData1 = system.dataset.setValue(table, 0,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,1)== "":
				newData2 = system.dataset.setValue(table, 1,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,1) =="":
				newData3 = system.dataset.setValue(table, 2,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,1) =="":
				newData4 = system.dataset.setValue(table, 3,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,1) =="":
				newData4 = system.dataset.setValue(table, 4,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,1) =="":
				newData4 = system.dataset.setValue(table, 5,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,1) =="":
				newData4 = system.dataset.setValue(table, 6,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,1) =="":
				newData4 = system.dataset.setValue(table, 7,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,1) =="":
				newData4 = system.dataset.setValue(table, 8,1, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == o:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,2) =="":
				newData1 = system.dataset.setValue(table, 0,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,2)== "":
				newData2 = system.dataset.setValue(table, 1,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,2) =="":
				newData3 = system.dataset.setValue(table, 2,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,2) =="":
				newData4 = system.dataset.setValue(table, 3,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,2) =="":
				newData4 = system.dataset.setValue(table, 4,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,2) =="":
				newData4 = system.dataset.setValue(table, 5,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,2) =="":
				newData4 = system.dataset.setValue(table, 6,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,2) =="":
				newData4 = system.dataset.setValue(table, 7,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,2) =="":
				newData4 = system.dataset.setValue(table, 8,2, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,1) =="":
				twoData1 = system.dataset.setValue(table2, 0,1, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,1) =="":
				twoData1 = system.dataset.setValue(table2, 1,1, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == p:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,3) =="":
				newData1 = system.dataset.setValue(table, 0,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,3)== "":
				newData2 = system.dataset.setValue(table, 1,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,3) =="":
				newData3 = system.dataset.setValue(table, 2,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,3) =="":
				newData4 = system.dataset.setValue(table, 3,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,3) =="":
				newData4 = system.dataset.setValue(table, 4,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,3) =="":
				newData4 = system.dataset.setValue(table, 5,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,3) =="":
				newData4 = system.dataset.setValue(table, 6,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,3) =="":
				newData4 = system.dataset.setValue(table, 7,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,3) =="":
				newData4 = system.dataset.setValue(table, 8,3, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == q:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,4) =="":
				newData1 = system.dataset.setValue(table, 0,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,4)== "":
				newData2 = system.dataset.setValue(table, 1,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,4) =="":
				newData3 = system.dataset.setValue(table, 2,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,4) =="":
				newData4 = system.dataset.setValue(table, 3,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,4) =="":
				newData4 = system.dataset.setValue(table, 4,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,4) =="":
				newData4 = system.dataset.setValue(table, 5,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,4) =="":
				newData4 = system.dataset.setValue(table, 6,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,4) =="":
				newData4 = system.dataset.setValue(table, 7,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,4) =="":
				newData4 = system.dataset.setValue(table, 8,4, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,2) =="":
				twoData1 = system.dataset.setValue(table2, 0,2, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,2) =="":
				twoData1 = system.dataset.setValue(table2, 1,2, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == r:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,5) =="":
				newData1 = system.dataset.setValue(table, 0,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,5)== "":
				newData2 = system.dataset.setValue(table, 1,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,5) =="":
				newData3 = system.dataset.setValue(table, 2,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,5) =="":
				newData4 = system.dataset.setValue(table, 3,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,5) =="":
				newData4 = system.dataset.setValue(table, 4,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,5) =="":
				newData4 = system.dataset.setValue(table, 5,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,5) =="":
				newData4 = system.dataset.setValue(table, 6,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,5) =="":
				newData4 = system.dataset.setValue(table, 7,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,5) =="":
				newData4 = system.dataset.setValue(table, 8,5, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == s:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,6) =="":
				newData1 = system.dataset.setValue(table, 0,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,6)== "":
				newData2 = system.dataset.setValue(table, 1,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,6) =="":
				newData3 = system.dataset.setValue(table, 2,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,6) =="":
				newData4 = system.dataset.setValue(table, 3,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,6) =="":
				newData4 = system.dataset.setValue(table,4,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,6) =="":
				newData4 = system.dataset.setValue(table, 5,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,6) =="":
				newData4 = system.dataset.setValue(table, 6,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,6) =="":
				newData4 = system.dataset.setValue(table, 7,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,6) =="":
				newData4 = system.dataset.setValue(table, 8,6, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,3) =="":
				twoData1 = system.dataset.setValue(table2, 0,3, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,3) =="":
				twoData1 = system.dataset.setValue(table2, 1,3, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == t:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,7) =="":
				newData1 = system.dataset.setValue(table, 0,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,7)== "":
				newData2 = system.dataset.setValue(table, 1,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,7) =="":
				newData3 = system.dataset.setValue(table, 2,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,7) =="":
				newData4 = system.dataset.setValue(table, 3,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,7) =="":
				newData4 = system.dataset.setValue(table, 4,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,7) =="":
				newData4 = system.dataset.setValue(table, 5,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,7) =="":
				newData4 = system.dataset.setValue(table, 6,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,7) =="":
				newData4 = system.dataset.setValue(table, 7,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,7) =="":
				newData4 = system.dataset.setValue(table, 8,7, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == u:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,8) =="":
				newData1 = system.dataset.setValue(table, 0,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,8)== "":
				newData2 = system.dataset.setValue(table, 1,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,8) =="":
				newData3 = system.dataset.setValue(table, 2,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,8) =="":
				newData4 = system.dataset.setValue(table, 3,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,8) =="":
				newData4 = system.dataset.setValue(table, 4,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,8) =="":
				newData4 = system.dataset.setValue(table, 5,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,8) =="":
				newData4 = system.dataset.setValue(table, 6,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,8) =="":
				newData4 = system.dataset.setValue(table, 7,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,8) =="":
				newData4 = system.dataset.setValue(table, 8,8, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,4) =="":
				twoData1 = system.dataset.setValue(table2, 0,4, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,4) =="":
				twoData1 = system.dataset.setValue(table2, 1,4, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == v:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,9) =="":
				newData1 = system.dataset.setValue(table, 0,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,9)== "":
				newData2 = system.dataset.setValue(table, 1,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,9) =="":
				newData3 = system.dataset.setValue(table, 2,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,9) =="":
				newData4 = system.dataset.setValue(table, 3,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,9) =="":
				newData4 = system.dataset.setValue(table, 4,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,9) =="":
				newData4 = system.dataset.setValue(table, 5,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,9) =="":
				newData4 = system.dataset.setValue(table, 6,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,9) =="":
				newData4 = system.dataset.setValue(table, 7,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,9) =="":
				newData4 = system.dataset.setValue(table, 8,9, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == w:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,10) =="":
				newData1 = system.dataset.setValue(table, 0,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,10)== "":
				newData2 = system.dataset.setValue(table, 1,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,10) =="":
				newData3 = system.dataset.setValue(table, 2,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,10) =="":
				newData4 = system.dataset.setValue(table, 3,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,10) =="":
				newData4 = system.dataset.setValue(table, 4,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,10) =="":
				newData4 = system.dataset.setValue(table, 5,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,10) =="":
				newData4 = system.dataset.setValue(table, 6,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,10) =="":
				newData4 = system.dataset.setValue(table, 7,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,10) =="":
				newData4 = system.dataset.setValue(table, 8,10, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			table2 = system.tag.read("[.]Every2HourShift2").value
			if table2.getValueAt(0,5) =="":
				twoData1 = system.dataset.setValue(table2, 0,5, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
			if table2.getValueAt(1,5) =="":
				twoData1 = system.dataset.setValue(table2, 1,5, "Blue")
				system.tag.write("[.]Every2HourShift2",twoData1)
		elif system.date.getHour24(timeTag) == x:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,11) =="":
				newData1 = system.dataset.setValue(table, 0,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,11)== "":
				newData2 = system.dataset.setValue(table, 1,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,11) =="":
				newData3 = system.dataset.setValue(table, 2,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,11) =="":
				newData4 = system.dataset.setValue(table, 3,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,11) =="":
				newData4 = system.dataset.setValue(table, 4,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,11) =="":
				newData4 = system.dataset.setValue(table, 5,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,11) =="":
				newData4 = system.dataset.setValue(table, 6,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,11) =="":
				newData4 = system.dataset.setValue(table, 7,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,11) =="":
				newData4 = system.dataset.setValue(table, 8,11, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
		elif system.date.getHour24(timeTag) == a:
			table = system.tag.read("[.]EveryHourShift2").value
			if table.getValueAt(0,12) =="":
				newData1 = system.dataset.setValue(table, 0,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData1)
			if table.getValueAt(1,12)== "":
				newData2 = system.dataset.setValue(table, 1,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData2)
			if table.getValueAt(2,12) =="":
				newData3 = system.dataset.setValue(table, 2,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData3)
			if table.getValueAt(3,12) =="":
				newData4 = system.dataset.setValue(table, 3,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(4,12) =="":
				newData4 = system.dataset.setValue(table, 4,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(5,12) =="":
				newData4 = system.dataset.setValue(table, 5,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(6,12) =="":
				newData4 = system.dataset.setValue(table, 6,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(7,12) =="":
				newData4 = system.dataset.setValue(table, 7,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)
			if table.getValueAt(8,12) =="":
				newData4 = system.dataset.setValue(table, 8,12, "Blue")
				system.tag.write("[.]EveryHourShift2",newData4)

```

---

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 3:28pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/8 "2023-01-13T15:28:04Z")

</div>

JordanCClark I am just going to duplicate a Time tag from the other lines and go back through and remake the edits. It is a very long code and if it is something as silly as an indentation error then I dont want anyone parsing through my own error ridden code.

Plus, I _should_ be able to catch it/not make the error again (hopefully) the second time around. Thank you for all your help!

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 13, 2023, 3:40pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/9 "2023-01-13T15:40:40Z")

</div>

Interesting. I copied and pasted your code into a function, and I didn't get the squiggly line.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/a/9aa5ba32ed9967413b14c44c08652f9c6bb6b13d.png)  
If you figure it out, please post the solution.

---

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 3:51pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/10 "2023-01-13T15:51:08Z")

</div>

Well that's interesting.

Even more interesting: It seems like the error comes at this point below. See how I have commented out the line and there is **no** error line in the top right-hand corner of the script, right below 'Enabled' (screenshot 1). But as soon as I uncomment the highlighted code, the red error line appears in the top right-hand corner (screenshot 2). I'm not sure what to make of it.

**Screenshot 1**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/7/0736e7bbdcc5aa382a9d3e95237c087560dceac6.png)

**Screenshot 2**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/e/9e5ae5c8ab36d6f409b0bf18648dba8c9e85e4d7.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 13, 2023, 4:11pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/11 "2023-01-13T16:11:11Z")

</div>

Interesting. I have that code in my copy, but it occurs at rows 798, so I must me missing almost two hundred lines somehow. I don't have the answer, but I do have a recommendation that could possibly help. It looks like hundreds of lines could be eliminated from this code with for loops to loop through the rows and columns of the dataset.  
Something like this:

```auto
for row in range(table.rowCount):
	for column in range(table.columnCount):
		if table.getValueAt(row, column) =="":
			newData = system.dataset.setValue(table, row, column, "Red")
			system.tag.write("[.]EveryHourShift1",newData)

```

The EveryHourShift could probably be iterated in some way as well.

---

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 4:30pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/12 "2023-01-13T16:30:35Z")

</div>

Thank you for the suggestion. This is our older version of Ignition that I am now in charge of maintaining. Unfortunately I have inherited a lot of this project, so I am constantly running into issues like this.

I figured since the code was so repetitive there had to be a better way to iterate through each line, however I am still fairly very new when it comes to coming up with my own code.

I truly appreciate your suggestion, I will have to take a day and dive in and try to reiterate to save time when I have to add in a new machine, as it takes about 20 min right now to go through the 1600 lines of code just to manually add in. Thank you for your time.

---

<div class="post-metadata">

**Author:** ![Kiyara\_Hill](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kiyara\_Hill](https://forum.inductiveautomation.com/u/Kiyara_Hill)\
**Post date:** [January 13, 2023, 4:31pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/13 "2023-01-13T16:31:56Z")

</div>

And for anyone who is wondering about the solution it looked like I ran through the tag character or line limit. It started working once I split the code into two separate tags.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 19, 2023, 11:08am UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/14 "2023-01-19T11:08:19Z")

</div>

Damn I've never seen so many ifs before !

I'm up for helping you with a refactor, if you can explain the logic behind all this.  
Like, what's `table`, what does it contain, how does it impact the tag writes, can several of those conditions be true (since it's only `if` and not `elif`, and there's only 2 tags that can be written to, only the last true condition for each of those 2 tags actually does something. Which means you could be overwriting the same tag over and over again hundreded of times, which is FAR from something you want to be doing)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c5706cb68df53b7a10aef323682792c855dbb1cd.jpeg)  
(I'm so sad that I couldn't find a gif)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 19, 2023, 11:54am UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/15 "2023-01-19T11:54:23Z")

</div>

> [@pascal.fragnoud](#):
>
> Which means you could be overwriting the same tag over and over again hundreds of times, which is FAR from something you want to be doing

Not to mention this is all being done in a Tag Event Script. There is a very good chance that there are events being missed.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 19, 2023, 12:22pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/16 "2023-01-19T12:22:03Z")

</div>

I highly recommend taking Pascal up on his offer. He's done many refactors on this site, and he does excellent work.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 20, 2023, 7:57am UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/17 "2023-01-20T07:57:43Z")

</div>

I took a closer look, and there are a few things that need to be cleared:

- It actually won't be overwriting hundreds of tags, as at most one of the `a, b, c...` branches will ever be executed, which means 11 writes at most.
- who the hell thought of this `a = 6, b = a + 1...` madness ? What is going on here ?  
I can see there are 24 of them and they correspond to hours, but... Why make it even less clear ?  
Why is s midnight ? Why does b (7) correspond to the first column (I suspect a day starts at 7 ?) ?  
Why is the `every2hoursShift` not ACTUALLY every 2 hours ?
- When an innermost branch is entered, do you want to change the color for every cell that's empty, or just the last one ?
- Can there actually be several empty cells in the same column ?  
Currently, it only does it for the last one, as the same base table is used in each condition, which means if the first cell is empty, it's value is changed, the tag is written, but then if another cell is also empty, this previous change is discarded. Is that intended behavior ?
- Are the two main branches strictly identical, except for the color ?

I can reduce all this to something that would actually be maintainable without changing what it does, but with more information it may be possible to go further and make the logic a bit less confusing.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 20, 2023, 10:31am UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/18 "2023-01-20T10:31:12Z")

</div>

Okay so here's a first draft that **should** be functionally equivalent, except on one point: it writes the color value in every empty cell from the processed column. This seemed like the most logical thing to do.  
If that's not the expected behavior, I'll do another version.  
Note: I insist on **should** , because frankly I might have missed quirks somewhere in the 1600 lines of ifs :X

I don't like that there are 2 separate tag reads, but it was simpler this way.

I might do another pass on this a bit later and see what can be improved, but for now I think I'll go put my head in the oven.  
Just so you know, the file I used while doing this was named `if_hell.py`.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/1/61c7a30bd1f5e3e98869abc68d830be9dad1d643.png)

```python
PMStatus = system.tag.readBlocking(["[.]PMStatus"])[0].value
if PMStatus:
	tags_paths = ["[.]EveryHourShift1", "[.]Every2HourShift1"]
	color = "Red"
else:
	tags_paths = ["[.]EveryHourShift2", "[.]Every2HourShift2"]
	color = "Blue"

shift1h, shift2h = [
	system.dataset.toPyDataSet(qval.value)
	for qval in system.tag.readBlocking(tags_paths)
]

hour = system.date.getHour24(currentValue.value)
col_index_1h = (hour - 6) % 12
col_index_2h = col_index_1h / 2

def fill_empty_cells(ds, col_index, value):
	for row in ds:
		if row[col_index] == "":
			row[col_index] = value

fill_empty_cells(shift1h, col_index_1h, color)
if col_index_2h in [8, 10, 12, 14, 16, 20, 22, 0, 2, 4]:
	fill_empty_cells(shift2h, col_index_2h, color)

shift1h = system.toDataSet(shift1h)
shift2h = system.toDataSet(shift2h)
system.tag.writeBlocking(tags_paths, [shift1h, shift2h])

```

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [January 20, 2023, 11:04am UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/19 "2023-01-20T11:04:53Z")

</div>

> [@pascal.fragnoud](#):
>
> if\_hell.py

very fitting,

> [@Kiyara\_Hill](#):
>
> that I am now in charge of maintaining. Unfortunately I have inherited a lot of this project, so I am constantly running into issues like this.

i hope not all code is like this, else you sure have your work cut out for you xd  
if you wrote this though, i suggest you loop up who loops work in python

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 20, 2023, 1:47pm UTC](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570/20 "2023-01-20T13:47:07Z")

</div>

> [@pascal.fragnoud](#):
>
> the 1600 lines of ifs

1600 lines of code reduced to less than 25 lines of code: Nicely done 👍

[Next page](https://forum.inductiveautomation.com/t/why-is-there-a-red-squiggly-under-the-d-in-def-valuechanged-on-tag-script/68570.md?page=2)
