• Nie Znaleziono Wyników

Pakiety programowe dla celów automatyzacji pomiarów i przetwarzania danych

N/A
N/A
Protected

Academic year: 2022

Share "Pakiety programowe dla celów automatyzacji pomiarów i przetwarzania danych"

Copied!
11
0
0

Pełen tekst

(1)

Seria: E LE K TR Y K A z.134 N r kol. 1225

D aniel K A M IN SK Ÿ

PA K IE T Y P R O G R A M O W E D L A C ELÓ W A U TO M A TY ZA C JI PO M IA R Ó W I P R ZE T W A R Z A N IA D A N Y C H

Streszczenie. W artykule opisano pakiety program ow e LabW indow s i LabV IEW w spierające proces uzyskiw ania program ów użytkow ych służących do zbierania, przetw arzania i prezentacji danych pom iarow ych za p o m o cą kom putera klasy IB M PC.

Pakiety te obejm ują bogaty zestaw program ów bibliotecznych dla w. w. celów. Pakiet LabV iew w ykorzystuje środow isko program ow e M S W indow s, natom iast pakiet LabW indow s w spom aga program ow anie w języku C.

SO FTW A R E SY STE M F O R A U TO M A TIC M E A SU R E M E N T A ND D IG ITA L SIG NA L P R O C E S S IN G

Sum m ary. L abW indow s and Lab V IEW are softw are packages that save developing time o f data acquisition and signal processing applications from A m erican com pany N ational Instrum ents. They include pow erful libraries for data acquisition, data analysis and data presentation tasks. System LabVTEW brings new pow erful m ethodology o f graphical program m ing and because o f running u nder M icrosoft W IN D O W S it has all advantages o f graphical environm ent typical for M S W IN D O W S program s. L abW indow s on the o th er hand is developm ent system fo r traditional program m ers w ho w orks with C program m ing language.

D IE P R O G R A M M K O M PL EX E FÜ R D IE A U T O M A T ISIE R U N G D ER M ESSU N G EN U N D D A T E N V E R A R B E IT U N G

Zusam m enfassung. L abW indow s und L abV IEW sind in der amerikanischen Firm a N ational Instrum ents gebildete Program m kom plexe, w elche die zur Entw icklung der A nw endungen für die D atenerfassung und die Signalverarbeitung notw endige Zeit w esentlich sparen. S ie'schliessen leistungsf ahige Program m bibliotheken ein, die D u rc h f thrung der atenerfassung, D atenanalyse und der graphischen D arstellung der Ergebnisse erm oglichen.

D as System L abV IEW bietet eine neue leistungsf ahige M ethodik der graphischen P rogram m ierung. D a dieses System in der U m gebung M S W IN D O W S funktioniert, hat es alle flir die M S W IN D O W S P rogram m e typischen V orteile der graphischen U m gebung. Lab W indow s ist im G egenteil ein Entw icklungssystem für traditionelle Program m ierer, die die R echnersprache C verw enden.

(2)

112 D. Kaminsky 1. IN T R O D U C TIO N

W ithout m easuring and evaluation th e processed data it is impossible to imagine any technical and developm ent activity. T he first generation o f instrum ents w ere analog instrum ents manually controlled from their front panels. T he users had no flexibility in user interface design, m easurem ents capabilities, o r com putational features.

W ith invention o f G eneral P urpose Interface B us (G PIB ), users could control the m easuring systems both program atically and manually. E ach G PIB instrum ent w as designed for a specific m easurem ent so a num ber o f instrum ents w as needed to create and complete m easurem ent system.

Today’s instrum ents are com bination o f general-purpose com puter and w orkstations, graphical softw are, program m able instrum ents and general purpose digitizers. M odem instrum ents also com bine sophisticated signal routing and conditioning, as well as program m able triggering schemes.

Softw are plays very im portant role in developing autom ated data acquisition and control systems. Application softw are packages gives to the user th e tolls to acquire data, analyse data and present them by the com puter. By using pow erful softw are developm ent packages it is possible to reduce the developm ent tim e and create high quality program s that are easy to m odify and maintain.

