Channel.getstate() - Keithley 708B Reference Manual

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

Advertisement

Section 7: Command reference

channel.getstate()

Queries the state indicators of the channels in the instrument.
Type
TSP-Link accessible
Function
Yes
Usage
state = channel.getstate(channelList)
state = channel.getstate(channelList, indicatorMask)
state
channelList
indicatorMask
Details
Each bit in the state represents a different indicator. Therefore, multiple indicators can be present (the OR
operation is performed bitwise). The optional state indicatorMask can be used to return only certain
indicators. If there is no indicatorMask, then all indicators are returned.
Indicators can be latched or unlatched, depending on other system settings. Latched indicators mean that the
condition has occurred since the last reset command (or power cycle). Unlatched indicators mean that the
condition has occurred when the channel.getstate() command was issued.
Although the channel.getstate() command returns a string representing a number, this can be easily
changed to a number and then compared to one of the provided Lua constants.
The only state information is an indicator of relay state (channel.IND_CLOSED).
Example
print(channel.getstate("4A01:4B08"))
channel.pattern.setimage("1A01,2B02,3C03",
"Path")
print(channel.getstate("Path"))
print(channel.getstate("3C03"))
-- Unmasking the return value must be done
-- one channel at a time.
if bit.bitand(channel.IND_CLOSED,
tonumber(channel.getstate("4A10"))) == 1
then
print("CLOSED")
else
print("OPENED")
end
Also see
channel.getclose()
7-34
Affected by
System reset
Channel reset
Return string listing the comma-delimited states for the channels in channelList
String specifying the channels to query, using normal channel list syntax
Value to specify only certain indicators; if omitted, all indicators are returned
(on page 7-27)
Models 707B and 708B Switching Matrix Reference Manual
Where saved
Default value
Not saved
0
Queries the state of the first 20 channels on
Slot 4.
See the state of channels in channel pattern
called "PathList".
The channel.IND_CLOSED command equates
to the number 1. Because the state is a bit-
oriented value, you must perform a logical AND
operation on the state to the overload constant to
isolate it from other indicators.
The tonumber() command only works with a
single channel. When multiple channels are
returned (for example,
channel.getstate("slot4")), this string
must be parsed by the comma delimiter to find
each value.
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