Issues with the system.tag.storeTagHistory() in 8.3

Hi everyone,

I’ve recently migrated projects running on 8.1 to 8.3 and noticed that there has been a few breaking changes and I’m stuck on this particular fault message. In essence, I’m running value changed script on a tag that uses system.tag.storeTagHistory() in the following manner:

def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):

historyProvider = ‘name_of_the_historian’

tagProvider = ‘name_of_the_provider’

paths = [tagPath]

values = [currentValue.value]

system.tag.storeTagHistory(historyProvider, tagProvider, paths, values)

Whenever this script is triggered, I see a warning with the message: SF Engine 'name_of_the_historian' does not accept data 'DefaultPersistentFlavor{signature='history_set', systemType=Tag History}' and also no data is inserted into the database.

Does anyone know what causes this message to appear? Didn’t have this problem with 8.1 but it started happening when I migrated to 8.3

Many thanks in advance.

I just saw in the document that system.tag.storeTagHistory() has been removed and replaced with system.historian.storeDataPoints()

I tried using the new system.historian.storeDataPoints() but it keeps spitting out a message

Bad_Failure(“Failed to normalize all data points”)

has anyone one seen this fault before?

paths = [‘histprov:historyDB:/sys:sys_name:/prov:provider_name:/tag:test_a’]

values = [1]

timestamps = [system.date.now()]

system.historian.storeDataPoints(paths, values, timestamps)

I tried following the example syntax#2 in the documentation but it doesn’t seem to want to work :confused:

It looks like the syntax#1 example from the documentation is working but syntax#2 is still failing with the message Bad_Failure(“Failed to normalize all data points”)

Has anyone tested the syntax#2 and managed to get it working? It’d be good if i can use the function without having to import the modules.

to anyone who wants to use syntax#2, I changed the path format and it worked:
paths = ["histprov:MSSQL:/drv:ignition-gateway:default:/tag:Tag2"]
values = [10]
timestamps = [system.date.now()]

Could you share exactly what the script looked like when you had issues? I tried the syntax as it was originally and it worked for me, see attached picture. Note my gateway name and historian names are used in the function

Thank you for answering the question @qpadgham , I think I might have misspelled something in the paths, following your instruction, i was able to make it work:

Quick question about retrieving the data, is it possible to view the data using Tag History binding? I am unable to retrieve any data that I inserted (tried both wide and tall):

Yes, it seems to work as I’d expect. I have the same script as before (names have slightly changed for the system and historian), and I have a Table component with the following binding on the data prop:

As I repeatedly run my script, new values appear in the table as I’d expect:

If you’re continuing to see issues feel free to submit a support ticket and we can take a look.

1 Like

thanks a lot @qpadgham

i tried creating another historian and re directed storeDataPoints() to it and things started working.. weird but at least it’s working now.