Tektronix AWG Agent
This agent uses Standard Commands for Programmable Instruments (SCPI) It works for many function generators, including the Tektronix3021c. It connects to the function generator over ethernet, and allows users to set frequency, peak to peak voltage, and turn the AWG on/off.
usage: python3 agent.py [-h] [--ip-address IP_ADDRESS] [--gpib-slot GPIB_SLOT]
Agent Options
- --ip-address
IP address of Tektronix device.
- --gpib-slot
GPIB slot of Tektronix device.
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 Tektronix AWG Agent we need to add a block to our ocs configuration file. Here is an example configuration block using all of the available arguments:
{'agent-class': 'TektronixAWGAgent',
'instance-id': 'tektronix',
'arguments': [
['--ip-address', '10.10.10.5'],
['--gpib-slot', '1']
]},
Most function generators (including the Tektronix 3021c) have GPIB ports rather than ethernet ports. Therefore a GPIB-to-ethernet converter is required, and the gpib slot must be specified in the ocs configuration file. The IP address is then associated with the converter.
Docker Compose
The Tektronix AWG Agent should be configured to run in a Docker container. An example docker-compose service configuration is shown here:
ocs-psuK:
image: simonsobs/socs:latest
hostname: ocs-docker
environment:
- INSTANCE_ID=tektronix
volumes:
- ${OCS_CONFIG_DIR}:/config:ro
Agent API
- class socs.agents.tektronix3021c.agent.TektronixAWGAgent(agent, ip_address, gpib_slot)[source]
Tektronix3021c Function Generator Agent.
- Parameters:
ip_address (string) – The IP address of the gpib to ethernet controller connected to the function generator.
gpib_slot (int) – The gpib address currently set on the function generator.
- set_frequency(frequency)[source]
Task - Set frequency of the function generator.
- Parameters:
frequency (float) – Frequency to set in Hz. Must be between 0 and 25,000,000.
Example Clients
Below is an example client demonstrating full agent functionality. Note that all tasks can be run even while the data acquisition process is running.:
from ocs.ocs_client import OCSClient
# Initialize the power supply
tek = OCSClient('tektronix', args=[])
tek.init.start()
tek.init.wait()
# Set AWG frequency
psuK.set_frequency.start(frequency=200)
psuK.set_frequency.wait()
# Set AWG peak to peak voltage
psuK.set_amplitude.start(amplitude=5)
psuK.set_amplitude.wait()
# Set AWG on/off
psuK.set_output.start(state=True)
psuK.set_output.wait()