# Flood limit tripped, starting 5000ms cooldown on my gateway when calculate using current time change

**URL:** <https://forum.inductiveautomation.com/t/flood-limit-tripped-starting-5000ms-cooldown-on-my-gateway-when-calculate-using-current-time-change/89508>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [April 26, 2024, 7:39am UTC](https://forum.inductiveautomation.com/t/flood-limit-tripped-starting-5000ms-cooldown-on-my-gateway-when-calculate-using-current-time-change/89508 "2024-04-26T07:39:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lina\_Su](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@Lina\_Su](https://forum.inductiveautomation.com/u/Lina_Su)\
**Post date:** [April 26, 2024, 7:39am UTC](https://forum.inductiveautomation.com/t/flood-limit-tripped-starting-5000ms-cooldown-on-my-gateway-when-calculate-using-current-time-change/89508/1 "2024-04-26T07:39:47Z")

</div>

I want to implement a flowing water animation in Ignition Perspective using an arrow icon by changing the X and Y positions. My script looks something like this:

if(this.custom.stop,this.custom.start,round(this.custom.start+(dateExtract(now(10), "ms") + dateExtract(now(1000), "seconds") \* 1000) % this.custom.move / this.custom.move \* this.custom.dis, 0))

There are approximately 20 similar animated components on the page. However, I am encountering an error message on my Gateway saying "Flood limit tripped, starting 5000ms cooldown." I suspect it is related to this issue. Can someone please suggest a solution to eliminate this error or a better way to achieve the animation effect?  
 ![2024-04-26_15-32-27](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/f/9f03fb70d8f22b1c82a433082b140ef6d57de236.gif)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 26, 2024, 11:39am UTC](https://forum.inductiveautomation.com/t/flood-limit-tripped-starting-5000ms-cooldown-on-my-gateway-when-calculate-using-current-time-change/89508/2 "2024-04-26T11:39:54Z")

</div>

Animation should be handled at the browser, if possible.  
Javascript would be the default method in most web applications but that is difficult in Perspective. We can use CSS animation.

![CSS flow](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/7/e715a403a38f4a71f971cc194869e36abdb9fee1.gif)

1. Create a coordinate view.
2. In Advanced Stylesheet (Project Browser → Perspective → Styles → right-click) paste in the following CSS.

> **CSS**
>
> ```python
> .psc-moveLeft {
> animation: moveLeft 2s linear infinite;
> position: relative;
> }
> @keyframes moveLeft {
> 0% {transform: translateX(0);}
> 100% {transform: translateX(-100px);}
> }
> 
> .psc-moveRight {
> animation: moveRight 2s linear infinite;
> position: relative;
> }
> @keyframes moveRight {
> 0% {transform: translateX(0);}
> 100% {transform: translateX(100px);}
> }
> 
> .psc-moveUp {
> animation: moveUp 2s linear infinite;
> position: relative;
> }
> @keyframes moveUp {
> 0% {transform: translateY(0);}
> 100% {transform: translateY(-100px);}
> }
> 
> .psc-moveDown {
> animation: moveDown 2s linear infinite;
> position: relative;
> }
> @keyframes moveDown {
> 0% {transform: translateY(0);}
> 100% {transform: translateY(100px);}
> }
> 
> ```

1. Project Browser → select your view → Shift-right-click → Paste JSON.

> **Sample view**
>
> ```python
> {
> "custom": {},
> "params": {},
> "props": {
> "defaultSize": {
> "height": 395,
> "width": 565
> }
> },
> "root": {
> "children": [
> {
> "meta": {
> "name": "Label"
> },
> "position": {
> "height": 201,
> "rotate": {
> "anchor": "25% 100%"
> },
> "width": 202,
> "x": 102,
> "y": 98
> },
> "props": {
> "style": {
> "borderBottomLeftRadius": 15,
> "borderBottomRightRadius": 15,
> "borderColor": "#BCBEC1",
> "borderStyle": "solid",
> "borderTopLeftRadius": 15,
> "borderTopRightRadius": 15,
> "borderWidth": 40
> }
> },
> "type": "ia.display.label"
> },
> {
> "custom": {
> "animationEnable": true
> },
> "meta": {
> "name": "IconR"
> },
> "position": {
> "height": 40,
> "rotate": {
> "anchor": "0% 50%"
> },
> "width": 40,
> "x": 130,
> "y": 100
> },
> "propConfig": {
> "props.style.animationPlayState": {
> "binding": {
> "config": {
> "expression": "if({this.custom.animationEnable}, \"running\", \"paused\")\r\n// can use \"initial\" rather than \"paused\"."
> },
> "type": "expr"
> }
> }
> },
> "props": {
> "color": "#11AC26",
> "path": "material/east",
> "style": {
> "classes": "moveRight"
> }
> },
> "type": "ia.display.icon"
> },
> {
> "custom": {
> "animationEnable": true
> },
> "meta": {
> "name": "IconD"
> },
> "position": {
> "height": 40,
> "rotate": {
> "anchor": "75% -47%",
> "angle": "9deg"
> },
> "width": 40,
> "x": 260,
> "y": 120
> },
> "propConfig": {
> "props.style.animationPlayState": {
> "binding": {
> "config": {
> "expression": "if({this.custom.animationEnable}, \"running\", \"paused\")\r\n// can use \"initial\" rather than \"paused\"."
> },
> "type": "expr"
> }
> }
> },
> "props": {
> "color": "#11AC26",
> "path": "material/south",
> "style": {
> "classes": "moveDown"
> }
> },
> "type": "ia.display.icon"
> },
> {
> "custom": {
> "animationEnable": true
> },
> "meta": {
> "name": "IconU"
> },
> "position": {
> "height": 40,
> "rotate": {
> "angle": "321deg"
> },
> "width": 40,
> "x": 100,
> "y": 220
> },
> "propConfig": {
> "props.style.animationPlayState": {
> "binding": {
> "config": {
> "expression": "if({this.custom.animationEnable}, \"running\", \"paused\")\r\n// can use \"initial\" rather than \"paused\"."
> },
> "type": "expr"
> }
> }
> },
> "props": {
> "color": "#11AC26",
> "path": "material/north",
> "style": {
> "classes": "moveUp"
> }
> },
> "type": "ia.display.icon"
> },
> {
> "custom": {
> "animationEnable": true
> },
> "meta": {
> "name": "IconL"
> },
> "position": {
> "height": 40,
> "rotate": {
> "angle": "338deg"
> },
> "width": 40,
> "x": 220,
> "y": 260
> },
> "propConfig": {
> "props.style.animationPlayState": {
> "binding": {
> "config": {
> "expression": "if({this.custom.animationEnable}, \"running\", \"paused\")\r\n// can use \"initial\" rather than \"paused\"."
> },
> "type": "expr"
> }
> }
> },
> "props": {
> "color": "#11AC26",
> "path": "material/west",
> "style": {
> "classes": "moveLeft"
> }
> },
> "type": "ia.display.icon"
> }
> ],
> "meta": {
> "name": "root"
> },
> "type": "ia.container.coord"
> }
> }
> 
> ```

Note that I've given each arrow `custom.animateEnable` to turn the animation on and off.

It's a bit fiddly but it might get you going. There are some tricks where you could add the transform into the component and use an expression binding to change the length of the animation, etc.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 26, 2024, 11:47am UTC](https://forum.inductiveautomation.com/t/flood-limit-tripped-starting-5000ms-cooldown-on-my-gateway-when-calculate-using-current-time-change/89508/3 "2024-04-26T11:47:09Z")

</div>

Yeah dont do these kinda animations in perspective, best to use css and keep things simple.  
Dont create to much conditions or variables with it. It should be clear how the water is going even if the arrows dont move.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 26, 2024, 11:49am UTC](https://forum.inductiveautomation.com/t/flood-limit-tripped-starting-5000ms-cooldown-on-my-gateway-when-calculate-using-current-time-change/89508/4 "2024-04-26T11:49:30Z")

</div>

@victordcq, thanks for the like.  
I was trying to make a generic flow arrow with a parameter to set the direction (up, down, left, right) and rotate based on that. For some reason the icon won't rotate when I've applied the styleclass.  
Have you any idea why?

If I did get that to work we'd then have to use CSS injection with an expression to move it the right way.

---

<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 26, 2024, 11:52am UTC](https://forum.inductiveautomation.com/t/flood-limit-tripped-starting-5000ms-cooldown-on-my-gateway-when-calculate-using-current-time-change/89508/5 "2024-04-26T11:52:16Z")

</div>

> [@Lina\_Su](#):
>
> now(10)

Especially don't try to run any but the simplest expressions at _ **ten milliseconds** _. Oy!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 26, 2024, 11:55am UTC](https://forum.inductiveautomation.com/t/flood-limit-tripped-starting-5000ms-cooldown-on-my-gateway-when-calculate-using-current-time-change/89508/6 "2024-04-26T11:55:44Z")

</div>

While im all for generic stuff, but by putting to much variables on animatios in perspective, its going to get abused with bindings which will cause issues. becuase those run on the gateway