M any vendors offer application softw are fo r all three elem ents o f autom ated data acquisition, control and D SP system (D ata Acquisition, D ata Analysis and D ata Presentation).

In many cases the offered softw are focuses only on the one o f the m entioned elem ent, and may be well suited for particular application. H ow ever, m ost applications requires softw are for all three elem ents o f the system.

A m erican com pany N ational Instrum ents, leader in hardw are and softw are instrum ents for data acquisition and instrum entation offers tw o prim ary softw are packages LabW indow s and Lab V IEW th at are going to becam e the w orld standards. These softw are packages build upon N ational Instrum ents industry standard device driver software. T he packages include pow erful data analysis routines for digital signal processing and statistical calculations. Each package also has very good data presentation capabilities for graphical user interface on the com puter screen as w ell as plotting them on plotters o r graphical printers and storing o r retrieving the m easured and processed data from files.

(3)

B oth L abW indow s and Lab V IE W are com plete program m ing systems, both products have the functionality and flexibility to m eet any application. T he differences are in program m ing m ethodology and the operating system s under w hich the packages run.

L abW indow s for D O S enhances the standard C and B A SIC program m ing languages fo r data acquisition and control applications, Lab V IE W is a graphical program m ing system fo r both nonprogram m ers as well novice o r advanced program m ers. Lab V IE W runs under M icrosoft W IN D O W S on PC com patible com puters and integrates all capabilities o f graphical systems.

T he usage o f Lab V IE W is not restricted only o f IB M PC com patible com puters, but also versions o f w orkstations (SU N , Apollo, e t c . . ) and V A X systems are available.

Let's describe th e features o f both systems to dem onstrate their advantages.

2. L A B W IN D O W S - D E V E L O P M E N T SY STE M FO R TR A D IT IO N A L PR O G R A M M ER S

LabW indow s is an integrated set o f softw are tools o f developing program s in M icrosoft C and QuickBasic. This softw are package includes libraries for data acquisition, data analysis and graphical presentation. L abW indow s helps the user to w rite and debug the program s in very effective way. B ecause all o f th e L abW indow s libraries are com patible w ith Q uickBasic and C the program s developed in this interactive program can be simple com piled and linked using th e standard Q uickBasic, C o r Q uick C compilers. T he interactive developm ent program s has a special interface called a function panel th at allows the user to experim ent with library functions and autom atically generates source code for th e user application. With LabW indow s libraries it is very simple to create m any o f "virtual instrum ents" that can represent functions o f real physical instrum ent by the help o f LabW indow s softw are, PC /X T /A T and data acquisition board o r suitable interface board.

