# JSON Based Tag Export

**URL:** <https://forum.inductiveautomation.com/t/json-based-tag-export/66699>\
**Category:** Ignition\
**Created:** [November 18, 2022, 6:09pm UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699 "2022-11-18T18:09:18Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Bowers](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@John\_Bowers](https://forum.inductiveautomation.com/u/John_Bowers)\
**Post date:** [November 18, 2022, 6:09pm UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/1 "2022-11-18T18:09:18Z")

</div>

I am working on a modbus device for the first time (that I recall), and I am struggling on the tag naming.

With 10,000+ tags, and a tag export being formatted as a .json rather than CSV, what is the recommended/suggested method of mass editing tag names?  
At the moment it seems like my options are to either hand type/copy+paste thousands of tags, or to write a program to audit my modbus address export and my PLC tag export to cross reference multiple fields and assign the proper names from there.

I can't seem to find a good method of doing this, but this seems incredibly poorly designed to the point I can't believe those are the only two options I have.

For a home project with a few tags I would probably just label them myself, but for any industrial applications this seems absurd.

I've tried doing a data read from file in excel to get it formatted into something that I could write a macro on, but then exporting it out of excel back to json is seeming slightly problematic.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 18, 2022, 6:27pm UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/2 "2022-11-18T18:27:28Z")

</div>

Do you have repeating patterns in the layout of your modbus addresses? If so, use an Ignition UDT, where the UDT has parameters for device name an base holding register address. Within the UDT, define all of the tags for that pattern, using arithmetic to generate the actual modbus address from the base address parameter.

Then you create instances of the UDT to create many tags at a time. With nice repeating naming conventions.

---

<div class="post-metadata">

**Author:** ![John\_Bowers](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@John\_Bowers](https://forum.inductiveautomation.com/u/John_Bowers)\
**Post date:** [November 18, 2022, 6:41pm UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/3 "2022-11-18T18:41:29Z")

</div>

No such luck in any regard. The original programmers of the PLC seemed to actively avoid planning ahead. The modbus addresses, types, and purposes are entirely randomized.  
(We have multiple instances of addresses such as: 404426 (int), 404427 (float), 404429 (int), 404430 (float), 404432(uint), 404433(int), etc).  
The I/O cards seemed to have even been randomized with 3 outputs to one skid, 3 to the second skid, then 1 to 3rd, 1 to 4th, 1 to 3rd, 1 to 4th, etc).

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 18, 2022, 6:43pm UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/4 "2022-11-18T18:43:37Z")

</div>

Can you clarify... do you already have Ignition tags created for all these and you're just trying to edit the tag name or audit them vs a CSV reference list? Or are you trying to figure out how to create all these tags?

---

<div class="post-metadata">

**Author:** ![John\_Bowers](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@John\_Bowers](https://forum.inductiveautomation.com/u/John_Bowers)\
**Post date:** [November 18, 2022, 6:49pm UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/5 "2022-11-18T18:49:52Z")

</div>

I have created all of the tags and confirmed the values are as desired per modbus address.

Now I am trying to edit the ignition tags such that the tag name of the prefix### format becomes the symbolic name of the PLC such as Tank1\_Level instead of WTP\_Int376

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 19, 2022, 1:02am UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/6 "2022-11-19T01:02:34Z")

</div>

> [@John\_Bowers](#):
>
> We have multiple instances of addresses such as: 404426 (int), 404427 (float), 404429 (int), 404430 (float), 404432(uint), 404433(int), etc).  
> The I/O cards seemed to have even been randomized with 3 outputs to one skid, 3 to the second skid, then 1 to 3rd, 1 to 4th, 1 to 3rd, 1 to 4th, etc)

Sounds like a good job to say "Your mess, your problem. Thanks, but no thanks!" to 😄

> [@John\_Bowers](#):
>
> prefix### format

What do you mean by this?

Renaming the tags will likely be more difficult than just creating the tags again with the same config, in script of course. I have my own tag creation scripts/Excel pair that I use for this. I can read tag json and convert it into an Excel table. I can edit Excel table and convert it back into tag json. It's more work than I would share on here though sorry

---

<div class="post-metadata">

**Author:** ![John\_Bowers](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@John\_Bowers](https://forum.inductiveautomation.com/u/John_Bowers)\
**Post date:** [November 19, 2022, 2:04am UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/7 "2022-11-19T02:04:17Z")

</div>

Sadly not an option for a new controls company just getting started.  
And the original programmers are long gone. We've gotten the project to redo their current SCADA in ignition almost solely off the fact we are willing to help!

The prefix meaning was for the address additions in Ignition, where you enter the prefix and then the start/stop addressing.

The json converting in and out of excel seemed to be the only route, but I just thought that was too inefficient to possibly be the expected method. I'll get that process going once this project is concluded and have it ready for the next.

I'll take this time to encourager the csv export function from 7.X be put back in, I'm not sure why it was removed in favor of the .json, especially given the import sitll allows it. That seems like a much more natural way of doing this.  
I did find the .csv import example, so I may try that. I was just used to 7.X (and every other PLC/software) being an export as csv, macro to alter names, import csv.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [November 19, 2022, 2:12am UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/8 "2022-11-19T02:12:41Z")

</div>

> [@John\_Bowers](#):
>
> for any industrial applications this seems absurd

Yes. It is. For a few tags from an instrument or something, fine. For a large PLC project, Modbus is a poor choice.

This may not be an option in this case, but I typically find it's faster and gives a better end result to reprogram the PLC from scratch (using prebuilt function blocks / AOIs for nearly everything) in cases where the original programmer has left a mess.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [November 19, 2022, 2:14am UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/9 "2022-11-19T02:14:45Z")

</div>

> [@witman](#):
>
> in cases where the original programmer has left a mess

Amen. Even when the original was unfortunately an earlier less experienced you.

---

<div class="post-metadata">

**Author:** ![John\_Bowers](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@John\_Bowers](https://forum.inductiveautomation.com/u/John_Bowers)\
**Post date:** [November 19, 2022, 4:55am UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/10 "2022-11-19T04:55:52Z")

</div>

Also not an option.  
Their current SCADA uses modbus to read the tags and they no longer have editing access to it. I have to get the current one working without altering that one's functionality.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 19, 2022, 11:48am UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/11 "2022-11-19T11:48:53Z")

</div>

The issue with a csv is that bindings and more complex values like lists of dictionaries (eg alarms) are "hard" to place into a single cell's value. Unless you do just copy the whole value as a json string into those values. This is what I do in my script, and I interpret complex structures the other way as well, but it's not intuitive at all to create those json strings in Excel... At the moment I just have a formula that creates the structure from values in other cells, but for alarms I only handle tags with single alarms attached. Multiple alarms would be a nightmare! Properties like writePermissions are also ugly to create in excel

---

<div class="post-metadata">

**Author:** ![John\_Bowers](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@John\_Bowers](https://forum.inductiveautomation.com/u/John_Bowers)\
**Post date:** [November 20, 2022, 5:54pm UTC](https://forum.inductiveautomation.com/t/json-based-tag-export/66699/12 "2022-11-20T17:54:03Z")

</div>

I'm glad you brought that up, as that's the first reasoning that I've seen to justify not having the .csv.  
Makes more sense now, but would still be an excellent feature for new installations.

I'm manually editing this time around, as the excel json import/exporting is new to me and was not all that intuitive from what I saw messing with it briefly.  
Once this project concludes I'll research that and have something made to have a prepared response to future installs.

If you have any files or recommended points to look into to assist, that would be lovely.

I appreciate everyone's recommendations thus far.
