# Coming up with a way to detect when something is on but no working, and if that case is true, make it stop counting towards another variable

**URL:** <https://forum.inductiveautomation.com/t/coming-up-with-a-way-to-detect-when-something-is-on-but-no-working-and-if-that-case-is-true-make-it-stop-counting-towards-another-variable/73559>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 10, 2023, 7:25pm UTC](https://forum.inductiveautomation.com/t/coming-up-with-a-way-to-detect-when-something-is-on-but-no-working-and-if-that-case-is-true-make-it-stop-counting-towards-another-variable/73559 "2023-05-10T19:25:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Bosely](https://avatars.discourse-cdn.com/v4/letter/b/f04885/32.png) [@Bryan\_Bosely](https://forum.inductiveautomation.com/u/Bryan_Bosely)\
**Post date:** [May 10, 2023, 7:25pm UTC](https://forum.inductiveautomation.com/t/coming-up-with-a-way-to-detect-when-something-is-on-but-no-working-and-if-that-case-is-true-make-it-stop-counting-towards-another-variable/73559/1 "2023-05-10T19:25:20Z")

</div>

Hi I'm trying to create a piece of coding. Using logic something along the lines of if input1=1 but input 2 is 0 then 0.  
Any help in coding this would be greatly appreciated.

---

<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:** [May 10, 2023, 7:44pm UTC](https://forum.inductiveautomation.com/t/coming-up-with-a-way-to-detect-when-something-is-on-but-no-working-and-if-that-case-is-true-make-it-stop-counting-towards-another-variable/73559/2 "2023-05-10T19:44:56Z")

</div>

To what are you attaching this logic?

---

<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:** [May 10, 2023, 8:07pm UTC](https://forum.inductiveautomation.com/t/coming-up-with-a-way-to-detect-when-something-is-on-but-no-working-and-if-that-case-is-true-make-it-stop-counting-towards-another-variable/73559/3 "2023-05-10T20:07:16Z")

</div>

> [@Bryan\_Bosely](#):
>
> piece of coding

You'll need to be more specific. Is this in an expression or in a python script?

It sounds like you want:  
Expression:

```auto
{view.custom.input1} && {view.custom.input2}

```

Python:

```auto
if input1 and input2:
    do_something()

```

Assuming input1 and 2 are bools or can be treated as 0 = false and \> 0 is true
