# Method for causing Navigation Tabs to Blink

**URL:** <https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500>\
**Category:** Ignition\
**Created:** [February 12, 2019, 12:36pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500 "2019-02-12T12:36:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![danFromNj](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@danFromNj](https://forum.inductiveautomation.com/u/danFromNj)\
**Post date:** [February 12, 2019, 12:36pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/1 "2019-02-12T12:36:51Z")

</div>

I have a project where I am using the Navigation Tabs and I need certain tabs to blink based on whether certain alarms exist in the system.

I was able to get them to blink by setting up custom properties in the Root Container of the window that contains the Navigation Tabs. The custom properties are the tab colors and are bound to an expression that will change the color based on a "Blink" tag that changes once per second. The Navigation Tabs use the Cell Update binding to link the color to the custom property. This works fine EXCEPT that this causes the CPU usage of the client to (over a period of about 2-3 hours) increase to a point where the computer running the computer is unresponsive.

The CPU increase is absolutely caused by the Cell Update. If I leave the whole project alone but remove this binding, the client will run endlessly without problem.

I decided to try a different method. I am using the propertyChange script in the Root Container. When the color in the custom property changes, the navigation tab colors are adjusted. In testing, this method is no better and the CPU usage starts to climb pretty quickly.

I am running the server on a Windows 7 64-bit machine. It is using version 7.9.10. I have found two previous posts where people saw this same problem.

> [@Animating Tab Strip Navigation Component](http://forum.inductiveautomation.com/t/animating-tab-strip-navigation-component/17352/6):
>
> Take a look at this… It is crude, and simple, but maybe it’ll give you an idea of what to do. I am by no means an expert! There should be comments in a text area, and more in the scripting. [NavigationFlash\_2018-03-13\_1405.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/20ff9f17b9d91b6a893c3c0567569d385021c287.proj) (24.1 KB)

> [@Vision Client slowdown](http://forum.inductiveautomation.com/t/vision-client-slowdown/14463):
>
> Hi I have a problem. After a little time (1h), the vision client slows down. After 2h, the are very slow. The bug grows with time. If you restart the vision client, the vision client work correctly for one moment. I am in vs 7.7.8. I am try vs 7.9.2 and it’s the same. I am try to find the problem. I see client diagnostics and the memory rises and falls. I am use ignition vs7.9 new functionality for try to find my problem. In web server, status, Vision Clients, Client Details, in …

Does anybody know a method for doing this that will not cause the CPU usage to become completely unstable?

---

<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:** [February 12, 2019, 1:03pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/2 "2019-02-12T13:03:17Z")

</div>

Well, that would be a memory leak. Nailing it down would take a very detailed look at your system. And fixing it would probably require IA’s involvement. Aside from involving IA, consider trying to minimize the creation of objects in you blink subsystem, like color objects. I would create custom color properties for each color you will use in your backgrounds, and have the blinking colors’ expressions simply select from those instead of converting from strings everywhere. That will limit the blinking’s object creating to just the dataset driving the tabs. Consider also using a timer event or timer component to consolidate that dataset construction to a single event script, blinking everything together in a single dataset change. That also eliminates the use of cell update bindings, which make a new dataset object on every evaluation of the binding.

---

<div class="post-metadata">

**Author:** ![danFromNj](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@danFromNj](https://forum.inductiveautomation.com/u/danFromNj)\
**Post date:** [February 12, 2019, 1:26pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/3 "2019-02-12T13:26:50Z")

</div>

Thank you for the reply.

I know that the memory leak is coming from the Cell Update since if I turn off that binding, the memory leak goes away. I have tried to get IA involved but they were unable to get anywhere with the problem. This is why I am now turning to the forums.

I am also using color properties. I have a custom color property that is the default color and one for the alarm color. Based on the “Blink” state, it sets the color to used in the Cell Update to the correct custom property.

I have now switched to scripting, instead of the cell update. I have added a Blink custom property to the Navigation Tabs. When this property changes, it will update all the tab colors in one shot. This causes the dataset to only get updated once per blink. I have to give it some time to run to see if this “fixes” the issue.

---

<div class="post-metadata">

**Author:** ![danFromNj](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@danFromNj](https://forum.inductiveautomation.com/u/danFromNj)\
**Post date:** [February 12, 2019, 2:38pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/4 "2019-02-12T14:38:16Z")

</div>

I changed the script so that it fires on the propertyChange for the “Blink” property. When it fires, it updates the colors in the Navigation Tabs dataset. I slowed the blinking down to once every 1.5 seconds.

This still doesn’t fix the problem. After about 1 hour to 1.5 hours, the CPU usage by the client has noticeably climbed and the memory usage continues to climb.

I feel like I am out of options on this. The only way to update the colors of the tabs is by rewriting the entire dataset. Even when this dataset update is reduced to only as often as the blink rate, the memory leak still exists. This seems like a bug to me. Updating a 7 row dataset once every 1.5 seconds should not cause the client to use up all the available memory and CPU.

Is there anyway to update the dataset instead of rewriting it? I already know the answer is no, but I thought I would ask. Is there any other way to update the tab colors that I am not thinking of? Worst case, I will remove the blinking tabs and switch to something that doesn’t require a dataset update 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:** [February 12, 2019, 5:03pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/5 "2019-02-12T17:03:31Z")

</div>

> [@danFromNj](#):
>
> Is there anyway to update the dataset instead of rewriting it? I already know the answer is no, but I thought I would ask

Technically, yes, but effectively, no. Most dataset objects have a setValueAt() method that can change data in place. It is only safe to use _before_ the dataset is assigned to a property, as such changes after the fact will typically be ignored. (They don't trigger a propertyChange.)

> [@danFromNj](#):
>
> Is there any other way to update the tab colors that I am not thinking of?

Try setting all of those tabs backgrounds to transparent, and change the color of a rectange behind it.

---

<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:** [February 12, 2019, 5:04pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/6 "2019-02-12T17:04:47Z")

</div>

And yes, definitely a serious bug.

---

<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:** [February 12, 2019, 5:13pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/7 "2019-02-12T17:13:48Z")

</div>

Does that linked NavigationFlash project exhibit the memory leak?

---

<div class="post-metadata">

**Author:** ![danFromNj](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@danFromNj](https://forum.inductiveautomation.com/u/danFromNj)\
**Post date:** [February 12, 2019, 5:54pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/8 "2019-02-12T17:54:18Z")

</div>

Both of the links that I provided in the original post talk about a memory leak caused by changing the background color of the navigation tabs.

---

<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:** [February 12, 2019, 5:59pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/9 "2019-02-12T17:59:17Z")

</div>

I was able to replicate using the NavigationFlash project and fixed the leak, should be part of the next 7.9.11 beta/release.

---

<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:** [February 12, 2019, 6:27pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/10 "2019-02-12T18:27:46Z")

</div>

I’m curious – in the cell binding implementation or the tabstrip component?

---

<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:** [February 12, 2019, 6:30pm UTC](https://forum.inductiveautomation.com/t/method-for-causing-navigation-tabs-to-blink/22500/11 "2019-02-12T18:30:30Z")

</div>

The leak was in the tab strip component. It leaks every time the ‘tabData’ property changes.
