System.tag.query history not fetching data

Hi using
system.tag.storeTagHistory(histProv, tagProv, tags_path, listing) to store tags data in Postgressql database

i have checked in database data are storing

But when i use system.tag.query history to fetch the data its not fetching

even i used tag history binding that also not working

Because i am using system.tag.storeTagHistory so that its not able to fetch the data?

can any one help me out

Wrong function, you are trying to use this, system.tag.query - Ignition User Manual 8.1 - Ignition Documentation

You need to use this,
https://docs.inductiveautomation.com/display/DOC81/system.tag.queryTagHistory

1 Like

yaa i am using [system.tag.queryTagHistory] i have mistakenly typed wrong. I have found the issue. tag provider name i have mentioned wrong. now its working

Hi i am using tag history binding

i have data for same time multiple times. Any way to fix this?

Are you sure the times are identical? You are only seeing to seconds. I bet if you look at ms they won’t be the same.

yes millisecond varies. I tired give return format Tall. I think that will fix right?

You have any idea to fix that one?

What exactly do you think should be fixed? How are you thinking the data should be presented?

My question is i am using system.tag.storeTagHistory(histProv, tagProv, tags_path, listing) to store data to database for 10 tags at same time.

But why ms seconds difference is occurring?

Is there anything i am doing wrong?

@PGriffith your thoughts?

Are you specifying the timestamps to use for storeTagHistory?

system.tag.storeTagHistory(historyprovider, tagprovider, paths, values [, qualities, timestamps])

No i am not using timestamp

Perhaps you should, if you want them all to be the same. The historian works on a per-tag basis. Since it uses the current system time if it’s not specified, I can see where it would have a sub-second difference.

Any example to mention timestamp please

Timestamp = system.date.now() like that?

Modified from the manual:

"""
Stores multiple records for a single tag path. Could be modified to store more records by increasing the number of items in each list.
Additionally, different tag paths could be used for each record.
"""
  
paths = ["folder/tag","folder/tag"]     
values = [15, 300]
quals = [192] * len(paths)
dates = [system.date.now()] * len(paths)
  
# Store the history with the variables declared above.
system.tag.storeTagHistory("My History Provider", "My Tag Provider", paths, values, quals, dates)

2 Likes

Thanks i will implement and Check