Skip to content
Snippets Groups Projects
Commit f9f1502b authored by camera computer's avatar camera computer
Browse files

QOL improvements

parent 632c7216
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ def trigger():
global awg
# step = get_step()
awg.force_trigger()
# step = int32(0)
print("triggering...")
# print("current step:", step)
......@@ -54,9 +53,10 @@ def load(fpath):
data = np.load(fpath, allow_pickle=True)
sig = data['signal']
step = get_step()
segment = (step + 1) % 2
segment = 1
awg.write_segment(sig, segment)
print(f"currently playing step {step}, loaded data onto step {segment}")
print(f"currently step {step}, loaded step {segment}")
data.close()
# argument parsing, more functionalities to be added later...
......@@ -87,10 +87,15 @@ sig0 = data0['signal']
data1 = np.load("data/wfm_5.npz", allow_pickle=True)
sig1 = data1["signal"]
# empty = np.zeros(static_sig.shape)
# empty = np.zeros(512)
# AWG stuff
# condition for awg step sequence.
# 0 for infinite loop until trigger
# 1 for finite loop, then goto nextstep afterwards.
condition = [SPCSEQ_ENDLOOPONTRIG, SPCSEQ_ENDLOOPALWAYS]
awg = AWG()
awg.open(id=awg_id) # change this to b'/dev/spcm0' for top AWG
awg.set_sampling_rate(sampling_rate)
......@@ -99,8 +104,10 @@ awg.set_trigger(EXT0=SPC_TM_POS)
awg.set_sequence_mode(2) # partition AWG memory into 2 segments
awg.write_segment(sig0, segment=0)
awg.write_segment(sig1, segment=1)
awg.configure_step(step=0, segment=0, nextstep=1, loop=1, condition=SPCSEQ_ENDLOOPONTRIG)
awg.configure_step(step=1, segment=1, nextstep=0, loop=1, condition=SPCSEQ_ENDLOOPONTRIG)
# awg.write_segment(empty, segment=1)
awg.configure_step(step=0, segment=0, nextstep=1, loop=1, condition=condition[0])
awg.configure_step(step=1, segment=1, nextstep=0, loop=1, condition=contition[0])
# awg.configure_step(step=1, segment=1, nextstep=0, loop=1, condition=SPCSEQ_ENDLOOPONTRIG)
start()
# console
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment