Notebooks#
These notebooks introduce basic operation with the OpenSync Python package. Use the Python environment where you installed the OpenSync wheel.
The documentation displays the notebooks and their saved outputs without executing their cells or opening a hardware connection.
Connect and read device information#
Connect OpenSync over USB, discover available devices, and read the identity and status of the first one:
import opensync
ports = opensync.device_comm_search()
if not ports:
raise RuntimeError("No OpenSync device found. Check the USB connection.")
with opensync.device_comm_managed(ports[0]) as device:
print(opensync.device_system_version(device))
print(opensync.device_system_status(device))
The context manager closes the connection when the block ends. This example reads device information without starting a timing sequence.
Configure and run a sequence#
The normal Python workflow is:
Create clock and channel parameter dictionaries with
get_clock_params()andget_pulse_params().Set timing, counters, synchronization, and enabled channels using the
config_clock_*andconfig_pulse_*helper functions.Inspect pulse timing with
get_pulse_plot()when useful.Open the serial connection and upload both configurations with
device_params_load(device, clock_params, pulse_params).Use
device_system_fire()to start anddevice_system_stop()to stop.
The notebooks above work through these steps. Function details are in the Python API Reference.