get_description Command

FlexOTO Instance:
Hardware Diagram

This command returns a description of the switch hardware in JSON format to FlexOTO. The following figure show the actions that occur with this command.

Interaction when the get_description query is sent to the switch driver

The returned JSON string provides the following information about the switch. FlexOTO uses this information when drawing one or more Switch blocks on FlexOTO's Hardware Diagram and to use the proper names when sending the set_routes command to the switch driver.

  • Switch model number. (shown on switch block)
  • Switch serial number. (shown on switch block)
  • Switch settling time in seconds.
  • For each of the switch's internal switches (there may be only one):
    • Name of internal switch. If the switch model only has a single internal switch, the name should be an empty string. (shown on switch block)
    • SupportsDisconnected (optional)
    • Names of input ports. (shown on switch block)
    • Names of output ports. (shown on switch block)
    • Wavelengths (optional)

Command Sent from FlexOTO

get_description

Response Returned from Driver

A JSON string describing the switch, followed by DONE, on separate lines.

print(error_messages)  # if needed
print(json_string)
print("DONE")

The following example JSON string creates two switch blocks (SW1 and SW2) that will be available for placing on FlexOTO's Hardware Diagram.

Copy
Example of returning a JSON string
json_string = """
{
    "ModelNumber": "CUSTOM SWITCH",
    "SerialNumber": "A12345",
    "SettlingTimeSeconds": 50e-3,
    "Groups": [
        {
            "Name": "SW1",
            "InputPorts": ["1","2","3","4","5","6","7","8"],
            "OutputPorts": ["OUT"]
        },
        {
            "Name": "SW2",
            "InOutPorts": ["1","2","3","4","5","6","7","8","9","10"],
            "Wavelengths": ["1350 nm", "1550 nm"]
        }
    ]
} """
print(json_string)
print("DONE")

The two switch blocks that this JSON string creates are shown placed on the Hardware Diagram in the following figure. The model number, group name, and port labels appear on the block. Also notice in the switch Setup dialogs show the switch's serial number and that switch SW1's wavelength selection is grayed out while switch SW2's wavelength selection is available.

CUSTOM SWITCH Blocks on Hardware Diagram

JSON ModelNumber Element

The ModelNumber element is a string that names the optical switch on FlexOTO's Hardware Diagram. The name that you give is entirely up to you and need not be related to the actual switch's model number.

"ModelNumber": "CUSTOM SWITCH",

JSON SerialNumber Element

The SerialNumber Element is a string that is the optical switch's serial number. You can query this value from the switch and then insert the name into the JSON string.

"SerialNumber": "A1234",

JSON SettlingTimeSeconds element

The value of the SettlingTimeSeconds element is a real number that represents the time in seconds that the switch requires to stabilize after a switch route has been selected. For example, 0.05 for 50 ms. When setting the switch route, FlexOTO will wait for this time to pass before acquiring or analyzing data through the route.

"SettlingTimeSeconds": 50e-3,

If you don't know your switch's settling time, you can enter zero or any other time delay that you want.

"SettlingTimeSeconds": 0.0,

JSON Groups Element

The Groups element is a list of one or more internal switch modules using the following elements. For each switch group, include the following elements:

  • Name
  • SupportsDisconnected
  • InputPorts
  • OutputPorts
  • InOutPorts
  • Wavelengths (optional)

FlexOTO displays the switch name, input ports, and output ports. Each group will be displayed on the resulting switch block that can be installed on FlexOTO's Hardware Diagram.

"Groups": []

JSON Groups Name Element

The Name element labels the switch group on FlexOTO's Hardware Diagram and should match the switch's front panel. If the switch model does not include multiple internal switches, Name should be assigned an empty string. When requesting that a switch route be created, FlexOTO sends the switch group name with the
set_routes command to the driver. Your driver will need to translate these strings to the correct strings for the switch. Consult the switch manual to find the exact strings to use.

"Name": "SW1",

JSON Groups SupportsDisconnected Element (optional)

This optional element indicates if the optical switch allows the output state to be disconnected. The value of this element can be set to true or false. A true setting indicates that all output ports can be disconnected from the input ports. FlexOTO's Instrument AutoCal is disabled when this element is false, because the calibration requires that DCA-M modules be disconnected from all input signals.

"SupportsDisconnected": true,

If the switch does not allow the output ports to be disconnected from the input ports, set SupportsDisconnected to false. You cannot run FlexOTO's Instrument AutoCal. You can, however, disconnect the fiber-optic cables from the DCA-M module's inputs and perform a module calibration from FlexDCA.

JSON Groups InputPorts Element

Identifies and labels switch input ports. When requesting that a switch route be created, FlexOTO sends the switch port names with the set_routes command to the driver. The element requires the associated OutputPorts element. For any-to-any switches, use the InOutPorts instead.

"InputPorts": ["1","2","3","4"],

JSON Groups OutputPorts Element

Identifies and labels switch output ports. When requesting that a switch route be created, FlexOTO sends the switch port names with the set_routes command to the driver. The element requires the associated InputPorts and OutputPorts elements. For any-to-any switches, use the InOutPorts instead.

"OutputPorts": ["OUT A","OUT B"],

JSON Groups InOutPorts Element

This element describes an any-to-any switch matrix and is used in place of the InputPorts and OutputPorts element. Any port can be an input or an output port. When requesting that a switch route be created, FlexOTO sends the switch port names with the set_routes command to the driver.

"InOutPorts": ["1","2","3","4","5","6","7","8"]

JSON Groups Wavelengths Element (optional)

Use this optional element to indicate all possible switch wavelength settings. Not all optical switches support this setting. If your switch does not support the wavelengths settings, your driver must still process the driver command set_wavelength but the response should do nothing except to return the "DONE" string).

"Wavelengths": ["1330 nm","1550 nm"]

In FlexOTO's GUI, the switch wavelength setting is located by clicking on the Switch block on the Hardware Diagram. Don't confuse this wavelength setting with the setting that is used to change a DCA-M modules wavelength setting. The location of the DCA-M setting is found by clicking the Stations Setup button which is located above the FlexOTO's Hardware Diagram.

You can enter any wavelength values that you want. In fact there are no rules on the strings except that their length is limited. FlexOTO uses these strings to populate the wavelength selections in the Switch Setup dialog that appears when you click on a Switch block. When you make a selection in this dialog, FlexOTO simply returns the wavelength string back to your driver as an argument to the set_wavelength command.