beautypg.com

10 bit commands, 1 bit set (bs) – HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual

Page 557

background image


7-96

TNC 407/TNC 415/TNC 425

3 Commands

01.98

7

3.10 Bit Commands

3.10.1 BIT SET (BS)

Abbreviation for PLC Editor:

BS (BIT SET)

Byte/Word/Double

Constant

Execution time [µs]

0.5 to 0.8

0.3 to 0.4

Number of bytes

6

8

Operands: B, W, D, K

Operation:
With this command, each bit in the Accumulator can be acted on. The addressed bit is set to "1"
through the use of the BS command. 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 Doubleword D8 in the Accumulator, set the bit 0 of the Accumulator to "1" and store the result
in Doubleword D12.

Initial state:

Doubleword D8 = 3E 80 (hex)
Doubleword D12 = ?

Accumulator and operand contents are shown here in hexadecimal notation.

Line Instruction

Accumulator Content

Operand Content

xx

xx

xx

xx

1

L D8

00

00

3E

80

00

00

3E

80

2

BS K+0

00

00

3E

81

3

= D12

00

00

3E

81

00

00

3E

81

Line 1:

Load Doubleword D8 into the Accumulator.

Line 2:

The bit specified in the operand is set to 1.

Line 3:

The result is stored in Doubleword D12.