SRS CG635 Agent

The SRS CG635 Agent is an OCS Agent which retrieves data from the SRS CG635 clock via a Prologix GPIB interface.

usage: python3 agent.py [-h] [--ip-address IP_ADDRESS] [--gpib-slot GPIB_SLOT]
                        [--mode {idle,init,acq}]

Agent Options

--ip-address

Prologix IP Address

--gpib-slot

Internal SRS GPIB Address

--mode

Possible choices: idle, init, acq

Starting action for the Agent.

Default: “acq”

Configuration File Examples

Below are configuration examples for the ocs config file and for running the Agent in a docker container.

OCS Site Config

To configure the SRS CG635 Agent we need to add an SRSCG635Agent block to our ocs configuration file. Here is an example configuration block using all of the available arguments:

{'agent-class': 'SRSCG635Agent',
 'instance-id': 'srs-cg635',
 'arguments': [['--ip-address', '10.10.10.10'],
               ['--gpib-slot', 23],
               ['--mode', 'acq']]},

Note

The --ip-address argument should be the IP address of the Prologix GPIB interface. The --gpib-slot argument should be the GPIB address set on the SRS CG635. For first time setup, use the utility software available on the Prologix website. The NetFinder utility should be used to find the IP address of the Prologix GPIB interface. The Prologix GPIB Interface utility should be used to set the GPIB address.

Docker Compose

The SRS CG635 Agent should be configured to run in a Docker container. An example docker-compose service configuration is shown here:

ocs-srs-cg635:
  image: simonsobs/socs:latest
  hostname: ocs-docker
  network_mode: "host"
  environment:
    - INSTANCE_ID=srs-cg635
    - SITE_HUB=ws://127.0.0.1:8001/ws
    - SITE_HTTP=http://127.0.0.1:8001/call
    - LOGLEVEL=info
  volumes:
    - ${OCS_CONFIG_DIR}:/config:ro

The LOGLEVEL environment variable can be used to set the log level for debugging. The default level is “info”.

Description

The SRS CG635 Agent retrieves data from the SRS CG635 clock via a Prologix GPIB interface. The SRS CG635 drivers are used to connect to the Prologix GPIB interface.

Agent API

class socs.agents.srs_cg635.agent.SRSCG635Agent(agent, ip_address, gpib_slot)[source]

Class to retrieve data from the SRS CG635 clock.

Parameters:
  • agent (ocs_agent.OCSAgent) – Instantiated OCSAgent class for this Agent.

  • ip_address (str) – IP address of the Prologix GPIB interface.

  • gpib_slot (int) – GPIB address set on the SRS CG635.

init(auto_acquire=False)[source]

Task - Initialize the connection to the srs clock.

Parameters:

auto_acquire (bool, optional) – Default is False. Starts data acquisition after initialization if True.

acq(wait=1, test_mode=False)[source]

Process - Continuously monitor SRS clock registers and publish to a feed. Note that local changes on the clock (physically pressing buttons) will be unavailable during this process.

The session.data object stores the most recent published values in a dictionary. For example:

session.data = {
    'timestamp': 1598626144.5365012,
    'block_name': 'clock_output',
    'data': {
        'Frequency': 122880000.0
        'Standard_CMOS_Output': 3,
        'Running_State': 1,
        'Timebase': 3
    }
}

Refer to drivers for interpretation of outputs.

Parameters:
  • wait (float, optional) – Time to wait between measurements [seconds]. Default=1s.

  • test_mode (bool, optional) – Run the process loop only once. Meant for testing only. Default=False

Supporting APIs

class socs.agents.srs_cg635.drivers.SRSCG635Interface(ip_address, gpibAddr, verbose=False, **kwargs)[source]

Bases: PrologixInterface

This device driver is written for the SRS CG635 clock used for the timing system.

get_freq()[source]

Queries the clock for its current output frequency in Hz.

Returns the frequency as a float.

get_stdc()[source]

Queries the clock for the current Standard CMOS (STDC) output setting.

The query returns an int with the int representing the CMOS output setting. The outputs are represented in volts between the CMOS low and CMOS high with CMOS low = 0V.

The standard CMOS output settings this query can return are are:

-1 = Not a standard CMOS Output
 0 = 1.2V
 1 = 1.8V
 2 = 2.5V
 3 = 3.3V (The default for our current setup)
 4 = 5.0V
get_runs()[source]

Queries the clock for the current Running State (RUNS).

Returns an int which represents the following running states:

0 = Not Running (Output is off)
1 = Running (Output is on)
get_timebase()[source]

Queries the clock for the current timebase (TIMB).

Returns an int which represents the following states:

0 = Internal timebase
1 = OCXO timebase
2 = Rubidium timebase
3 = External timebase
get_all_status()[source]
clear()[source]

Clear all the event registers and error queue.