Skip to main content
Version: 8.3

system.historian.types.metadataPoint

New in 8.3.5

This function is used in Python Scripting.

Description​

Creates a metadata point that can be stored to a Core Historian or Internal Historian (Legacy). Metadata points allow you to store additional properties associated with a historical path at a specific point in time.

The returned object is used with system.historian.storeMetadata.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.historian.types.metadataPoint(source, properties, timestamp)

Parameters​

TypeParameterDescription
StringsourceThe historical path where the metadata point will be stored. See Path Syntax for more information on recommended syntax.
DictionarypropertiesA dictionary of properties to be stored as historical metadata.
DatetimestampThe timestamp when the metadata point was recorded.
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.

Returns​

MetadataPoint - A metadata point object that can be passed to system.historian.storeMetadata.

Scope​

Gateway, Vision Client, Perspective Session

Code Examples​

Create and Store Metadata
# Create a metadata point and store it using the historian API.

source = "histprov:SQL_Historian:/sys:GW1:/prov:default:/tag:Mytag"

properties = {
"batchId": "A123",
"operator": "jsmith"
}

timestamp = system.date.now()

metadata = system.historian.types.metadataPoint(
source,
properties,
timestamp
)

system.historian.storeMetadata([metadata])