Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/instruments/img/dummy_instrument.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/instruments/img/empty_server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/instruments/img/load_from_file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/instruments/img/param_manager_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/instruments/img/param_manager_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/instruments/img/two_instruments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 85 additions & 1 deletion docs/instruments/instrumentserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ This will open the GUI of the server and start running it.
![Instrumentserver GUI](img/empty_server.png)

!!! note
The server can be run without a gui by passing the `--gui False` argument.
The server can be run without a gui by passing the `--gui False` argument.

If running the instrumentserver without the gui, the gui can be opened separately using the following command:
```bash
$ instrumentserver-detached
```

By default, instrumentserver listens to the local host IP address (127.0.0.1) and the port 5555. To be able to communicate
with the server through other devices in the network we have to specify the IP address we want the server to listen to.
Expand Down Expand Up @@ -141,3 +146,82 @@ Changing things in the GUI will also be reflected in the code.
Changing something from the GUI only changes the code if we are calling the parameter manager directly.
If we store a value in a separate variable and then change the GUI, the value in the variable might not get update.
Because of this, we always recommend to call the Parameter Manager directly instead of saving the values in variables.

## Config Files

The instrumentserver also contains functionality for config files. These config files contain set-up for QCoDeS instruments. These config files can then be used by the instrumentserver
on start-up to have the desired instruments already created without having to manually add them after starting the server.
Comment on lines +152 to +153
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeated These config ... start on 2 sentences in a row.

I think the wording is a little confusing. The instruments are not already created, instead the server will instantiate those instruments at startup. There is a minor difference there.


To open the instrument server with a config file, we can use the '-c' flag to specify a config file, followed by the path to the config file:

```bash
$ instrumentserver -c serverConfig.yml
```


Below is a sample config file to initialize a DummyInstrument and an Oxford Triton dilution refrigerator

`instruments`: this field will contain each instrument you wish to create. Under this field should be the names of each instrument you are creating

`type`: This specifies which QCoDeS driver the instrumentserver should use to create the instrument. Can either be a local file or a community-created driver
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has to be the python import path. If they put a path this will not work. The only way to passing this to a file is if they have that file in a package that install in editable mode.


`address`: the tcp/ip address of the instrument on the same network as the instrumentserver
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is whatever the instrument uses as an address. Sometimes its a tcp/ip other times a usb adress others a serial port or even the serial number if that driver uses that


`port`: which port (of the instrument) to communicate with (can generally be found in the manual of the instrument)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not part of the defaults arguments. This is specific to that instrument and that is why you need to put it inside of the init field. You should also mention what the init field does.


```yaml
instruments:
dummy_instrument_random_number:
type: instrumentserver.testing.dummy_instruments.generic.DummyInstrumentRandomNumber
initialize: True
fridge_test:
type: labcore.instruments.qcodes_drivers.Oxford.triton.OxfordTriton
address: 192.168.999.999
init:
port: 33576
```

This is the result of running the instrument server with this config file:

![two_instruments](img/two_instruments.png)

### Parameter Manager with Config Files

The instrumentserver also comes with the virtual instrument Parameter Manager.
The Parameter Manager allows us to store values in an instrument inside of the Instrumentserver, allowing access from any process or device in the same network.
The idea of it is to have a single source of truth for parameters whose values change frequently, and it provides a GUI from which you can change the values and easily see what they are.

The following is an example config file to add the parameter manager as a virtual instrument

```yaml
instruments:
parameter_manager:
type: instrumentserver.params.ParameterManager
initialize: True
gui:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the parameter manager with the custom GUI in the example before so you can mention how the instrumentserver supports custom gui's for instruments that need to be specified like this.

type: instrumentserver.gui.instruments.ParameterManagerGui
```

![parameter_manager_2](img/param_manager_2.png)


![parameter_manager_3](img/param_manager_3.png)

The instrumentserver also supports loading parameters from a file. They can also be created manually either from the terminal or the GUI.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace the They can also... to Parameters can also...

If you want to load parameters from file, then name of that file is important. Depending on the name it will either: not load the parameters, fully replace the parameters (add a warning about how they are all lost if that happens), make a new profile that you can switch to the other parameters there.


![load_from_file](img/load_from_file.png)

Below is an example of a parameter file

```json
{
"parameter_manager.active.qubit": {
"unit": "",
"value": "qC"
},
"parameter_manager.opx.const_amp": {
"unit": "",
"value": 5
}
}
```