Pfeiffer TPG 366 Agent
The Pfeiffer TPG 366 Controller is a six channel pressure gauge monitor. The Pfeiffer agent communicates with the Controller module, and reads out pressure readingss from the six different channels.
usage: python3 agent.py [-h] [--ip_address IP_ADDRESS] [--port PORT]
[--mode {acq,test}]
Agent Options
- --ip_address
- --port
- --mode
Possible choices: acq, test
Default: “acq”
Configuration File Examples
Below are useful configurations examples for the relevent OCS files and for running the agent in a docker container.
OCS Site Config
To configure the Pfeiffer TPG 366 Agent we need to add a PfeifferAgent block to our ocs configuration file. Here is an example configuration block using all of the available arguments:
{'agent-class': 'PfeifferAgent',
'instance-id': 'pfeiffer',
'arguments': [
['--ip-address', '10.10.10.20'],
['--port', '8000'],
['--mode', 'acq'],
]}
You should assign a static IP address to Pfeiffer device, and record it here. In general, the Pfeiffer device will assign port 8000 by default. This should not need to be changed unless you you specificy the port otherwise.
Docker Compose
The Pfeiffer Agent can be run via a Docker container. The following is an example of what to insest into your institution’s docker compose file.
ocs-pfeiffer:
image: simonsobs/socs:latest
hostname: ocs-docker
network_mode: "host"
environment:
- INSTANCE_ID=pfeiffer
volumes:
- ${OCS_CONFIG_DIR}:/config:ro
Agent API
- class socs.agents.pfeiffer_tpg366.agent.PfeifferAgent(agent, ip_address, port, f_sample=1.0)[source]
- acq(sampling_frequency=2.5, test_mode=False)[source]
Process - Get pressures from the Pfeiffer gauges.
- Parameters:
sampling_frequency (float) – Rate at which to get the pressures [Hz]. Defaults to 2.5 Hz.
test_mode (bool) – Run the Process loop only once. This is meant only for testing. Defaults to False.
Example Clients
Below is an example client to start data acquisition:
from ocs.ocs_client import OCSClienti
import time
pfeiffer = OCSClient("pfeiffer", args=[])
params = {'auto_acquire': True}
pfeiffer.acq.start(**params)
pfeiffer.acq.wait()
time.sleep(0.05)
Note
If ['--mode', 'acq'] is specified in the ocs configuration file,
acquisition will begin automatically upon agent startup, so there may be no
need to run this client.
Supporting APIs
- class socs.agents.pfeiffer_tpg366.drivers.TPG366(ip_address, port=8000, timeout=10)[source]
Interface class for connecting to the Pfeiffer TPG366 maxigauge controller.
- Parameters:
ip_address (str) – IP address of the device.
port (int) – Associated port for TCP communication. Default is 8000.
timeout (float) – Duration in seconds that operations wait before giving up. Default is 10 seconds.
- comm
Socket object that forms the connection to the compressor.
- Type:
socket.socket
- send_and_recv(message)[source]
Send message and request transmission of queried data from device.
The flow control for querying the TPG366 involves first sending a message (referred to in the TPG366 manual as a mnemonic) to set the measuring mode, receiving positive feedback from the device, then sending a request for transmission from the device, followed finally by receiving the measurement data.
This method combines these four steps into one.
- Parameters:
message (str) – Mnemonic command code message with parameters.
- Return type:
Decoded response from the device.
- channel_power()[source]
Check the power state of all channels.
- Returns:
List of channel states.
- Return type:
list