I'm scripting a tag history query and want a wide table with AsStored values. I'm expecting a t_stamp column but not getting it. (I am getting a column for each tag defined in the paths list.)
# Read records for the last two hours.
startD = system.date.addHours(system.date.now(), -2)
endD = system.date.addMinutes(system.date.now(), -15)
# Query the historian.
ds = system.tag.queryTagHistory(
paths,
startDate = startD,
endDate = endD,
returnFormat = 'Wide',
columnNames = colNames,
ignoreBadQuality = True,
)
headers = system.dataset.getColumnHeaders(ds)
for h in headers:
print h
Can anyone spot my error? Am I missing a parameter?
Phil, I'm generating the wide table in a gateway scheduled event. I don't think I can use the groupBy() function is this case. Isn't it expression language only?