2023年全國(guó)碩士研究生考試考研英語(yǔ)一試題真題(含答案詳解+作文范文)_第1頁(yè)
已閱讀1頁(yè),還剩15頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、<p><b>  中文5650字</b></p><p><b>  附 錄</b></p><p>  Research & Development of Virtual Oscillograph</p><p>  Based on LabVIEW</p><p>  Abs

2、tract: This paper introduces the design process of a virtual oscillograph based on LabVIEW. Mainly analyzes the amplitude value and time base adjusting methods during the real-time display. At the same time, it simply in

3、troduces the basic thought when measuring the period and frequency of the waveform gate voltage method and its application. At the end of this paper, combining the parameter measurement and waveform display of the virtua

4、l oscillograph with the modern motor close-loop lock-phas</p><p>  Keywords: Virtual Oscillograph; Time-Base; Motion Control</p><p> ?、? INTRODUCTION</p><p>  In the rapidly develop

5、ing industry control field, measuring technologies and apparatus become more and more important. But because of the disadvantages of the traditional instruments such as high price, single function, bad expansibility, etc

6、., they can hardly meet the industry requirement. With the development of computer technologies and virtual instruments (VI for short), the scope designed by users becomes widely. There are many different functions with

7、the same hardware which can make two o</p><p>  All measuring instruments consist of three parts: data acquisition, data analysis and results output [2]. In these three parts, data acquisition can be done by

8、 the system hardware like A/D module or digital I/O modules. Data analysis and results output can be completed by software system based on computer. So, if given some necessary data acquisition hardware, a measuring inst

9、rument based on computer can be constituted. The software technology is the essential one in the virtual instrument. [3] </p><p>  Multi-channel digital oscillograph, which mainly used in real-time data acqu

10、isition, is one of the most widely used general measuring instruments. It also can display the changes of some electric signals and compare the differences among different signals. So the research and development of virt

11、ual oscillograph is the hotspot in the area. Making use of the Graph platte in LabVIEW, you can conveniently acquire the dynamic waveforms and make them displayed. But most virtual oscillographs based on </p><

12、p>  II. RESEARCH ON THE MULTICENTER DIGITAL</p><p>  OSCILLOGRAPH'S SOFTWARE ARITHMETIC</p><p>  The virtual oscillograph introduced by this paper is mainly used in laboratory for the mea

13、surement and storage of various analog signals. The main functions are: data acquisition, waveform display, parameter measurement, waveform storage and replay etc. It has 64 analog signal input channels and can take 8 si

14、gnal observations at the same time with the choice of switch matrix. According to the requirement, we use the NI-6133 Daq card for the data acquisition. The block diagram of virtual oscillog</p><p>  Now we

15、will introduce the soft arithmetic to the basic functions of virtual oscillograph.</p><p>  Characteristics of Graph Control</p><p>  In LabVIEW, there are three controls for waveform displaying

16、: Graph, Chat and x-y graph. Every control has its own advantages. This paper takes Graph control for example to discuss the soft arithmetic to the basic function of virtual oscillograph. Graph oscillograph displays all

17、waveform data input in the screen at a time. Every time when the waveform data are input, the screen will be freshed. [7] Using its own operation tools, you can move, zoom the waveform or use the cursors to measure the p

18、</p><p>  In the virtual oscillograph introduced in this paper, there are some basic functions such as amplitude and position value adjustment, time base change, trigger mode selection etc. The oscillograph&

19、#39;s front panel is shown in fig.2.</p><p>  Amplitude Value Adjustment</p><p>  Multi-center oscillograph can display more than one waveform at the same time, so it is very convenient to compa

20、re every signal change. Every waveform displayed should be operated separately through the selecting box on the front panel. At first, we distribute the screen into 10×10 grids and set every channel a Y-axis. The va

21、lue of every one of the 10 grids in the Y-axis is equal to the value of related amplitude knob control. With the property node of the waveform graph, you can set the minimum</p><p>  Use an array to save the

