# Ignition Designer Freezing with a History Tag

**URL:** <https://forum.inductiveautomation.com/t/ignition-designer-freezing-with-a-history-tag/114823>\
**Category:** Ignition\
**Tags:** vision, ignition83\
**Created:** [April 1, 2026, 2:44am UTC](https://forum.inductiveautomation.com/t/ignition-designer-freezing-with-a-history-tag/114823 "2026-04-01T02:44:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [April 1, 2026, 11:32am UTC](https://forum.inductiveautomation.com/t/ignition-designer-freezing-with-a-history-tag/114823/2 "2026-04-01T11:32:30Z")

</div>

_Edit: This reply was based on it being Perspective, not Vision. The content still applies mostly, but scripts in Vision run in the EDT which is single-threaded._

Multiple things going wrong here:

- Never import libraries within a function. Imports should be at the top of a script library. Performance impact
- Never import `system`. This is always\* available and can cause issues if imported.
- You’re trying to run a history query from the start of this year until now, every second. This is impossible. You’re likely ending up with stacked threads all querying tag history, and they’re building up not able to keep up with your request rate. The database is also being hammered with queries looking at significant amounts of data.

I would be curious to see exactly how long it _does_ take the script to run..

However, I'll say that I would move this into a tag instead which accumulates hours and historise the tag if you need to trend it, but use the accumulator tag _value_ to show runtime, not queries / tag history. Ideally the tag should be accumulated in the plc, not scada. But if youre just wanting “decent” runtime values, scada will be OK.

I think this looks OK, although I don't know how accurate it will be…

> [@How to implement Accumulator](https://forum.inductiveautomation.com/t/how-to-implement-accumulator/9952/4):
>
> EDIT: 2020-09-11 Edited to new forum format Using only SQLTags: The Trigger tag doas all the work. In the Expression/SQL section: if({[.]Filling}, (if((dateextract(now(),"sec")/2)=toInt((dateextract(now(),"sec")/2)),1,0)+1), 0) In the Tag Events/Value Changed Script: if currentValue\>0: flow=system.tag.read("[Client]Accumulator Test (JC)/Flow").value/60 total=system.tag.read("[Client]Accumulator Test (JC)/Total").value system.tag.write("[Client]Accumulator Test (JC)/Total",total+fl…

A bit dated though.

For the expression tag expression I'd be using:

```python
if({[.]running tag}, getSecond(now()) % 2, -1)

```

That will flip flop the value every second to create the accumulation pulse trigger. Use that to trigger its value change script to run if value \>=0 which reads the current value of your memory accumulator tag, and add 1s to it

Note: it's not usually recommended to call tag.read / writeBlocking from tag event handlers since they can sometimes take time to read if there are issues, but memory tags are an exception.

---

_[View the full topic](https://forum.inductiveautomation.com/t/ignition-designer-freezing-with-a-history-tag/114823)._
