【正文】
clk=0。 del_ms(1)。 dat=1。i8。 clk=1。 d_in=d_in1。 clk=0。 dat=0。 while(d) { for(ii=0。ii++)。 } } 附錄五中英文資料Multichannel data collection and analysis of the design and applicationAbstract:The Paper mainly introduces a multichannel data acquisition and analysis system posed of one PC and one measuring instrument. The system can test eight products parallelly. It reduces the test cost and improves work efficiency. The paper also gives the hardware structure and software flow diagr am of the system. The application in the gyro test is also introduced briefly. Key words:munication prot。 gyro。s parallel port to provide and meet shown in table 1.Table1 The relation between channel selection and port outputCommunications port outputBinary codeChannel selection select channel00001100122010330114410055101661107711188way channel selector industry can use the SCM, subject to additional controls, select RS232 serial port as data transmission, because the RS232 port is the puter and measuring instruments on the standard configuration, municate with each other without additional hardware , Easy to use. In addition, a serial municationonly a bit, with only a standard datavoltage potential, hence more difficult in data errors. In a parallel port to transfer data 8bit, data transmission speed, but the data vulnerable to interference. Transmission distance in a shorter amount of data transmission larger circumstances, may be parallel port (such as GPIB, LPT, etc.) to municate. In addition, since LPT parallel port may signal transmission, channel selection is suitable for the control port.System in the course of work, good access control modules and data acquisition module synchronization is particularly important because different channels of data storage needs of the corresponding data buffer pool, which is controlled by software.3 software designThe whole system software design is the most important part. Software system from the bottom of the munication protocol can be divided into functional threetier module and user interface. Software design in the use of multithreaded Windows technology, the technology for data collection procedures can effectively accelerate the reaction time and increase the efficiency of implementation. The procedures used in a separate thread for data collection, so the guaranteed maximum energy collection of realtime。s operation. The module also in its algorithm in the function of any expansion, forming a algorithm to adapt to different procedures for data analysis.In addition, software design, a friendly user interface is necessary in the process of the functions from the package, through a unified interface to users, to reduce operating difficulties and enhance efficiency.4 system test resultsFigure 5 to 8 in the analysis of data acquisition systems, at the same time two threeaxis gyro and a single axis gyroscope total of seven road test data of the situation. Its precise data collection, data analysis can be conducted at the same time, and through realtime charts, userfriendly, easy to operate.Figure 5 8 Data Collection and Analysis System5 ConclusionMultichannel data acquisition and analysis system for the hardware requirements simple, easy to set up, can be applied to various tests occasions, it can also test multiple products, thereby reducing the cost and enhance efficiency. As a result of a multithreaded technology, the speed of data acquisition systems and hardware only (instrument) and the response speed of the speed of Communication. With the collection and analysis software algorithm has nothing to do.PAD programming tools can be used to develop a data collection, data analysis, graphics display and print output, and other powerful features and friendly user interface of our software. Software modular design and easy to carry out expansion, according to different algorithm for data analysis at the request of upgrades, and hardware can remain the same. The system give full play to the use of puters and measuring instruments of mutual munication, automation and test advantage.多路數(shù)據(jù)采集與分析系統(tǒng)的設(shè)計及應(yīng)用摘要:介紹了用一臺PC機和一臺測量儀表組成的8路數(shù)據(jù)采集與分析系統(tǒng)。給出了系統(tǒng)硬件結(jié)構(gòu)和軟件流程圖,并介紹了該系統(tǒng)在陀螺測試中應(yīng)用。特別在數(shù)據(jù)量大、測量時間長的場合,如陀螺零位穩(wěn)定性測試,利用計算機對測量儀表進行自動控制、自動數(shù)據(jù)采集分析顯得尤為重要,可節(jié)省大量人力和物力,提高工作效率,降低成本,常規(guī)的測試法通常一臺測量儀表在同一時間只能測試一個產(chǎn)品,即一臺計算機和一臺測量儀表組成的測試系統(tǒng)只能進行串行測試。先介紹一個用一臺PC機和一臺測量儀表組成的8路數(shù)據(jù)采集與分析系統(tǒng),可同時進行多套產(chǎn)品的測試,在不增加成本的基礎(chǔ)上,充分發(fā)揮了計算機自動測試的優(yōu)勢,提高了工作效率。一臺PC機通過RS232端口和一臺測量儀表相連接,PC機并行端口(LPT)和一個8路通道選擇器相連,一個8路連接頭將通道選擇器分別與多個測試產(chǎn)品連接。測試過程中,計算機通過并行端口控制8路通道選擇器,分別打開不同的通道,各通道數(shù)據(jù)通過選擇器傳送到測量儀表中,測量儀表再通過RS232端口把數(shù)據(jù)發(fā)送到計算機中保存,在一個周期內(nèi)完成所有通道的數(shù)據(jù)采集,這樣就實現(xiàn)了同時測試多個產(chǎn)品的功能。2 硬件設(shè)計該系統(tǒng)主要是用計算機自帶的RS232通信端口和數(shù)字化測量儀表的通信端口連接通信,再利用LPT并行端口對一個8路通道選擇器進行通道控制。表1 通道選擇器和通信端口輸出的對應(yīng)關(guān)系通信端口輸出二進制碼通道選擇器選擇通道00001100122010330114410055101661107711188路通道選擇器業(yè)可使用單片機,但需額外的控制,選擇RS232串口作為數(shù)據(jù)傳輸端口,是因為RS232端口是計算機和測量儀表上的標準配置,相互通信不需額外的硬件,使用方便。并行端口可在一次的數(shù)據(jù)傳輸中傳輸8個位,數(shù)據(jù)傳輸速度快,但易發(fā)生數(shù)據(jù)干擾。另外,由于LPT端口可并行傳輸信號,因此適合用作通道選擇器的控制端口。3 軟件設(shè)計軟件設(shè)計是整個系統(tǒng)中最重要的部分。在軟件設(shè)計中采用Windows多線程技術(shù),此技術(shù)進行數(shù)據(jù)采集可有效加快程序的反應(yīng)速度,增加執(zhí)行的效率。尤其當采集的數(shù)據(jù)量大、數(shù)據(jù)處理任務(wù)重時,采用多線程技術(shù)將極大地提高整個系統(tǒng)的工作效率。其程序框圖如圖2所示。多通道數(shù)據(jù)采集過程易發(fā)生數(shù)據(jù)的相互干擾,特別是在通道的快速切換時,數(shù)據(jù)易發(fā)生波動,如圖3所示。如我們開發(fā)的數(shù)據(jù)自動跟蹤算法能自動跟蹤每個通道的數(shù)據(jù),判斷該通道是否處于穩(wěn)定狀態(tài),且只采集穩(wěn)定狀態(tài)的數(shù)據(jù),忽略其他的波動數(shù)據(jù)。限幅濾波算法為(1)圖3 通道快速切換時出現(xiàn)的數(shù)據(jù)波動當新采集到的數(shù)據(jù)和前一個數(shù)據(jù)的差的絕對值超過一個給定的值時 ,認為該數(shù)據(jù)無效,而取前一個數(shù)據(jù)為當前數(shù)據(jù)。零位穩(wěn)定性計算式為:(2)先根據(jù)式(2)編寫出一個算法函數(shù),然后在分析模塊中調(diào)用。圖4 數(shù)據(jù)分析程序流程圖由于系統(tǒng)采用了多線程技術(shù),在分析循環(huán)運行時并不會影響采集模塊的運行。另外,在軟件設(shè)計中,一個友好的用戶界面是必須的,把 從程序中的功能封裝起來,通過一個統(tǒng)一的界面提供給用戶,有利于降低操作難度,提高工作效率。其采集的數(shù)據(jù)精確,能同時進行數(shù)據(jù)分析,并通過圖表實時顯示,界面友好、操作方便。由于采用了多線程技術(shù),該系統(tǒng)的數(shù)據(jù)采集速度只與硬件(測量儀表)的響應(yīng)速度和不斷口通信速度有關(guān)。利用PAD編程工具可開發(fā)出具有數(shù)據(jù)采集、數(shù)據(jù)分析、圖表顯示及打印輸出等強大功能和友好用戶界面的配套軟件。該系統(tǒng)充分發(fā)揮了利用計算機和測量儀表相互通信,進行自動化控制和測試的