Keithley 3700 series Reference Manual page 156

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

Advertisement

Section 9: Instrument Control Library (ICL)
bit.clear
Also see
Example
bit.get
Function
Usage
Remarks
Also see
Example
9-12
Logic and bit operations
bit.get
(on page 9-12)
bit.getfield
(on page 9-12)
bit.set
(on page 9-13)
bit.setfield
(on page 9-14)
bit.toggle
(on page 9-15)
bit.toggle
(on page 9-15)
The binary equivalent of decimal 15 is 1111. If you clear the bit at index position 2, the
returned decimal value would be 13 (binary 1101):
value = bit.clear(15, 2)
print(value)
Output: 1.300000e+01
Retrieves the weighted value of a bit at a given index position.
value = bit.get(value1, index)
value1: Given number.
index: Index position of the bit to be retrieved (1 to 32).
value: Returned weighted value of the bit.
This function returns the value of the bit in value1 at the given index. This is the
same as returning value1 with all other non-indexed bits set to zero.
Prior to retrieving the indexed bit, 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.
If the indexed bit for the number is set to 0, the result will be 0.
See
Logic and bit operations
bit.clear
(on page 9-11)
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 10 is 1010. Getting the bit at index position 4 will
return decimal value 8:
value = bit.get(10, 4)
print(value)
Output: 8.000000e+00
Series 3700 System Switch/Multimeter Reference Manual
(on page 9-9)
(on page 9-9) for more information.
Document Number: 3700S-901-01 Rev. A / August 2007

Advertisement

Table of Contents
loading

Table of Contents