22、 amplitude values every Y-axis changed. When a channel is selected, put its old amplitude value to the knob first; and after adjusting, replace the related array element with the new value. And then the amplitude value c

23、hange function is finished.</p><p>  Time Base Adjustment</p><p>  Time base adjusting is one of the basic functions in oscillograph. The time base adjusting knob's value shows the time of e

24、very one grid of X-axis in the screen which is the nodus during the oscillograph design procedure.</p><p>  Basic Clew</p><p>  According to the characteristics of the Graph control, it displays

25、 all the data input at a time. So distribute the X- axis into 10 grids and make every grid's time t. If the waveform could bestride the whole X-axis, the time spent to collect all the data is 10t. Suppose the board&#

26、39;s sampling rate is f, in other word, the board collects f data every second. So the number N needed in the waveform is:</p><p>  N= f×l0t =l0ft (1)</p><p>  Keeping the board sam

27、pling at the frequency of f, the program reads N data points from the board memory and put them to the oscillograph in every loop. Change the t value is to change the N value read from board memory every time, and thus a

28、djust the time base in the real-time sampling.</p><p>  But through the experiment we can see, when the time base is too long (>100ms) or too short (< 500us), the waveform displayed has time lags to di

29、fferent extend. That is because when the time base is too long (if the length of the needed waveform exceeds 1 second), we must wait for enough time to get all needed data collected by the board, and display them on the

30、screen at a time. So that can cause discontinuous waveform displayed in the screen. When the time base is too short, the N value read e</p><p>  Long time base</p><p>  To avoid the time lag dis

31、cussed above, it must reduce the number of data read from sampling board every loop. Considering the display characteristics of Graph control, it can not put the data points read from boards to the graph every loop becau

32、se it will make the oscillograph refreshing all the time, and the waveform displayed could not bestride the whole X-axis. An array could be set to save the waveform data points displayed. The array's capacity is N, w

33、hich is the number of data points calcu</p><p>  The whole procedure is made up of two parts. First, set the whole array NULL. At the beginning of the display procedure, the array is not full. So put the new

34、 m data points into the end of the array (Enqueue), and then display the whole array value in the graph control. A continuously moving waveform should be showed in the screen. Second, when the array is full, get rid of f

35、irst m elements of the array; move the rest N-m elements forward the beginning of the array; and put the new m data points</p><p>  Because the number of data points m read from board card every time is suit

36、able, the time lag caused by waiting for enough data is properly solved. It ensures the synchronization between sample and display. To reduce the time spent to calculate the FIFO procedure by system, sampling frequency s

37、hould be reduced at the long time base to reduce the capacity of the display array.</p><p>  Short time base</p><p>  In this part, the problem to be solved is that the time lag and memory overf

