04-11-2022 11:27 AM
Hello to all of you,
I have a problem that I don't understand at all;
I have a NI 6323 card with two SCB-68A cards as data connections.
I want to work in differential.
When I work in CSR or NRSE mode, I can access 32 channels.
When I put my terminal in DIFFERENTIAL mode, I can only have 8 channels instead of 16.
With 32 channel
-----
def cfg_read_task(Saturation):
Saturation.ai_channels.add_ai_voltage_chan('/Dev1/ai0:31',min_val=0.5,max_val=1.5,
terminal_config = nidaqmx.constants.TerminalConfiguration(-1))
Saturation.timing.cfg_samp_clk_timing(rate=sampling_freq_in, sample_mode=constants.AcquisitionType.CONTINUOUS,
samps_per_chan=buffer_in_size_cfg)
-----
With 8 channel and differential terminal
-----
def cfg_read_task(Saturation):
Saturation.ai_channels.add_ai_voltage_chan('/Dev1/ai0:7',min_val=0.5,max_val=1.5,
terminal_config = nidaqmx.constants.TerminalConfiguration(10106))
Saturation.timing.cfg_samp_clk_timing(rate=sampling_freq_in, sample_mode=constants.AcquisitionType.CONTINUOUS,
samps_per_chan=buffer_in_size_cfg)
-----
This script is working :
With 16channel and differential terminal
This script is not working :
-----
def cfg_read_task(Saturation):
Saturation.ai_channels.add_ai_voltage_chan('/Dev1/ai0:15',min_val=0.5,max_val=1.5,
terminal_config = nidaqmx.constants.TerminalConfiguration(10106))
Saturation.timing.cfg_samp_clk_timing(rate=sampling_freq_in, sample_mode=constants.AcquisitionType.CONTINUOUS,
samps_per_chan=buffer_in_size_cfg)
-----
I attach my MAX image who see my two scb68-A cart.
Does anyone have any idea what I'm missing?
thanks for reading,
Solved! Go to Solution.
04-11-2022 11:58 AM
You're probably missing the way differential pairs are fixed in the hardware and the way the AI channels are split across the 2 connectors.
You *can* declare channels ai0:7 as differential, but that just defines the + inputs. The device itself will then use (and expect you to physically wire) ai8:15 as the - inputs.
Similar stuff holds true for ai16:23 (+) and ai24:31 (-) on the other connector.
So your task config should designate 'Dev1/ai0:7, Dev1/ai16:23' to give you 16 total differential channels.
-Kevin P
04-12-2022 03:06 AM
Hoooo Yeah, i'm dumb sometimes;
Thanks Kevin P! As usual, you have the right answer !
Version who work :
def cfg_read_task(Saturation):
Saturation.ai_channels.add_ai_voltage_chan('/Dev1/ai0:7',min_val=0.5,max_val=1.5,
terminal_config = nidaqmx.constants.TerminalConfiguration(10106),
units=nidaqmx.constants.VoltageUnits(10348))
Saturation.ai_channels.add_ai_voltage_chan('/Dev1/ai16:23',min_val=0.5,max_val=1.5,
terminal_config = nidaqmx.constants.TerminalConfiguration(10106),
units=nidaqmx.constants.VoltageUnits(10348))