ftsw500_interface
frog.hardware.plugins.spectrometer.ftsw500_interface
¤
Module containing code for sending commands to FTSW500 for the ABB spectrometer.
Communication is via TCP.
The FTSW500 program must be running on the computer at FTSW500_HOST for the commands to work. The server always returns a response after having received a command. The response will start with the tag "ACK" in case of success, or "NAK" otherwise, and is terminated by the end-of-line character "\n". An answer can also contain a string value or message after the tag, which will be preceded by "&". For example, querying whether the instrument is currently measuring data would yield a response "ACK&true\n" or "ACK&false\n".
Attributes¤
Classes¤
FTSW500Interface(host=DEFAULT_FTSW500_HOST, port=DEFAULT_FTSW500_PORT, polling_interval=DEFAULT_FTSW500_POLLING_INTERVAL)
¤
Bases: FTSW500InterfaceBase
Interface for communicating with the FTSW500 program.
Create a new FTSW500Interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host
|
str
|
The hostname or IP of the machine running the FTSW500 software |
DEFAULT_FTSW500_HOST
|
port
|
int
|
The port on which to make requests |
DEFAULT_FTSW500_PORT
|
polling_interval
|
float
|
How often to poll the spectrometer's status (seconds) |
DEFAULT_FTSW500_POLLING_INTERVAL
|
Source code in frog/hardware/plugins/spectrometer/ftsw500_interface.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
Functions¤
close()
¤
Close the device.
Source code in frog/hardware/plugins/spectrometer/ftsw500_interface.py
96 97 98 99 100 101 102 103 |
|
request_command(command)
¤
Request that FTSW500 run the specified command.
The status is requested after sending the command so that we are immediately notified if it has changed in response to the command (e.g. recording has started).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command
|
str
|
Name of command to run |
required |
Source code in frog/hardware/plugins/spectrometer/ftsw500_interface.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|