This function was deprecated in 8.0.0.
It has since been reintroduced in 8.1.8.
Inserts data into the tag history system, allowing Tag history to be recorded via scripting.
The Tag paths are associated with a historical and realtime provider, but they do not necessarily need to exist in the realtime provider. This means records from non-existent (virtual) Tags can be stored in the Tag History system. Because of this, it is imperative that Tag paths passed to the function are typed precisely, otherwise the history will be stored at an incorrect path.
Note that the Tag History system does cache tag data. Thus, if this function is called, the tag path and tag id are cached until the history provider or gateway are restarted. This means manually removing the tag from the sqlth_te table, and then calling this function again with the same path will not re-populate the tag execution table (especially so when working purely with virtual tag paths). Instead, the cache must first be cleared, and then a new entry will be added the next time this function is called.
This scripting function has no Client Permission restrictions.
system.tag.storeTagHistory(historyprovider, tagprovider, paths, values [, qualities, timestamps])
String historyprovider - The historical provider to store to.
String tagprovider - The name of the realtime tag provder to associate these tags with. The tag provider does not need to exist, and the tag paths do not need to exist in it.
String paths - A list of paths to store. The values, qualities, and timestamps are one-to-one with the paths. A single path may be present multiple times in order to store multiple values.
Object values - A list of values to store.
Integer qualities - A list of integer quality codes corresponding to the values. Quality codes can be found on the Tag Quality and Overlays page. If omitted, GOOD quality will be used.
Date timestamps - A list of Date timestamps corresponding to the values. If omitted, the current time will be used. A java.util.date object may be passed, so the system.date funcitions can be used to return a timestamp.