Skip to content

Commit 9b64a0d

Browse files
committed
Minimal example connection table and labscript using dummy devices
1 parent f77525f commit 9b64a0d

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

labscript_profile/default_profile/labconfig/example.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ app_saved_configs = %(labscript_suite)s\app_saved_configs\%(apparatus_name)s
1010
user_devices = user_devices
1111

1212
[paths]
13-
connection_table_h5 = %(experiment_shot_storage)s\connectiontable.h5
14-
connection_table_py = %(labscriptlib)s\connectiontable.py
13+
connection_table_h5 = %(experiment_shot_storage)s\connection_table.h5
14+
connection_table_py = %(labscriptlib)s\connection_table.py
1515

1616
[servers]
1717
zlock = localhost
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from labscript import start, stop, add_time_marker, DigitalOut
2+
from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock
3+
from labscript_devices.DummyIntermediateDevice import DummyIntermediateDevice
4+
5+
# Use a virtual, or 'dummy', device for the psuedoclock
6+
DummyPseudoclock(name='pseudoclock')
7+
8+
# An output of this DummyPseudoclock is its 'clockline' attribute, which we use
9+
# to trigger children devices
10+
DummyIntermediateDevice(name='intermediate_device', parent_device=pseudoclock.clockline)
11+
12+
# Create a DigitalOut child of the DummyIntermediateDevice
13+
DigitalOut(name='digital_out', parent_device=intermediate_device, connection='do0')
14+
15+
# Begin issuing labscript primitives
16+
# start() elicits the commencement of the shot
17+
start()
18+
19+
# Stop the experiment shot with stop()
20+
stop(1.0)
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, DigitalOut
2+
from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock
3+
from labscript_devices.DummyIntermediateDevice import DummyIntermediateDevice
4+
5+
# Use a virtual, or 'dummy', device for the psuedoclock
6+
DummyPseudoclock(name='pseudoclock')
7+
8+
# An output of this DummyPseudoclock is its 'clockline' attribute, which we use
9+
# to trigger children devices
10+
DummyIntermediateDevice(name='intermediate_device', parent_device=pseudoclock.clockline)
11+
12+
# Create a DigitalOut child of the DummyIntermediateDevice
13+
DigitalOut(name='digital_out', parent_device=intermediate_device, connection='do0')
14+
15+
# Begin issuing labscript primitives
16+
# A timing variable t is used for convenience
17+
# start() elicits the commencement of the shot
18+
t = 0
19+
add_time_marker(t, "Start", verbose=True)
20+
start()
21+
22+
# Wait for 1 second with all devices in their default state
23+
t += 1
24+
25+
# Change the state of digital_out, and denote this using a time marker
26+
add_time_marker(t, "Toggle digital_out (high)", verbose=True)
27+
digital_out.go_high(t)
28+
29+
# Wait for 0.5 seconds
30+
t += 0.5
31+
32+
# Change the state of digital_out, and denote this using a time marker
33+
add_time_marker(t, "Toggle digital_out (low)", verbose=True)
34+
digital_out.go_low(t)
35+
36+
# Wait for 0.5 seconds
37+
t += 0.5
38+
39+
# Stop the experiment shot with stop()
40+
stop(t)

0 commit comments

Comments
 (0)