Add Multiple Tags
9 min
you can add tags to connected devices by navigating to devicehub > tags to learn more about registers for specific devices, see the industrial systems connection guide docid\ er7j0mogtlktbxyupdcd before you begin before creating tags, make sure you have connected a device refer to connect a device docid\ pal6abpzbrimdu9lvgj30 important refer to the following information on free tags and opc ua drivers certain device drivers do not have a list of register names in the add tag form these are referred to as free tags you must enter case sensitive register names exactly how they are defined in the device devices do not display a connected status until a tag with a correct register name is created see device connectivity issues docid\ duoc4zw wfvhotuxjzbzl for more information for opc ua, map the opc server tags to the client enter the register name using this format where the semicolon is required ns=1;s=tagname for example ns=2;s=channel1 device1 tag1 add multiple tags you can add multiple tags at once by downloading a csv template file, filling out the file with tag details, and uploading the csv file important when saving the csv file, you must ensure that commas are used as column delimiters and not semicolons if semicolons are used as column delimiters, you won't be able to upload the csv file successfully see tag upload through csv issues docid\ tz7nwvxup1isuavobitbg to learn more step 1 download a sample csv template you will need to download a template csv file that has the required fields for the tags you will add to download a sample csv template from the tags pane, s elect download all tags as csv the sample tags csv is downloaded to your local drive step 2 populate the csv template file you can now populate the csv template with the tags that will be added a row/record for each tag must be populated with attribute values, as described below refer to the industrial systems connection guide docid\ er7j0mogtlktbxyupdcd and review the tag parameters section for your device if tags for the device have additional fields that are not included in the template file, add them as required the order of the attribute columns in the template file may be in any order refer to the following sections for information on populating the csv template file example of a tag csv file deviceid devicename drivername name tagname description valuetype registerid publishcov tagformula metadata pollinginterval a581b3e2 12cc 4a69 92c0 2c09dafc5148 test device ab compactlogix ethernet freetag testregistername testtagname sampledescription bool true value+timestamp+100 {"metadatakey1" "metadatavalue1"} 1 tag attribute rules the devicename is required to find the corresponding device the deviceid can be omitted if the deviceid is not included, a device name not found error displays, but the tags will still be successfully added attribute values are required unless noted as optional if an optional value is null, it is ignored this allows for the loading of register definitions for multiple device types from a single file if the value is null and the device driver defines it as mandatory, the tag is not imported if an optional value is present in the csv file, but it is not supported by the device driver, it is treated as an error and the tag is not imported attribute columns in the csv can be in any order attribute name data type description required deviceid string id of the device use the copy icon to get this value from the device tile in devicehub > devices if a device identified by the deviceid is not found, devicename is used no devicename string the name you configure for the device yes drivername string driver name is for validating optional attributes against registration json this type should directly correspond to the name of the driver package use the copy icon to get this value from the device tile in devicehub > devices no name string plc register name or full plc register address depends on valuetype this name is case sensitive yes tagname string the name you configure for the tag yes description string the description you configure for the tag no valuetype string type of the register value a vailable selections depend on the register table of the device e xamples bit, word yes registerid string a unique register id generated for this tag leave this value blank as it is generated when the tag is created no publishcov boolean a flag that indicates whether the only publish on change of value setting is enabled if left bank, the value false is set by default no tagformula string a formula that will transform the tag payload value to a new final value this column is empty when no formula entered available formula parameters are value current tag value timestamp current tag unit time in milliseconds available math functions include sin , cos , sqrt , tan , power , log , and exp example formula sin(value) + 1 for additional functions on tag values such as rounding and data conversions, you can use analytics docid 8aloe 5 c9ubqjsw0ppcx or the flows manager docid\ jghnqyhxbik8x2nhh5vte see analytics guides docid\ xrlqsbhj0 rdauedlzy54 and flows guides docid\ ccnpmwlj32yt95tvrdhj3 to learn more no metadata string a json formatted string containing one or more metadata key value pairs no pollinginterval float polling interval in seconds defines how often the tag polls the driver for a value 0 means auto polling disabled 1 means poll every 1 second if left blank, a value of 1 applies no csv formatting and escaping rules as csv format is not standardized, several different methods could be used for escaping special characters the litmus edge csv specification adheres to the rules used by microsoft excel, as listed below field separators must be a semicolon ( ; ) fields can have white spaces around them this space is removed during processing fields can be escaped with double quotes ( " ) or single quotes ( ' ) leading or trailing white spaces inside the quotes are preserved any separator characters within a quoted field is treated as part of the field value any quotation character in a field value must be escaped with a backslash ( \ ) character fields are parsed based on their data type string values are read "as is" and numeric values are parsed with a numeric parser empty fields are treated as null values step 3 upload populated csv file of tags once the csv template file is populated, you can upload it to add all tags that were added to the file to upload a populated csv file from the tags pane, click add tag , and then select upload csv the upload tags dialog box appears click select csv select the file to upload and click open from the upload tags dialog box, click upload upon a successful upload, the tags appear in the tags pane if the details in the csv file do not match the expected configuration, error messages indicate the issues