PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
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 

 

nsw42_0-1717785723918.png

 

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

 

 

nsw42_1-1717785780474.png

 

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.ai_channels.add_ai_voltage_chan("Dev3/ai0")
    task.timing.cfg_samp_clk_timing(rate=samplesPerSecond, sample_mode=AcquisitionType.CONTINUOUS, samps_per_chan=10000)

    task.start()

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

 

 

0 Kudos
Message 1 of 3
(108 Views)

You may be experiencing ghosting

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHy6CAG&l=en-US

 

Can you share your hardware connections?

Santhosh
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
(77 Views)
Solution
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
(37 Views)