Esempio n. 1
0
def ltc2320_16_dc2395a_a(num_samples,
                         verbose=False,
                         do_plot=False,
                         do_write_to_file=False):
    with Ltc2320(dc_number='DC2395A-A',
                 num_channels=8,
                 num_bits=16,
                 verbose=verbose) as controller:
        # You can call this multiple times with the same controller if you need to
        ch0, ch1, ch2, ch3, ch4, ch5, ch6, ch7 = controller.collect(
            num_samples, consts.TRIGGER_NONE)

        if do_plot:
            funcs.plot_channels(controller.get_num_bits(),
                                ch0,
                                ch1,
                                ch2,
                                ch3,
                                ch4,
                                ch5,
                                ch6,
                                ch7,
                                verbose=verbose)
        if do_write_to_file:
            funcs.write_channels_to_file_32_bit("data.txt",
                                                ch0,
                                                ch1,
                                                ch2,
                                                ch3,
                                                ch4,
                                                ch5,
                                                ch6,
                                                ch7,
                                                verbose=verbose)
        return ch0, ch1, ch2, ch3, ch4, ch5, ch6, ch7
def ltc2171_14_dc1525a_e(num_samples,
                         spi_registers,
                         verbose=False,
                         do_plot=False,
                         do_write_to_file=False):
    with Dc1525aE(spi_registers, verbose) as controller:
        # You can call this multiple times with the same controller if you need to
        ch0, ch1, ch2, ch3 = controller.collect(num_samples,
                                                consts.TRIGGER_NONE)

        if do_plot:
            funcs.plot_channels(controller.get_num_bits(),
                                ch0,
                                ch1,
                                ch2,
                                ch3,
                                verbose=verbose)
        if do_write_to_file:
            funcs.write_channels_to_file_32_bit("data.txt",
                                                ch0,
                                                ch1,
                                                ch2,
                                                ch3,
                                                verbose=verbose)
        return ch0, ch1, ch2, ch3
def ltc2325_12_dc2395a_i(num_samples,
                         verbose=False,
                         do_plot=False,
                         do_write_to_file=False):
    with ltc2320.Ltc2320(
            dc_number='DC2395A-I',
            num_channels=4,
            num_bits=13,  # 12-bit + sign
            verbose=verbose) as controller:
        # You can call this multiple times with the same controller if you need to
        ch0, ch1, ch2, ch3 = controller.collect(num_samples,
                                                consts.TRIGGER_NONE)

        if do_plot:
            funcs.plot_channels(controller.get_num_bits(),
                                ch0,
                                ch1,
                                ch2,
                                ch3,
                                verbose=verbose)
        if do_write_to_file:
            funcs.write_channels_to_file_32_bit("data.txt",
                                                ch0,
                                                ch1,
                                                ch2,
                                                ch3,
                                                verbose=verbose)
        return ch0, ch1, ch2, ch3
def ltc2261_dc1369a_a(num_samples,
                      spi_registers,
                      verbose=False,
                      do_plot=False,
                      do_write_to_file=False):
    with Dc1369aA(spi_registers, verbose) as controller:
        # You can call this multiple times with the same controller if you need to
        data = controller.collect(num_samples, consts.TRIGGER_NONE)
        data = data[0]  # Keep only one channel

        if do_plot:
            funcs.plot_channels(controller.get_num_bits(),
                                data,
                                verbose=verbose)
        if do_write_to_file:
            funcs.write_channels_to_file_32_bit("data.txt",
                                                data,
                                                verbose=verbose)
        return data
def ltc2374_16_dc2071a_c(num_samples, spi_registers, is_high_speed,
                         verbose = False, do_plot = False, 
                         do_write_to_file = False):
    with Ltc2374(dc_number = 'DC2071A-C',
                 spi_registers = spi_registers,
                 is_high_speed = is_high_speed,
                 num_channels = len(spi_registers),
                 num_bits = 16,
                 verbose = verbose) as controller:
        # You can call this multiple times with the same controller if you need to
        data = controller.collect(num_samples, consts.TRIGGER_NONE)

        if do_plot:
            funcs.plot_channels(controller.get_num_bits(), 
                       *data,
                       verbose=verbose)
        if do_write_to_file:
            funcs.write_channels_to_file_32_bit("data.txt",
                                       *data,
                                       verbose=verbose)
        return data