38、low because the number N calculated via Eq. (1) is too small. The number N could not increase blindly because that will cause the disaccord between the set time base and the waveform displayed. So, a method called E-M (e

39、xpand-move) is put forward. Fix the number to be read in every loop, which usually should be the one at proper time base. Suppose it as m, and the needed number at the short time base calculated via Eq.(1</p><

40、p>  Until now, the whole procedure is finished. The diagram is shown in Fig.4 and Fig.5.</p><p>  Position Adjustment and zero mark</p><p>  Changing the Y value of the waveform data can chan

41、ge the waveform's position displayed on the screen. Increasing or decreasing the Y value of the waveform data can move the waveform up or down. To mark every waveform's zero position, add a button control to each

42、 waveform displayed. Drag the control into a line to mark the zero position.</p><p>  Initialize the control, relative to the oscillograph panel, to the middle of the right screen edge. When changing the pos

43、ition of the waveform, change the coordinate of the zero mark at the same time. So the zero mark will move with the waveform. In addition, set the mark button control invisible outside the top and bottom edges, that the

44、effect can be truer. As seen in Fig.2.</p><p>  Other functions</p><p>  What discussed above are the 3 basic functions in a virtual oscillograph. For other functions such as trig mode, couple m

45、ode, cursor, data storage, replay and print etc. are not discussed in this paper. According to actual needs, all the functions mentioned above can be achieved well through making full use of the property node in LabVIEW.

46、</p><p>  III. CALCULATION OF FREQUENCY AND PERIOD</p><p>  Period and frequency are key parameters to a periodic signal. Traditional measurement is to count the standard signal during the gate

47、pulse duration in hardware so as to calculate the period of the measured signal. But there areusually no counters on hardware to use for a virtual oscillograph based on PC. It must be measured through software. However,

48、the significance in a virtual oscillograph is that it can conveniently analyze the data collected by board cards, and then get the waveform's eige</p><p>  The period of a periodic signal can be defined

49、as the time slot that the signal across a specified gate voltage from the same direction (positive or negative edge) two times. As seen in Fig. 6</p><p>  Suppose a signal sample Xi, (i < N), N is integer

50、, the total number of the sample data. Take the average value of the sample data as the gate voltage; compare it with Xi one by one. When Xi>=v and Xi-1<v, the waveform is across the gate voltage from the bottom u

51、p, called positive edge; when Xi<=v and Xi-1>v, the waveform is across the gate voltage from the top down, called negative edge. At the same time, to eliminate the infection brought by interference, get ride of the

52、 positive and negative </p><p>  Suppose the sample length is L, there is L△To≈kT. Put it on the Eq. (2) above, there is:</p><p>  When a is far smaller than 1/L,increasing the L value can incre

53、ase the measure precision consumedly. When a is as much as 1/L, there is no significance to increase the L value. a is fixed on system's hardware. With a, it can find the proper L value that make the sample and calcu

54、lation process under the best precision.</p><p>  Suppose the square signal, its pulse duration is T', the one measured is TC', so there is:</p><p>  What discussed above is the period a

55、nd frequency measurement in the sampling procedure, putting forward the measurement precision theory. But to the amplitude, rise time or spectrum analyze etc. are not discussed in this paper. Using the data group collect

56、ed, the user can develop other better measurements. In LabVIEW, there is plenty of measuring VIs, which can measure the parameter exactly. [10] </p><p>  Combining the control procedure with virtual oscillog

57、raph can achieve better effect. Next, take DC motor's PWM speed control for instance, it will introduce the function that using virtual oscillograph in PID and closed loop feedback controlling.</p><p>  

58、IV. APPLICATION IN MOTOR SPEED CONTROL</p><p>  Lock-phase technology plays an important role on motor speed control. With the technology, it can improve the precision of motor speed; and also, it does stepl

59、ess speed variation control only by changing the specified frequency, that will be conveniently used on controlling more than one motor work synchronously. [11] The basic theory diagram that indicates the speed control s

60、ystem based on PPL closed-loop lock-phase is shown in Fig.7.</p><p>  Suppose the specified pulse met the motor speed is fR, the pulse from photo sensor is fF. Compare their frequency and phase in the phase

61、comparator, and bring the signal voltage proportion to frequency and phase difference. This voltage controls the motor speed through the low-pass filter to synchronize the motor speed and the specified control signal. In

62、 case the load is fluctuating which changed the motor speed, the pulse output from photo sensor is changing at the same time. There is differen</p><p>  Combining the phase comparator and computer, taking th

63、e advantage of measurement and control of virtual instruments, we can get the digital lock-phase closed loop circuit. The theory diagram is shown in Fig 8.</p><p>  In the diagram, motor speed is converted i

64、nto square signal in proportion it refers to through the photo-sensor. If the speed value measured by virtual oscillograph is lower than the necessary one, the output frequency should be increased; oppositely, the output

65、 frequency should be decreased. In the actual controlling, the anticipant speed can be achieved quickly by comparing the frequency measured and specified, adjusting through PID.</p><p>  Following the PID th

66、eory, putting the secular equation and Jury criterion together, there are:</p><p>  Therefore, to keep the system working steadily, we should set KP = 1, KI = 1/2</p><p>  It is quickly to adjus

67、t the output frequency to the anticipated one by PID revision. We can get the proper square signal through the wave form generator with the specific frequency, and the low-pass filter can convert it into relevant control

68、 voltage. The whole procedure is quick and steady. Using the measure function of virtual oscillograph can complete the same work as lock phase speed control system. Its advantage to traditional lock- phase speed control

69、system is that it can use the control </p><p>  V. CONCLUSION</p><p>  The virtual oscillograph in this paper not only has the functions that common oscillographs have such as data acquire and d

70、isplay, parameter measurement, but also can be used in industry control, as an important part in motor speed control system. In the actual application, its flexibility is popular with more and more people. With different

71、 hardware, more complex and agile measuring system will be produced. With the development of computer and measurement technology, virtual instrument technolo</p><p>  VI. ACKNOWLEDGMENT</p><p> 

72、 This work is supported by natural science foundation of China under the research project 50375008 and 60575052.</p><p>  VII. REFERENCES</p><p>  W.Jang, and F.Yuan,"Design, of multicenter

73、 virtua oscillograph", China measurement technology, Vol.30 No.4, July, 2004.</p><p>  F. M. Li, B. L. Ren, and W. W. Liu, "the means of designing virtual instrument applications in LabVIEW environ

74、ment", Journal of Shenyang University, Vol. 16, No.2, Apr.2004, China</p><p>  J. C. Dong, "Design of virtual oscilloscope based on LabVIEW", Journal of Qingdao University, Vol 17, No.3, Sept.

75、 2002</p><p>  "Getting started with LabVIEW", National Instruments Corporation, USA, 2003</p><p>  J. H. Liu, "Graphic language LabVIEW on virtual instruments tutorial", XiD

76、ian University Press, Xi'an China, 2001</p><p>  M.Li, and Z.M.Wang, "Design and implementation of virtual instrument based on LabVIEW 7i", Instrumentation Analysis Monitoring, No.4, 2004, Chin

77、a</p><p>  "LabVIEW user manual", National Instruments Coorperation, USA, 2003</p><p>  B. Du, "Measuring frequency and pulse-width in virtual- scope", Measurement & Cont

78、rol Technology, Vol 20, No.1, 2001, China</p><p>  "Data acquisition fundamental ", National Instruments Corporation, USA, 2003</p><p>  Beyon and J. Y., "Hands-on exercise manual

79、 for LabVIEW programming, data acquisition and analysis", Upper Saddle River, N. J. Prentice Hall PTR, 2001</p><p>  W. P. Huang, "A single-chip microcomputer-based DC motor's speed regulating

80、system with all-digital and PLL control", Coal miner automation, No.3, 1997</p><p>  基于LabVIEW的虛擬示波器研究和開發(fā)</p><p>  摘要:介紹了一種基于LabVIEW環(huán)境下開發(fā)的虛擬示波器的軟件設(shè)計(jì)過(guò)程;重點(diǎn)介紹了示波器實(shí)時(shí)顯示過(guò)程中的幅值和時(shí)基調(diào)整的方法,在保證實(shí)時(shí)性的前提下,

81、對(duì)于長(zhǎng)短時(shí)基顯示分別提出了各自的處理算法;同時(shí),簡(jiǎn)要介紹了波形的時(shí)頻測(cè)量的基本思想:門檻電壓法及其應(yīng)用;并在此基礎(chǔ)上,將其應(yīng)用于現(xiàn)代電機(jī)閉環(huán)鎖相調(diào)速系統(tǒng),分析了參數(shù)測(cè)量在PID控制中的作用;實(shí)驗(yàn)結(jié)果表明,該虛擬示波器實(shí)時(shí)性能良好,對(duì)系統(tǒng)的閉環(huán)控制起到了很好的作用。</p><p>  關(guān)鍵詞:虛擬示波器;時(shí)基;運(yùn)動(dòng)控制</p><p><b> ?、? 引文</b>&

82、lt;/p><p>  在高速發(fā)展的工業(yè)控制領(lǐng)域,測(cè)量技術(shù)和儀器變得越來(lái)越重要。但由于傳統(tǒng)手段的弊端,如價(jià)格昂貴、功能單一、可擴(kuò)展性不好等,很難滿足業(yè)界的要求。隨著計(jì)算機(jī)技術(shù)和虛擬儀器的發(fā)展,用戶的設(shè)計(jì)范圍變得比較廣泛。用先進(jìn)的總線技術(shù),同樣的硬件可以使兩個(gè)或者兩個(gè)以上的機(jī)器同步工作,實(shí)現(xiàn)很多不同的功能,如PXI總線技術(shù)[1]。這些突出的特點(diǎn),例如成本低、多功能等使得虛擬儀器的使用越來(lái)越廣泛。</p>

83、<p>  所有的測(cè)量?jī)x器都包括三個(gè)部分:數(shù)據(jù)采集部分,數(shù)據(jù)分析部分和結(jié)果輸出部分[2]。在這三個(gè)部分中,數(shù)據(jù)采集部分可以由硬件系統(tǒng)的A/D模塊或數(shù)字I/O模塊來(lái)完成。而數(shù)據(jù)分析和結(jié)果輸出部分可由計(jì)算機(jī)基礎(chǔ)上的軟件系統(tǒng)來(lái)完成。因此,如果給予一些必要的數(shù)據(jù)采集硬件,基于計(jì)算機(jī)便可構(gòu)成測(cè)量?jī)x器硬件。同時(shí),在虛擬儀器中,軟件技術(shù)也是必不可少的[3]。Visual C++, LabVIEW,LabWindows/CVI,VEE等都是開

