Description
The "BrowseTags" command returns "Name", "DisplayName" and "DataType" as well as optional further attribute values of the tags of an HMI system or several HMI systems communicating via runtime collaboration.
Information on the general browse behavior of the command can be found in section Behavior of the browse commands.
If the number of hits exceeds the page size of the response, the command consists of an initial request and 1 to N Next requests:
-
You define the query in the initial request.
It provides a response that delivers the first set of hits.
-
You can call the remaining hits via Next requests.
Initial request
{"Message": "BrowseTags", "Params": {"LanguageId": <Value>, "Filter": "<String>", "Attributes": ["<Attribute name>", ..., "<Attribute name>"], "PageSize": <Value>, "SystemNames": ["<Name>", ..., "<Name>"]}, "ClientCookie": "<Cookie>"}
-
LanguageId: OptionalControls in which language the "DisplayName" of the tags is returned.
-
Value: The language ID
-
Default value: The default language of the system from which the tag originates
-
-
Filter: OptionalRestricts the command to tags whose "Name" matches the filter.
-
Value: Filter string
Permitted wildcards:
Wildcard
Description
Example
*
Replaces 0 to more characters
Filter string: "Motor*"
Tags contained in the response:
-
"Motor"
-
"MotorOn"
-
"MotorOff"
?
Replaces 1 character
Filter string: "Motor_?"
Tags contained in the response:
-
"Motor_1"
-
"Motor_2"
-
-
Default value: All tags of the system specified by
SystemNamesare queried.
-
-
Attributes: OptionalControls which tag attributes returns the response:
-
Value: Comma-separated enumeration of the attribute names
The response returns "Name", "DisplayName" and "DataType" as well as the specified attributes.
-
Value: "*"
The response provides all attributes supported by the TIA Portal for tags: Name, DisplayName, AcquisitionMode, Persistent, DataType, Connection, AcquisitionCycle, MaxLength, SubstituteValueUsage, InitialValue, SubstituteValue, InitialMaxValue, InitialMinValue, Address
-
Default value: The response returns "Name", "DisplayName" and "DataType".
-
-
PageSize: OptionalControls how many tags a response returns.
Default value: The configured page size is used. See also section ReadConfig.
-
SystemNames: OptionalControls from which system the tags are read.
-
Value: "*"
All systems that communicate with each other via runtime collaboration -
Value: Comma-separated list of systems that communicate with each other via runtime collaboration
FOR EXAMPLE: "HMI_RT_1", "HMI_RT_2"
-
Default value: The local system
-
-
ClientCookie:Value: Name of the response cookie
For example:
{"Message": "BrowseTags", "Params": {"LanguageId": 1033, "Filter": "*InternalTag_Bool_1*", "Attributes": ["AcquisitionMode", "MaxValue"], "PageSize": 50, "SystemNames": ["HMI_RT_1", "HMI_RT_2"]}, "ClientCookie": "myBrowseTagRequest1"}
Next request
{"Message": "BrowseTags", "Params": "Next", "ClientCookie": "<Cookie>"}
For example:
{"Message": "BrowseTags", "Params": "Next", "ClientCookie": "myBrowseTagRequest1"}
Response
OnSuccess
{"ClientCookie": "<Cookie>", "Message": "NotifyBrowseTags", "Params": {"Tags": [{"<Attribute name":<Value>, "<Attribute name>":<Value>, "DataType":<Value>, "DisplayName": "<Value>", "Name":"<Value>"}],}}
For example:
{"ClientCookie": "<myBrowseTagRequest1>", "Message": "NotifyBrowseTags", "Params": {"Tags": [{"AcquisitionMode":0, "MaxValue":1000, "DataType":1, "DisplayName": "HMI_RT_1::InternalTag_Bool_1", "Name":"HMI_RT_1::InternalTag_Bool_1"}],}}
OnError
{"Message": "ErrorBrowseTags", "ErrorCode": "<Code>", "ErrorDescription": "<Description>", "ClientCookie": "Cookie>"}
For example:
{"Message": "ErrorBrowseTags", "ErrorCode": "-2165323798", "ErrorDescription": "Invalid system name.", "ClientCookie": myBrowseTagRequest1"}