You're currently browsing the Ignition 8.0 docs. Click here to view the latest docs.



Ignition can export and import Tag configurations to and from the JSON (JavaScript Object Notation) format. You can import XML (Extensible Markup Language) or CSV (Comma Separated Value) file formats as well, but Ignition will convert them to JSON format while in a Tag provider. Tag export files can be edited directly in any text editor, allowing you to make bulk edits to Tags before importing them back into a Tag provider. 

Export Tags

  1. In the Designer, go to the Tag Browser, and select the Tags folder to export all your Tags. You can also select an individual folder that contains Tags you want to export. You can even export individual Tags as long the individual Tags are in the same folder. 

    Exporting UDTs and UDT Instances

    If you select a UDT instance to export, the UDT definition is not automatically included. You must export the definition as a separate file. 

    When later importing these UDTs, it is recommended to import UDT definitions before importing any instances. 

  2. On the Tag Browser toolbar, click the Export  icon to export your Tags. 



  3. The Save window will open. Specify the folder where you want to save your exported Tag files, and then click Save. Ignition will export Tags to a .json file.



On this page ...


IULocgo


Importing and Exporting Tags





Import Tags

You can import Tags to a individual folder or under the Tags tab.  To import Tags under the Tags tab, you can click the Tags tab or the empty space at the bottom of the Tag Browser below all your Tags. When importing Tags, you need to tell Ignition how to handle duplicate Tags. If any of the Tags being imported already exist in the folder you specify, Ignition can abort the import, overwrite the Tags, rename them, ignore them, or merge them. This is called a collision policy.

Collision Policy Options Table

Policy

Description

Abort

Aborts the import if duplicate Tags are found. 

Overwrite

Overwrites any Tags in the folder that have the same name as Tags being imported. Note this a complete overwrite of the Tag.

Rename

Renames any duplicate Tags.

Ignore

Ignores duplicate Tags and imports only those that are unique.

MergeOverwrite

Overwrites the Tag with the exception of any properties that aren't defined in the import folder. Those properties will be merged.


  1. On the Tag Browser toolbar, click the Import  icon
  2. Specify the folder you want to import your Tags from, and choose a previously exported file either .json, .xml, or .csv file type. 
  3. Choose a Collision Policy, which indicates how Ignition will deal with duplicate Tags. 
  4. Click Open to import the Tags.



  5. The Tags now appear in the Tag Browser in the folder you indicated for the import.



Tag File Formats

Tags can be imported from CSV, JSON, and XML. Tags can only be exported in XML or JSON.  There are many configuration settings for Tags than what is displayed in a JSON or XML export file. The Tag export feature only exports the configuration properties that have been edited in at least one of the Tags in the selected export folder. Therefore, to ensure the desired configuration setting is available in the export file, at least one Tag within the selected export folder must have that configuration property changed.

CSV Format

Legacy Ignition systems exported Tags as a CSV formatted file. This functionality was deprecated in Ignition 7.6.0. 

Modern Gateways can not export Tags to a CSV file, but they can still import Tags from this legacy CSV format. This is offered as a means to support those migrating to Ignition from a third-party system. Note that importing Tags from the CSV format in this manner will not create any alarms on the imported Tags. 


Below is an example of the legacy CSV format, which contains a couple of different Tag types, purely for demonstrative purposes. It contains:

  • An OPC Tag
  • A Folder
  • An OPC Tag located in a folder
  • A Derived Tag
  • An Expression Tag
  • A Memory Tag
  • A Query Tag