84、發(fā)的軟件環(huán)境。LabVIEW是一個(gè)叫做G語(yǔ)言的圖形化編程語(yǔ)言。它可用在以GPIB、VXI總線、PXI總線、PCI總線和數(shù)據(jù)采集卡等為基礎(chǔ)的硬件系統(tǒng),具有強(qiáng)大的分析能力。它的圖形化編程方法可以用簡(jiǎn)單清晰的數(shù)據(jù)流來(lái)完成總程序。利用其嵌入式板卡驅(qū)動(dòng)程序界面,我們可以很方便地操作一個(gè)板卡[4,5]。</p><p>  多通道數(shù)字示波器主要用于實(shí)時(shí)數(shù)據(jù)采集,是一個(gè)最廣泛使用的通用測(cè)量?jī)x器。它還能夠顯示出一些電信號(hào)的變化并

85、比較彼此之間的差異。因此,研究和開發(fā)虛擬示波器是一個(gè)熱點(diǎn)領(lǐng)域。在LabVIEW中利用Graph platte,你可以很方便地獲取動(dòng)態(tài)波形,并把它們顯示出來(lái)。大多數(shù)基于LabVIEW的虛擬示波器都使用Graph platte來(lái)操作和分析波形數(shù)據(jù)。雖然它很容易使用,但也存在不少缺點(diǎn):(1)當(dāng)波形一直變化時(shí),屏幕就會(huì)一直刷新,Graph platte就不能正常工作;(2)它的操作方法并不能滿足大多數(shù)的使用者,因?yàn)樗诓僮鲿r(shí)不同于傳統(tǒng)的示波器。

