DAQ

class pcdsdevices.daq.Daq(name=None, platform=0, parent=None)

The LCLS1 DAQ as a flyer object. This uses the pydaq module to connect with a running daq instance, controlling it via socket commands. It can be used as a flyer in a bluesky plan to have the daq start at the beginning of the run and end at the end of the run. It has additional knobs for pausing and resuming acquisition if desired.

Unlike a normal bluesky flyer, this has no data to report to the RunEngine on the collect call. No data will pass into the python layer from the daq.

begin(events=None, duration=None, use_l3t=None, controls=None, wait=False)

Start the daq with the current configuration. Block until the daq has begun acquiring data. Optionally block until the daq has finished aquiring data.

Parameters:
  • events (int, optional) – Number events to stop acquisition at.
  • duration (int, optional) – Time to run the daq in seconds.
  • wait (bool, optional) – If switched to True, wait for the daq to finish aquiring data.
collect()

As per the bluesky interface, this is a generator that is expected to output partial event documents. However, since we don’t have any events to report to python, this will be a generator that immediately ends.

complete()

End the current run.

Return a status object that will be marked as ‘done’ when the DAQ has finished acquiring.

Returns:end_status
Return type:DaqStatus
configure(events=None, duration=None, record=False, use_l3t=False, controls=None, always_on=False)

Changes the daq’s configuration for the next run.

Parameters:
  • events (int, optional) – If provided, the daq will run for this many events before stopping, unless we override in begin. If not provided, we’ll use the duration argument instead.
  • duration (int, optional) – If provided, the daq will run for this many seconds before stopping, unless we override in begin. If not provided, and events was also not provided, an empty call to begin() will run indefinitely.
  • use_l3t (bool, optional) – If True, an events argument to begin will be reinterpreted to only count events that pass the level 3 trigger.
  • record (bool, optional) – If True, we’ll record the data. Otherwise, we’ll run without recording.
  • controls (dict{str: device}, optional) – If provided, values from these will make it into the DAQ data stream as variables. We will check device.position and device.value for quantities to use and we will update these values each time begin is called.
  • always_on (bool, optional) – This determines our run control during a Bluesky scan with a RunEngine attached to a Daq object. If this is False, we will start taking events at create messages and stop taking events at save messages. If we are configured for a number of events or a duration, we’ll make sure to run for exactly that long between the create and save messages, waiting in the scan if necessary. If this is True, we won’t provide any run control. The daq will start recording at the beginning of the run and will stop recording at the end of the run.
Returns:

old, new

Return type:

tuple of dict

connect()

Connect to the DAQ instance, giving full control to the Python process.

describe_collect()

As per the bluesky interface, this is how you interpret the null data from collect. There isn’t anything here, as nothing will be collected.

describe_configuration()
Returns:config_desc – Mapping of config key to field metadata.
Return type:dict
disconnect()

Disconnect from the DAQ instance, giving control back to the GUI

end_run()

Stop the daq if it’s running, then mark the run as finished.

kickoff(events=None, duration=None, use_l3t=None, controls=None)

Begin acquisition. This method is non-blocking.

Returns:ready_status – Status that will be marked as ‘done’ when the daq has begun to record data.
Return type:DaqStatus
pause()

Stop acquiring data, but don’t end the run.

read_configuration()
Returns:config – Mapping of config key to current configured value.
Return type:dict
resume()

Continue acquiring data in a previously paused run.

stage()

Nothing to be done here, but we overwrite the default stage because it is expecting sub devices.

Returns:staged – list of devices staged
Return type:list
state_enum

alias of pydaq state

stop()

Stop the current acquisition, ending it early.

unstage()

Nothing to be done here, but we overwrite the default stage because it is expecting sub devices.

Returns:unstaged – list of devices unstaged
Return type:list
wait(timeout=None)

Pause the thread until the DAQ is done aquiring.

Parameters:timeout (float) – Maximum time to wait in seconds.