Skip to content

Keithley7002#

Controls a Keithley 7001/7002 switch mainframe from Python scripts. Provides relay switching on the switch matrix. This class inherits from MeasmaticDevice.


property card_columns#

Returns the number of columns of one card. Is 0 until the device was initialized.

Returns#

Type Description
int The number of columns per card.

Example#

matrix = measmatic.get_device('device-switch')
n = matrix.card_columns

property card_rows#

Returns the number of rows of one card. Is 0 until the device was initialized.

Returns#

Type Description
int The number of rows per card.

Example#

matrix = measmatic.get_device('device-switch')
n = matrix.card_rows

property columns#

Returns the number of columns of the overall matrix, which is twice the number of columns of one card.

Returns#

Type Description
int The number of columns of the switch matrix.

Example#

matrix = measmatic.get_device('device-switch')
n = matrix.columns

property demo_mode#

Gets or sets the demo mode. In demo mode no commands are sent to the device.

Returns#

Type Description
bool True if the demo mode is active, otherwise False .

Example#

matrix = measmatic.get_device('device-switch')
matrix.demo_mode = True

property model#

Returns the detected model of the switch.

Returns#

Type Description
Any The model, an Atv.Framework.Devices.Switch.Keithley7002.EModel value (SwUnknown, SwDemo, Sw7001 or
Sw7002).

Example#

matrix = measmatic.get_device('device-switch')
model = matrix.model

property model_string#

Returns the detected model as text.

Returns#

Type Description
str unknown , Demo , 7001 or 7002 .

Example#

matrix = measmatic.get_device('device-switch')
text = matrix.model_string

property number_of_slots#

Returns the number of slots property of the device. The value is not set by the device class and is 0.

Returns#

Type Description
int The number of slots.

Example#

matrix = measmatic.get_device('device-switch')
n = matrix.number_of_slots

property rows#

Returns the number of rows of the switch matrix, which equals the number of rows of one card.

Returns#

Type Description
int The number of rows of the switch matrix.

Example#

matrix = measmatic.get_device('device-switch')
n = matrix.rows

property switch_cards#

Returns the switch cards property of the device. The collection is not filled by the device class, so it has no value.

Returns#

Type Description
Any An iterable of Atv.Framework.Devices.Switch.KeithleyCards.KeithleySwitchCardBase, which is not set by
the device class.

Example#

matrix = measmatic.get_device('device-switch')
cards = matrix.switch_cards

method check_errors()#

Queries the error queue of the device and raises an error if it contains an error. Does nothing in demo mode.

Example#

matrix = measmatic.get_device('device-switch')
matrix.check_errors()

method clear_device_errors()#

Clears the errors stored in the device. Does nothing in demo mode.

Example#

matrix = measmatic.get_device('device-switch')
matrix.clear_device_errors()

method close_backplane_relays()#

Intended to close all backplane relays. Not implemented, so this does nothing.

Example#

matrix = measmatic.get_device('device-switch')
matrix.close_backplane_relays()

method close_relay(card: int, row: int, column: int)#

Closes a relay on one of the installed cards, addressed by card, row and column.

Parameters#

Name Description
card Card number, starting at 1. The card must be installed.
row Row on the card, starting at 1.
column Column on the card, starting at 1.

Example#

matrix = measmatic.get_device('device-switch')
matrix.close_relay(1, 2, 5)

method close_relay(relayList: Any)#

Closes several relays one after another. Does nothing in demo mode.

Parameters#

Name Description
relayList The relays to switch, a Python list of Atv.Framework.Devices.Switch.Model.SwitchRelay objects.

Example#

from Atv.Framework.Devices.Switch.Model import SwitchRelay
matrix = measmatic.get_device('device-switch')
relays = []
for column in (1, 2):
relay = SwitchRelay()
relay.Row = 1
relay.Column = column
relays.append(relay)
matrix.close_relay(relays)

method close_relay(row: int, column: int)#

Closes a relay addressed by row and column of the overall matrix. The two cards are placed side by side, so columns beyond the column count of one card (card_columns) are mapped to the second card.

Parameters#

Name Description
row Row of the relay in the switch matrix, starting at 1.
column Column of the relay in the switch matrix, starting at 1.

Example#

matrix = measmatic.get_device('device-switch')
matrix.close_relay(2, 40)

method close_relay(relay: Any)#

Closes the relay described by the given relay object. Its DesiredState is ignored.

Parameters#

Name Description
relay The relay to switch, an instance of Atv.Framework.Devices.Switch.Model.SwitchRelay (its Row and Column

Example#

from Atv.Framework.Devices.Switch.Model import SwitchRelay
matrix = measmatic.get_device('device-switch')
relay = SwitchRelay()
relay.Row = 2
relay.Column = 5
matrix.close_relay(relay)

method configure_pseudo_card(pseudoCard: Any)#

Not supported by this device. Always raises a NotSupportedException.

Parameters#

Name Description
pseudoCard The pseudo card configuration, an Atv.Framework.Devices.Switch.PseudoCard.

Example#

from Atv.Framework.Devices.Switch import PseudoCard
matrix = measmatic.get_device('device-switch')
matrix.configure_pseudo_card(PseudoCard())

method get_idn()#

Queries the identification string of the device ( *IDN? ).

Returns#

Type Description
str The identification string without surrounding whitespace.

Example#

matrix = measmatic.get_device('device-switch')
idn = matrix.get_idn()

method get_switch_card(slot: int)#

Not implemented by this device. Always raises a NotImplementedException.

Parameters#

Name Description
slot The slot number.

Returns#

Type Description
Any Never returns; the call raises an error.

Example#

matrix = measmatic.get_device('device-switch')
card = matrix.get_switch_card(1)

method is_card_installed(card: int)#

Checks whether a card was detected in the given card position during initialization.

Parameters#

Name Description
card Card number, 1 or 2. Other values return False.

Returns#

Type Description
bool True if the card is installed, otherwise False .

Example#

matrix = measmatic.get_device('device-switch')
installed = matrix.is_card_installed(1)

method open_all()#

Opens all relays of the switch.

Example#

matrix = measmatic.get_device('device-switch')
matrix.open_all()

method open_relay(card: int, row: int, column: int)#

Opens a relay on one of the installed cards, addressed by card, row and column.

Parameters#

Name Description
card Card number, starting at 1. The card must be installed.
row Row on the card, starting at 1.
column Column on the card, starting at 1.

Example#

matrix = measmatic.get_device('device-switch')
matrix.open_relay(1, 2, 5)

method open_relay(relayList: Any)#

Opens several relays one after another. Does nothing in demo mode.

Parameters#

Name Description
relayList The relays to switch, a Python list of Atv.Framework.Devices.Switch.Model.SwitchRelay objects.

Example#

from Atv.Framework.Devices.Switch.Model import SwitchRelay
matrix = measmatic.get_device('device-switch')
relays = []
for column in (1, 2):
relay = SwitchRelay()
relay.Row = 1
relay.Column = column
relays.append(relay)
matrix.open_relay(relays)

method open_relay(row: int, column: int)#

Opens a relay addressed by row and column of the overall matrix. The two cards are placed side by side, so columns beyond the column count of one card (card_columns) are mapped to the second card.

Parameters#

Name Description
row Row of the relay in the switch matrix, starting at 1.
column Column of the relay in the switch matrix, starting at 1.

Example#

matrix = measmatic.get_device('device-switch')
matrix.open_relay(2, 40)

method open_relay(relay: Any)#

Opens the relay described by the given relay object. Its DesiredState is ignored.

Parameters#

Name Description
relay The relay to switch, an instance of Atv.Framework.Devices.Switch.Model.SwitchRelay (its Row and Column

Example#

from Atv.Framework.Devices.Switch.Model import SwitchRelay
matrix = measmatic.get_device('device-switch')
relay = SwitchRelay()
relay.Row = 2
relay.Column = 5
matrix.open_relay(relay)

method reset()#

Resets the device ( *RST ), detects the model (7001 or 7002) and the installed cards, and opens all relays. Raises an error for an unsupported model. In demo mode only the model is set to demo.

Example#

matrix = measmatic.get_device('device-switch')
matrix.reset()

method switch_relay(relay: Any)#

Switches a relay according to its desired state: opens it if DesiredState is Open, closes it if DesiredState is Closed, and does nothing otherwise.

Parameters#

Name Description
relay The relay to switch, an instance of Atv.Framework.Devices.Switch.Model.SwitchRelay. Its Row and Column

Example#

from Atv.Framework.Devices.Switch.Model import SwitchRelay
matrix = measmatic.get_device('device-switch')
relay = SwitchRelay()
relay.Row = 2
relay.Column = 5
relay.DesiredState = RelayState.Closed  # Atv.Framework.Devices.Switch.Enumeration.RelayState
matrix.switch_relay(relay)

method switch_relay(relayList: Any, switchingOrder: Any = ...)#

Switches several relays according to their desired states. Relays with DesiredState Open are opened and relays with DesiredState Closed are closed, in the given order.

Parameters#

Name Description
relayList The relays to switch, a Python list of Atv.Framework.Devices.Switch.Model.SwitchRelay objects.
switchingOrder Order in which relays are switched if the list contains relays to open and to close, a Default: ...

Example#

from Atv.Framework.Devices.Switch.Model import SwitchRelay
matrix = measmatic.get_device('device-switch')
relays = []
for column in (1, 2):
relay = SwitchRelay()
relay.Row = 1
relay.Column = column
relay.DesiredState = RelayState.Closed  # Atv.Framework.Devices.Switch.Enumeration.RelayState
relays.append(relay)
matrix.switch_relay(relays)

method wait_until_switched()#

Waits until the matrix has actually switched the relays, by polling the operation complete flag (up to 10 times with 50 ms pause). Raises an error if the operation does not complete. Does nothing in demo mode.

Example#

matrix = measmatic.get_device('device-switch')
matrix.close_relay(1, 2, 5)
matrix.wait_until_switched()