Remote Control

Before diving into how the remote control for the Retina works, it has to be mentioned that we offer a Python controller class, WebSQControl, to facilitate easy remote control via Python. The latest version, along with full documentation, is available in the Help section of the user interface. If your goal is to get started quickly we would recommend you access this class and look at the examples here.

Methods of communication

JSON RPC

In order to send commands to the Retina driver we make use of the JSON RPC protocol. Commands in this format can be send to the API endpoint: [Driver IP]/api. This allows for communication with the driver, independent of platform or language. A request object in a JSON RPC command is expected to have the following format:

{
    "method": "<method name>",
    "params": "<parameters for the method>",
    "jsonrpc": "2.0",
    "id": "<identifier>"
}

A full list of methods, with expected parameters and responses can be found in the appendix here.

Websocket (Readout only)

The websocket outputs a direct stream of bytes which gives the most efficient way to readout data by far. You can access the websocket by listening to the following endpoint: [Driver IP]/counts.

The messages which are send here consist of 32 bytes, and structured as show in table Table: Channel Unit message structure. Every measurement interval of 10ms, these messages will be bundled and send to the websocket as one byte string. These messages will have to be split up again for readout.

Table: Channel Unit message structure

Parameter

Type

Bytes

Description

McuId

Int8

1

ID of the Retina Box.

CuId

Int8

1

ID of the Retina Channel Unit.

cuStatus

Int8

1

Status of the Channel Unit, see table Table: Status codes of the channel units in the appendix for more information

Padding

-

1

Can any 1 byte value

MonitorV

Float

4

Monitor Voltage (V)

biasI

Float

4

Bias Current (A)

Counts

Int32

4

Counts measured in one measurement interval (10ms)

intSize

Int32

4

Size of integration interval in Number of measurement intervals of 10ms

Rank

Int32

4

Channel Rank

Time

Double

8

Timestamp

WebSQControl Examples

We include a few examples of how to use the WebSQControl. The latest versions of these will be available in the help section of the user interface. We explore a few basic functionalities.

Collecting Counts

This example collects counts from the websocket for 2 seconds, with an interval of 0.1 seconds. This should return a list of the countrates for each channel every 0.1 seconds.

from WebSQController import WebSQController

# Please change this to be the IP address of the driver in your network
websq_domain = 'http://192.168.10.10/'

sq = WebSQController(websq_domain)

# Collects counts for 2 seconds every 0.1 seconds.
counts = sq.collectCounts(2, 0.1)
print(counts)

IV Sweeping

This example performs and IV sweep and prints the result for the first channel.

from WebSQController import WebSQController

# Please change this to be the IP address of the driver in your network
websq_domain = 'http://192.168.10.10/'

sq = WebSQController(websq_domain)

traces = sq.sweepIv(0, 50, 1, 100)

channels = list(traces.keys())
first_channel = channels[0]

print(f"Data for channel {first_channel}:")
print("Bias Current (uA):")
print(traces[first_channel]['biasI'])
print("Monitor Voltage (V):")
print(traces[first_channel]['monitorV'])

Setting the Bias Current

This is an example of how to set values on the driver for a specific channel.

from WebSQController import WebSQController

# Please change this to be the IP address of the driver in your network
websq_domain = 'http://192.168.10.10/'
sq = WebSQController(websq_domain)

print("Setting the bias current to 20 uA, for channel 1")

sq.setBiasI(20e-6, channels=[1])

print("Getting the bias current value of channel 1:")
print(sq.getBiasI(channels=[1]))