Keithley 3700 series Reference Manual page 157

System switch/multimeter
Hide thumbs Also See for 3700 series:
Table of Contents

Advertisement

Series 3700 System Switch/Multimeter Reference Manual
bit.getfield
Function
Usage
Remarks
Also see
Example
bit.set
Function
Usage
Remarks
Document Number: 3700S-901-01 Rev. A / August 2007
Returns a field of bits starting at a given index position.
value = bit.getfield(value1, index, width)
value1: Given number.
index: Index position of the first bit; 1 to (33 - width ).
width: Field width - number of bits to be included in the field; 1 to 24.
value: Returned value of the bit field.
A field of bits is a contiguous group of bits. This function retrieves a field of bits
from value1 starting at the given index position. The index position is the least
significant bit of the retrieved field. The number of bits to return is given by width.
Prior to retrieving the field of bits, any fractional part of the given number will be
truncated to make it an integer.
The least significant bit of the given number has an index of 1 and the most
significant bit has an index of 32.
Logic and bit operations
bit.clear
(on page 9-11)
bit.get
(on page 9-12)
bit.set
(on page 9-13)
bit.setfield
(on page 9-14)
bit.test
(on page 9-15)
bit.toggle
(on page 9-15)
The binary equivalent of decimal 13 is 1101. The field at index 2 and width 3 consists
of the binary bits 110. The returned value will be decimal 6 (binary 110):
value = bit.getfield(13, 2, 3)
print(value)  6.000000e+00
Sets a bit at a given index position.
value = bit.set(value1, index)
value1: Given number.
index: Index position of the bit to be set (1 to 32).
value: Returned value of the new number.
This function returns value, which is value1 with the indexed bit set. The index
must be a value between 1 and 32. The least significant bit of the given number
has an index of 1 and the most significant bit has an index of 32.
Any fractional part of value1 will be truncated to make it an integer.
Section 9: Instrument Control Library (ICL)
(on page 9-9)
9-13

Advertisement

Table of Contents
loading

Table of Contents