GetToken (Control Lock Module)
(Control Token Manager)
This function works with Control Tokens. If you are interested in stream handling refer to GetToken
Description: | Checks if a token is applied directly to a tag or (optionally) to a tag's ancestor. Can also search for token requests. |
Returns: | An alarm record |
Usage: ![]() |
Script or steady state. |
Function Groups: |
(Control Token Manager) |
Related to: |
CanControl (Control Token Manager) | CanDenyTokenRequest | CanGrantTokenRequest | CanReleaseToken | CanRequestToken | DenyTokenRequest | GetTokenLevel | GrantTokenRequest | ReleaseToken | RequestToken | |
Format: ![]() |
\ControlTokenManager.GetToken(TagID[, IncludeAncestry, Snapshot, GetRequest, ReturnAll]) |
Parameters: |
TagID |
Required text. The unique ID of the tag to check. |
IncludeAncestry |
Optional Boolean. Set TRUE to search the tag's ancestry. Defaults to TRUE. |
Snapshot |
Optional Boolean. Set TRUE if this function is called in script. Defaults to FALSE. |
GetRequest |
Optional Boolean. Set TRUE to search the TokenRequests list instead of the Tokens list. Defaults to FALSE. |
ReturnAll |
Optional Boolean. Set TRUE to return all matching records. Defaults to FALSE. |
Comments: |
For more information about alarm records and what an alarm record contains, see Alarm API Structure Definitions Checking the validity of the returned value is sufficient to determine if the tag in question has a token. Given a tag's unique ID, this module checks if a token is applied directly to the tag (IncludeAncestry = FALSE). If IncludeAncestry = TRUE (default), this will search the tag's ancestry for the nearest token. Returns Invalid if no token is found. Can optionally search the TokenRequests list instead if GetRequest = TRUE |