Custom ramps through the NI cards

41 views
Skip to first unread message

Karthik Chandrashekara

unread,
Sep 18, 2024, 11:07:58 AM9/18/24
to the labscript suite

Hi everyone,

I am looking in to implementing user-defined ramps via analog NI cards using the "customramp" function:


Capture1.PNG


Ultimately, we might switch to using another AWG to which we upload the ramps and trigger them in the sequence but we wanted to know how to be able to program arbitrary ramps with the NI cards through labscript anyway. Here is an instance of one such attempt,

 

A function was defined the following way:


Capture2.PNG


And written in the sequence like so:


Capture3.PNG


But I currently get this error:


Capture.PNG


I am not entirely sure where the error on my part is. I started actually by passing the function handle but I received an error that it should not be a function which is why I switched to passing the ramp as an array to the customramp function. What could be the issue here? In general, what are some best practices to programming custom ramps via labscript? 

Ian B. Spielman

unread,
Sep 18, 2024, 12:18:52 PM9/18/24
to labscri...@googlegroups.com
Dear Karthik ,

Things are much more simple than you are thinking. Here is an example CustomRamp:

def LineRamp(t, duration, Initial, Final):
"""Creates a linear ramp from Initial to Final"""
f = t / duration
return (1 - f) * Initial + f * Final

— Ian

Ian B. Spielman

Fellow, Joint Quantum Institute
National Institute of Standards and Technology and the University of Maryland

----- WEB -----
http://ultracold.jqi.umd.edu

----- EMAIL -----
spie...@jqi.umd.edu

----- ZOOM -----
https://umd.zoom.us/j/7984811536

----- PHONE -----
(301) 246-2482

----- MAIL -----
UMD:
2207 Computer & Space Sciences Bldg.
College Park, MD 20742

NIST:
100 Bureau Drive, Stop 8424
Gaithersburg, MD 20899-8424 USA

----- OFFICE -----
UMD: Physical Sciences Complex, Room 2153
NIST: Building 216, Room B131

> On Sep 18, 2024, at 11:07, Karthik Chandrashekara <karthi...@gmail.com> wrote:
>
> Hi everyone,
>
> I am looking in to implementing user-defined ramps via analog NI cards using the "customramp" function:
>
> <Capture1.PNG>
>
> Ultimately, we might switch to using another AWG to which we upload the ramps and trigger them in the sequence but we wanted to know how to be able to program arbitrary ramps with the NI cards through labscript anyway. Here is an instance of one such attempt,
> A function was defined the following way:
>
> <Capture2.PNG>
>
> And written in the sequence like so:
>
> <Capture3.PNG>
>
> But I currently get this error:
>
> <Capture.PNG>
>
> I am not entirely sure where the error on my part is. I started actually by passing the function handle but I received an error that it should not be a function which is why I switched to passing the ramp as an array to the customramp function. What could be the issue here? In general, what are some best practices to programming custom ramps via labscript?
>
> --
> 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/5309d6d8-f10a-41a1-8b65-9dd35cf70ca3n%40googlegroups.com.
> <Capture2.PNG><Capture1.PNG><Capture3.PNG><Capture.PNG>

Karthik Chandrashekara

unread,
Sep 19, 2024, 12:52:12 PM9/19/24
to the labscript suite
Dear Ian,

Thank you! Indeed I was overthinking this. With the rest as is, redefining the function I wanted to implement like so -

Capture4.PNG

- gave me what I needed!

Cheers,
Karthik

Reply all
Reply to author
Forward
0 new messages