86、本文提出了一些辦法來(lái)解決這些問(wèn)題。在實(shí)時(shí)顯示波形時(shí),我們重建了波形操作并介紹了一些相關(guān)的軟件算法。在介紹中利用了時(shí)基上的動(dòng)態(tài)調(diào)整并提出兩個(gè)概念:FIFO進(jìn)程和E-M進(jìn)程。此外,還介紹了一個(gè)在測(cè)量時(shí)間和頻率中成功測(cè)量門檻電壓的途徑,并在此基礎(chǔ)上提出了在鎖相環(huán)系統(tǒng)中的應(yīng)用。</p><p>  II. 多通道數(shù)字示波器軟件算法的研究</p><p>  本文介紹的虛擬示波器主要用于實(shí)驗(yàn)室中各種

87、模擬信號(hào)的測(cè)量與存儲(chǔ)。其主要功能有:信號(hào)采集、波形顯示、參數(shù)測(cè)量、波形存儲(chǔ)與回放等。具有64路模擬信號(hào)輸入通道,通過(guò)開關(guān)矩陣的選擇,可同時(shí)進(jìn)行8路信號(hào)的觀測(cè)。根據(jù)要求,硬件上選用 NI - 6133 同步采集卡作為信號(hào)采集模塊。該虛擬示波器的主要實(shí)現(xiàn)框圖如圖1所示[6]。</p><p>  下面將介紹虛擬示波器基本功能的軟件算法實(shí)現(xiàn)。</p><p>  A:Graph控件的特點(diǎn)<

