Showing results for 
Search instead for 
Did you mean: 

NI USB 6001 Trying to read voltage data from multiple channels at once

Go to solution

I am using the nidaqmx library in python. When I attempt to read the voltage from 3 ai channels at once, I observe a strange phenomenon in which the voltage along my (Dev3/ai3) channel follows the trend/is proportional to the voltage along my (Dev3/ai0) channel. Dev3/ai1 however is completely independent and functions as expected. Dev3/ai0 also displays the voltages I expect. However, Dev3/ai3 mimics the voltage detected along ai0.


However when I only add Dev3/ai3 to the task, I read the voltage that I expect to see.


Below is an image showing the expected behavior of Dev3/ai3 




As seen above, readings are appropriately in the negative thousands.





However, as seen above, when reading multiple voltages, the current data follows the trend of the dev3/ai0.

My code is attached below

    # Configure NI DAQmx settings
    task = nidaqmx.Task()

    # Channel ai3 is reading currentData
    scale = nidaqmx.scale.Scale.create_lin_scale("currentScaler", 10000, pre_scaled_units = UnitsPreScaled.VOLTS)
    task.ai_channels.add_ai_voltage_chan("Dev3/ai3", terminal_config=TerminalConfiguration.RSE, custom_scale_name="currentScaler", units = BridgeUnits(10065))

    # Channel ai1 is reading the psu voltage
    scale = nidaqmx.scale.Scale.create_lin_scale("psuVoltageScaler", 10, pre_scaled_units = UnitsPreScaled.VOLTS)
    task.ai_channels.add_ai_voltage_chan("Dev3/ai1", custom_scale_name="psuVoltageScaler", units = BridgeUnits(10065))

    # Channel ai0 is reading the saturation sensor voltage
    task.timing.cfg_samp_clk_timing(rate=samplesPerSecond, sample_mode=AcquisitionType.CONTINUOUS, samps_per_chan=10000)


    timer = 0.0
    while True:
            sample = task.read(nidaqmx.constants.READ_ALL_AVAILABLE)
            for i in sample[0]:
                timer = timer + (1.0/samplesPerSecond)
            for i in sample[1]:
            for i in sample[2]:



0 Kudos
Message 1 of 3

You may be experiencing ghosting



Can you share your hardware connections?

Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 3
Accepted by topic author nsw42

I looked into it, and it appears that ghosting is in fact the issue. The impedence of my current source is very high as I use a transimpedence amplifier to generate the signal. Therefore the settling time of the daq is very high and results are all messed up when multiplexing.

0 Kudos
Message 3 of 3