When I run the below code in the client as opposed to the designer I get different results:
[code]startDate = 2013-04-18 15:43:38
endDate = 2013-04-18 21:57:23
extractInterval = 1
fileConct = “d:\data\extract\”
esServer = server1
scanClassQ = “”"
SELECT sqlth_scinfo.id, sqlth_scinfo.scname AS Scan_Class, sqlth_te.id As tagID, sqlth_te.tagpath AS ioTags
FROM sqlth_scinfo
LEFT JOIN sqlth_te ON sqlth_scinfo.id = sqlth_te.scid
WHERE sqlth_te.tagpath is not null
AND sqlth_scinfo.scname like ‘%s%%’
“”" %(esServer)
try:
#obtain energy Server Scan class
scTags = system.db.runQuery(scanClassQ)
#build dictionary list
scanTagDict[esServer] = [row[‘ioTags’] for row in scTags]
tags = [ row for row in scanTagDict[esServer]]
print tags
tagData = system.tag.queryTagHistory(tags, startDate, endDate, None, “MinMax”, “Wide”, tags, None, extractInterval, None, None)
exportHist = system.dataset.toCSV(tagData, 1, 0)
system.file.writeFile(fileConct, exportHist , 1)[/code]
Running the code on the client actually returns a dtaset with times, values, and my actually header of all my tags. When running this script as a Timer task on the gateway It only returns the first tag in the sequence and dates with no data points. I’ve attached two sample csv files of the export. Please advise if I’m misinterpreting how the gateway handles lists as opposed to the client.
gateway_2013_04_18.csv (50.3 KB)
client_2013_04_18.csv (1.17 MB)