Bit.set() - Keithley 708B Reference Manual

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

Advertisement

Section 7: Command reference

bit.set()

This function sets a bit at the specified index position.
Type
TSP-Link accessible
Function
No
Usage
result = bit.set(value, index)
result
value
index
Details
This function returns result, which is value with the indexed bit set. The index must be between 1 and 32.
The least significant bit value is at index position 1; the most significant bit is at index position 32.
Any fractional part of value is truncated to make it an integer.
Example
myResult = bit.set(8, 3)
print(myResult)
Also see
bit.clear()
(on page 7-11)
bit.get()
(on page 7-12)
bit.getfield()
(on page 7-13)
bit.setfield()
(on page 7-15)
bit.test()
(on page 7-16)
bit.toggle()
(on page 7-17)
Logical operators
7-14
Affected by
Result of the bit manipulation
Specified number
One-based bit position within value to set (1 to 32)
(on page 6-22)
Models 707B and 708B Switching Matrix Reference Manual
Where saved
Default value
The binary equivalent of decimal 8 is 1000. If the bit at
index position 3 is set to 1, the returned value is
decimal 12 (binary 1100).
Output:
1.2000000e+01
707B-901-01 Rev. A / August 2010

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents