system.tag.queryTagHistory return None, aggregationMode Max

Ignition 7.7.6 (b2015120217)

I need to obtain from history the maximum value from a list of tag Path.
I use system.tag.queryTagHistory with aggregationMode = Maximum, but I obtain a None value.

import datetime
startTime = datetime.datetime.now() - datetime.timedelta(minutes=600)
paths.append("[histo_court]TMO/VEN/ACCDE/20143/TMf/CUMUL_NB_MVT")
endTime = datetime.datetime.now()
dataSet = system.tag.queryTagHistory(paths=paths, startDate=startTime, endDate=endTime, returnSize=1, aggregationMode=“Maximum”, returnFormat=‘Wide’,ignoreBadQuality=1, noInterpolation=1,validateSCExec=0)

These tag are stored with one value every hours.

Any Idea ? :scratch:

First thing I notice is you don’t have paths defined.
It should be
paths=[]
Then you can just use the Query for Maximum feature to get what you want since it looks like you are just calculating Now() - 600 minutes.

dataSet=
import datetime
paths=[]
paths.append("[histo_court]TMO/VEN/ACCDE/20143/TMf/CUMUL_NB_MVT")
dataSet = system.tag.queryTagHistory([paths],returnSize=1,aggregationMode='Maximum',rangeMinutes='-600')