system.historian.browse
This function is used in Python Scripting.
Description​
Returns a list of browse results for the specified historian.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax #1​
system.historian.browse(rootPath, [snapshotTime], [nameFilters], [maxSize], [recursive], [continuationPoint], [includeMetadata])
Parameters​
| Type | Parameter | Description |
|---|---|---|
| String | rootPath | The root path to start browsing from. |
| Date | snapshotTime | The snapshot time to browse at. When specified, the browse returns node definitions that were active at that historical timestamp, including tags that have since been retired. When omitted/null, the current tag structure will be returned. This parameter is only functional for the Core Historian. [optional] |
| List | nameFilters | A list of name filters to apply to the browse results. [optional] |
| Integer | maxSize | The maximum number of results to return. [optional] |
| Boolean | recursive | Whether to browse recursively. Accepted values are True and False. The value is False by default, meaning that the browse will only return data directly inside the root path. [optional] |
| String | continuationPoint | The continuation point to continue browsing from when browsing large result sets. The string value for this is provided in the Results object when maxSize limits results and more are available. This string can then be passed into a subsequent browse() call to retrieve the next page of results. This is similar to system.tag.query continuation parameter. [optional] |
| Boolean | includeMetadata | Whether to include metadata in the browse results. [optional] |
Returns​
Results - A Results object that contains a list of browse results.
Scope​
Gateway, Vision Client, Perspective Session
Syntax #2​
system.historian.browse(rootPath, BrowseFilter)
Parameters​
| Type | Parameter | Description |
|---|---|---|
| String | rootPath | The root path to start browsing from. |
| Dictionary[String, Any] | browseFilter | A dictionary of browse filter keys. Refer to the Filter Keys section below for a full list of options. |
Filter Keys​
The following keys represent filter criteria that can be used by the browseFilter parameter:
dataType: Represents the data type on the tag. Valid values can be found on the Tag Properties page.valueSource: Represents how the node derives its value. Generally only used by nodes with a tag type of "AtomicTag".tagType: The type of the node (tag, folder, UDT instance, etc). A list of possible types can be found on the Tag Properties page.typeId: Represents the UDT type of the node. If the node is a UDT definition, then the value will be None. If the node is not a UDT, then this filter choice will not remove the element. As such, this filter functions best when paired with a tagType filter with a value of UdtInstance.quality: Represents the "Bad" and "Good" quality on the node. All other quality codes are ignored.maxResults: Limits the amount of results that will be returned by the function.
Returns​
Results - A Results object that contains a list of browse results.
Scope​
Gateway, Vision Client, Perspective Session
Code Examples​
Syntax #1 Code Snippet
# Browse a specified historical simulator tag path and display the results
# within the last 10 seconds, up to 10 results.
rootPath = "histprov:HISTORIAN:/sys:gw1:/prov:default:/tag:FOLDER/"
snapshotTime = system.date.addSeconds(system.date.now(), -10)
nameFilters = ['']
maxSize = 10
recursive = False
includeMetadata = True
result = system.historian.browse(rootPath, snapshotTime, maxSize, recursive, includeMetadata)
system.util.getLogger('HistorianTest: browse').info(str(result))