system.historian.storeDataPoints
This function is used in Python Scripting.
Description​
Stores a list of data points to the specified historian.
When provided as individual parameter lists, ensure all parameters are 1:1, meaning all provided lists must be of the same length. If a particular annotation doesn't need a parameter, that element can be None in the list.
It is possible to store two datapoints with the same timestamp with the Core Historian. If this occurs, the trends will use the highest value point for interpolation. However, it is not recommended to attempt storing two points with identical timestamps.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax #1​
system.historian.storeDataPoints(paths, values, [timestamps], [qualities])
Parameters​
| Type | Parameter | Description |
|---|---|---|
| List | paths | A list of qualified historical paths. See Path Syntax for more information on recommended syntax. |
| List | values | A list of historical values. |
| List | timestamps | A list of timestamps. If omitted, the current time will be used. [optional] Note: Including timestamps ensures accuracy of your data. They should only be excluded if you wish to store a single point with the current timestamp of the Gateway. |
| List | qualities | A list of qualities. Quality codes can be found on the Quality Codes and Overlays page. If omitted, Good quality will be used.[optional] |
| Boolean | blockForResult | Whether the result should be blocked until confirmation that the storage has been attempted. Default is True. [optional] |
Returns​
List - A list of QualityCode objects. The quality code will indicate success or failure.
Scope​
Gateway, Vision Client, Perspective Session
Syntax #2​
system.historian.storeDataPoints(datapoints)
Parameters​
| Type | Parameter | Description |
|---|---|---|
| List | datapoints | A list of data point Java objects created with system.historian.types.dataPoint. |
Returns​
List - A list of QualityCode objects. The quality code will indicate success or failure.
Scope​
Gateway, Vision Client, Perspective Session
Code Examples​
paths = ["histprov:mariadb:/sys:gatewayName1:/prov:default:/tag:test_a"]
values = [1]
timestamps = [system.date.now()]
qualities = [192]
listOfQualityCodes = system.historian.storeDataPoints(paths, values, timestamps, qualities)
source = "histprov:SQL_Historian:/sys:GW1:/prov:default:/tag:test_tag"
value = 100
datapoints = [system.historian.types.dataPoint(source, value)]
system.historian.storeDataPoints(datapoints)