Skip to main content
Version: 8.3

system.historian.storeDataPoints

This function is used in Python Scripting.

Description​

Stores a list of data points to the specified historian.

Changed in 8.3.5
Data points can be provided as individual parameter lists or as objects created with system.historian.types.dataPoint.

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.

note

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​

TypeParameterDescription
ListpathsA list of qualified historical paths. See Path Syntax for more information on recommended syntax.
ListvaluesA list of historical values.
ListtimestampsA 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.
ListqualitiesA list of qualities. Quality codes can be found on the Quality Codes and Overlays page. If omitted, Good quality will be used.[optional]
BooleanblockForResultWhether 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​

TypeParameterDescription
ListdatapointsA 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​

Syntax #1 Code Snippet
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)
Syntax #2 Code Snippet
source = "histprov:SQL_Historian:/sys:GW1:/prov:default:/tag:test_tag"
value = 100
datapoints = [system.historian.types.dataPoint(source, value)]

system.historian.storeDataPoints(datapoints)