CLRBIT v, n 
Purpose To clear the Bit # of the integer variable to '0'.

may be any integer variable or a system variable such as relay[n], output[n], etc. However, if v is a 32-bit integer, SETBIT will only operate on the lower 16 bits. The range of depends on the PLC firmware version, as follow:

PLC Firmware

Before  r78 r78 or later

0 to 15 0 to 31

n is an integer constant or variable of value between 0 and 15 or between 0 and 31. Following digital electronics convention, bit 0 refers to the least significant bit (rightmost bit) and bit 15 the most significant bit (leftmost bit) of a 16-bit variable and bit 31 is the most significant bit of a 32-bit integer variable.

For older PLC firmware (before r78), CLRBIT only works on the lower 16 bits.

Examples CLRBIT output[2],11
Comments: Output #28 will be turned OFF.
(Output channel #2 bit #11 = Output #17 +11 = 28)
See Also SETBIT, TESTBIT

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual