Keithley 3700 series Reference Manual page 154

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

Advertisement

Section 9: Instrument Control Library (ICL)
The bit.bitand, bit.bitor and bit.bitxor functions in this group perform logic operations on two
numbers. The TSP (Test Script Processor) will perform the indicated logic operation on the
binary equivalents of the two integers. Logic operations are performed bitwise. That is, Bit 1 of
the first number is AND'ed, OR'ed or XOR'ed with Bit 1 of the second number. Bit 2 of the first
number is AND'ed, OR'ed or XOR'ed with Bit 2 of the second number. This bitwise logic
operation is performed on all corresponding bits of the two numbers. The result of a logic
operation will be returned as an integer.
Bit operations:
The rest of the functions in this group are used for operations on the bits of a given number.
These functions can be used to clear a bit, toggle a bit, test a bit, set a bit (or bit field) and
retrieve the weighted value of a bit (or field value). All of these functions use an index parameter
to "point" to the bit position of the given number. The least significant bit of a given number has
an index of 1, and the most significant bit has an index of 32.
bit.bitand
Function
Usage
Remarks
Also see
Example
bit.bitor
Function
Usage
Remarks
9-10
Performs a bitwise logical AND operation on two numbers.
value = bit.bitand(value1, value2)
value1: First number for the AND operation.
value2: Second number for the AND operation.
value: Returned result of the AND operation.
This function performs a logical AND operation on two numbers.
Any fractional parts of value1 and value2 are truncated to make them integers.
The returned value is also an integer.
Logic and bit operations
Adding decimal 10 (binary 1010) with decimal 9 (binary 1001) will return a value of
decimal 8 (binary 1000):
value = bit.bitand(10, 9)
print(value)
Output: 8.000000e+00
Performs a bitwise logical OR operation on two numbers.
value = bit.bitor(value1, value2)
value1: First number for the OR operation.
value2: Second number for the OR operation.
value: Returned result of the OR operation.
This function performs a logical OR operation on two numbers.
Any fractional parts of value1 and value2 are truncated to make them integers.
The returned value is also an integer.
Series 3700 System Switch/Multimeter Reference Manual
(on page 9-9)
Document Number: 3700S-901-01 Rev. A / August 2007

Advertisement

Table of Contents
loading

Table of Contents