NI Acquisition Card USB-6361 Multi-channel Analog Input Acquisition Error Reporting Solution


foreword

I have been tossing a USB-6361 acquisition card for a long time. I used to collect analog signals with a single channel. I suddenly received a dual-channel acquisition of analog signals. I thought I would just add a new Analog Input task, but things are not as expected. Simple, so record the solution.


1. Existing routines

In fact, the official provides us with many examples to facilitate our development of NI boards. What I want to use here is the voltage-continuous input routine. The relevant example path is: Help -> Find Examples -> Hardware Input and Output -> DAQmx -> Analog Input -> Voltage - Continuous Input
注:这里有 DAQmx 的前提是你已经安装了 DAQmx 的驱动,具体安装方法这里不赘述,去 NI 官网可以找得到
insert image description here

1. Front panel

insert image description here

2. Program block diagram

insert image description here

2. Collection test

1. Single channel acquisition

Here I use the test panel to output a sine wave with an amplitude of 3V, and use an RF cable to connect AO1 and AI0, and the single-channel acquisition is no problem

insert image description here

2. Multi-channel acquisition

① Wrong approach

Copy the block diagram again, and change the input channel. Here, AI0 and AI1 are used for synchronous acquisition, and the following error occurs during operation: Problem reason:
insert image description here
USB -6361 can only support 1 Analog Input task at the same time. This way to collect already belongs to 2 Analog Input tasks, so an error occurs.

I saw a similar problem in the experience post on the NI official website. Due to hardware limitations, the number of analog input and analog output tasks for each device is only 1.
insert image description here

②, the correct way

Use channel expansion method to use multiple channels to collect in the same Analog Input task.
insert image description here

1) Front panel

insert image description here
Change the previous Dev/ai0 to Dev/ai0:1

2) Program block diagram

insert image description here
Do not modify other positions, DAQmx reads here with a slight modification, the mode is changed to analog 1D waveform N channel N sampling , and the output content is separated from Dev/ai0 and Dev/ai1 using the index array control , where index 0 corresponds to Dev/ ai0, index 1 corresponds to Dev/ai1

3) Run the tests

insert image description here
Although no error is reported, there is still a problem. In this picture, only Dev/ai0 is connected to the signal, and Dev/ai1 remains floating, but it can be seen that there is a problem of signal crosstalk, that is, Dev/ai1 Interference from Dev/ai0.

For the solution to the crosstalk problem, you can refer to the following related materials:
<1>, how to eliminate the ghost effect that occurs during measurement and data acquisition?
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHy6CAG&l=zh-CN
<2>、NI does not specify what voltage a device will read when there is no signal connected.
Since an open or unconnected channel is not being actively driven to any specific voltage you cannot expect a specific voltage to appear on the channel. To see zero volts on a given channel, there will need to be a zero voltage signal applied across the + and - terminals of the channel, which is the same as grounding the channel. To pull down the signal to zero, you can use a pull-down resistor. See Can I Use Pull-Down Resistors for Analog Inputs? for more details. Incorrect Readings on Unconnected or Open Channels of DAQ
Device
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P6TeSAK&l=zh-CN

In fact, there is no need to pay attention to this crosstalk problem at all. When I connect Dev/ai1 to the device instead of floating, or connect it to an oscilloscope, then the crosstalk problem does not exist.

Therefore, to solve the crosstalk problem, you can try the following two solutions:
<1>, solution 1: add a pull-down resistor at the input terminal
insert image description here
<2>, solution 2: do not keep the channel floating, so that it can be connected to any device


Summarize

The above is all the content. This article realizes the function of simultaneous acquisition of multi-channel analog input, introduces the crosstalk problem and gives a solution.


My qq: 2442391036, welcome to communicate!


Guess you like

Origin blog.csdn.net/qq_41839588/article/details/131587209