Path,Name,Owner,TagType,DataType,Value,Enabled,AccessRights,OPCServer,OPCItemPath,ScanClass,DriverName,ScaleMode,RawLow,RawHigh,ScaledLow,ScaledHigh,ClampMode,ScaleFactor,Deadband,DeadbandMode,FormatString,EngUnit,EngLow,EngHigh,EngLimitMode,Tooltip,Documentation,ExpressionType,Expression,OPCWriteBackServer,OPCWriteBackItemPath,SQLBindingDatasource,HistoryEnabled,PrimaryHistoryProvider,HistoricalScanclass,HistoricalDeadband,HistoricalDeadbandMode,InterpolationMode,HistoryMaxAgeMode,HistoryMaxAge,HistoryTimestampSource,UDTParentType,PersistValue,SourceDataType,SourceTagPath,SQLBindingPollRate,Permissions
# version=1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,_types_,,6,2,,TRUE,Read_Write,,,Default,,0,0,100,0,10,0,0,1.00E-04,0,"#,##0.##",,0,100,0,,,0,,,,,FALSE,,Default Historical,0.01,0,3,0,1,0,,FALSE,,,,
,A Folder,,6,2,,TRUE,Read_Write,,,Default,,0,0,100,0,10,0,0,1.00E-04,0,"#,##0.##",,0,100,0,,,0,,,,,FALSE,,Default Historical,0.01,0,3,0,1,0,,FALSE,,,,
A Folder/,OPC in a folder,,0,2,,TRUE,Read_Write,,,Default,,0,0,100,0,10,0,0,1.00E-04,0,"#,##0.##",,0,100,0,,,0,,,,,FALSE,,Default Historical,0.01,0,3,0,1,0,,FALSE,,,,
,Derived Tag,,13,2,100,TRUE,Read_Write,,,Default,,0,0,100,0,10,0,0,1.00E-04,0,"#,##0.##",,0,100,0,,,0,,,,,FALSE,,Default Historical,0.01,0,3,0,1,0,,FALSE,,[~]Expression Tag,,
,Expression Tag,,1,2,100,TRUE,Read_Write,,,Default,,0,0,100,0,10,0,0,1.00E-04,0,"#,##0.##",,0,100,0,,,1,"//This is an expression
100",,,,FALSE,,Default Historical,0.01,0,3,0,1,0,,FALSE,,,,
,Memory Tag,,1,7,I'm a memory Tag,TRUE,Read_Write,,,Default,,0,0,100,0,10,0,0,1.00E-04,0,"#,##0.##",,0,100,0,,,0,,,,,FALSE,,Default Historical,0.01,0,3,0,1,0,,FALSE,,,,
,OPC Tag,,0,2,,TRUE,Read_Write,Ignition OPC-UA Server,[devicename]folder/path,Default,,0,0,100,0,10,0,0,1.00E-04,0,"#,##0.##",,0,100,0,,,0,,,,,FALSE,,Default Historical,0.01,0,3,0,1,0,,FALSE,,,,
,Query Tag,,1,2,,TRUE,Read_Write,,,Default,,0,0,100,0,10,0,0,1.00E-04,0,"#,##0.##",,0,100,0,,,2,"/*Some Query*/
SELECT 100",,,,FALSE,,Default Historical,0.01,0,3,0,1,0,,FALSE,,,,

Property Values in the CSV Import

The following table shows the configuration property names and values contained in legacy CSV Tag import files. Tags were overhauled in Ignition 8.0, so the properties listed here are not the same as Tags export from an Ignition 8.0+ system. For modern tag properties, see the Tag Properties and Tag Property Enum Reference pages.

Tag Properties

Property Name

Type

Values (if applicable)

Description

Value

The value of the Tag, dependent on the data type.
Data TypeInt

0 - Int1
1 - Int2
2 - Int4
3 - Int8
4 - Float4
5 - Float8
6 - Boolean
7 - String
8 - DateTime
9 - DataSet


 EnabledBoolean true/false 
 TagtypeInt

0   - OPC Tag
1   - DB Tag (see ExpressionType)
2   - Client Tag
6   - Folder
13 - Derived Tag

Determines the type of the Tag. 

A value of one is a "DB Tag", which is either a Memory Tag, Query Tag, or Expression Tag, depending on the value of the ExpressionType field. 

ExpressionTypeInt

0 - None
1 - Expression
2 - SQL Query

Used in conjunction when the TagType is set to 1 (DB Tag), otherwise this field is ignored. 
 AccessRights Int0 - Read Only
1 - Read/Write
2 - Custom
If custom, will be defined by a Permissions Tag.
 OPCServerString 

 OPCItemPathString 

 OPCWriteBackServerString
