You can help by flagging or editing this transcript. We'll review any changes before posting them.
We are experiencing playback issues from our video hosting provider. Please check back shortly.
4:03Tags in Ignition
6:37Importing and Exporting Tags
Take topic challenge
Learn how to transfer Tags from system to system using built-in Import and Export features.
Video recorded using: Ignition 8.0
Transcript(open in window)
[00:00] In this lesson, we'll talk about tag imports and exports. In some cases, you may need to backup just your tags, say you're going to make some large scale changes to a particular tag provider, it might be a good idea to backup just the tags. Now you can always take a full system backup, so you could take a gateway backup, which will include your tags, the downside to the gateway backup, though, is it does temporarily stop the service, whereas a tag import you can do while the gateway is running. Tag exports and imports are facilitated from the Tag Browser in your Designer. You simply need to select the tag, or folder you're trying to export, so in this case I could actually grab my tags folder here, which would be my entire tag provider, and press the export button, that's at the top of the Tag Browser. You'll get a little save window here, I'll simply save my files to my desktop for right now, we do support two different file types, that'd be XML, and JSON, I'll leave it with the default for right now and just press the save button, and it let me know that it finished exporting, so we'll click okay again. If you wanted to export your tags as XML, it's actually a really easy change to make, we'll try that again, we will export our tags, but this time we'll simply change the file extension to XML, that will create in an XML document instead of a JSON document, as well as change the format of the file. So we'll save that, and hit okay. If you wanted to import from one of those files, again, you simply need to select wherever you want to import into. Now, be mindful of where you import this into, so again, if I select this refrigeration folder, and I import my tag provider, I will recreate my tag provider inside of this folder. So just be cautions of what you have selected first. I'll drop my import file at the root of my tag provider again, and this time we'll press the import button, we'll grab one of our files here, and you will note, down below, under files of type, that CSV is supported, this is mostly for legacy purposes. The legacy CSV format, in older versions of Ignition, does not include alarm configurations in the exported file so we prefer you use XML or JSON nowadays, but newer versions of Ignition can read those old files. Now you'll want to be aware of the Collision Policy on the right-hand side. Basically, when we're importing your tags from the file here, how should we handle any sort of path collisions that exist inside of the tag provider? So with abort you'll actually get a little error message at the end, I'll just hit open, but it's actually a report letting me know that there were some path collisions between the file I'm importing, and the tag provider I'm importing in to. Now if you didn't want the big error message here, we can close this, we could try that again, we'll import, you could simply set the Collision Policy to ignore, so if there is any sort of conflict it just skips and moves on, without the error message. Now, talking about these files and importing them real quick, I'll hit cancel here, note that we do have a refrigeration folder. Now if I go and I take a look at the files that we exported, I'll simply modify the JSON file, so I'll right-click, I'm going to edit with Notepad++, but of course you can use your preferred text editor, or JSON editor, we can see that I have my refrigeration folder, so how about we just change the name here? So this'll be my new refrigeration folder, or my refrigeration_new folder. Now, all of the tags that are under this one folder, they're going to be placed under a new folder. So I will actually get new tags, at a different path. Now the reason I'm showing you this, technically when I save here, this file that I exported, it no longer has a folder called refrigeration, there's only refrigeration_new in the other folders, right? So when we're looking at this, if I try to import into my Tag Browser, the import is not going to delete refrigeration, refrigeration's going to stay. So if we try that right now, we'll import, I'll grab the JSON, and just because I don't want the errors let's go ahead and ignore anything else. I'll hit open. You can see that it added the new folder, and it didn't touch the old one, so when you're working with these exported files, and you import, if there's isn't a tag at a specific node, we don't delete nodes. We don't delete folders, and other tags, we can potentially overwrite them, you did see that as one of the import settings here, I could change the Collision Policy to overwrite, if there's a collision, but we won't delete. Now, of course, this makes large scale editing of tags a bit more simplistic. The Designer does have its own find and replace, that's with CTRL+F or Command+F, and it does allow you to search for tags, and do some find and replace, but sometimes it's nice to do that in an external editor of some sort. So, again, I could try editing one of these files, you could always do a find and replace, say you needed to update the name of a device connection, or you needed to change the data type on a whole bunch of your tags. You could just export the entire tag provider, make the changes, save the file, and import back in from the new file. Now, as best practices go, this one's kind of common sense, if you're going to do any sort of external editing of these export files, it's usually a good practice to save those changes in a separate file, so that way you have a file of your tag provider before you made any modifications, and then you have the newly created modified version. And the reason for that, say for example, I did go back into my Designer here, say I did exactly what I told you not to do, which was select a folder and then import your entire tag provider into that folder, maybe you want to do that, but in this case I don't, so I'm going to try to import again, we'll go and grab that tags.json, and shouldn't be any collisions, but we'll set it to ignore anyways, I'll hit open, and if we take a look inside of that sine folder, we can see that I basically recreated the sine folder as well as everything else. So if that does happen, sometimes it's a little bit easier to just delete the old nodes, so I could delete sine here. Select my tags folder, and then just reimport from your original files, so it's a good idea to have an unedited original backup file, 'cause then you could just simply reimport, and again we'll set it to ignore, hit open, and now I'm back to where I was.