Compilation of HDF5 File Time

62 views
Skip to first unread message

Addison Okell

unread,
Mar 5, 2025, 2:46:31 PMMar 5
to the labscript suite
Hi,

I am testing out Labscript for our lab as a possible replacement of current control system. An issue I seem to be having is the time it takes to create an HDF5 file. We will be using an analog device that will take a buffer of around a million points. Since I may have to implement this device myself, as its not currently supported, I was using the digital channels on our NI 6535 card to see how Labscript works. I noticed that if I switch the state of two digital channels every clock cycle for a long sequence (10-30 seconds) the generation of the HDF5 gets very slow. Am I being unrealistic in terms of Labscripts abilities, or am I missing something? Below is the shot file for further clarity. 

from labscript import *
from numpy import arange

# Import classes needed for the devices which will be used
from labscript_devices.PrawnBlaster.labscript_devices import PrawnBlaster
from labscript_devices.NI_DAQmx.models.NI_PXIe_6535 import NI_PXIe_6535

PrawnBlaster(name='prawn', com_port='COM3', num_pseudoclocks=1)

NI_PXIe_6535(name='ni_6535', parent_device=prawn.clocklines[0],
            clock_terminal='/Dev1/PXI_Trig7',
            MAX_name='Dev1',
            connected_terminals=[('/Dev1/PFI5', '/Dev1/PXI_Trig7'), ('/Dev1/DO/SampleClock', '/Dev1/PFI4'), ('/Dev1/PFI4', '/Dev1/PFI0')])
DigitalOut('my_digital_out', ni_6535, 'port0/line1')
DigitalOut('my_digital_out2', ni_6535, 'port0/line2')
#Experiment Logic
start()

# Define constants
SAMPLING_RATE = 100000
total_time = 30
for i in range(0, SAMPLING_RATE*total_time):
    time = i/SAMPLING_RATE
    if (i % 2) == 0:
        my_digital_out2.go_low(t=time)
        my_digital_out.go_high(t=time)
    else:
        my_digital_out2.go_high(t=time)
        my_digital_out.go_low(t=time)

stop(total_time) 

Thank you for your time!
Reply all
Reply to author
Forward
0 new messages