QuTech-Delft / QMI

Quantum Measurement Infrastructure
Other
14 stars 4 forks source link

Enhancement: Device Driver Rhode Schwarz ZNBx #31

Open gyger opened 1 year ago

gyger commented 1 year ago

Is your feature request related to a problem? Please describe. I am wondering if you are planning or working on introducing device drivers for Rhode Schwarz instruments like Oscilloscope [1] / VNAs [2] etc.

Describe the solution you'd like Device driver for ZNB4,6,8,20.

Describe alternatives you've considered I guess using Qcodes is an alternative.

[1] https://www.rohde-schwarz.com/us/products/test-and-measurement/oscilloscopes_63663.html [2] https://www.rohde-schwarz.com/us/products/test-and-measurement/network-analyzers/rs-znb-vector-network-analyzer_63493-11648.html

heevasti commented 1 year ago

Hi,

Thank you for your request! Indeed more instrument drivers in QMI are always welcome. This could be handled in a couple of ways:

  1. Making a more detailed request with a list of functionalities you would like to have (implementing the whole SCPI protocol library from the manual is quite a lot of work, so an initial selection of most needed features is better. More can be added later) and we can then review/refine the ticket further and add it to our backlog. Note that we have also various requests and support duties locally here at QuTech so when we can pick up the ticket from the backlog to do is not easily predicted. Perhaps we speak of a time-span of 1-2 months to get it done.
  2. Check out contribution guidelines and try to get it started yourself (we can also help). Then by making a pull request with your development, we can then review the pull request. Perhaps we can then also take over some further development and e.g. adding unit-tests to it. This would probably be the faster option to get it done. This way you'll also probably first implement the SCPI commands you really need and other useful, but not-so-necessary, functions will then follow in some follow-up ticket.

From a quick look on the manual, QMI can communicate with the ZNB devices with VXI-11 protocol (vxi11 transport in QMI) and also using USB connection (usbtmc transport in QMI). Examples for VXI-11 and USBTMC transport use in QMI (excluding import statements):

with start_stop(
        qmi, "awg5014_test"
    ), open_close(
        qmi.make_instrument(
            "awg5014", Tektronix_Awg5014, "vxi11:123.45.67.89"
        )  # Note that AWG load/send commands have issues with encoding in TCP protocol -> use GPIB or VXI11
    ) as awg:

    # Start with clearing the buffer
    awg.wait_and_clear()

    # getting idn
    idn = awg.get_idn()
    print("The vendor of the device is %s" % idn.vendor)
    print("The model of the device is %s" % idn.model)
    print("The serial of the device is %s" % idn.serial)
    print("The version of the device is %s" % idn.version)
    qmi.start("rs_smbv100a_test")
    # usb transport string
    usb_transport_str = "usbtmc:vendorid=0x0AAD:productid=0x005f:serialnr=258300"
    try:
        # make instrument
        instr: RohdeSchwarz_SMBV100A = qmi.make_instrument("smbv100a", RohdeSchwarz_SMBV100A, usb_transport_str)
        instr.open()
        # getting idn
        idn = instr.get_idn()
        print("The vendor of the device is %s" % idn.vendor)
        print("The model of the device is %s" % idn.model)
        print("The serial of the device is %s" % idn.serial)
        print("The version of the device is %s" % idn.version)
        instr.close()
    finally:
        qmi.stop()

Vendor and Product ID, and serial nr, should be present in the documentation, or can be found on the instrument itself.