# Check a bit to set or disable a alarm level in a moving analog indicator

**URL:** <https://forum.inductiveautomation.com/t/check-a-bit-to-set-or-disable-a-alarm-level-in-a-moving-analog-indicator/113476>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 22, 2026, 10:16am UTC](https://forum.inductiveautomation.com/t/check-a-bit-to-set-or-disable-a-alarm-level-in-a-moving-analog-indicator/113476 "2026-01-22T10:16:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirko.cerin](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@mirko.cerin](https://forum.inductiveautomation.com/u/mirko.cerin)\
**Post date:** [January 22, 2026, 10:16am UTC](https://forum.inductiveautomation.com/t/check-a-bit-to-set-or-disable-a-alarm-level-in-a-moving-analog-indicator/113476/1 "2026-01-22T10:16:09Z")

</div>

Hi everyone,

I made a simple script in the binding of an alarm level inside an analog indicator that checks if a bit is true to get the value of a tag or disable the alarm level if it’s false.

The code is the following:

```python
def transform(self, value, quality, timestamp):
	sAux = system.tag.readBlocking(self.view.params.TagPath+"/H_PAR")
	if value:
		value = sAux[0]
	else:
		value = "null"
	return value

```

It’s works partially, because the check on the bit is correct and the if works good too, the problem is that when it’s false and it return “null” the object gives error because it get the null as a string.

Is there a way to return a null correclty so that the designer doesn’t give error?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/51969ec3da244fbddd93e599eec09f2d69a3effa.png)

---

<div class="post-metadata">

**Author:** ![Jasmine\_Quick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jasmine_quick/32/80380_2.png) [@Jasmine\_Quick](https://forum.inductiveautomation.com/u/Jasmine_Quick)\
**Post date:** [January 22, 2026, 11:10am UTC](https://forum.inductiveautomation.com/t/check-a-bit-to-set-or-disable-a-alarm-level-in-a-moving-analog-indicator/113476/2 "2026-01-22T11:10:12Z")

</div>

Could you use an empty string instead of null? So just the quote marks with a space in between?

---

<div class="post-metadata">

**Author:** ![mirko.cerin](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@mirko.cerin](https://forum.inductiveautomation.com/u/mirko.cerin)\
**Post date:** [January 22, 2026, 11:17am UTC](https://forum.inductiveautomation.com/t/check-a-bit-to-set-or-disable-a-alarm-level-in-a-moving-analog-indicator/113476/3 "2026-01-22T11:17:54Z")

</div>

I tried what you suggested and it works now, it still give the red mark on the property but as long as it doens’t show on the runtime it’s fine.

Thank you so much

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [January 22, 2026, 1:38pm UTC](https://forum.inductiveautomation.com/t/check-a-bit-to-set-or-disable-a-alarm-level-in-a-moving-analog-indicator/113476/4 "2026-01-22T13:38:43Z")

</div>

> [@mirko.cerin](#):
>
> it return “null” the object gives error because it get the null as a string.

In Python, the equivalent value is `None` (without quotes).

To avoid performance bottlenecks down the road, try to avoid script transforms if possible. For a straightforward if statement like this, I recommend that you create a custom property bound to the tag in your `readBlocking` function, then change this transform to an expression transform, and convert your Python script there. Additionally, if your En\_H tag is used more than once in this view, move that tag binding to a custom property as well, and convert this binding to an Expression only, with no transform, referencing the two custom properties you create.

---

<div class="post-metadata">

**Author:** ![mirko.cerin](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@mirko.cerin](https://forum.inductiveautomation.com/u/mirko.cerin)\
**Post date:** [January 22, 2026, 2:08pm UTC](https://forum.inductiveautomation.com/t/check-a-bit-to-set-or-disable-a-alarm-level-in-a-moving-analog-indicator/113476/5 "2026-01-22T14:08:52Z")

</div>

Thanks for the heads up, I wasn’t really aware about how to use the custom properties.

It also simplified the expression since it became like this now:

```python
if({this.custom.sEn_L},{value},None)

```

Thanks again.
