Keithley 2601 Reference Manual page 274

System sourcemeter 2600 series (smu)
Hide thumbs Also See for 2601:
Table of Contents

Advertisement

Section 12: Instrument Control Library
The binary equivalent of decimal 8 is 1000. If the bit at index3 is set to 1, the returned
Example
will be decimal 12 (binary 1100):
value
value = bit.set(8, 3)
print(value)
Output: 1.200000e+01
bit.setfield
Function
Overwrites a bit field at a given index position.
Usage
value = bit.setfield(value1, index, width, fieldvalue)
value1
index
width
fieldvalue
value
Remarks
• This function returns value, which is value1 with a field of bits overwritten,
the given index position. The index specifies the position of the least significant bit of
the given field. The width
fieldvalue
significant bit has an index of 32.
P
rior 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.
• See
"Logic and bit
Also see
bit.clear, bit.get, bit.getfield, bit.set, bit.test,
The binary equivalent of decimal 15 is 1111. After overwriting it with a decimal 5 (binary
Example
101) at index position 2, the returned
value = bit.setfield(15, 2, 3, 5)
print(value)
Output: 1.100000e+01
12-14
Given number.
Index position of the least significant bit of the
field; 1 to (33 –
Field width – number of bits in the field; 1 to 24.
Value to write to the field.
Returned value of the new number.
bits
starting at the given index will be set to the value given by
. The least significant bit in
operations" on
page 12-10
value
Return to
Section Topics
Series 2600 System SourceMeter® Instruments Reference Manual
).
width
has a
n index of 1 and the most
value1
for more information.
bit.toggle
will be decimal 11 (binary 1011):
starting
at
2600S-901-01 Rev. C / January 2008

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

26362602261126122635

Table of Contents