Hi Team,
We are using the Ignition 8.1.14 on VM and MSSQL is setup on other VM.
Currently there is gateway script which runs at mid night to query the data for that day and email the report to us in xml format.
We have notice on couple of instance where the duplicate value is populated for the time of the day.
If i look at the values in the power table using history tag by browsing for same day. The values has changed for that period where report is showing us the data as duplicate values.
I check the wrapper log file i am unable to pickup any error logs. I also looked at the gateway script log activity and nothing relevant showing there as well.
Is there anywhere to check what is going on with the system and how to identify what is causing this issue?
Above is the code and the issue is when the system.tag.queryTagHistory is getting the data. It is not bring the data correctly sometime it is populating the data with duplicate values.
You messed up the code formatting. The code goes inside the triple backticks.
You can fix it by editing your question using the pencil icon. Preview before posting.
To put more details:
Following screen shot is showing the data for same day in power table. As you can see the data is changing.
So i am not sure why system.tag.queryTag History is duplicating the values. I can replicate this issue … and no error comes up on wrapper log file or under gateway script log files.
###############################################################################
monitorName = SiteWellsReport
sampleHeaders = [‘t_stamp’, ‘value’]
# getting data by query tag history
# Tag path is list of tags which needs to be quered from historian
TagPaths=[’[IGN]farms/flows/well4flow/tot/MeterTotal’,’[IGN]farms/flows/well9flow/tot/MeterTotal’,’[IGN]farms/flows/well12flow/tot/MeterTotal’,’[IGN]farms/flows/well15flow/tot/MeterTotal’,’[IGN]farms/flows/well17flow/tot/MeterTotal’] # Bore well 4A, 9, 12, 15,17
# naming the columns in the table
columnName=[‘Timestamp’,‘Well 4A m3’,‘Well 9 m3’,‘Well 12 m3’,‘Well 15 m3’,‘Well 17 m3’]
#End time of the query
endTime = system.date.now()
#Start time of the query
startTime = system.date.addHours(endTime, -24)
dataSet = system.tag.queryTagHistory(paths=TagPaths, startDate=startTime, endDate=endTime, returnSize=96, aggregationMode=LastValue, returnFormat=‘Wide’, ignoreBadQuality = ‘true’, columnNames=columnName, intervalMinutes =15 )
#print rows returned for record keeping
print (‘Get Dataset Rows’)
print dataSet
print (‘finish Dataset Rows’)
#coverting dataset to python dataset
pythonDataset = system.dataset.toPyDataSet(dataSet)
sampleData = pythonDataset
Hi Josborn,
I tried removing aggregationmode = lastvalue… it looks like there is lot of decimal places after the decimal point which got introduced and still having the same issue as shown below.
Not certain if this is contributing to what you are seeing or not, but it is definitely not correct.
'true' is not the boolean value True.
You're using both returnSize and intervalMinutes, yes there are 96 - 15min intervals in 24 hours, but you only need to use one of these. Personally I think intervalMinutes is more readable
Your columnName list has to be a 1-1 match with the tagPaths, since 'Timestamp' isn't one of the tagPaths that you are providing then it shouldn't be included in the list.
Your definition of the columnName list should look like:
Hi Irose,
Thanks for your reply.
I have tried correcting the ignorebad value to “True”. this has made no difference.
i have tried deleting the return size and only have interval setting. this has made no difference.
If i tried to delete the time stamp from the columnNames. It is giving error. But if i look into the dataset Row0 of the dataset is the time stamp. that is by default. So if we are labeling the row 0 as "Well 4A m3 " the data under it is date time stamp.
The error is because elsewhere in the script you’re referencing the column Timestamp which doesn’t exist. The timestamp column will now be titled t_stamp.
Leaving Timestamp out of the columnName list is correct.
If you do include it, since presumably the script is not erroring, then I would guess that you’re dataset is now missing the Well 17 3m column header.
Like I said I’m not sure it is contributing to the problem you are trying to solve, but it is definitely causing issue that eventually will come to light.
You should probably contact support about what you’re seeing perhaps they can look over your shoulder and isolate the issue.