Databases


For applications that require storing and processing lots of data, or where you need to be able to quickly sort and retrieve the data, you may need to design systems from the ground up with experts who understand the different tiers of an enterprise-level network. This often includes working with SQL databases such as Oracle or Sybase, tying together the LabVIEW labs to a common network, and implementing remote client access. Figure 16.57 illustrates this architecture.

Figure 16.57. Databases are an important part of large, distributed corporate applications.


For example, suppose you had several test labs using LabVIEW to do functional testing on widget products. Adding Internet capability would allow you to monitor the current test status of any of the labs using a web browser. By tying a database into the network, you could not only obtain historical test information from the same web browser, but you could examine all kinds of interesting relationships. For example, you could compare average pass/fail times between different labs, or run a query comparing historical results with current real-time tests.

So, of particular importance in the enterprise system is the back-end database. In many cases, you will want to store your data acquisition test results in a database, rather than on your local drive. Databases allow far more efficient storage and retrieval of large amounts of data, particularly for situations of concurrent publishers and subscribers. In addition, databases allow programmers to create all types of queries that can examine relationships between elements in the database.

Although there are a variety of database vendors and brands, from the simple Microsoft Access to high-end Oracle systems, most of them can work with a common language known as SQL. SQL stands for Structured Query Language and is principally used to write queries that are sent to the database in order to retrieve the desired data. It's possible to use SQL statements with a variety of different databases, partly thanks to ODBC (Open DataBase Connectivity), a "glue" layer that abstracts SQL statements from an application and lets them work with a variety of database drivers.

Another way databases are used is to allow web access to the data remotely. By writing web server scripts (using CGI or ASP, for example), a remote user with a web browser can perform queries and pull up data or charts that are displayed right on the browser. If your LabVIEW-based application handles a large amount of data and you'd like to have web access to not only the real-time processes, but also historical data, consider tying a database to the LabVIEW system (as a publisher of data) and a web server script (as the subscriber of data). Your web scripts could even be written in LabVIEW as CGI VIs!

National Instruments sells a Database Connectivity Toolset for LabVIEW that has support for any ADO (ActiveX Data Objects) compliant database. (ADO supports both OLE-DB and ODBC, on the Windows platform.) This allows LabVIEW to read from and write to almost any SQL database. You can also use the free, open source LabSQL, which also supports ADO, for connecting to almost any database. A copy of LabSQL is on the enclosed CD, or you can download it from the LabVIEW Open Source Tools (LOST) site, http://jeffreytravis.com/lost.




LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net