Editing a Dataset TAG memory element by element

I am trying to edit a Dataset created as a TAG Memory, I am using next script and I get not errors when it is executed, but the dataset “MT1/Resultados/Datos” is not updated with new values.

table = system.tag.read(“MT1/Resultados/Datos”)
while a <=10:
source = ‘Puerta/Datos/Tiempo/’+ str(a)
tiempo = system.tag.read(source).value
newData = system.dataset.setValue(table.value, a, “Tiempo”, tiempo)
print newData.getValueAt(a, 0)
estado = system.tag.write(“MT1/Resultados/Datos”,newData)
print estado

Please edit your post to include the code formatting markers – your indentation is not visible, and that is important to read your code. Use triple-backquotes (like so: ```) on a lines by themselves above and below your code. That said, I suspect that part of your problem is the lack of any increment for ‘a’, making the loop run forever.