88、/p><p>  LabVIEW提供了3種波形顯示方式:Graph,Chat,X-Y Graph。每種示波器各自具有不同的特點(diǎn)。本文以Graph為例,介紹虛擬示波器基本功能的程序?qū)崿F(xiàn)。Graph示波器是將一次輸入示波器的波形數(shù)據(jù)全部顯示出來(lái),每進(jìn)行一次數(shù)據(jù)輸入操作,便會(huì)刷新屏幕一次[7]。利用自帶的操作工具,你可以移動(dòng)、縮放波形或使用光標(biāo)來(lái)測(cè)量參數(shù)。但是它不能用于動(dòng)態(tài)波形。因此,我們有必要開發(fā)一個(gè)更為方便的波形操作工

89、具以實(shí)現(xiàn)動(dòng)態(tài)波形的實(shí)時(shí)顯示。</p><p>  在本文中介紹的虛擬示波器,有一些基本的功能,如有幅值位置及時(shí)基調(diào)整、觸發(fā)方式選擇等。圖2顯示了該示波器的前面板。</p><p><b>  B:幅值調(diào)整</b></p><p>  示波器具有多通道同時(shí)顯示的功能,便于各個(gè)信號(hào)之間的比較。對(duì)于每一條顯示的波形,應(yīng)該能夠分別對(duì)其進(jìn)行操作。通過(guò)面板

90、上的通道選擇框,選定某一條波形后,可以單獨(dú)對(duì)該波形進(jìn)行操作。將示波器屏幕分成10×10個(gè)網(wǎng)格。對(duì)于幅值調(diào)整按鈕,其上的數(shù)值對(duì)應(yīng)示波器縱軸方向每一小格所代表的信號(hào)幅度。因此,可以為每條波形設(shè)置一個(gè)Y坐標(biāo)軸,利用波形圖的屬性節(jié)點(diǎn),將每個(gè)坐標(biāo)軸的最小值設(shè)置為幅值調(diào)節(jié)旋鈕所對(duì)應(yīng)數(shù)值的-5倍,最大值為其對(duì)應(yīng)數(shù)值的5倍。這樣,在改變幅值大小的同時(shí)改變波形所對(duì)應(yīng)Y軸的最大最小值,將顯示的波形按照要求放大或縮小,同時(shí)保持波形的零點(diǎn)位置不變。&

