Chapter 4. Ladder Diagram (LD) Programming
4.2.5
Bit Test
When the Bit Test function receives power flow, it tests 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 scan that power is received, the Bit Test 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 can test different bits on successive
sweeps. If the value of BIT is outside the range (1 BIT (16 × length) for a WORD
and 1 BIT (32 × length) for a DWORD), then Q is set OFF.
You can specify a string length of 1 to 256 WORDs or DWORDs.
Note: When using the Bit Test function, the bits are numbered 1 through 16 for a WORD, not 0
through 15. They are numbered 1 through 32 for a DWORD.
Operands for Bit Test
Parameter Description
Length (??) The number of WORDs or DWORDs in the data string to
test. 1 Length 256.
IN
The first WORD or DWORD in the data to test
BIT
The number of the bit to test in IN. 1 BIT (16×Length). All except variables located in
Q
The state of the specific bit tested; Q is energized if the
bit tested is a 1.
Example 1
When input V_I0001 is set, the bit at the
location contained in reference PICKBIT is
tested.
The bit is part of string PRD_CDE.
If it is 1, output Q passes power flow to the ADD
function, causing 1 to be added to the current
value of the ADD function input IN1.
Example 2
When input V_I0001 is set, the bit at the location
contained in reference PICKBIT is tested.
The bit is part of string PRD_CDE.
If it is 1, output Q passes power flow and the coil
V_Q0001 is turned on
74
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
Allowed Operands
Constant
All
%S - %SC
Flow
Optional
No
No
No
No
GFK-2950C