NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

多通道数据采集与对应显示的问题

在编写多通道采集程序时,我想在选择各个通道的水平按钮后,能分别在对应的图表上显示采集到的波形。
现在的问题是:选择的通道和显示的位置不匹配,比如当我选择了通道1和通道2,我的目的是在压力、和流量两个图表(图2、图3)上显示波形,但程序却在温度和压力图表上(图1和图2)显示波形,我不知道怎么编写,才能使各个采集通道与显示的图表固定地对应下来,请各位高手帮忙,谢谢!

0 项奖励
1 条消息(共 4 条)
3,513 次查看

 


@xqnxpwy wrote:

在编写多通道采集程序时,我想在选择各个通道的水平按钮后,能分别在对应的图表上显示采集到的波形。
现在的问题是:选择的通道和显示的位置不匹配,比如当我选择了通道1和通道2,我的目的是在压力、和流量两个图表(图2、图3)上显示波形,但程序却在温度和压力图表上(图1和图2)显示波形,我不知道怎么编写,才能使各个采集通道与显示的图表固定地对应下来,请各位高手帮忙,谢谢!


 

 

The physical channels input to the DAQmx Create Channel is not always of 3-Channels, but the output waveform of the DAQmx Read is fixed at 3-Channels and 3-Graph Indicators.

 

This way, when you have chosen Ch1 and Ch2, the output waveform from the DAQmx Read has Ch1's data at index-0 and Ch2's data at index-1; hence, there were updated to Graph1 and Graph2 instead of Graph2 and Graph3.

 

One quick fix is to divert the corresponding Channel data (from the output waveform) to the correct Graph Indicator based on the Boolean inputs.

 

22970iB153EDEF86A2ADF1

 

See attached VI as a quick reference. (PS: I have omitted some but the hint to your problem)

 

 

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 项奖励
2 条消息(共 4 条)
3,497 次查看

谢谢,这是个好方法,但是,如果我的采集通道很多,比如有10路,这样采用您的方法就会很复杂,请问还有别的解决方法吗?

0 项奖励
3 条消息(共 4 条)
3,478 次查看

See, that was an improvised solution for the the question that you asked.

 

Of course there are many (better) ways of achieving the same but please do understand that we are here to guide not to give complete solution to your problem. Please try it out by yourself. And, if you did come out something but having trouble, you may upload it here so that we are able to help looking into your problem(s) instead of asking for solution.

 

Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime. - Lao Tzu 

 

Agree?

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 项奖励
4 条消息(共 4 条)
3,469 次查看