# Internal flash bit

**URL:** <https://forum.inductiveautomation.com/t/internal-flash-bit/28393>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [September 19, 2019, 3:45pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393 "2019-09-19T15:45:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexm](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@alexm](https://forum.inductiveautomation.com/u/alexm)\
**Post date:** [September 19, 2019, 3:45pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/1 "2019-09-19T15:45:20Z")

</div>

Hi,

I am using perspective and I need to create an internal flash bit to be ON/OFF every 1s. The goal is to bind it with components so they can start flashing. Is there a quick way to do this without scripting?  
If not could someone please give guidance to create one?

Many thanks  
Alex

---

<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:** [September 19, 2019, 3:50pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/2 "2019-09-19T15:50:21Z")

</div>

How about a boolean expression tag where the expression is `now() % 2` and the rate is 1000ms?

edit: nevermind, this isn’t great because it can miss toggles pretty easily. `getSecond(now()) % 2` might work a little better, but still not bullet proof.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [September 19, 2019, 4:48pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/3 "2019-09-19T16:48:12Z")

</div>

I make an expression tag and use {[System]Gateway/UptimeSeconds} % 2 and leave it event-driven. I use for the same thing. Like a clock bit in a plc for flashing. I haven’t ever noticed it missing. But, if it misses I don’t care.

 ![time](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/dcde3fbcc231840f1608c5aec09a377a079e3031.jpeg)

---

<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:** [September 19, 2019, 6:31pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/4 "2019-09-19T18:31:26Z")

</div>

It’s a _tiny_ bit convoluted, but you can just use a style class for this, too:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6f8404f3c97d88ed6a777ecf355b8cfff746715b.png)  
Set the duration appropriately, then add a stop at 49% with the same color as your 0% state.  
Then add a stop at 50% (and 100%) with the alternate color.

The animation will take 1s to transition through all your steps - so half the time, it will be trying to transition from step 0 to step 49 - but since they’re the same, nothing will happen. Then, after 50% of 1s has elapsed, it switches to the 50% style (and the new background color). Then it tries to “transition” between that style and the 100% style - so as long as they’re the same, there will only be a single “transition” frame between animation loops.

---

<div class="post-metadata">

**Author:** ![alexm](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@alexm](https://forum.inductiveautomation.com/u/alexm)\
**Post date:** [September 19, 2019, 6:35pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/5 "2019-09-19T18:35:49Z")

</div>

It seemed to work. Thank you very much indeed.

---

<div class="post-metadata">

**Author:** ![alexm](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@alexm](https://forum.inductiveautomation.com/u/alexm)\
**Post date:** [September 19, 2019, 6:36pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/6 "2019-09-19T18:36:55Z")

</div>

Thank you very much inded for that. Where shall I look In order to make the rate faster or slower? I tried altering the %2 but it only seemed to make it slower or not flash at all.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [September 19, 2019, 6:48pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/7 "2019-09-19T18:48:56Z")

</div>

So with this expression, if the value is a **Modulus** of two the bit goes high. I would look towards using @paul-griffith style. If you wanted to make it more variable. I sure am.

---

<div class="post-metadata">

**Author:** ![alexm](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@alexm](https://forum.inductiveautomation.com/u/alexm)\
**Post date:** [October 22, 2019, 7:29am UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/8 "2019-10-22T07:29:41Z")

</div>

So if the bit was to go high every 15m would this be  
{[System]Gateway/UptimeSeconds} % 900000 ?

---

<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:** [June 7, 2020, 3:47am UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/9 "2020-06-07T03:47:13Z")

</div>

Would this method be synchronised across multiple styles classes?

---

<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:** [June 8, 2020, 3:27pm UTC](https://forum.inductiveautomation.com/t/internal-flash-bit/28393/10 "2020-06-08T15:27:05Z")

</div>

I believe that’s entirely up to the browser - so, maybe (all style classes are loaded as one stylesheet, so there’s a decent chance, _if_ that’s how they start all keyframe loops). But zero guarantees.
