3 bit test (bt, btx), 3 bit test (bt, btx) bt – HEIDENHAIN TNC 306 Technical Manual User Manual

Page 376

Advertising
background image


7-86

TNC 416/TNC 406/TNC 306

Commands

3/2000

3.10.3 BIT TEST (BT, BTX)

BT

Abbreviation for PLC Editor:

BT (BIT TEST)

Byte/Word/Double

Constant

Execution time [µs]

2.2 to 2.8

2.2 to 2.4

Number of bytes

8

0

Operands: B, W, D, K, X

Operation:
With this command, the status of each individual bit in the Accumulator may be interrogated. Direct
transition from Word to Logic execution takes place. The BIT TEST tests the status of a bit from the
Word Accumulator and then acts correspondingly on the Logic Accumulator. If the tested bit is "1",
then the Logic Accumulator is also set to "1"; if it is "0" ,it is set to "0". The program continues in logic
execution. The selection (addressing) of the corresponding bit is derived from the content of the
specified Operand or a Constant. In the bit-numbering, bit 0 corresponds to the LSB and bit 31 the
MSB. For operand contents larger than 32, the operand value Modulo 32 is used, i.e. the integer
remainder from the division (operand value)/32.

Example:
Load Double word D8 in the Accumulator, and assign the logic state of bit 0 to an Output.

Initial state:

Double word D8 = 3E 81 (hex)
Output

O12 = ?

Word Accumulator and operand contents are shown here in hexadecimal notation, the Logic
Accumulator in binary representation.

Line Instruction

Accumulator content

Operand content

xx

xx

xx

xx

1

L D8

00

00

3E

81

00

00

3E

81

2

BT K+0

00

00

3E

81

3

= O12

x x x x x x 1 x x x x x x x

1

Line 1:

Load Double word D8 into the Accumulator.

Line 2:

The bit specified in the operand is tested as to its status.

Line 3:

The Logic Accumulator is assigned to Output O12.

Advertising
This manual is related to the following products: