pcdshub / pcdsdaq

Utilities for using the DAQ's pydaq, pycdb, and pyami libraries in conjunction with Bluesky
https://pcdshub.github.io/pcdsdaq
Other
0 stars 9 forks source link

DAQ as a readable device #26

Closed ZLLentz closed 6 years ago

ZLLentz commented 6 years ago

Expected Behavior

I can't remember why we opted against this, but I'm imagining something like:

from bluesky.plans import scan
from bluesky.run_engine import RunEngine

from pcdsdaq.daq import Daq
from pcdsdevices.device_types import IMS

RE = RunEngine({})
daq = Daq()
mot = IMS('XPP:USR:MMS:01', name='my_stage')
RE(scan([daq], mot, 0, 10, 11))

Where:

I feel like this would be much simpler for the purposes of LCLS. We'd be able to use most of the built-in tools as-is.

As an aside, this makes it easier to implement scan PVs (it is revealed, the true reason I'm suggesting this...)

Current Behavior

Only usable as a flyer, instead of as both a flyer and a reader

ZLLentz commented 6 years ago

@teddyrendahl any opinions on this?

teddyrendahl commented 6 years ago

Can I be a 🍑and say I suggested this back at the beginning? 😝

I like this. The result is that you can just pass the DAQ in as a detector which seems the most intuitive thing for me. The only thing that is awkward is the stage unstage thing. If I want to have all my steps be different runs do I stage / unstage on every per_step hook? I guess that isn't crazy...

ZLLentz commented 6 years ago

Sorry for not remembering! Time has shown that using this a flyer is "correct" mechanically but unintuitive. IIRC stage_wrapper puts itself at every open_run and close_run, which I why I suggested that. So as long as you use the stage_wrapper and start/stop your runs at the right times, the daq will know how to partition the runs!

ZLLentz commented 6 years ago

Memory was bad, this is not how stage_wrapper works. Oh well.

ZLLentz commented 6 years ago

Two ideas then:

ZLLentz commented 6 years ago

closed by #27