在编写多通道采集程序时,我想在选择各个通道的水平按钮后,能分别在对应的图表上显示采集到的波形。
现在的问题是:选择的通道和显示的位置不匹配,比如当我选择了通道1和通道2,我的目的是在压力、和流量两个图表(图2、图3)上显示波形,但程序却在温度和压力图表上(图1和图2)显示波形,我不知道怎么编写,才能使各个采集通道与显示的图表固定地对应下来,请各位高手帮忙,谢谢!
@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.
See attached VI as a quick reference. (PS: I have omitted some but the hint to your problem)
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?