Grabbing data value from a dataset into a memory tag

It seems I am missing something as I am sure this is simple. I have a table that I want to get a value from the dataset and store into a memory tag. This is what I currently have:

# Get the dataset from the Table component & Convert to PyDataSet
ds = event.source.parent.getComponent('Table').data  # table component name is "Table"
pds = system.dataset.toPyDataSet(ds)

# Grab the second item of the first row
strTag = pds[0][1]  # strTag is a memory tag defined as a STRING

When I run this code, I do not get any results, and the Output Console does not show any errors. Can anyone see what I am missing? I tried this same code with the data as a DataSet as well as pyDataSet.

Thanks

All you’re doing is assigning the value from the table to the python variable “strTag”.

To actually write to your memory tag you have to use the system.tag.write() function like so:

# Get the dataset from the Table component & Convert to PyDataSet
ds = event.source.parent.getComponent('Table').data  # table component name is "Table"
pds = system.dataset.toPyDataSet(ds)

# Grab the second item of the first row
strTag = pds[0][1]  # strTag is a memory tag defined as a STRING
system.tag.write("Path/To/Tag",strTag)

system.tag.write() did the trick !!

I knew I was missing something small.

Thanks…