版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p> 中文5650字,3300單詞</p><p> 出處:Liu Y, Han Y, Yu S. Research & Development of Virtual Oscillograph Based on LabVIEW[C]// IEEE International Conference on Industrial Informatics. 2006:1124-1128.<
2、/p><p><b> 附 錄</b></p><p> Research & Development of Virtual Oscillograph</p><p> Based on LabVIEW</p><p> Abstract: This paper introduces the design p
3、rocess 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 introduces the basic thought when measuring
4、 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 virtual oscillograph with the modern motor clos
5、e-loop lock-phas</p><p> Keywords: Virtual Oscillograph; Time-Base; Motion Control</p><p> ?、? INTRODUCTION</p><p> In the rapidly developing industry control field, measuring tec
6、hnologies 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., they can hardly meet the industry requ
7、irement. 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 the same hardware which can make two o<
8、;/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 the system hardware like A/D module or d
9、igital 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 instrument based on computer can be constitut
10、ed. 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 acquisition, is one of the most widely used g
11、eneral 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 virtual oscillograph is the hotspot in the ar
12、ea. 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><p> II. RESEARCH ON THE MULTICENTER DI
13、GITAL</p><p> OSCILLOGRAPH'S SOFTWARE ARITHMETIC</p><p> The virtual oscillograph introduced by this paper is mainly used in laboratory for the measurement and storage of various analog si
14、gnals. 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 signal observations at the same time with t
15、he 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 will introduce the soft arithmetic to the
16、 basic functions of virtual oscillograph.</p><p> Characteristics of Graph Control</p><p> In LabVIEW, there are three controls for waveform displaying: Graph, Chat and x-y graph. Every contro
17、l 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 waveform data input in the screen at a ti
18、me. 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</p><p> In the virtual osc
19、illograph 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's front panel is shown in fig.2.</
20、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 compare every signal change. Every waveform di
21、splayed 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 value of every one of the 10 grids in the Y
22、-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 amplitude values every Y-axis changed. W
23、hen 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 change function is finished.</p>&l
24、t;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 every one grid of X-axis in the screen whi
25、ch is the nodus during the oscillograph design procedure.</p><p> Basic Clew</p><p> According to the characteristics of the Graph control, it displays all the data input at a time. So distrib
26、ute 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's sampling rate is f, in other word, t
27、he 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 sampling at the frequency of f, the program
28、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 adjust the time base in the real-time samp
29、ling.</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 different extend. That is because when the
30、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 screen at a time. So that can cause disco
31、ntinuous 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 discussed above, it must reduce the number o
32、f 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 because it will make the oscillograph refreshi
33、ng 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, which is the number of data points calcu&l
34、t;/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 m data points into the end of the array
35、(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 first m elements of the array; move the re
36、st 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 suitable, the time lag caused by waiting for
37、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 should be reduced at the long time base to
38、 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 overflow because the number N calculated via E
39、q. (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 (expand-move) is put forward. Fix the numbe
40、r 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><p> Until now, the whole procedure is
41、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 change the waveform's position displayed
42、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 waveform displayed. Drag the control int
43、o 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 position of the waveform, change the coordin
44、ate 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 effect can be truer. As seen in Fig.2.<
45、;/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 mode, cursor, data storage, replay and pri
46、nt 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.</p><p> III. CALCULATION O
47、F 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 pulse duration in hardware so as to calcu
48、late 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, the significance in a virtual oscillograp
49、h 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 as the time slot that the signal across a
50、 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, the total number of the sample data. Ta
51、ke 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 up, called positive edge; when Xi<=v an
52、d 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 positive and negative </p><p&
53、gt; 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 increase the measure precision consumedly. Whe
54、n 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 calculation process under the best precision.&
55、lt;/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 and frequency measurement in the sampling
56、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 collected, the user can develop other better mea
57、surements. In LabVIEW, there is plenty of measuring VIs, which can measure the parameter exactly. [10] </p><p> Combining the control procedure with virtual oscillograph can achieve better effect. Next, tak
58、e 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> IV. APPLICATION IN MOTOR SPEED CONTROL<
59、;/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 stepless speed variation control only by chang
60、ing 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 system based on PPL closed-loop lock-phase
61、 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 comparator, and bring the signal voltage
62、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 case the load is fluctuating which chang
63、ed 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 the advantage of measurement and control of
64、 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 into square signal in proportion it refers
65、 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 frequency should be decreased. In the ac
66、tual controlling, the anticipant speed can be achieved quickly by comparing the frequency measured and specified, adjusting through PID.</p><p> Following the PID theory, putting the secular equation and Ju
67、ry 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 adjust the output frequency to the anticipated
68、 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 voltage. The whole procedure is quick an
69、d 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 system is that it can use the control <
70、;/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 display, parameter measurement, but also c
71、an 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 hardware, more complex and agile measuri
72、ng system will be produced. With the development of computer and measurement technology, virtual instrument technolo</p><p> VI. ACKNOWLEDGMENT</p><p> This work is supported by natural scienc
73、e foundation of China under the research project 50375008 and 60575052.</p><p> VII. REFERENCES</p><p> W.Jang, and F.Yuan,"Design, of multicenter virtua oscillograph", China measure
74、ment 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 environment", Journal of Shenyang Universit
75、y, 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. 2002</p><p> "Getting
76、 started with LabVIEW", National Instruments Corporation, USA, 2003</p><p> J. H. Liu, "Graphic language LabVIEW on virtual instruments tutorial", XiDian University Press, Xi'an China, 20
77、01</p><p> M.Li, and Z.M.Wang, "Design and implementation of virtual instrument based on LabVIEW 7i", Instrumentation Analysis Monitoring, No.4, 2004, China</p><p> "LabVIEW use
78、r manual", National Instruments Coorperation, USA, 2003</p><p> B. Du, "Measuring frequency and pulse-width in virtual- scope", Measurement & Control Technology, Vol 20, No.1, 2001, China
79、</p><p> "Data acquisition fundamental ", National Instruments Corporation, USA, 2003</p><p> Beyon and J. Y., "Hands-on exercise manual for LabVIEW programming, data acquisitio
80、n 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 system with all-digital and PLL control&q
81、uot;, Coal miner automation, No.3, 1997</p><p> 基于LabVIEW的虛擬示波器研究和開(kāi)發(fā)</p><p> 摘要:介紹了一種基于LabVIEW環(huán)境下開(kāi)發(fā)的虛擬示波器的軟件設(shè)計(jì)過(guò)程;重點(diǎn)介紹了示波器實(shí)時(shí)顯示過(guò)程中的幅值和時(shí)基調(diào)整的方法,在保證實(shí)時(shí)性的前提下,對(duì)于長(zhǎng)短時(shí)基顯示分別提出了各自的處理算法;同時(shí),簡(jiǎn)要介紹了波形的時(shí)頻測(cè)量的基本思想
82、:門檻電壓法及其應(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></p><p> 在高速發(fā)展的工業(yè)控制領(lǐng)域,測(cè)量技術(shù)和儀
83、器變得越來(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><p> 所有的測(cè)量?jī)x器都包括三個(gè)部分:數(shù)據(jù)采集部分,數(shù)據(jù)分析部分和結(jié)
84、果輸出部分[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等都是開(kāi)發(fā)的軟件環(huán)境。LabVIEW是一個(gè)叫做G語(yǔ)言的圖形化編程語(yǔ)言。它可用在以GPIB、
85、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)的變化并比較彼此之間的差異。因此,研究和開(kāi)發(fā)虛擬示波器是一個(gè)熱點(diǎn)領(lǐng)域。在LabVIEW中利
86、用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)的示波器。本文提出了一些辦法來(lái)解決這些問(wèn)題。在實(shí)時(shí)顯示波形時(shí),我們重建了波形操作并介紹了一些
87、相關(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)室中各種模擬信號(hào)的測(cè)量與存儲(chǔ)。其主要功能有:信號(hào)采集、波形顯示、參數(shù)測(cè)量、波形存儲(chǔ)與回放等
88、。具有64路模擬信號(hào)輸入通道,通過(guò)開(kāi)關(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)</p><p> LabVIEW提供了3種波形顯示方式:Gra
89、ph,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)波形。因此,我們有必要開(kāi)發(fā)一個(gè)更為方便的波形操作工具以實(shí)現(xiàn)動(dòng)態(tài)波形的實(shí)時(shí)顯示。</p><p> 在本文中
90、介紹的虛擬示波器,有一些基本的功能,如有幅值位置及時(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ò)面板上的通道選擇框,選定某一條波形后,可以單獨(dú)對(duì)該波形進(jìn)行操作。將示波器屏幕分成10&
91、#215;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)位置不變。</p><p> 設(shè)置一個(gè)幅值數(shù)組,用于存儲(chǔ)每次調(diào)整后的
92、波形幅值大小。這樣,每當(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)整按鈕的數(shù)值表示屏幕網(wǎng)格每一小格所代表的時(shí)間。這是示波器設(shè)計(jì)過(guò)程的難點(diǎn)。</p>
93、;<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)。因此,所需要波形數(shù)據(jù)點(diǎn)個(gè)數(shù)N應(yīng)為:</p><p> N= f×
94、;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)或太短(<500μs)時(shí),顯示的波形會(huì)有不同程度的延時(shí)。這是因?yàn)楫?dāng)時(shí)基太大時(shí)(
95、如所需要的波形長(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)不及取出而被新數(shù)據(jù)覆蓋,板卡內(nèi)存溢出的情況。因此,有必要對(duì)長(zhǎng)時(shí)基和短時(shí)基的情況分別處理。<
96、/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ǔ)所要顯示的波形數(shù)據(jù)。數(shù)組的容量為N,N為顯示滿屏波形所需要的數(shù)據(jù)點(diǎn)的個(gè)數(shù)。設(shè)每次讀取板
97、卡數(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ù)組開(kāi)頭m個(gè)數(shù)據(jù)去掉,把后面的數(shù)據(jù)往前移動(dòng)m個(gè)位置,再將新取得的m個(gè)數(shù)據(jù)放至數(shù)組末尾。我們把這個(gè)過(guò)程叫做FIFO過(guò)程。這時(shí),屏
98、幕上所看到的是一條完整的波形如圖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> 3)短時(shí)基</b></p><p> 對(duì)于短
99、時(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)。將所讀取的m個(gè)數(shù)據(jù)的Δt擴(kuò)大m/n倍(expand過(guò)程)。同時(shí),改變x軸的最大和最小值
100、,分幾次將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)波形使之上升或下降。在每個(gè)顯示波形上添加一個(gè)控制按鈕,可以標(biāo)志出每個(gè)波形的零點(diǎn)位置。拖動(dòng)
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 外文翻譯--基于labview的虛擬示波器研究和開(kāi)發(fā)
- 基于labview的虛擬示波器設(shè)計(jì)
- 基于labview的虛擬示波器設(shè)計(jì)
- 基于LabVIEW的虛擬示波器設(shè)計(jì).doc
- 基于LabVIEW的虛擬示波器的設(shè)計(jì).pdf
- 基于labview的虛擬示波器設(shè)計(jì)【開(kāi)題報(bào)告】
- 開(kāi)題報(bào)告---基于labview的虛擬示波器的設(shè)計(jì)
- 基于LabVIEW的低頻虛擬示波器研究與實(shí)現(xiàn).pdf
- 基于labview的虛擬儀器外文翻譯
- 基于labview的虛擬示波器的設(shè)計(jì)與實(shí)現(xiàn)
- 基于labview的虛擬示波器的設(shè)計(jì)與實(shí)現(xiàn)
- 畢業(yè)論文---基于labview的虛擬示波器的設(shè)計(jì)
- 基于labview的虛擬示波器設(shè)計(jì)【畢業(yè)設(shè)計(jì)】
- 基于LabVIEW的PXI虛擬數(shù)字示波器設(shè)計(jì).pdf
- 虛擬數(shù)字存儲(chǔ)示波器外文翻譯
- 基于LabVIEW的虛擬示波器的設(shè)計(jì)與實(shí)現(xiàn).pdf
- 基于LabVIEW的虛擬數(shù)字示波器的設(shè)計(jì)與實(shí)現(xiàn).pdf
- 基于labview的虛擬示波器及其硬件設(shè)計(jì)與實(shí)現(xiàn)
- 畢業(yè)論文(設(shè)計(jì))基于labview的虛擬示波器的設(shè)計(jì)
- 基于LabVIEW虛擬示波器的設(shè)計(jì)及遠(yuǎn)程控制.pdf
評(píng)論
0/150
提交評(píng)論