Benchtop Measurement and Test
Distributed Measurement and Control
Systems Engineering Software
You can request repair, RMA, schedule calibration, or get technical support. A valid service agreement may be required.
Provides support for NI data acquisition and signal conditioning devices.
Provides support for Ethernet, GPIB, serial, USB, and other types of instruments.
Provides support for NI GPIB controllers and NI embedded controllers with GPIB ports.
Here is a minimal working version of the code I'm trying to run.
My aim is to run the ADC all the time to keep the samples current. When I do a read I would like 1 sample from each channel, but the latest samples.
Right now the samples remain the same all the time.
from nidaqmx.constants import AcquisitionType, VoltageUnits, READ_ALL_AVAILABLE, CurrentShuntResistorLocation, WAIT_INFINITELY
from nidaqmx.stream_readers import AnalogSingleChannelReader, AnalogMultiChannelReader
import numpy as np
CURR_IN_MODULE_0 = 'cDAQ1Mod2/ai0:15'
CURR_IN_MODULE_1 = 'cDAQ1Mod3/ai0:15'
sample_rate = 1000
num_of_read_channels = 32
num_of_samps_per_channel = 1
read_data = np.zeros(shape = (num_of_read_channels, num_of_samps_per_channel))
read_task = nidaqmx.Task()
read_task.ai_channels.add_ai_current_chan(physical_channel = CURR_IN_MODULE_0, shunt_resistor_loc = CurrentShuntResistorLocation.INTERNAL)
read_task.ai_channels.add_ai_current_chan(physical_channel = CURR_IN_MODULE_1, shunt_resistor_loc = CurrentShuntResistorLocation.INTERNAL)
read_task.timing.cfg_samp_clk_timing(rate = sample_rate, sample_mode = AcquisitionType.CONTINUOUS)
reader = AnalogMultiChannelReader(read_task.in_stream)
reader.read_many_sample(data = read_data, number_of_samples_per_channel = num_of_samps_per_channel)
What do you need our team of experts to assist you with?
We'll be in touch soon!