Skip to content

Commit

Permalink
Add AnalogOut with ramp example, rename DigitalOut connection
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanderson committed Jun 22, 2020
1 parent 9b64a0d commit 4c19de9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from labscript import start, stop, add_time_marker, DigitalOut
from labscript import start, stop, add_time_marker, AnalogOut, DigitalOut
from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock
from labscript_devices.DummyIntermediateDevice import DummyIntermediateDevice

Expand All @@ -9,8 +9,13 @@
# to trigger children devices
DummyIntermediateDevice(name='intermediate_device', parent_device=pseudoclock.clockline)

# Create an AnalogOut child of the DummyIntermediateDevice
AnalogOut(name='analog_out', parent_device=intermediate_device, connection='ao0')

# Create a DigitalOut child of the DummyIntermediateDevice
DigitalOut(name='digital_out', parent_device=intermediate_device, connection='do0')
DigitalOut(
name='digital_out', parent_device=intermediate_device, connection='port0/line0'
)

# Begin issuing labscript primitives
# start() elicits the commencement of the shot
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from labscript import start, stop, add_time_marker, DigitalOut
from labscript import start, stop, add_time_marker, AnalogOut, DigitalOut
from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock
from labscript_devices.DummyIntermediateDevice import DummyIntermediateDevice

Expand All @@ -9,8 +9,13 @@
# to trigger children devices
DummyIntermediateDevice(name='intermediate_device', parent_device=pseudoclock.clockline)

# Create an AnalogOut child of the DummyIntermediateDevice
AnalogOut(name='analog_out', parent_device=intermediate_device, connection='ao0')

# Create a DigitalOut child of the DummyIntermediateDevice
DigitalOut(name='digital_out', parent_device=intermediate_device, connection='do0')
DigitalOut(
name='digital_out', parent_device=intermediate_device, connection='port0/line0'
)

# Begin issuing labscript primitives
# A timing variable t is used for convenience
Expand All @@ -29,6 +34,9 @@
# Wait for 0.5 seconds
t += 0.5

# Ramp analog_out from 0.0 V to 1.0 V over 0.25 s with a 1 kS/s sample rate
t += analog_out.ramp(t=t, initial=0.0, final=1.0, duration=0.25, samplerate=1e3)

# Change the state of digital_out, and denote this using a time marker
add_time_marker(t, "Toggle digital_out (low)", verbose=True)
digital_out.go_low(t)
Expand Down

0 comments on commit 4c19de9

Please sign in to comment.