Write back target for expression Tags.
 OPCWriteBackItemPathString

 ScaleModeInt 0 - Off
1 - Linear
2 - Square Root
3 - Exponential Filter

ScaleFactorFloat
For exponential filter.
RawLowFloat
Defines scale range.
RawHighFloat

ScaledLowFloat

ScaledHighFloat

ClampModeInt

0 - None
1 - Low
2 - High
3 - Both


DeadbandFloat

DeadbandModeInt

0 - Absolute
1 - Percentage


FormatStringString

EngUnitString

EngLowFloat

EngHighFloat

EngLimitModeInt

0 - None
1 - Low
2 - High
3 - Both


TooltipString

DocumentationString

DriverNameString
Used for external Tags.
ScanClassString
The export will only include the name of the Scanclass, not the configuration of the Scanclass itself. A Scanclass with the same name needs to already exist on the Gateway that the Tags are being imported to, prior to importing them.
HistoryEnabledBooleantrue/false
PrimaryHistoryProviderString
The history provider to use if storing history.
HistoricalDeadbandFloat

HistoricalDeadbandModeInt

0 - Absolute
1 - Percentage


HistoricalScanclassString

InterpolationModeInt

0 - Discrete
2 - Analog (deadband)
3 - Analog (compressed)

How values are interpolated. 2 exists for backwards compatibility (and is equivalent to 1), but only 0 or 3 should be used in the future.

HistoryTimestampSourceInt

0 - System
1 - Value


HistoryMaxAgeModeInt

0 - Unlimited
1 - Limited


HistoryMaxAgeInt
Max cycles between storage.
UDTParentTypeString

The path to the parent UDT type. Used by sub-types and instances.


JSON Example

In this example, we exported all Tags in our Tag Browser (with the exception of the Motor UDT). The following Tags were exported.

  • C Temp - Expression Tag with an Alarm
  • F Temp - Memory Tag with History Settings
  • OPC - OPC Tag
  • Motor 1 - UDT Instance



The following exported Tag file is in JSON format. As you browse through the JSON file, you will see the Tag properties and configuration settings for each of the four Tags listed above. 


Below is an example of a JSON format Tag export. Descriptions on the various properties can be found on the Tag Properties and Tag Property Enum Reference pages.

Exported Tags in JSON Format
{
"name": "",
  "tagType": "Provider",
  "tags": [
    {
      "valueSource": "expr",
      "expression": "(5/9) * ({[~]F Temp} - 32)",
      "dataType": "Float4",
      "sourceTagPath": "[ExportTags]F Temp",
      "name": "C Temp",
      "tagType": "AtomicTag"
    },
    {
      "valueSource": "opc",
      "opcItemPath": "ns\u003d1;s\u003d[Generic]_Meta:Sine/Sine0",
      "name": "OPC",
      "tagType": "AtomicTag",
      "opcServer": "Ignition OPC UA Server"
    },
    {
      "name": "Motor 1",
      "typeId": "Motor UDT",
      "parameters": {
        "MotorNumber": "1"
      },
      "tagType": "UdtInstance",
      "tags": [
        {
          "name": "Amps",
          "tagType": "AtomicTag"
        },
        {
          "name": "HOA",
          "tagType": "AtomicTag"
        }
      ]
    },
    {
      "name": "_types_",
      "tagType": "Folder",
      "tags": [
        {
          "name": "Motor UDT",
          "parameters": {
            "MotorNumber": ""
          },
          "tagType": "UdtType",
          "tags": [
            {
              "opcItemPath": {
                "bindType": "parameter",
                "binding": "ns\u003d1;s\u003d[Dairy]_Meta:Overview/Motor {MotorNumber}/Amps"
              },
              "valueSource": "opc",
              "dataType": "Int4",
              "name": "Amps",
              "tagType": "AtomicTag",
              "opcServer": "Ignition OPC UA Server"
            },
            {
              "opcItemPath": {
                "bindType": "parameter",
                "binding": "ns\u003d1;s\u003d[Dairy]_Meta:Overview/Motor {MotorNumber}/HOA"
              },
              "valueSource": "opc",
              "dataType": "Int4",
              "name": "HOA",
              "tagType": "AtomicTag",
              "opcServer": "Ignition OPC UA Server"
            }
          ]
        }
      ]
    },
    {
      "valueSource": "memory",
      "historyProvider": "MySQL",
      "dataType": "Float4",
      "alarms": [
        {
          "mode": "OutsideValues",
          "setpointA": 25.0,
          "setpointB": 75.0,
          "name": "Alarm"
        }
      ],
      "name": "F Temp",
      "historyEnabled": true,
      "value": 98.6,
      "tagType": "AtomicTag",
      "sampleMode": "TagGroup"
    }
  ]
}