LabW indow s has three libraries for data collection : G PIB library, RS 232 library and D ata A cquisition library. T he last one gives the user a w ide set o f functions fo r controlling data acquisition boards (preferred N ational instrum ents' data acquisition boards). Because L abW indow s has functions fo r creating m ultiplot graphs, bar charts and strip charts and also special library - A dvanced analysis library w ith m any o f functions for signal processing it is

(4)

ideal softw are tool fo r developing program s for m onitoring technological processes and controlling.

T he paper deals w ith application L abW indow s softw are tools for developing control program fo r autom atic m onitoring and controlling w orkplace for m easuring param eters and characteristics o f electrical machines. F o r the m easurings and control is used a low -cost data acquisition board from N ational Instrum ents - board Lab PC.

L abW indow s requires an IBM PC AT, PS/2, o r com patible com puter running M S DOS version 3.0 o r later. T o run L abW indow s interactive environm ent it is necessary to have 640 kilobytes o f conventional m em ory and 1.4 m egabytes o f extended m em ory (it is recom m ended to have at least 3 .4 megabytes o f extended m em ory). T o use LabW indow s com piled program s it necessary to have only 640 kilobytes o f conventional memory.

F o r creating executable program s LabW indow s requires either M icrosoft QuickBasic 4.x, M icrosoft BA SIC 7.0, M icrosoft C 5.x o r 6.x o r Q uick C 2.x. It is also possible to compile program s w ith M icrosoft C 7.0 with the restriction o f creating only batch file as product o f utility LW M A K E, because M icrosoft C 7.0 runs in Enhanced m ode o f 80386 m icroprocessor and needs for the w ork m em ory extender not com patible w ith D OS 16/M D O S extender from Rational System Inc. incorporated inside LabW indow s environm ent o r must be run under M icrosoft W indow s 3.0 o r 3.1 w ith th e virtual m em ory m anager (V M M ) incorporated inside M icrosoft W indow s. L abW indow s on the other hand cannot run under M icrosoft W indow s as a W indow s application. It can be run only as non W indow s application, but only in a case if M icrosoft W indow s are running in real o r standard mode. LabW indow s cannot run at all at W indow s in 8038,6 Enhanced mode.

F o r starting L abW indow s in Standard m ode th e PIF file must be specified as follows:

- R equired am ount 1,024 - Lim it -1

The L abW indow s libraries unleash the full pow er o f the C an Q uickBA SIC program m ing languages. T he L abW indow s libraries contain num erous functions for developing acquisition and control program s. L abW indow s libraries are accessible both within the developm ent system and in stand-alone program s. Libraries for C program m ing language are fully com patible w ith M icrosoft Libraries so it is possible to link them to all program s w ritten and com piled in M icrosoft C versions m entioned above. The libraries use the large m odel o f mem ory.

■ii4 D . Kaminsky

(5)

All library functions are callable by the help o f function panels that are obtained after m enu selection from Library m enu com m and. T he follow ing libraries are available in L abW indow s softw are developm ent tool:

T he G PIB Library contains the function fo r com plete program m ing control o f IE E E 488 (e.g. G PIB ) instrum ents. W ith G PIB 488.2 Library it is possible to access any o f N ational Instrum ents controller boards and the standard M S D O S device driver.

T he RS 2323 Library has functions fo r perform ing serial com m unications using multiple R S 232 ports under interrupt control.

T he optional V X I Library has functions to control V X I instrum ents from either V X Ipc - 386 em bedded V X I controller o r external com puters equipped w ith A T-M X I o r M C-M X I interface. T he library has functions for program m ing both M essage B ased and R egister based devices.

T he data A cquisition Library has functions to acquire and output data w ith all o f N ational Instrum ents boards for IB M PC /A T, E IS A and M icro Channel (PS/2) com puters.

T he library contains both simple and sophisticated functions to give th e user the maximum p o w er and flexibility w ith th e data acquisition boards.

T he Instrum ent Library D eveloper Program (ILD P) satisfies all high dem ands for instrum ent drivers. T hrough the ID LP partnership w ith instrum ent vendors (also the D epartm ent o f Electrical M easurem ents is one w orkplace w here the instrum ent drivers are being w ritten), the L abW indow s Instrum ent Library continues to gro w w hile m aintaining a high standard o f quality.

LabW indow s provide to user Integrated D evelopm ent E nvironm ent. All function are accessible from pull dow n main m enu by selection from keyboard o r by m ouse pointer. The main m enu contains the follow ing com m ands: File, Edit, P rogram , Libraries, V iew and Option.

File m enu provides standard functions calling the utility LW M A K E for creating stand-alone executable program s by the external com pilers (C o r Q uickB A SIC ) o r for creating R un Time applications. This is useful on case o f large program application, w hen th e com piled code is useful in case o f large conventional m em ory and cannot be directly executed under M SD O S operating system. T he E dit m enu provides functions for delete, m ove o r copying text, and pasting text to and from files. T he Program m enu provides tools to assist in debbuging an application program . T he syntax can be checked w ithout executing the code. T he breakpoints can be placed in the source code to halt the program at desired locations to be able then execute the program step by step and locate m istakes in the program . T he Instrum ents provides

(6)

access to Instrum ent Library, w hich contains device control functions for various instruments.

LabW indow s developm ent tool. T he Libraries provides libraries that assist in writing application program s. These libraries include: Form atting I/O, U ser Interface, Graphics, Analysis, D ata Acquisition, RS 232, G PIB , G PIB -488.2, V XI and System libraries. The A dvanced Analysis Library - the optional library w ith w ide range o f functions for statistics and Digital Signal Processing replaces the regular Analysis Library.

These libraries provide functions m entioned above in previous paragraph. The View contains com m ands to invoke V ariable Display, display the m ost recently used function panel o r graph and enable the Split Screen m ode. It also contains com m ands to switch betw een the various w indow s. T he O ption m enu contains com m ands for calling the U ser Interface E ditor o r the instrum ent driver panel/tree editors. T here are also com m ands for saving instrum ent driver code.

Program m ing w ith LabW indow s is very simple. The Libraries menu item provides to user after selecting th e library and specifying the function panel. A function panel is a full screen user interface for entering th e param eters to functions and interactively executing library functions w ithout typing and editing the program code. G enerated source code can be put to the program w indow o f editor by selecting the Keep com m and from Function Panel Menu.

Interactive executing the library functions w ith filled param eters can be used for effective checking the validity o f the param eters and correct function results.

3. A N A LY SIN G SIG N A LS IN L A B W IN D O W S - A D V A N CED A NA LYSIS L IB RA R Y

A dvanced Analysis Library is pow erful set o f functions for data analysis and Digital Signal Processing. T he Library contains signal generation algorithms and curve fitting functions. T here are also num erous o f utility functions for w orking w ith data arrays, complex num bers and com plex arrays. In area o f Digital Signal Processing A dvanced Analysis Library provide functions in frequency D omain: com puting FFT, FHT, Pow er Spectrum o f signal, com puting C onvolution and C orrelation. In time D om ain there are available Integration, Differentiate, A rrayReversal and Pulse Param eters Com puting. The library is very rich also in sphere o f digital filtering. A dvance Analysis Library provides functions for design both Finite -US--- —_________________________________________ D. Kaminsky

(7)

Im pulse R esponse and Infinite Im pulse R esponse digital filters, w indow ing functions (H am m ing, H anning, Blackm an, T riangle and Kaiser). Also statistical functions are included to A dvanced Analysis library. It contains variance, RM S, m om ents and median com puting, linear and exponential curve fitting.

4. C O N T R O L L IN G T H E A N A LO G TO D IG ITA L A ND D IG ITA L TO A N A LO G B O A R D S O F IB M PC X T /A T B Y T H E H E L P OF LA B W IN D O W S - D A TA A C Q U ISIT IO N L IB R A R Y

D ata A cquisition Library provides to th e user pow erful set o f functions for controlling the acquisition boards available from N ational Instrum ents.

The acquisition functions can be divided into follow ing groups: th e single channel and scanned D ata A cquisition functions and the multiply channel D ata A cquisitions functions.

T he single channel and scanned data acquisition functions are further divided into high- level data acquisition functions, low level data acquisition functions and double buffer ones.

Single channel data acquisition involves selecting a single analog input channel and gain o f input signal setting. A/D conversion are perform ed on that channel once every sample interval.

M ultiple channel scanned data acquisition scans sequence o f analog input channels scanned. A sam ple interval indicate th e tines to elapse betw een A/D conversions on each channel in the sequence. A single starting channel is all th at is needed to select the sequence o f channel to scan. T he channel are then scanned on consecutive order.B oth the single and multiply channel m odes can be used w ith any o f the follow ing additional modes:

- Posttrigger m ode - Pretrigger m ode - D ouble-buffered m ode

Posttrigger m ode collects a specified num ber o f sam ples after trigger is received. Post trigger m ode acquisition can be initiated through softw are o r by pulse edge applied to E X T T R IG input o f N ational Instrum ents acquisition boards. O nce the user's buffer has been filled, the data acquisition stops.

(8)

Pretrigger m od collects data before and after a trigger is received. D ata acquisition is initiated through softw are. T he acquisition board collects the data to use defined buffer until a pulse is received at the E X T T R IG input. Then the board collects specified num ber o f samples and then stops the acquisition process. T he user buffer is treated as circular buffer e g. when the entire buffer has been w ritten to, data o r stored at the beginning again, overw riting the old data. So w hen the data acquisition stops the buffer contains data before and after the stop trigger occurred.

D ouble-buffer mode, like pretrigering m ode also fills the user's buffer continuously.

Unlike pretrigering m ode how ever, double buffered m ode transfers old data into second buffer before overw riting the old data w ith new data. D ata is transferred out o f one half o f the user’s buffer while the o th er h alf is being filled with new data. D ouble buffered m ode can be used in conjunctions w ith either pretriger and posttriger modes.

The data Acquisition Library functions for controlling the acquisition process can be divided into tw o basic types asynchronous and synchronous data acquisition functions. The first class o f functions w orks in follow ing way: they initiates the acquisition process, w hich is still on going and then returns the control to program . T he second class o f functions don't return control to application program until process is finished.

5. C R E A TIN G U SE R IN T ER FA C E W IT H U SER IN TER FA CE ED ITO R

W hen developing the application program , there is always the problem how to design and develop th e user interface for com m unication w ith th e user e.g. to develop system for entering the input param eters from the keyboard and on the other hand to present measured physical values o f scanned o r processed signal. L abW indow s solves this problem with powerful U ser Interface E ditor with U ser Interface Library functions for controlling the behaviour o f screen during the com m unication w ith user. LabW indow s U ser Interface Library enables to the user to com bine graphical panel (created com pletely in interactive w ay by U ser Interface E ditor) and pull dow n m enus for simple interactive operations o f the program . T he program can view m easurem ent's data control operation o f the system from custom designed application interface.

D . K am insky

(9)

6. D A T A A C Q U IS IT IO N B O A R D S FO R IB M PC X T/A T A V A ILA B LE FO R LAB W IN D O W S A PPLIC A T IO N

f

L abW indow s can control data acquisition boards designed for M C series board for the IB M PS/2 family o f com puters that uses M icro Channel Bus, PC A T and com patible com puters and boards for E IS A bus com puters.

7. LAB V IE W G R A PH IC A L PR O G R A M M IN G SY STEM S - N E W A PPR O A C H TO C R E A TIN G R EA L T IM E A PPLIC A TIO N S

Lab V IE W is a graphical program m ing system for data acquisition and control, data analysis and data presentation. Lab V IE W offers an innovative program m ing m ethodology in w hich th e user graphically assembles softw are m odules called virtual instrum ents (VI).

L abV IEW is an alternative to the text program m ing. Similarly as in LabW indow s also L abV IEW offers to the user tools o f developing com plete data acquisition application. To create a V I in L abV IE W m eans at first build the front panel w ith knobs, slides, switches, graphs, strip charts, and so on. T he front panel serves as an interactive interface for supplying inputs to and observing outputs from an instrum entation system. This part o f developing the application is similar to creating graphical interface by the help o f U ser Interface E ditor in L abW indow s system.

T o program th e VI, the user m ust construct the block diagram free from the many syntactical details o f conventional program m ing. This is the main difference from w orking under L abW indow s developm ent system. T he user selects the functional block from palette m enus and connects them w ith w ires to pass data from one block to the next one. These blocks range ffomsimple arithm etic functions to advanced acquisition and analyses routines, and to netw ork and file I/O operations that store o r retrieve data in A SCII, binary o r even spreadsheet formats.

T he block diagram m ethodology is based on m odem program m ing concepts o f object oriented and data flow program m ing. D ata flow program m ing dictates that any object may not execute until all o f its inputs are available and the object's outputs are not available until the object's function is com pleted. T hus the data flow o f data betw een connected objects controls

(10)

the execution order. T he execution order is not constrained to the sequential order o f lines from a text based program . Free from the constraints o f text based program s, it is possible to quickly develop application simply by connecting functional blocks together.

L abV IEW is a hierarchical system. Any virtual instrum ent (V I) can serve as subroutine for another VI. It is possible to use VI as subV I by adding its icon also created by LabVIEW system, in the block diagram o f th e final application. As in traditional, text based program m ing languages, LabV IEW contains structures that control the block diagram execution. Program control structures fo r L abV IEW include Sequence, Case statem ent, F o r L oop and W hile Loop.

These structures are graphically depicted as b order structures. T he user ju st as norm ally imbeds code into the lines o f a structure in conventional program m ing languages, now in LabV IEW places the icons w ithin th e borders o f L abV IEW graphical structures. LabV IEW features a graphical com piler th at generates optimised code. VI execute at speed com parable to those o f com piled program s. In addition it is possible to execute LabV IEW R un Tim e System, a low cost com pact form o f L abV IEW developm ent system.

-Láü--- — --- D. Kaminslcv

CO N C LU SIO N S

B oth systems are very pow erful tools for developing application program s in sphere o f m onitoring and controlling technological process. B ut it has also a very good application in technical research laboratories, technical diagnostic, because o f wide set o f functions for data analysis, digital signal processing and data presentation. Also usage in educational process is very useful, because students could turn their attention to solve the technical problems concerning measuring, controlling and analysing the acquired data and they do not w aste their tim e w ith program m ing th e standard situations as are controlling the A/D acquisition boards and solving th e graphical problem s o f presentation graphs and m easured values.

(11)

L IT ER A TU R E

[ 1 ] L abW indow s U ser M anual.

[2] Lab V IE W U ser M anual.

[3] IE E E 488 and V X Ibus C ontrol D ata A cquisition and Analysis N ational Instrum ents products catalogue 1993.

[4] D. Kaminsky, N ova technologie - Lab V IEW , C H IP 6, 1993, CS edition.

[5] D. K aminsky , M odern! softw arove systemy pro m śfeni a diagnostiku, conference proceedings, O strava 1992.

Recenzent: D r hab. inż. Jerzy Jakubiec W płynęło do Redakcji dnia 15 czerw ca 1993 r.

Streszczenie

Jeden ze sposobów budow ania w spółczesnych system ów pom iarow ych oparty jest na konstrukcji tzw. w irtualnego przyrządu pom iarow ego. Idea budow y tego rodzaju przyrządu polega na szerokim w ykorzystaniu sprzętow ych i program ow ych m ożliw ości, jakie stw arzają kom putery klaszy PC. W ykorzystując standardow e oprzyrządow anie kom putera poszerzone o odpow iedniej kląsy karty w ielo w ejściow ych przetw orników analogow o-cyfrow ych buduje się w yspecjalizow ane oprogram ow anie, kreujące na ekranie kom putera panel, służący do kom unikacji op erato ra z tak zbudow anym przyrządem . W artykule przedstaw iono dw a pakiety program ow e, służące do konstruow ania przyrządów w irtualnych: L abW kindow s - realizujący pow yższe zadania w tradycyjny sposób przy użyciu języka C oraz Lab V IEW , wykorzystujący technikę ikon charakterystyczną dla systemu operacyjnego W IN D O W S firmy Microsoft.

Opisano środow isko sprzętow e i p rogram ow e obu pakietów o raz specyfikę ich aplikacji.

Cytaty

Powiązane dokumenty

(Each transition matrix for the in- terval map is irreducible and aperiodic, thus such an eigenvalue for the matrix exists by the Perron–Frobenius Theorem. It is well known that for

In this paper, we propose a crowdsourcing based approach for data acquisition and tagging with support for Active Learning where the system acts as an oracle and repository of

[r]

W odpowiedzi na zapotrzebowanie branż odzieżowej i jej pokrewnych zasadne jest stworzenie niniejszego kodeksu oraz wdrożenie jego zapisów do rynkowych mechanizmów, aby móc

WALL-BOX ONE pozwala uporządkować przestrzeń w łazience i nada jej nowoczesnego designu. Niezależnie od tego czy w kolorze ponadczasowej eleganckiej stali nierdzewnej,

Gdy dziecko idzie to przedszkola, zaczyna się nowy etap nie tylko dla niego, ale także dla Was kochani rodziców.. Zaczynacie zastanawiać się nad tym, czy

tel, policja lub wojsko, wyrasta wszechobecny kult Wielkiej Matki, która w Ameksyce ma dwa pozornie przeciwstawne sobie oblicza: dobrotliwej Matki Bożej z

Przysługuje Pani/Panu prawo do: a) żądania dostępu do swoich danych, ich sprostowania, usunięcia (o ile nie zakłóca to obsługi świadczenia lub wykupu lub obowiązków