4-60 Series 90-30/20/Micro Programmable Controllers Reference Manual September 1998 GFK-0467K
4
BTST (WORD)
The Bit Test (BTST) function is used to test a bit within a bit string to determine whether that bit is
currently 1 or 0. The result of the test is placed in output Q.
Each sweep power is received, the BTST function sets its output Q to the same state as the specified
bit. If a register rather than a constant is used to specify the bit number, the same function block
can test different bits on successive sweeps. If the value of BIT is outside the range (1 BIT (16
* LEN) ), then Q is set OFF.
A string length of 1 to 256 words can be selected.
_____
| |
(enable) —| BIT_|
| |
|TEST_|
| WORD|
| |
(bit to be tested) —|IN Q|— (output parameter Q)
| LEN |
|00001|
| |
(bit number of IN) —|BIT |
|_____|
Parameters:
Parameter Description
enable When the function is enabled, the bit test is performed.
IN IN contains the first word of the data to be operated on.
BIT BIT contains the bit number of IN that should be tested. Valid range is (1 BIT (16 *
LEN) ).
QOutput Q is energized if the bit tested was a 1.
LEN LEN is the number of words in the string to be tested.
Note
When using the Bit Test, Bit Set, Bit Clear or Bit Position function, the bits
are numbered 1 through 16, NOT 0 through 15.