Jump to content

DAQ

From Photonicamp Wiki
Revision as of 20:19, 4 December 2024 by Schilder (talk | contribs)

For more information regarding a DAQ, please visit this link.

In our lab, we are using a DAQ NI USB-6259:

Picture of our DAQ, model NI USB-6259

Specifications Detailed specifications can be found on the website of National Instruments Specific specs: Multichannel maximum: 1.00 MS/s. This rate is shared among all input channels.

Ghosting When reading multiple signals simultaneously, it is possible that the signal of channel X will be partially visible in the signal recorded by channel Y due to what is called ghosting. Please find more information about ghosting here.

An example of a python script to read out channels

import nidaqmx

DAQtaskAI = nidaqmx.Task(); #create a task object
DAQtaskAI.ai_channels.add_ai_voltage_chan("Dev1/ai0",min_val=0,max_val=10) # add an input channel to the task. min_val and max_val are the minimum and maximum voltage that will be applied. #Transmission
DAQtaskAI.ai_channels.add_ai_voltage_chan("Dev1/ai1",min_val=0,max_val=10) # Short
DAQtaskAI.ai_channels.add_ai_voltage_chan("Dev1/ai2",min_val=0,max_val=10) # MZI signal
DAQtaskAI.ai_channels.add_ai_voltage_chan("Dev1/ai3",min_val=0,max_val=10) # Short
DAQtaskAI.ai_channels.add_ai_voltage_chan("Dev1/ai4",min_val=0,max_val=10) # HCN signal

DAQtaskAI.timing.cfg_samp_clk_timing(rate=100000,samps_per_chan=500000) #set sampling parameters. In this example the sampling rate per channel is 100 kHz and data will be collected during 5 seconds.

#measure
data = DAQtaskAI.read(number_of_samples_per_channel = 500000, timeout = 5);

transmission = data[0]
mzi    = data[2]
hcn    = data[4]

An example of a python script to set an output voltage

import nidaqmx

DAQtaskAO = nidaqmx.Task(); #create a task object
DAQtaskAO.ao_channels.add_ao_voltage_chan("Dev1/ao0");
DAQtaskAO.write(data=5.2, auto_start = True); #5.2 Volt will be set at channel ao0.