Resets a single bit in an Integer tag to
0.
Function |
Group |
Execution |
Windows |
Embedded |
Thin Client |
ResetBit
|
Arithmetic |
Synchronous |
Supported |
Supported |
Supported |
Syntax
ResetBit( tagName, numBitNumber )
- tagName
- The name of an Integer tag where the bit value will
be reset.
Note: To
directly specify the name of a tag, rather than take the value of
the tag, you must enclose the tag name in double-quotes. For
example, ResetBit( "Second", 1
).
- numBitNumber
- A numeric tag or value specifying the position
(0…31) of the bit to reset.
Returned value
0 |
No
error |
1 |
Invalid
parameter |
2 |
Tag does
not exist |
Notes
You can use the Bit field to read/write values from
specific bits in an integer tag. For example, enter Second->b0 to access the LSB (Least
Significant Bit of the Second tag), and Second->b31 to access the MSB (Most
Significant Bit of the Second tag).
Examples
Tag Name |
Expression |
Tag |
ResetBit( "numSource", 4 ) // If the
tag numSource held a value of 16,
then the function returns 0 and numSource holds a new value of 0. |
Tag |
ResetBit( "numSource", 1 ) // If the
tag numSource held the value 19,
then the function returns 0 and numSource holds a new value of 17. |