Keithley 3700 series Reference Manual page 158

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

Advertisement

Section 9: Instrument Control Library (ICL)
bit.set
Also see
Example
bit.setfield
Function
Usage
Remarks
Also see
9-14
Logic and bit operations
bit.clear
(on page 9-11)
bit.get
(on page 9-12)
bit.getfield
(on page 9-12)
bit.setfield
(on page 9-14)
bit.test
(on page 9-15)
bit.toggle
(on page 9-15)
The binary equivalent of decimal 8 is 1000. If the bit at index 3 is set to 1, the returned
value will be decimal 12 (binary 1100):
value = bit.set(8, 3)
print(value)  1.200000e+01
Overwrites a bit field at a given index position.
value = bit.setfield(value1, index, width, fieldvalue)
value1: Given number.
index: Index position of the least significant bit of the field; 1 to (33 - width ).
width: Field width number of bits in the field; 1 to 24.
fieldvalue: Value to write to the field.
value: Returned value of the new number.
This function returns value, which is value1 with a field of bits overwritten, starting
at the given index position. The index specifies the position of the least significant
bit of the given field. The width bits starting at the given index will be set to the
value given by fieldvalue. The least significant bit in value1 has an index of 1 and
the most significant bit has an index of 32.
Prior to setting the field of bits, any fractional parts of value1 and fieldvalue will be
truncated to make them integers.
If the fieldvalue is wider than the width, the extra most significant bits of the
fieldvalue will be truncated. For example, assume the width is 4 bits, and the
binary value for fieldwidth is 11110 (5 bits). The most significant bit of fieldwidth
will be truncated, and a binary value of 1110 will be used as the fieldvalue.
Logic and bit operations
bit.clear
(on page 9-11)
bit.getfield
(on page 9-12)
bit.set
(on page 9-13)
bit.test
(on page 9-15)
bit.toggle
(on page 9-15)
Series 3700 System Switch/Multimeter Reference Manual
(on page 9-9)
(on page 9-9)
Document Number: 3700S-901-01 Rev. A / August 2007

Advertisement

Table of Contents
loading

Table of Contents