91、lt;/p><p>  設(shè)置一個(gè)幅值數(shù)組,用于存儲(chǔ)每次調(diào)整后的波形幅值大小。這樣,每當(dāng)選擇某一條波形時(shí),先將其上一次調(diào)整的幅值數(shù)據(jù)賦給幅值調(diào)整按鈕,在調(diào)整完畢后,用新調(diào)整的值覆蓋相應(yīng)的數(shù)組元素。這樣,即完成了波形幅值調(diào)整的功能。</p><p><b>  C:時(shí)基調(diào)整</b></p><p>  時(shí)基調(diào)整是示波器中最基本的功能之一。時(shí)基調(diào)整按鈕的

92、數(shù)值表示屏幕網(wǎng)格每一小格所代表的時(shí)間。這是示波器設(shè)計(jì)過(guò)程的難點(diǎn)。</p><p><b>  基本思路</b></p><p>  根據(jù)Graph示波器的特點(diǎn),要將一次輸入的所有波形數(shù)據(jù)點(diǎn)全部顯示出來(lái)。故將屏幕X軸分成10格,設(shè)每格所表示的時(shí)間為t,如果波形能夠橫跨整個(gè)X軸,則采集該段波形所需的時(shí)間為10t。再設(shè)板卡采樣頻率為f,即1s內(nèi)采f個(gè)數(shù)據(jù)點(diǎn)。因此,所需要波形

93、數(shù)據(jù)點(diǎn)個(gè)數(shù)N應(yīng)為:</p><p>  N= f×l0t =l0ft (1)</p><p>  保持?jǐn)?shù)據(jù)采集板卡以頻率f采集,程序在每一次循環(huán)內(nèi)讀取板卡內(nèi)存的N個(gè)數(shù)據(jù)并放入示波器中顯示。改變t的值即改變每次讀取的N的個(gè)數(shù),從而做到實(shí)時(shí)采集過(guò)程中時(shí)基的調(diào)整。</p><p>  但是,經(jīng)過(guò)實(shí)驗(yàn)我們可以發(fā)現(xiàn),當(dāng)時(shí)基太長(zhǎng)(>100ms)或

94、太短(<500μs)時(shí),顯示的波形會(huì)有不同程度的延時(shí)。這是因?yàn)楫?dāng)時(shí)基太大時(shí)(如所需要的波形長(zhǎng)度超過(guò)1秒),則必須等板卡采集足夠的時(shí)間后才能將數(shù)據(jù)全部取出,一次性地在屏幕上顯示出來(lái),就會(huì)造成屏幕上顯示的波形不連續(xù)。而當(dāng)時(shí)基太小,由于每次循環(huán)讀取的N值太小,1s鐘的數(shù)據(jù)要經(jīng)過(guò)多次循環(huán)才能取完,加上程序其它部分的一些處理,每次取數(shù)不及時(shí),造成了顯示的延時(shí)。同時(shí),由于板卡的內(nèi)存有限,取數(shù)的速度小于采集的速度,從而造成舊數(shù)據(jù)來(lái)不及取出而被新

95、數(shù)據(jù)覆蓋,板卡內(nèi)存溢出的情況。因此,有必要對(duì)長(zhǎng)時(shí)基和短時(shí)基的情況分別處理。</p><p><b>  長(zhǎng)時(shí)基</b></p><p>  對(duì)于長(zhǎng)時(shí)基,為了避免上述波形延時(shí)的情況,必須減少每次循環(huán)所讀取數(shù)據(jù)點(diǎn)的個(gè)數(shù),同時(shí)考慮到Graph示波器的顯示特點(diǎn),不能將每次讀取的點(diǎn)分別輸入示波器,這樣會(huì)讓示波器不斷刷新,使波形不能顯示滿屏??梢钥紤]建立一個(gè)波形數(shù)組,用于存儲(chǔ)所要

