Bit.getfield() - Keithley 708B Reference Manual

Switching matrix
Hide thumbs Also See for 708B:
Table of Contents

Advertisement

Models 707B and 708B Switching Matrix Reference Manual
Also see
bit.clear()
(on page 7-11)
bit.set()
(on page 7-14)
bit.test()
(on page 7-16)
bit.toggle()
(on page 7-17)
Logical operators

bit.getfield()

This function returns a field of bits from the value starting at the specified index position.
Type
TSP-Link accessible
Function
No
Usage
result = bit.getfield(value, index, width)
result
value
index
width
Details
A field of bits is a contiguous group of bits. This function retrieves a field of bits from value starting at index.
The index position is the least significant bit of the retrieved field. The number of bits to return is specified by
width.
The least significant bit value is at index position 1; the most significant bit is at index position 32.
Example
myResult = bit.getfield(13, 2, 3)
print(myResult)
Also see
bit.get()
(on page 7-12)
bit.set()
(on page 7-14)
bit.setfield()
(on page 7-15)
Logical operators
707B-901-01 Rev. A / August 2010
(on page 6-22)
Affected by
Result of the bit manipulation
Specified number
One-based bit position within value to get (1 to 32)
The number of bits to include in the field (1 to 32)
(on page 6-22)
Where saved
Default value
The binary equivalent of decimal 13 is 1101.
The field at index position 2 and width 3
consists of the binary bits 110. The returned value
is decimal 6 (binary 110).
Output:
6.0000000e+00
Section 7: Command reference
7-13

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents