system.historian.types.dataPoint
This function is used in Python Scripting.
Description​
Creates a data point that can be stored to a historian. Data points represent individual values associated with a historical path, timestamp, and quality.
The returned object is used with system.historian.storeDataPoints.
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​
system.historian.types.dataPoint(source, value, [timestamp], [quality])
Parameters​
| Type | Parameter | Description |
|---|---|---|
| String | source | The historical path where the data point will be stored. See Path Syntax for more information on recommended syntax. |
| Object | value | The value to be stored in the historian. |
| Date | timestamp | The timestamp when the data point was recorded. If omitted, the current time is 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. |
| Integer | quality | The quality code of the data point. If omitted, a "good" quality is used. [optional] |
Returns​
AtomicPoint - A data point object that can be passed to system.historian.storeDataPoints.
Scope​
Gateway, Vision Client, Perspective Session
Code Examples​
# Create a data point and store it using the historian API.
source = "histprov:SQL_Historian:/sys:GW1:/prov:default:/tag:Mytag"
value = 42
point = system.historian.types.dataPoint(
source,
value
)
system.historian.storeDataPoints([point])