Hi, I am, for each new tag.
The vast amount of prints are me trying to fault find.
(FYI it was based on this Mass import of UDT tags via simple csv and script (example))
import csv
def openFile():
filePath = system.file.openFile("csv","%user%")
csvFile = open(filePath, 'r')
print '------------------------------------------------------'
print "Scanning .csv file for table headers..."
reader = csv.DictReader(csvFile)
print ".csv table headers found:"
print reader.fieldnames
print '------------------------------------------------------'
for row in reader:
if row['UDTType'] == 'UDT': addUDT(row)
def addUDT(csvRow):
print 'Now in addUDT subroutine.'
tagProv = '[' + csvRow['provider'] + ']'
print 'tagProv = ' + tagProv
baseTagPath = tagProv + csvRow['folder1'] + '/' + csvRow['folder2']
print 'baseTagPath = ' + baseTagPath
tagName = csvRow['tagname']
print 'tagName = ' + tagName
typeId = csvRow['UDTType']
print 'typeId = ' + typeId
tagType = "UdtInstance"
print 'tagType = ' + tagType
print 'Reading in Tag information...'
tag = {
"name" : tagName,
"typeId" : typeId,
"tagType" : tagType,
"parameters" : {
"item1" : csvRow['item1'],
"item2" : csvRow['item2'],
"item3" : csvRow['item3'],
"item4" : csvRow['item4'],
"item5" : csvRow['item5'],
"item6" : csvRow['item6'],
"item7" : csvRow['item7'],
"item8" : csvRow['item8'],
"item9" : csvRow['item9'],
"item10" : csvRow['item10'],
"item11" : csvRow['item11'],
"item12" : csvRow['item12'],
"item13" : csvRow['item13'],
"item14" : csvRow['item14'],
"item15" : csvRow['item15'],
"item16" : csvRow['item16'],
"item17" : csvRow['item17'],
"item18" : csvRow['item18'],
"item19" : csvRow['item19'],
"item20" : csvRow['item20'],
"item21" : csvRow['item21'],
"item22" : csvRow['item22'],
"item23" : csvRow['item23'],
"item24" : csvRow['item24'],
"item25" : csvRow['item25'],
"item26" : csvRow['item26'],
"item27" : csvRow['item27'],
"item28" : csvRow['item28'],
"item29" : csvRow['item29'],
"item30" : csvRow['item30'],
"item31" : csvRow['item31'],
"item32" : csvRow['item32'],
"item33" : csvRow['item33'],
"item34" : csvRow['item34'],
"item35" : csvRow['item35'],
"item36" : csvRow['item36'],
"item37" : csvRow['item37'],
"item38" : csvRow['item38'],
"item39" : csvRow['item39'],
"item40" : csvRow['item40'],
"item41" : csvRow['item41'],
"item42" : csvRow['item42'],
"item43" : csvRow['item43'],
"item44" : csvRow['item44'],
"item45" : csvRow['item45'],
"item46" : csvRow['item46'],
"item47" : csvRow['item47'],
"item48" : csvRow['item48'],
"item49" : csvRow['item49'],
"item50" : csvRow['item50'],
"item51" : csvRow['item51'],
"item52" : csvRow['item52'],
"item53" : csvRow['item53'],
"item54" : csvRow['item54'],
"item55" : csvRow['item55'],
"item56" : csvRow['item56'],
"item57" : csvRow['item57'],
"item58" : csvRow['item58'],
"item59" : csvRow['item59'],
"item60" : csvRow['item60'],
"item61" : csvRow['item61'],
"item62" : csvRow['item62'],
}
}
collisionPolicy = "o"
print 'collisionPolicy = ' + collisionPolicy
print 'Now creating Tag...'
system.tag.configure(baseTagPath, [tag], collisionPolicy)
print 'Success! ' + typeId + ' ' + tagName + ' inserted.'
print '------------------------------------------------------'
openFile()