# Database driven tags / server load

**URL:** <https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261>\
**Category:** Ignition\
**Created:** [April 10, 2023, 2:14pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261 "2023-04-10T14:14:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [April 10, 2023, 2:14pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261/1 "2023-04-10T14:14:12Z")

</div>

I have 1000s of tags from UDTs that have some information coming from PLC and some information that is fairly static, but I want to be able to change the value based on data from an excel sheet.

Ignition servers are dark with no connection to internet or any other site (safety critical system)  
To be clear about process we have another Off site database that has all the data along with QA checks etc. When a change is made this database uses an excel macro file to hold the data. This excel sheet is then brought to the ignition network and we then need to load any change data into ignition.

My question are

1. Can you push data from excel into a memory tag without having Ignition grab that data itself (what we don't want is a change being made to the excel file and ignition grabbing data from that change without us telling it to from excel -- also don't want something like a change to the excel file -name etc- to break the connection) . I don't know of a way to do this in this fashion,

2. I believe the best way would be to have DB tables setup on the ignition server and have the Excel macro push data into the SQL DB server. My question on this route is if we have 1000s of tags linked to the SQL DB for tag values with 99% of the time those values not changing what kind of performance hit are we taking for this function. Maybe I just answered my own question -- set these tags Execution mode to event driven and have a SCADA button to rescan these DB values so even if the read is a huge SQL load it only happens when we tell it to.

That brings to mind if anyone has done this or could give some ideas on if we do option 2. Event driven change could we then for QA check display a list of all values that actually changed?

Not looking for full detail resolution / solve for this but more for general ideas and thoughts.  
If you have other ideas that I am not even considering here please share.

---

<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:** [April 10, 2023, 2:19pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261/2 "2023-04-10T14:19:32Z")

</div>

Modern Ignition can script completely custom reading and writing of Excel files using the Apache POI libraries. You don't say whether you are using Perspective or Vision, but that just impacts how you get the file into your algorithm. After that you have total control over what you read from the spreadsheet and where you put those values.

Related prior topics:

[https://forum.inductiveautomation.com/search?q=Apache%20POI%20Excel%20order%3Alatest](https://forum.inductiveautomation.com/search?q=Apache%20POI%20Excel%20order%3Alatest)

---

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [April 10, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261/3 "2023-04-10T14:29:08Z")

</div>

> [@pturmel](#):
>
> m. After that you have total control over what you read from the spreadsheet and where you put those values.

mainly for QA reasons we want to PUSH the data from excel into ignition and not have ignition read from the excel file. The excel file will only exist on the ignition server for the time to make the change and then be deleted. A new file would be brought at later date to make other changes then deleted. If excel file is somehow left and someone makes a change to it we don't want that data getting into ignition. Only when certain conditions are met do we want excel to push that data into ignition.

---

<div class="post-metadata">

**Author:** ![j.israelsen](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@j.israelsen](https://forum.inductiveautomation.com/u/j.israelsen)\
**Post date:** [April 10, 2023, 2:41pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261/4 "2023-04-10T14:41:39Z")

</div>

The other day I came across this "CSV Tag Write Tool" on the Ignition Exchange:

> **[Ignition Exchange](https://www.inductiveautomation.com/exchange/2440/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

Not sure if is exactly what you are looking for but perhaps it will be helpful for updating the Ignition from a CSV. Note, I think this would entail Ignition getting the data from the file (not the file writing to Ignition).

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 10, 2023, 4:15pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261/5 "2023-04-10T16:15:45Z")

</div>

Ah yes, safety critical Excel sheets 🙈

I would consider your option 2 reasonable. Thousands of rows (as long as it's truly _thousands_, and not hundreds of thousands) is child's play for any decently specced DB. And putting the data into a DB abstracts Ignition and whatever process generates these Excel sheets away from each other, which is a good thing if you ever decide to change either end. Cough, cough.

---

<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:** [April 10, 2023, 6:17pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261/6 "2023-04-10T18:17:39Z")

</div>

> [@rfolkes](#):
>
> Only when certain conditions are met do we want excel to push that data into ignition.

I think you completely missed what I was suggesting. I am **not** suggesting placing an Excel file in a static place in the Ignition gateway to be read. Let's revisit and answer your OP questions:

1. No, there's no way for Excel to write directly to Ignition tags. You could make a Webdev API to support external writes to tags. Brace yourself for a bunch of code in both Ignition and Excel if you go that route.

2. Yes, you can make a DB connection from Excel to push updates, and have Ignition monitor the DB to write to tags. Brace your self for a bunch of code or configuration in Ignition and code in Excel.

My suggestion would work like this:

\*) In either Perspective with a file upload component, or Vision with an Open File browser operation, initiated by a suitably authenticated operator, open a file from the client side.

\*) In the associated script, directly access the file content with the Apache POI libraries. In Perspective, this means **not** placing the file bytes in a gateway local file. In Vision, the file would be client-local the whole time.

\*) From either source, use the Apache POI API to access the sheets and cells of the spreadsheet, using some pre-defined layout, and write the retrieved values directly to the appropriate tags. Or perhaps to "staging" tags with a followup review-and-approve User Interface.

With this approach, updates to the tags are initiated by a human, from a client-side spreadsheet file. No code is required in the Excel file. The code in Ignition need not make any database calls, just move spreadsheet cell values to tags.

---

<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:** [April 10, 2023, 6:24pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261/7 "2023-04-10T18:24:26Z")

</div>

Side Note:

Not having any code in the Excel file makes it possible to avoid having an actual copy of Excel in a workstation within your isolated, production network. If you must open such a file on that network, LibreOffice will do a beautiful job, but won't run any Excel macros or VBA. Which is good. And you can avoid the engineering malpractice of installing any copy of Windows itself on any machine connected to that network.

---

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [May 3, 2023, 4:33pm UTC](https://forum.inductiveautomation.com/t/database-driven-tags-server-load/72261/8 "2023-05-03T16:33:15Z")

</div>

Thanks for the ideas. I think we have moved to either

A) Have the Excel push the data into the PLC (we are already doing this and this function will not change) - Then Ignition reads those PLC tags (at a slow rate and or triggered by user undetermined at this time) Value change script on those tags then updates DB appropriately.

B) Excel push data directly into the DB using SQL in excel and tags in ignition read form the DB.

Which method we use will depend on memory load on PLC.
