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 historian. 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​
| Type | Parameter | Description |
|---|---|---|
| String | source | The historical path where the metadata point will be stored. |
| Dictionary | properties | A dictionary of properties to be stored as historical metadata. |
| Date | timestamp | The timestamp when the metadata point was recorded. |
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:default:/tag:MyTag"
properties = {
"batchId": "A123",
"operator": "jsmith"
}
timestamp = system.date.now()
metadata = system.historian.types.metadataPoint(
source,
properties,
timestamp
)
system.historian.storeMetadata([metadata])