# Connecting 3000 tags using script that makes Ignition gateway restart automatically (ERROR)

**URL:** <https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899>\
**Category:** Ignition\
**Tags:** python, ignition81, scripting, perspective\
**Created:** [March 6, 2024, 2:25pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899 "2024-03-06T14:25:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahad\_Ahad](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ahad\_Ahad](https://forum.inductiveautomation.com/u/Ahad_Ahad)\
**Post date:** [March 6, 2024, 2:25pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/1 "2024-03-06T14:25:26Z")

</div>

I am trying to read the DB from the siemens PLC. The DB contains an ARRAY captured from the photocells. I want to see the array value on the perspective. I created an array visual to perspective (attached image) and linked with the script (script image attached) which is reading value from the tag and printing on the label array. I have used system.tag.read function for this purpose. Now the problem is it cant handle reading all the values and the goes to restart automatically. How to achieve this goal? Any Idea. Or I need to connect tag 1 by 1 (Total 3000 tags)

Need HELP!

 ![MatrixImage](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/b/7b6828673d28b8cad04bf13355244d5a71796d48.jpeg)  
 ![ScriptMatrix](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/9/b9b8b59dea36a3a36169bbf7ccceec56fb88f538.jpeg)

---

<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:** [March 6, 2024, 2:26pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/2 "2024-03-06T14:26:57Z")

</div>

Doing 3,000 individual `system.tag.read` calls inside a _transform_ is... bad.

---

<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:** [March 6, 2024, 2:27pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/3 "2024-03-06T14:27:07Z")

</div>

You are trying to process 3000 tags, one at a time, every 100 milliseconds?

---

<div class="post-metadata">

**Author:** ![Ahad\_Ahad](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ahad\_Ahad](https://forum.inductiveautomation.com/u/Ahad_Ahad)\
**Post date:** [March 6, 2024, 2:30pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/4 "2024-03-06T14:30:11Z")

</div>

Ok then any good solution?

---

<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:** [March 6, 2024, 2:30pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/5 "2024-03-06T14:30:12Z")

</div>

But I'm going to guess that it isn't the tag reading that crashes your gateway, but some astonishingly inefficient repeating Perspective view gobbling up RAM.

---

<div class="post-metadata">

**Author:** ![Ahad\_Ahad](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ahad\_Ahad](https://forum.inductiveautomation.com/u/Ahad_Ahad)\
**Post date:** [March 6, 2024, 2:31pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/6 "2024-03-06T14:31:24Z")

</div>

Yeah tag reading is not crashing the gateway. I think the script is

---

<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:** [March 6, 2024, 2:32pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/7 "2024-03-06T14:32:06Z")

</div>

The script **is** the tag reading.

How have you constructed the view?

---

<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:** [March 6, 2024, 2:32pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/8 "2024-03-06T14:32:31Z")

</div>

At the very least you could read all 3,000 tags in a single call to `system.tag.readBlocking`, but I think there are probably larger design flaws that need to be addressed here.

Doing this inside a transform every 100ms isn't great, and as @pturmel hinted this page/view design may have issues of its own...

---

<div class="post-metadata">

**Author:** ![Ahad\_Ahad](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ahad\_Ahad](https://forum.inductiveautomation.com/u/Ahad_Ahad)\
**Post date:** [March 6, 2024, 2:35pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/9 "2024-03-06T14:35:34Z")

</div>

There are 62 columns (Each column is a template). Each column contains 47 labels. So the template is repeated 62 times (embeded view).

so it is a 62x47 matrix.

Each column is connected to a script shared above in the image. Each column is trying to read 47 tags using script.

---

<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:** [March 6, 2024, 2:38pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/10 "2024-03-06T14:38:26Z")

</div>

Please don't take this the wrong way, but that was a _poor_ design choice.

How is a "single" label intended to work?

---

<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:** [March 6, 2024, 2:39pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/11 "2024-03-06T14:39:10Z")

</div>

Ooooo! Even _ **worse** _.

That script isn't reading just the elements from start to stop, since your `range()` expression doesn't involve `start`. So the embedded views are all starting at array subscript zero. The latter ones would be reading all 3000. So you are actually trying to read (62 \* 3000)/2 =\> 93000 tags, one at a time, every 100ms.

And trying to push them into a complex nested view setup.

---

<div class="post-metadata">

**Author:** ![Ahad\_Ahad](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ahad\_Ahad](https://forum.inductiveautomation.com/u/Ahad_Ahad)\
**Post date:** [March 6, 2024, 2:43pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/12 "2024-03-06T14:43:50Z")

</div>

Ok so I understood that the design is poor.

Lets make it simple.

If I have 3000 small labels on the perspective screen and I want to read all the 3000 tag values and push those values to the labels then what would be a general idea for this?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [March 6, 2024, 2:44pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/13 "2024-03-06T14:44:45Z")

</div>

Honestly I'd probably do a gateway script that pulls the data you need into a dataset tag and then display it via a table that is bound to that dataset tag.

---

<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:** [March 6, 2024, 2:44pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/14 "2024-03-06T14:44:50Z")

</div>

Well, that depends on what the label is supposed to do. What are you trying to do with them, perhaps a Label isn't the best component for the task.

---

<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:** [March 6, 2024, 2:45pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/15 "2024-03-06T14:45:56Z")

</div>

You need to not have 3000 components on screen, full stop. Perspective just won't be able to handle that well.  
A Table might work, with advanced row customization (but don't use embedded views!) but your best bet is going to be rendering a custom SVG out via script and displaying that single element.

I want to say there was a thread with a similar problem on this a while back...

---

<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:** [March 6, 2024, 2:47pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/16 "2024-03-06T14:47:17Z")

</div>

> [@paul-griffith](#):
>
> bet is going to be rendering a custom SVG out via script and displaying that single element.

This is where my brain is at as well, just trying to figure out what is supposed to happen based on the value of the individual tags.

---

<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:** [March 6, 2024, 2:47pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/17 "2024-03-06T14:47:50Z")

</div>

> [@Perspective - Best Way To Display Grid 10,000 x 384](https://forum.inductiveautomation.com/t/perspective-best-way-to-display-grid-10-000-x-384/50526):
>
> All, I have data that is just 1s and 0s. I am reading the bits out of 120,000 DINTs. That’s a burden as it is, but now I am trying to display this in a grid format (0=Color 1, 1=Color 2). I tried to create a table that was 10,000 rows and 384 columns via a script without any data even in it. Once I get out to about 100 columns at 10,000 rows deep, my gateway crashes. Am I missing a very simple way to display this information?

This thread may be useful to you, OP, for a fundamentally different approach.

---

<div class="post-metadata">

**Author:** ![Ahad\_Ahad](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ahad\_Ahad](https://forum.inductiveautomation.com/u/Ahad_Ahad)\
**Post date:** [March 6, 2024, 2:48pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/18 "2024-03-06T14:48:27Z")

</div>

I purpose that I am trying to achive is to put labels in the matrix form and read the values from the tags (integer values) which are coming from the photocells and analyse them.

---

<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:** [March 6, 2024, 2:48pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/19 "2024-03-06T14:48:47Z")

</div>

What datatype are these tags, and how do you want to show them? (I'm thinking a table with 62 columns, styled by cell.)

---

<div class="post-metadata">

**Author:** ![Ahad\_Ahad](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ahad\_Ahad](https://forum.inductiveautomation.com/u/Ahad_Ahad)\
**Post date:** [March 6, 2024, 2:53pm UTC](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899/20 "2024-03-06T14:53:49Z")

</div>

Integer datatype and I want to show them in integer form on perspective. Table could be good choice but do I need to convert the array of integers into dataset or something?

[Next page](https://forum.inductiveautomation.com/t/connecting-3000-tags-using-script-that-makes-ignition-gateway-restart-automatically-error/86899.md?page=2)
