# Alarms set bit state,how to set Event Value equal to bit value?

**URL:** <https://forum.inductiveautomation.com/t/alarms-set-bit-state-how-to-set-event-value-equal-to-bit-value/77117>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 31, 2023, 3:12am UTC](https://forum.inductiveautomation.com/t/alarms-set-bit-state-how-to-set-event-value-equal-to-bit-value/77117 "2023-07-31T03:12:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [July 31, 2023, 3:12am UTC](https://forum.inductiveautomation.com/t/alarms-set-bit-state-how-to-set-event-value-equal-to-bit-value/77117/1 "2023-07-31T03:12:38Z")

</div>

Tag Alarms set Bit State.

 ![5](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/95bea1deac7b22f95861918706e33e5d417c5861.png)

How to set Event Value equal to Bit value ,not to Value?

 ![4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e1fd2a89a6fb32ddaa2ac32c26ed155eae13b0a0.png)

---

<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:** [July 31, 2023, 7:46am UTC](https://forum.inductiveautomation.com/t/alarms-set-bit-state-how-to-set-event-value-equal-to-bit-value/77117/2 "2023-07-31T07:46:24Z")

</div>

Can you display the bitPosition in the alarm table? Otherwise, you might need to create an associated data with the bit number in it and display that 😕

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [December 18, 2023, 7:17am UTC](https://forum.inductiveautomation.com/t/alarms-set-bit-state-how-to-set-event-value-equal-to-bit-value/77117/3 "2023-12-18T07:17:26Z")

</div>

> [@nminchin](#):
>
> associated

Yeah! I add an associated data in it.  
I can see the associated data in alarm info.  
But this new associated data can't show in Alarm Status Table Columns.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d896c1304024147b502f79a00e1bd2832e208596.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 19, 2023, 12:46pm UTC](https://forum.inductiveautomation.com/t/alarms-set-bit-state-how-to-set-event-value-equal-to-bit-value/77117/4 "2023-12-19T12:46:41Z")

</div>

One approach that would work would be to move your associated data expression to the label property:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/c/7cfca6a961ff06fb65a229a9fad2a1b1d9eece36.png)

Then, you could use [the method I developed for renaming alarm status table columns](https://forum.inductiveautomation.com/t/customizing-alarm-status-table/61102/4) to change the column headers in the table:

```auto
if event.propertyName == 'componentRunning':
	def getTable(statusTable):
		for component in statusTable.getComponents():
			if component. __class__. __name__ == 'AlarmStatusTable$1':
				return component
			else:
				table = getTable(component)
				if table:
					return table
	
	table = getTable(event.source)
	tableHeader= table.tableHeader
	columnModel = table.columnModel
	for column in range(table.columnCount):
		tableColumn = columnModel.getColumn(column)
		if tableColumn.headerValue == 'Label':
			tableColumn.setHeaderValue("Real Alarm Value")
		elif tableColumn.headerValue == 'Event Value':
			tableColumn.setHeaderValue("Tag Value")
	tableHeader.repaint()

```

**Result:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/5/b5faa2655cbce13d380bc7259afdfce76e759fa6.png)

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [December 20, 2023, 2:37am UTC](https://forum.inductiveautomation.com/t/alarms-set-bit-state-how-to-set-event-value-equal-to-bit-value/77117/5 "2023-12-20T02:37:05Z")

</div>

This is a good solution. 👏 👏  
Thank you very much!
