AddLock

(Control Lock Manager)

Description: Adds a Control Lock to a tag.
Returns: Nothing
Usage: Script Only.
Function Groups:

(Control Lock Manager)

Related to:

AddLock | CanAddLock | CanControl (Control Lock Manager) | CanRemoveLock | GetLockLevel | RemoveLock |

Format: \ControlLockManager.AddLock(TagID, Level[, Note, Custom, Timestamp, SessionID, AccountID, MachineID, Device])
Parameters:  
TagID
Required text. The unique ID of tag to be locked. (TagObj.UniqueID)
Level
Required integer. The Lock Level (defaults to 1).
Note
Optional text. A note to log with the lock.
Custom

Optional. A structure of custom fields to log.

This is anything that can be packed by Pack(). That is, numerics or strings, or any simple data structures that contain numerics or strings such as arrays, structures and dictionaries.

Timestamp
Optional timestamp. UTC timestamp of this event.
SessionID
Optional text. The ID of the session adding the lock.
AccountID
Optional text. The AccountID of the user adding the lock.
MachineID
Optional text. The workstation's MachineID, from which the lock was created.
Device
Optional text. The name of the client device.
Comments:

In order to lock the entire tag tree, a fictitious ‘Root Tag’ is declared in ControlLockManager.

This option is accessible only through custom script using syntax similar to:

 \ControlLockManager.AddLock(\ControlLockManager.RootTagID, Level)

The fictitious root tag's name and area can be changed by adding ControlLockRootTagName and ControlLockRootTagArea properties. This changes the Name and Area of the root tag in the Alarm List (Control Lock List) widget.

Example:

None available.