OPC UDT Array to Dataset for CSV Export

Hi, I'm trying to read a UDT array from a OPC UA device to ultimately dump tag values to a CSV. I'm having some trouble understanding how to get the data formatted to be a proper dataset that can be exported to a CSV file.

Here's the script I've got working so far. I have 19 elements per row for a variable amount of rows, I'm just working with the first row for now. This does dump the tag values to a CSV along with my headers, however it doesn't seem to be recognized as a dataset to manipulate and export more rows of data. Is there a better way to read tags and/or manipulate tag lists into a dataset?

If there's a better way to read a UDT array, or even just a 2d float array from an OPC plc to a CSV file and also write back to the PLC from a CSV, I'd love to learn out about it.

headers = ["Wheel 1 RPM", "Wheel 2 RPM", "Wheel 3 RPM", "Wheel 4 RPM", "Wheel 5 RPM", "Wheel 6 RPM", "Wheel 7 RPM", "Wheel 8 RPM", "MV 1 Flow", "MV 2 Flow", "MV 3 Flow", "MV 4 Flow", "MV 5 Flow", "MV 6 Flow", "MV 7 Flow", "MV 8 Flow","Tractor Pos", "Spinner RPM", "Dwell Time"]
tagList = []
for i in range(1):  
	# Make a list of tag names that we can use to read them all at once.
	for j in range(1,9):
		tagList.append("[L350_Tags]Recipe_Buffer/Step/Step_"+str(i)+"_/Wheel_Speed_SP/Wheel_Speed_SP_"+str(j)+"_")
	for j in range(1,9):
		tagList.append("[L350_Tags]Recipe_Buffer/Step/Step_"+str(i)+"_/MV_Flow_SP/MV_Flow_SP_"+str(j)+"_")
	tagList.append("[L350_Tags]Recipe_Buffer/Step/Step_"+str(i)+"_/Tractor_Pos_SP")
	tagList.append("[L350_Tags]Recipe_Buffer/Step/Step_"+str(i)+"_/Spinner_Speed_SP")
	tagList.append("[L350_Tags]Recipe_Buffer/Step/Step_"+str(i)+"_/Dwell_Time")

# Read all tags in tagList
qValues = system.tag.readAll(tagList)

# Set dataset framework
values = [tag.value for tag in qValues]

csvheaders = system.dataset.toCSV(headers, 0, 0, 0)
csvvalues = system.dataset.toCSV(values, 0, 0, 0)

# Use system.file.saveFile to have the user find a directory to write to.
filePath = system.file.saveFile("myExport.csv", "csv", "Comma Separated Values")

# We can check the value of filePath to make sure the user picked a path before attempting to write.
if filePath:
    system.file.writeFile(filePath, csvheaders)
    system.file.writeFile(filePath, csvvalues,1)

CSV file output:

"['Wheel 1 RPM', 'Wheel 2 RPM', 'Wheel 3 RPM', 'Wheel 4 RPM', 'Wheel 5 RPM', 'Wheel 6 RPM', 'Wheel 7 RPM', 'Wheel 8 RPM', 'MV 1 Flow', 'MV 2 Flow', 'MV 3 Flow', 'MV 4 Flow', 'MV 5 Flow', 'MV 6 Flow', 'MV 7 Flow', 'MV 8 Flow', 'Tractor Pos', 'Spinner RPM', 'Dwell Time']"
"[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 21.0, 22.0, 31.0]"