19-24
Return to
2600AS-901-01 Rev. B / September 2008
Section 19: Remote Commands
Series 2600A System SourceMeter® Instruments Reference Manual
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
Performs a bitwise logical AND operation on two numbers.
TSP-Link
accessibility
This function cannot be accessed from a remote TSP-Link node.
Usage
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.
Remarks
• 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.
Also see
Example
AND’ing 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.00
bit.bitor
Function
Performs a bitwise logical OR operation on two numbers.
TSP-Link
accessibility
This function cannot be accessed from a remote TSP-Link node.
Usage
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.
Remarks
• 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.
Also see
Example
OR’ing decimal 10 (binary 1010) with decimal 9 (binary 1001) will return a
value
of decimal 11
(binary 1011):
value = bit.bitor(10, 9)
print(value)
Output:
1.01