catalight.equipment.gc_control.sri_gc.GC_Connector

class catalight.equipment.gc_control.sri_gc.GC_Connector(ctrl_file='/home/docs/checkouts/readthedocs.org/user_builds/catalight/checkouts/stable/catalight/equipment/gc_control/DEFAULT.CON')

Bases: object

Interface with SRI GC through Peaksimple interface via .dll file.

If the assembly can’t be found, find the .dll file, right click, properties, check “unblock”, click apply

Parameters:

ctrl_file (str) – Full path to the initial ctrl file to use.

__init__(ctrl_file='/home/docs/checkouts/readthedocs.org/user_builds/catalight/checkouts/stable/catalight/equipment/gc_control/DEFAULT.CON')

Connect to GC and load control file.

Methods

__init__([ctrl_file])

Connect to GC and load control file.

connect([max_tries])

Attempt to connect to running peaksimple software.

disconnect([max_tries])

Disconnect from peaksimple software.

is_running([max_tries])

Request status of GC collection (running or not).

load_ctrl_file([max_tries])

Load a new ctrl file to the GC based on .ctrl_file attr.

read_gc_settings()

Read loaded control file and updates object with values from file.

set_running([max_tries])

Start data collection.

update_gc_settings(data_file_path)

Write over the currently loaded ctrl file to update settings.

Attributes

min_sample_rate

(min) Minimum setpoint for sample_rate.

sample_rate

Time between GC collections in minutes.

peaksimple

Create instance of PeaksimpleConnector.

ctrl_file

Full path to control file to use.

sample_set_size

Number of GC collection for each time set_running() is called.

_min_sample_buffer

Min time to wait after ctrl file “Channel 1 time” finishes and starting new run. The default is 5. This value + Channel 1 time sets the min_sample_rate. To change sampling time, use self.sample_rate.

Type:

float

connect(max_tries=1)

Attempt to connect to running peaksimple software.

Parameters:

max_tries (int, optional) – Number of attempts to make before aborting. The default is 1.

Raises:

Peaksimple.ConnectionFailedException – Connection to GC was unsuccessful.

Return type:

None

ctrl_file

Full path to control file to use.

Type:

str

disconnect(max_tries=1)

Disconnect from peaksimple software. Reconnection still usually fails.

Runs Peaksimple.PeaksimpleConnector.Disconnect(), but attempts to reconnect still fail. The peaksimple software needs to be manually closed to reconnect. Note, programmatic attempts to close peaksimple using subprocesses have also failed.

Parameters:

max_tries (int, optional) – Number of attempts to make before aborting. The default is 1.

Return type:

None

is_running(max_tries=3)

Request status of GC collection (running or not).

Parameters:

max_tries (int, optional) – Number of attempts to make before aborting. The default is 3.

Raises:

Exception – Exception raised on calling IsRunning() are suppressed up until max_tries is reached.

Returns:

result – When successful, returns the status of GC collection (on/off)

Return type:

bool

load_ctrl_file(max_tries=3)

Load a new ctrl file to the GC based on .ctrl_file attr.

Attempt to load a new control file. Waits 5 seconds after loading then calls read_ctr_file()

Parameters:

max_tries (int, optional) – Number of attempts to make before aborting. The default is 3.

Raises:
  • Peaksimple.ConnectionWriteFailedException – Somewhat randomly occurring error usually fixed by reattempting.

  • Peaksimple.NoConnectionException – Communication to peaksimple lost. Likely need to reboot peaksimple.

property min_sample_rate

(min) Minimum setpoint for sample_rate. Sum of Channel 1 Time from GC control file and self.min_sample_buffer. Value automatically updates when read_gc_settings() is called.

Type:

float, read-only

peaksimple

Create instance of PeaksimpleConnector. SRI Gas chromatograph for more info on methods.

read_gc_settings()

Read loaded control file and updates object with values from file.

Currently updates min_sample_rate property by pulling run time from control file and adding self.min_sample_buffer. Updates sample_rate if it is faster than the new min_sample_rate.

Return type:

None

property sample_rate

Time between GC collections in minutes.

The GC will collect data every sample_rate minutes when sample_set_size is set >1. If the min_sample_rate is less than the entered value, prints a warning and resets sample_rate to min_sample_rate. Warning - Ctrl file must be loaded for changes to take effect!!

sample_set_size

Number of GC collection for each time set_running() is called. Can be changed per experiment by editing Experiment.sample_set_size

Type:

int

set_running(max_tries=3)

Start data collection. Make sure correct GC settings are loaded first.

Wraps over peaksimple set running function. Will set channel 1 running by default. This could be made flexible in the future if ever needed. I think most SRI GC interactions are controlled by channel 1 though.

Parameters:

max_tries (int, optional) –

Number of attempts to make before aborting. The default is 3.

raises Exception:

Exception raised on calling SetRunning are suppressed up until max_tries is reached.

update_gc_settings(data_file_path)

Write over the currently loaded ctrl file to update settings.

Updates data file path to that provided. Sets postrun repeat to sample_set_size. Goes line by line through the control file defined by ctrl_file attr and rewrites the line to set appropriate options. Ensures postrun cycle & repeat, autoincrement, and save image, data, & results are all turned on. Updates Postrun cycle time to get total sample time to match self.sample_time.

Parameters:

data_file_path (str) – Full path to the directory in which you’d like to save data files.