05-31-2025 02:18 AM
Hello all. I am using the DAQ USB-6363 on the (HTTP://outlaw.com/spacecraft/spectra) Python package. With this Python program package, the DAQ works as it collects one sample for a single pulse sequence and repeats the number of samples times for each frequency step. I want the DAQ to collect all the samples for each frequency step with a single pulse sequence. How can I edit my Python program to achieve that, or how can I proceed?
Solved! Go to Solution.
06-03-2025 10:41 AM
Hi waqar192,
I noticed that this may not be your project. After reviewing the project specifications, I saw that the hardware listed in the system requirements differs from the one you're using. Could you please confirm if I understood that correctly?
Also, regarding your question—could you clarify whether you're asking to read N samples for a single pulse? I’d be happy to help once I better understand your intent.
06-03-2025 08:39 PM
Hi mane__avagyan
Thanks for responding. I am using DAQ USB-6363. I need to collect 10,000 samples for each frequency step. According to DAQ's Sampling rate, it should take 5ms, but it takes up to 3s.
My question is: How can I change the sampling rate of the USB-6363 using the Python Package that I mentioned earlier?
By Pulse sequence, I mean the signal sequence used for DAQ triggering and acquisition along with MW. When the DAQ receives a trigger signal, it starts collecting samples and collects only one sample, and then collects a second sample for a second signal, and then repeats till the process of sample collection up to Nsamples (10,000) times. I want the DAQ to collect N samples (10,000) with a single trigger by using that Python program package.
06-04-2025 08:13 AM
According to the device specifications ,(USB-6363 Specifications - NI) you can read a maximum of 2 Msamples using a single channel. If you're using multiple channels, it's not possible to collect 10,000 samples within 5 milliseconds.
To better understand your setup, could you please let me know how many channels you're currently using? Also, if your application includes additional logic or processing, that could further slow down data collection, especially since you're already approaching the device's performance limits.
06-04-2025 08:24 PM
Thanks for the cooperation.
I am using three channels (AIO for Photodiode, PFI0 for Sampleclk of DAQ, and PFI5 for start Trig). For the pulse sequence, I am using Pulse Blaster, having a clock frequency of 100 MHz. I have attached the DAQ control program as well. When I make changes in the program, it doesn't affect the results. Could you please suggest to me how I can control the DAQ?
How can I control the Sampling rate?
How can the AI clock signal be controlled internally in the DAQ?
If you need further information, I can provide it.
Thanks.
06-04-2025 11:58 PM
Or simply, how can I get multiple data points or Samples with a single trigger?
06-06-2025 08:44 AM
Okay waqar192, thanks for the additional information. Will try to get the results that you want, will check, and come back with updates
06-06-2025 10:53 AM
Hello once again waqar192,
You mentioned about 3 channels, but by reviewing your code, I can see only 1 analog input channel.
In this part
channel = readTask.ai_channels.add_ai_voltage_chan(
DAQ_PDInput,
"",
TerminalConfiguration.RSE,
-5.0,
5.0,
VoltageUnits.VOLTS
)
And what about Samples:
NsampsPerDAQread = 2 * Nsamples # Two samples per measurement (signal and reference)
You multiply by 2 based on the assumption that each measurement consists of 2 samples, one for the signal and one for the reference.
readTask.timing.cfg_samp_clk_timing(
20000, # 20 kHz sampling rate
...
NsampsPerDAQread
)
In this part, the DAQ is configured to sample at 20k samples per second. So if Nsamples = 1000, then NsampsPerDAQread = 2000, the DAQ will collect 2000 samples in one read, which takes 0.1 sec.
counts = task.read(N, timeout)
N is the number of samples to read (should match NsampsPerDAQread)
1. How can I control the Sampling rate?
You can control the sampling rate of the DAQ device by modifying the value passed to the cfg_samp_clk_timing() function in the configureDAQ() function. You can replace 20000 with any other valid sampling rate supported by your DAQ hardware. For example:
The valid sampling rate depends on your DAQ device model. Most NI DAQs support a wide range for your USB-6363 maximum is 2.00 MSample/s. Make sure your sampling rate is at least twice the highest frequency in your signal to avoid aliasing. Also, don't forget about buffer size. higher sampling rates may require larger buffer sizes and faster processing.
2. How can the AI clock signal be controlled internally in the DAQ?
In your code
readTask.timing.ai_conv_src=DAQ_SampleClk
readTask.timing.ai_conv_active_edge = Edge.RISING
3 . How can I get multiple data points or Samples with a single trigger?
You should change 3 components of your code.e
Change the number of samples: Pass a different Nsamples value to configureDAQ().
Change the trigger source: Modify DAQ_StartTrig in connectionConfig.py.
Change the sample rate: Adjust the first argument in cfg_samp_clk_timing().
06-08-2025 08:35 PM
Thanks for explaining. Got it now