XML Example

In this example, we exported the same four Tags from our Tag Browser, that were also used in the JSON example, in XML format. As you browse through the XML file, you will see the Tag properties and configuration settings for each of the same four Tags.


Below is an example of an XML format tag export. Descriptions on the various properties can be found on the Tag Properties and Tag Property Enum Reference pages.

Exported Tags in XML Format
<Tags MinVersion="8.0.0">
   <Tag name="" type="Provider">
      <Tags MinVersion="8.0.0">
         <Tag name="C Temp" type="AtomicTag">
            <Property name="valueSource">expr</Property>
            <Property name="expression">(5/9) * ({[~]F Temp} - 32)</Property>
            <Property name="dataType">4</Property>
            <Property name="sourceTagPath">[ExportTags]F Temp</Property>
         </Tag>
         <Tag name="OPC" type="AtomicTag">
            <Property name="valueSource">opc</Property>
            <Property name="opcItemPath">ns=1;s=[Generic]_Meta:Sine/Sine0</Property>
            <Property name="opcServer">Ignition OPC UA Server</Property>
         </Tag>
         <Tag name="Motor 1" type="UdtInstance">
            <Property name="typeId">Motor UDT</Property>
            <Parameters>
               <Property name="MotorNumber" type="String">1</Property>
            </Parameters>
            <Tags MinVersion="8.0.0">
               <Tag name="Amps" type="AtomicTag">
               </Tag>
               <Tag name="HOA" type="AtomicTag">
               </Tag>
            </Tags>
         </Tag>
         <Tag name="_types_" type="Folder">
            <Tags MinVersion="8.0.0">
               <Tag name="Motor UDT" type="UdtType">
                  <Parameters>
                     <Property name="MotorNumber" type="String"></Property>
                  </Parameters>
                  <Tags MinVersion="8.0.0">
                     <Tag name="Amps" type="AtomicTag">
                        <Property name="opcItemPath">{bindType=parameter, binding=ns=1;s=[Dairy]_Meta:Overview/Motor {MotorNumber}/Amps}</Property>
                        <Property name="valueSource">opc</Property>
                        <Property name="dataType">2</Property>
                        <Property name="opcServer">Ignition OPC UA Server</Property>
                     </Tag>
                     <Tag name="HOA" type="AtomicTag">
                        <Property name="opcItemPath">{bindType=parameter, binding=ns=1;s=[Dairy]_Meta:Overview/Motor {MotorNumber}/HOA}</Property>
                        <Property name="valueSource">opc</Property>
                        <Property name="dataType">2</Property>
                        <Property name="opcServer">Ignition OPC UA Server</Property>
                     </Tag>
                  </Tags>
               </Tag>
            </Tags>
         </Tag>
         <Tag name="F Temp" type="AtomicTag">
            <Property name="valueSource">memory</Property>
            <Property name="historyProvider">MySQL</Property>
            <Property name="dataType">4</Property>
            <CompoundProperty name="alarms">
               <PropertySet>
                  <Property name="mode">5</Property>
                  <Property name="setpointA">25.0</Property>
                  <Property name="setpointB">75.0</Property>
                  <Property name="name">Alarm</Property>
               </PropertySet>
            </CompoundProperty>
            <Property name="historyEnabled">true</Property>
            <Property name="value">98.6</Property>
            <Property name="sampleMode">2</Property>
         </Tag>
      </Tags>
   </Tag>
</Tags>




Related Topics ...


  • No labels