96、顯示的波形數(shù)據(jù)。數(shù)組的容量為N,N為顯示滿屏波形所需要的數(shù)據(jù)點(diǎn)的個(gè)數(shù)。設(shè)每次讀取板卡數(shù)據(jù)的個(gè)數(shù)為固定值m,m為合適時(shí)基所對(duì)應(yīng)的讀取點(diǎn)的個(gè)數(shù)。</p><p>  整個(gè)顯示過(guò)程分兩步。先將數(shù)組初值置為空。在顯示初期,數(shù)組未滿,每次循環(huán)將新取得的數(shù)據(jù)加入數(shù)組末尾(入隊(duì)),并將整個(gè)數(shù)組的數(shù)據(jù)一起輸入示波器顯示。這時(shí)在屏幕上可以看到顯示的是一條不斷往前運(yùn)動(dòng)的波形。當(dāng)數(shù)組滿時(shí),將數(shù)組開頭m個(gè)數(shù)據(jù)去掉,把后面的數(shù)據(jù)往前移動(dòng)m

97、個(gè)位置,再將新取得的m個(gè)數(shù)據(jù)放至數(shù)組末尾。我們把這個(gè)過(guò)程叫做FIFO過(guò)程。這時(shí),屏幕上所看到的是一條完整的波形如圖3所示。</p><p>  由于每次從板卡中讀取的數(shù)據(jù)點(diǎn)的值m都是合適的,因此很好地解決了等待采樣數(shù)據(jù)造成的顯示延時(shí)的問(wèn)題,保證了采集與顯示的同步。為了減少系統(tǒng)計(jì)算FIFO過(guò)程所占用的時(shí)間,可在長(zhǎng)時(shí)基下降低采樣頻率,以減小所設(shè)數(shù)組大小。</p><p><b>  

98、3)短時(shí)基</b></p><p>  對(duì)于短時(shí)基,我們所要解決的是由于數(shù)值N經(jīng)公式(1)計(jì)算出的值過(guò)小而帶來(lái)的顯示延時(shí)和內(nèi)存溢出問(wèn)題。不能盲目增加讀取數(shù)據(jù)點(diǎn)數(shù)N,這樣會(huì)導(dǎo)致顯示的波形和所設(shè)時(shí)基大小不一致。為此,提出E-M(expand-move)解決辦法。將每次讀取的數(shù)據(jù)個(gè)數(shù)固定,一般為合適時(shí)基所對(duì)應(yīng)的讀取點(diǎn)的個(gè)數(shù)。設(shè)其為m,在短時(shí)基下根據(jù)公式(1)計(jì)算出所需數(shù)據(jù)點(diǎn)的個(gè)數(shù)設(shè)為N(N<m)。將所

99、讀取的m個(gè)數(shù)據(jù)的Δt擴(kuò)大m/n倍(expand過(guò)程)。同時(shí),改變x軸的最大和最小值,分幾次將m個(gè)數(shù)據(jù)(擴(kuò)大Δt后)完全顯示,再進(jìn)入下一次循環(huán)。</p><p>  至此,整個(gè)程序就結(jié)束了。該圖顯示在圖4和圖5中。</p><p>  D:位置調(diào)整和零標(biāo)志</p><p>  改變Y軸的波形數(shù)據(jù)值可以改變波形在屏幕上的位置顯示。增加或減少Y軸的波形數(shù)據(jù)值可以移動(dòng)波形使

100、之上升或下降。在每個(gè)顯示波形上添加一個(gè)控制按鈕,可以標(biāo)志出每個(gè)波形的零點(diǎn)位置。拖動(dòng)控制按鈕成一條線,以標(biāo)志零點(diǎn)位置。</p><p>  初始化控件,相對(duì)于示波器,位于右屏幕邊緣的中間。當(dāng)改變波形的位置時(shí),坐標(biāo)的零位置點(diǎn)同時(shí)改變。因此,零位置點(diǎn)會(huì)隨波形移動(dòng)。此外,可以設(shè)置標(biāo)志按鈕控制頂部和底部邊緣以外不可見(jiàn),使效果更加逼真。如圖2所示。</p><p><b>  E:其他功能&

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論