This function is used in Python Scripting.

Description

Exports Tags to a file on a local file system.

The term "local file system" refers to the scope in which the script was running; for example, running this script in a Gateway Timer script will export the file to the Gateway file system.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

Note: This function accepts keyword arguments.
system.tag. exportTags([filePath], tagPaths, [recursive], [exportType] )

  • Parameters

String  or Nothing filePath  - The file path that the Tags will be exported to. If the file does not already exist, this function will attempt to create it.

This feature was changed in Ignition version 8.1.8:
Previously, the filePath parameter was required. If omitted, causes the function to return the tag export as a string. 


List
 tagPaths - A List of Tag paths to export. All Tag paths in the list must be from the same parent folder.

Boolean recursive - Set to true to export all Tags under each Tag path, including Tags in child folders. Defaults to true. [optional]

String exportType - The type of file that will be exported. Set to "json" or "xml". Defaults to "json".     

  • Returns

Nothing

  • Scope

Gateway, Vision Client, Perspective Session

Code Examples
Code Snippet
# This example attempts to export the entire Tag Provider, including UDT definitions. 

# The filepath is Operating System dependent, so the path notation below may differ based on where the function is called from.
filePath = 'C:\\Users\\myUser\\Desktop\\myTags'			
tagPaths = ["[default]"]
recursive = True

system.tag.exportTags(filePath, tagPaths, recursive)
# Exports the entire tag provider named "default" as a string, and 
# returns the string to a "tags" variable. 
tags = system.tag.exportTags(tagPaths = ["[default]"])
Keywords

system tag exportTags, tag.exportTags