Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.

Description

Moves Tags or Folders to a new destination. The new destination can be a separate Tag provider. If interested in copying the Tags to a new destination, instead of moving them, please see the system.tag.copy page.

Moving Across Tag Providers

When moving UDTs to a different provider, the destination provider must have a matching UDT definition. This function moves folders/Tags sequentially, so definitions can be placed earlier in the list, with instances following after.

Note that moving Tags with this function will not move or otherwise update prior Tag History or Alarm Journal entries: the old records will persist in the database at the old path, while future entries will be based on the new paths.

Remote Tag Providers

Additionally, this function can move Tags to or from a Remote Tag provider. In this case, the Tag Access Service Security settings on both providers must be set to ReadWriteEdit.

Client Permission Restrictions

Permission Type: Tag Editing

Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope.

Syntax

 system.tag.move(tags, destination, [collisionPolicy])

  • Parameters

List tags - A List of Tag paths to move.

String destination - The destination to move the Tags to. The destination Tag provider must be specified: i.e., [default]Folder/myTag.

String collisionPolicy - The action to take when a Tag or folder with the same path and name is encountered. Possible values include: "a" Abort and throw an exception, "o" Overwrite and replace existing Tag's configuration, "i" Ignore that item in the list. Defaults to Overwrite. [optional]  

  • Returns

List - A List of QualityCode objects, one for each Tag in the list, that is representative of the result of the operation. See Scripting Object Reference.

  • Scope

Gateway, Vision Client, Perspective Session

Code Examples
Code Snippet - Rename a Folder
# This function moves a folder in a Tag provider to a new folder.

# Since both paths are at the same node, the "Old_Folder" will be placed at the root of the provider, and the name changed, effectively renaming the folder. 
tags = ['[default]Old_Folder']
destination  = '[default]New_Folder/'

# Move the folder.
system.tag.move(tags, destination)
Code Snippet - Move Multiple Folders to a New Folder
# This function moves an entire folder of Tags to a new destination.

# Define the source and new path.
tags = ['[default]Old_Folder', '[default]Another_Folder' ]
destination  = '[default]New_Folder/Imports'

# If there are any conflicts with the new destination, then abort the operation
policy = 'a'

# Move the folder
system.tag.move(tags, destination)
Keywords

system tag move, tag.move