setting a trigger initially on

49 views
Skip to first unread message

Yuna Park

unread,
May 12, 2023, 5:14:12 PM5/12/23
to the labscript suite
Hi,

I want to set a digital output to be initially on from the connection table. I would think if I just set things up as below, the output would be on, but it does not work. How can I do this? Thanks!

PulseBlasterUSB(name='pb0', board_number=0, pulse_width='minimum', programming_scheme='pb_stop_programming/STOP')
DigitalOut(name='mot_coil_always_on', parent_device=pb0.direct_outputs, connection='flag 21')
start()
mot_coil_always_on.go_high(1)
stop(2)

Philip Starkey

unread,
May 13, 2023, 12:54:28 AM5/13/23
to labscri...@googlegroups.com
Hi Yuna,

Your current example sets the channel to go high 1 second into the start of the experiment (the "1" being passed to go_high()).

Have you tried the following?
t = start()
mot_coil_always_on.go_high(t)
stop(2)

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/5b627a5d-d4c0-4ed5-b0e9-95fabb03dcb3n%40googlegroups.com.

Yuna Park

unread,
May 16, 2023, 7:38:11 PM5/16/23
to the labscript suite
Hi, 

I tried this, but it did not work. Do you have any other suggestions? 

Thanks!

Yuna

Philip Starkey

unread,
May 16, 2023, 8:05:22 PM5/16/23
to labscri...@googlegroups.com
Hi Yuna,

Could you provide the h5 file for one that hasn't worked?

Cheers,
Phil

Yuna Park

unread,
May 16, 2023, 8:14:50 PM5/16/23
to the labscript suite
Hi, 

I wasn't sure which file you would like to see, but I attached connection_table.h5.

Thanks!

Yuna
connection_table.h5

Johannes Schabbauer

unread,
May 17, 2023, 3:02:21 AM5/17/23
to labscri...@googlegroups.com
Hi Yuna,

I remember there is a "default_value" argument in the constructor of DigitalOut/Output. Did you try setting that to True in your connection table? I'm not familiar with the PulseBlaster implementation,
but maybe that could work.

Best wishes,
Johannes


Philip Starkey

unread,
May 17, 2023, 8:30:44 AM5/17/23
to labscri...@googlegroups.com
Hi Yuna,

My apologies, I missed that this was for the connection table. Instructions (anything after start()) is ignored when compiling the connection table.

There are two options for you...

Option 1
You could pass inverted=True to the DigitalOut constructor. E.g.
DigitalOut(name='mot_coil_always_on', parent_device=pb0.direct_outputs, connection='flag 21', inverted=True)

This should have the following effects:
  • BLACS should be aware of this setting and create an inverted digital output widget for you (where the off state for the button results in a high output on the channel and an on state results in a low output). They should also show up as a different colour (I think it's blue instead of green). This can be customised in the BLACS settings accessible via the GUI.
  • In labscript experiment logic (not just your connection table file), go_high/go_low calls will still correspond to the channel output being high/low but the behaviour of mot_coil_always_on.enable(t) and mot_coil_always_on.disabled(t) will be reversed when compared to inverted=False. That is, enable(t) would be the same as go_low(t) if inverted=True. So for experiments you should do:
    t = start()
    mot_coil_always_on.go_high(t)

Option 2
Don't invert the channel. After compiling the connection table, enable the channel in BLACS by clicking the button widget for the channel (you can also lock the channel against changes in the BLACS GUI by right clicking on the button). BLACS will remember this every time you close and open it (as long as it's closed successfully once - it might not remember if it is made to force quit).
In your labscritp experiment logic files, call:
t = start()
mot_coil_always_on.go_high(t)
to ensure the channel is always high for the entire experiment.

Which option you chose depends on the logic of what you are controlling and whether it makes sense to have the labscript suite treat the output as inverted. It sounds like maybe it's not a true inversion, rather something that should be always enabled, in which case I would choose option 2. However, it's easy enough to experiment with them both to see which makes the most sense for you.

I hope I've managed to solve the problem this time. Let me know if it looks like I've missed anything else.

Cheers,
Phil


Reply all
Reply to author
Forward
0 new messages