Welcome to ENeXAr’s documentation!¶
Here you can find the commands that the RPC server can receive:
- class enexar.epics_server.EpicsServer(prefix: str, root_path: str)¶
- _acquire(path: str, pv: str, n_acq: str, continuous: str, use_groups: str, timeout: str | None, metadata: Value | None, ts: Value, dbnd: Value | None, arr: Value | None, sync: Value | None, dec: Value | None, user: str | None, host: str | None, synchronous: bool = False) Value¶
- Parameters:
path (str) – relative path of the file, including filename.
pv (str) – PV signal to be acquired.
n_acq (str, optional) – number of acquisitons, if continuous==False. Defaults to ‘1’.
continuous (str, optional) – flag to enable continuous measurement. Defaults to False.
timeout (str, optional) – timeout in seconds for each acquisition. Set to 0 to disable. Defaults to 4 seconds.
metadata (dict, optional) – metadata for the acquisition, in JSON format. See README.md for more information.
ts (bool, optional) – EPICS timestamp filter. If set to True, it will enable the timestamp filter that sets the timestamp to the time when the request was done, instead of when the record was processed.
dbnd (dict, optional) – EPICS deadband filter. To receive monitor updates only when the PV changes by an amount larger than the deadband. It is defined as a JSON string with the same format as in the EPICS documentation.
arr (dict, optional) – EPICS array filter. To get a subset of an array, defined by the starting index s, the end index e, and the increment i. It is defined as a JSON string with the same format as in the EPICS documentation. The shorthand notation is not accepted.
sync (dict, optional) – EPICS synchronize filter. To synchronize the monitor updates with respect to an internal IOC state. It is defined as a JSON string with the same format as in the EPICS documentation.
dec (str, optional) – EPICS decimate filter. The monitor will update only after the record is processed dec times. It takes an integer number.
synchronous (bool, optional) – whether the acquisition is done synchronously (True) or asyncrhonously.
- Returns:
return True if the command is succesful, otherwise False with an alarm.
- Return type:
bool
- acquire(path: str, pv: str, user: str, host: str, n_acq: str = '1', continuous: str = 'False', use_groups: str = 'True', timeout: str | None = None, metadata: Value | None = None, ts: Value = 'False', dbnd: Value | None = None, arr: Value | None = None, sync: Value | None = None, dec: Value | None = None) Value¶
Acquires a PV and save it into the file specified by path. By default, it takes only 1 acquisition, but can be increased by passing the n_acq parameter. It can also be used to run a continuous acquisition by setting the continuous=True that will ve valid until a STOP (or CLOSE) command arrives. This command is asyncronous, the acquisition is done in a separate thread and the rpc call will return inmediately if no problems are found.
For the parameters and return value, check documentation of
_acquire()
- acquire_s(path: str, pv: str, n_acq: str = '1', continuous: str = 'False', use_groups: str = 'True', timeout: str | None = None, metadata: Value | None = None, ts: Value = 'False', dbnd: Value | None = None, arr: Value | None = None, sync: Value | None = None, dec: Value | None = None, user: str | None = None, host: str | None = None) Value¶
Acquires a PV and save it into the file specified by path. By default, it takes only 1 acquisition, but can be increased by passing the n_acq parameter. It can also be used to run a continuous acquisition by setting the continuous=True that will ve valid until a STOP (or CLOSE) command arrives. This command is syncronous, the rpc won’t return until the acquisition is done. If the acquisiton takes too long, the rpc call may time out unless the timeout is increased to cover for the full acquisition time. This makes continuous synchronous acquisition in general not useful, but it is supported.
For the parameters and return value, check documentation of
_acquire()
- close(path: str, user: str, host: str) Value¶
Close a file. If there was any acquisition taking place, it is stopped.
- Parameters:
path (str) – relative path of the file, including filename.
- Returns:
return True if command was successful, otherwise False with an alarm.
- Return type:
bool
- is_acquiring(pv: str, path: str, user: str | None = None, host: str | None = None) Value¶
Returns True if the PV is being acuired to a given path.
- Parameters:
path (str) – relative path of the file, including filename.
pv (str) – PV signal.
- Returns:
return True if the PV is being acquired, otherwise False.
- Return type:
bool
- is_open(path: str, user: str, host: str) Value¶
Check if a file is already open.
- Parameters:
path (str) – relative path of the file, including filename.
- Returns:
return True if file is open, otherwise False.
- Return type:
bool
- list_directory(path: str = ',.', user: str | None = None, host: str | None = None) Value¶
List the directory passed as an argument, or the path if it is a file.
- Parameters:
path (str) – relative path of the file, including filename.
- Returns:
return the list of files in the directory passed as an argument, or the path if it is a file. If the path does not exist, it returns an Error message.
- Return type:
list
- open(path: str, user: str, host: str) Value¶
Create a new FileManager for a file that doesn’t exists. If the FileManager already exists, it does nothing. Everything is done by a Worker process on a different process.
- Parameters:
path (str) – relative path of the file, including filename (extension optional).
- Returns:
return True if command was successful, otherwise False with an alarm.
- Return type:
bool
- stop_acquisition(pv: str, path: str, user: str | None = None, host: str | None = None) Value¶
Stop logging a PV on a given path. The file will accept more measurements.
- Parameters:
path (str) – relative path of the file, including filename.
pv (str) – PV signal.
- Returns:
return True if the command is succesful, otherwise False with an alarm.
- Return type:
bool