Skip to content

Commit a48a9c0

Browse files
committed
Example connection table and labscript experiment script for RemoteBLACS and IMAQdxCamera
1 parent 5025b1b commit a48a9c0

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from labscript import start, stop, add_time_marker, Trigger, RemoteBLACS
2+
from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock
3+
from labscript_devices.DummyIntermediateDevice import DummyIntermediateDevice
4+
from labscript_devices.IMAQdxCamera.labscript_devices import IMAQdxCamera
5+
6+
# Use a virtual ('dummy') device for the psuedoclock
7+
DummyPseudoclock(name='pseudoclock')
8+
9+
# An output of this DummyPseudoclock is its 'clockline' attribute, which we use
10+
# to trigger children devices
11+
DummyIntermediateDevice(name='intermediate_device', parent_device=pseudoclock.clockline)
12+
13+
# Instantiate a labscript.Trigger instance used to trigger the camera exposure
14+
# This will be specified as the camera's parent device later
15+
Trigger(
16+
name='camera_trigger', parent_device=intermediate_device, connection='port0/line0'
17+
)
18+
19+
# On the host specified below, start the RemoteBLACS server by running the following:
20+
# $ python - m labscript_utils.remote
21+
RemoteBLACS(name='test_remote', host='localhost')
22+
23+
# We then initiate an IMAQdxCamera using this RemoteBLACS instance
24+
# using mock=True to bypass any attempts to commmunicate with an
25+
# actual camera, and generate fake data at the end of the shot
26+
IMAQdxCamera(
27+
name='camera',
28+
parent_device=camera_trigger,
29+
connection='trigger',
30+
serial_number=0xDEADBEEF,
31+
worker=test_remote,
32+
mock=True,
33+
)
34+
35+
# Begin issuing labscript primitives
36+
# start() elicits the commencement of the shot
37+
start()
38+
39+
# Stop the experiment shot with stop()
40+
stop(1.0)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
from labscript import start, stop, add_time_marker, Trigger, RemoteBLACS
2+
from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock
3+
from labscript_devices.DummyIntermediateDevice import DummyIntermediateDevice
4+
from labscript_devices.IMAQdxCamera.labscript_devices import IMAQdxCamera
5+
6+
# Use a virtual ('dummy') device for the psuedoclock
7+
DummyPseudoclock(name='pseudoclock')
8+
9+
# An output of this DummyPseudoclock is its 'clockline' attribute, which we use
10+
# to trigger children devices
11+
DummyIntermediateDevice(name='intermediate_device', parent_device=pseudoclock.clockline)
12+
13+
# Instantiate a labscript.Trigger instance used to trigger the camera exposure
14+
# This will be specified as the camera's parent device later
15+
Trigger(
16+
name='camera_trigger', parent_device=intermediate_device, connection='port0/line0'
17+
)
18+
19+
# On the host specified below, start the RemoteBLACS server by running the following:
20+
# $ python - m labscript_utils.remote
21+
RemoteBLACS(name='test_remote', host='localhost')
22+
23+
# We then initiate an IMAQdxCamera using this RemoteBLACS instance
24+
# using mock=True to bypass any attempts to commmunicate with an
25+
# actual camera, and generate fake data at the end of the shot
26+
IMAQdxCamera(
27+
name='camera',
28+
parent_device=camera_trigger,
29+
connection='trigger',
30+
serial_number=0xDEADBEEF,
31+
worker=test_remote,
32+
mock=True,
33+
)
34+
35+
# Begin issuing labscript primitives
36+
# A timing variable t is used for convenience
37+
# start() elicits the commencement of the shot
38+
t = 0
39+
add_time_marker(t, "Start", verbose=True)
40+
start()
41+
42+
t += 1
43+
add_time_marker(t, "Exposure: 'before' image", verbose=True)
44+
camera.expose(t, name='comparison', frametype='before', trigger_duration=0.2)
45+
46+
t += 0.5
47+
add_time_marker(t, "Exposure: 'after' image", verbose=True)
48+
camera.expose(t, name='comparison', frametype='after', trigger_duration=0.2)
49+
50+
t += 0.5
51+
stop(t)

0 commit comments

Comments
 (0)