# How to use GetBit to read bit in an INT

**URL:** <https://forum.inductiveautomation.com/t/how-to-use-getbit-to-read-bit-in-an-int/7377>\
**Category:** Ignition\
**Created:** [October 7, 2013, 5:21am UTC](https://forum.inductiveautomation.com/t/how-to-use-getbit-to-read-bit-in-an-int/7377 "2013-10-07T05:21:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VisionTech](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@VisionTech](https://forum.inductiveautomation.com/u/VisionTech)\
**Post date:** [October 7, 2013, 5:21am UTC](https://forum.inductiveautomation.com/t/how-to-use-getbit-to-read-bit-in-an-int/7377/1 "2013-10-07T05:21:39Z")

</div>

Got a tip, to use a funk “GetBit” to read the status of individuals bitten in a integer.  
Got a Integer valve status, containing:

Bit 1: Local  
Bit2: Remote  
Bit 3: Manual  
Bit 4 Auto  
.  
.  
.  
.  
etc  
I want to show the different states(Boolen) through color shifts in circles and visibility of buttons for manual control ( Openbuton, Closebuton)

Rune / Norway

---

<div class="post-metadata">

**Author:** ![jaepark](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jaepark](https://forum.inductiveautomation.com/u/jaepark)\
**Post date:** [October 7, 2013, 3:14pm UTC](https://forum.inductiveautomation.com/t/how-to-use-getbit-to-read-bit-in-an-int/7377/2 "2013-10-07T15:14:09Z")

</div>

getBit(number, position)  
This function returns the bit value (an integer, 0 or 1) in the number at position position, according to its binary representation. The least significant bit in a number is position 0.

Integer is 123  
Binary is 111011

You can create custom properties and bind them to:

Custom Value:  
DoorOpen = getBit(myInteger, 0)  
Local = getBit(myInteger, 1)  
Remote = getBit(myInteger, 2)  
…

I am not sure what you mean by color shifts in circles.
