Error with external wait monitor using Prawnblaster

112 views
Skip to first unread message

Tomáš Lamich

unread,
Apr 12, 2022, 10:25:14 AM4/12/22
to the labscript suite
Hi again everybody,

I fought a problem using external wait monitor and PrawnBlaster during compilation of shot in runmanager. The error is shows me is as follows:
Traceback (most recent call last):
  File "\\files\Users\tlamich\Pico_test\wait_tst.py", line 49, in <module>
    stop(t)
  File "c:\users\tlamich\labscript-suite\labscript\labscript\labscript.py", line 3588, in stop
    generate_code()
  File "c:\users\tlamich\labscript-suite\labscript\labscript\labscript.py", line 3407, in generate_code
    device.generate_code(hdf5_file)
  File "c:\users\tlamich\labscript-suite\labscript-devices\labscript_devices\PrawnBlaster\labscript_devices.py", line 411, in generate_code
    reps = instruction["reps"]
TypeError: string indices must be integers
Compilation aborted.


If I use the internal wait monitor, I have no error and the code executes smoothly. Also If I comment out the line using the 'wait' function I can run the code.
Following is the declaration of wait monitor, and relevant parts of the experimental sequence:
PrawnBlaster(name='prawn', com_port='COM4', num_pseudoclocks=1,use_wait_monitor=False)
#find the COM port and include it here
NI_PCI_6713(name='ni_card_1',parent_device=prawn.clocklines[0],
                        clock_terminal='PFI2', MAX_name='Dev1')
NI_PCI_DIO_32HS(name='DIO_card',parent_device=prawn.clocklines[0],
                        clock_terminal='PFI2', MAX_name='Dev2')
WaitMonitor(name='waiter',parent_device=DIO_card,connection='port0/line3',
                        acquisition_device=ni_card_1, acquisition_connection='ctr0',
                        timeout_device=ni_card_1, timeout_connection='PFI1')

DigitalOut('WaitDummy',DIO_card,'port0/line7')

start()
t0=0
t=t0
t+=0.1
#choose randomly to trigger the wait monitor or timeout the experiment
a=random()
if a > 0.5:
    dig0.go_high(t)
else:
    dig0.go_low(t)
Ana1.constant(t, value=1)
t+=0.5
#wait for the trigger
t+=wait('wait_0',t=t,timeout=2.0)
#do things after succesfull retriggering
t+=0.1
...(do some more pulses to see the retriggering)
stop(t)

If anyone knows what I am doing wrong, I'll be very grateful.

Have a great day.
Tomas

dihm....@gmail.com

unread,
Apr 14, 2022, 3:34:41 PM4/14/22
to the labscript suite
Tomas,

You seem to have stumbled on to some quirk of the Prawnblaster itself. I'm not 100% confident of this and don't have a ton of time to investigate right now, but my guess is that the Prawnblaster does not like doing waits if they are timed by something else. I don't necessarily think that is intentional, but I'm also pretty sure we didn't really think anyone would actually want to do wait timing externally to the prawnblaster. Is there a reason the internal timing doesn't work for you?

Sorry to not be more helpful,
-David

Philip Starkey

unread,
Apr 15, 2022, 12:06:10 AM4/15/22
to labscri...@googlegroups.com
Hi Tomas,

Apologies for the delay in replying (it seems like a lot of labscript suite mailing list emails are going to my spam folder).

I've had a brief look and I think it might just be a matter of adding a continue statement at the end of this "else" code block (similar to how it is in the code block for the if statement above). Would you mind adding that and testing to see if it fixes the issue?

That said, I suspect that the prawnblaster's internal wait monitor would be better than the NI card (should have a better timing resolution for measuring the lengths of waits). So you night want to consider just using that if it's an appropriate option for your setup.

Cheers,
Phil

--
You received this message because you are subscribed to the Google Groups "the labscript suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to labscriptsuit...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/labscriptsuite/acbae6bb-2f2b-483d-8955-047c81ff4664n%40googlegroups.com.


--
Dr Philip Starkey
Senior Technician (Lightboard developer)

School of Physics & Astronomy
Monash University
10 College Walk, Clayton Campus
Victoria 3800, Australia

Tomáš Lamich

unread,
Apr 19, 2022, 5:43:16 AM4/19/22
to the labscript suite
Hi David and Phil,

I am sorry for the delay in my response, I was away for the Easter holiday.
Thank you very much for your input, we discussed the issue and agreed that using internal wait monitor will be simpler for us than the current set-up.
The reason I wanted to use external wait monitor was that historically people in our lab used PineBlaster and external wait monitoring, so I wanted to see if this feature will be available after the change.

Out of curiosity I tried to add the continue statement as Phil suggested, but that also raised and error, although in different section of the code:
Traceback (most recent call last):
  File "\\files\Users\tlamich\Pico_test\wait_tst.py", line 49, in <module>
    stop(t)
  File "c:\users\tlamich\labscript-suite\labscript\labscript\labscript.py", line 3588, in stop
    generate_code()
  File "c:\users\tlamich\labscript-suite\labscript\labscript\labscript.py", line 3407, in generate_code
    device.generate_code(hdf5_file)
  File "c:\users\tlamich\labscript-suite\labscript-devices\labscript_devices\PrawnBlaster\labscript_devices.py", line 450, in generate_code
    pulse_program[j]["half_period"] = instruction["half_period"]
OverflowError: Python int too large to convert to C long
Compilation aborted.


I thought it would be worthy sharing with you.

Cheers,
Tom

Philip Starkey

unread,
Apr 21, 2022, 5:43:23 AM4/21/22
to labscri...@googlegroups.com
Thanks Tomas. Not sure what's causing that error as the numpy array should be able to hold 64 bit integers and the wait should only need 32bits. I'll see if I can reproduce it when I have time. Maybe it's unrelated to the missing continue statement!

Cheers,
Phil

Reply all
Reply to author
Forward
0 new messages