DiConMxs9100#
Controls a DiCon MXS-9100 optical switch from Python scripts. Provides relay switching on the switch matrix. This class inherits from MeasmaticDevice.
property columns#
Returns the number of columns (outputs) of the optical switch, as determined from the device during initialization.
Returns#
| Type | Description |
|---|---|
| int | The number of columns of the switch. |
Example#
matrix = measmatic.get_device('device-switch')
columns = matrix.columns
property rows#
Returns the number of rows (inputs) of the optical switch, as determined from the device during initialization.
Returns#
| Type | Description |
|---|---|
| int | The number of rows of the switch. |
Example#
matrix = measmatic.get_device('device-switch')
rows = matrix.rows
method close_relay(row: int, column: int)#
Closes a relay of the optical switch, that is routes the given row (input) to the given column (output), then waits for the configured switching delay. Raises an error if the row or column does not exist.
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(1, 3)
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 close_relay(relayList: Any)#
Closes several relays, then waits for the configured switching delay. All relays are checked for existence first. Does nothing for an empty list.
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_impl(relayList: Any)#
Device-specific implementation behind close_relay for several relays: closes each relay of the list one after another via close_relay.
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_impl(relays)
method close_relay_impl(row: int, column: int)#
Device-specific implementation behind close_relay: sends the command that routes the row to the column directly, without range check and without switching delay. Optical switches use reversed open/close logic: the device commands of opening and closing are exchanged.
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_impl(1, 3)
method open_all()#
Opens all relays by disconnecting every row of the optical switch.
Example#
matrix = measmatic.get_device('device-switch')
matrix.open_all()
method open_relay(row: int, column: int)#
Opens a relay of the optical switch, that is disconnects the given row. The column is ignored by the device command. Then waits for the configured switching delay. Raises an error if the row or column does not exist.
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(1, 3)
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 open_relay(relayList: Any)#
Opens several relays, then waits for the configured switching delay. All relays are checked for existence first. Does nothing for an empty list.
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_impl(row: int, column: int)#
Device-specific implementation behind open_relay: sends the command that disconnects the row directly, without range check and without switching delay. The column is ignored. Optical switches use reversed open/close logic: the device commands of opening and closing are exchanged.
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_impl(1, 3)
method open_relay_impl(relayList: Any)#
Device-specific implementation behind open_relay for several relays: opens each relay of the list one after another via open_relay.
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_impl(relays)
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. Does nothing for an empty list.
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)