Professional Documents
Culture Documents
How often has your customer or For comparison, let’s examine a simple your customer’s satisfaction. By
manager requested presentation quality quality checking and reporting data replacing the Write to Spreadsheet VIs
graphs and data tables from your acquisition program. The block diagram with a few simple Excel communication
LabVIEW applications? LabVIEW, shown in Figure 1 outputs a plain page VIs, your data will look more
though brilliant in other ways, has of numbers or a text file that is really professional (see Figure 3b).
limited capabilities for generating quite basic . Your customer now has the
formatted output, making it difficult to data, but not in a very useful format, Often, the data is not simply composed
create data presentations which meet a unless you first import the file into Excel of numeric data. How frequently do you
customer or manager’s expectations. and then format it. Reformatting an need a column representing time
Up until now, a typical method for imported text file in Excel can be time occurrences? The data formatting VI
generating formatted output was to save consuming, especially since Excel tends reformats the first column to reflect the
simple tab-delimited ASCII text files, to break up header information. time of day. You will also want to format
and later import those files into Excel to the rest of the data table. Additionally,
manually create formatted data tables Writing Formatted Excel Files the formatting VIs give you access to
and graphs. There is a new toolkit avail- from LabVIEW Excel’s “format>>cells” pull-down menu
able which will cut out this extra step and The block diagram shown in Figure 2 of data type formatting options. The
have your LabVIEW programs talk illustrates how to output formatted data Name Sheet.vi assigns meaningful names
directly to Excel using ActiveX. The new more efficiently by eliminating the text to each work or chart sheet.
toolkit, XL-VIEW, allows you to bridge file writing VIs and sending
the gap between LabVIEW and Excel, your data directly to Excel.
giving you the best of both worlds. The new toolkit of VIs called
XL-VIEW makes it easy to
This modular package of VIs allows automate this process.
your programs to create formatted data Adding borders, bold or italic
tables and graphs ready for use by your fonts, or even some color and
manager or customer. XL-VIEW lets data alignment will make
you easily take advantage of the data the table easier to read.
formatting power of Excel from Yes, the program has grown
within LabVIEW. (see Figure 3a), but so has Figure 2: Writing Excel files using XL-VIEW
advantage of Excel’s graphing capabilities create a hard copy of the table and graph.
from within your LabVIEW programs. If There is no need to open Excel, the
you only need to build a simple graph, Print.vi in XL-VIEW will print the graph
use XL-VIEW’s Easy Graph.vi. However, and data for you directly from within
if you want direct control over the Excel your LabVIEW program.
Graph Wizard steps, you have that flexi-
bility, too. Having full access to the Before your program directs Excel to
Graph Wizard allows you to label axes, print, you’ll want to format the output
apply gridlines and modify scaling. pages. Using XL-VIEW, your application Figure 4b: XL-VIEW graph results
include the answer as part of the data illustrated previously in Figure 6. All if you had been maintaining this data set
table. A pie chart of the averages would equation building VIs have inputs for within Excel and written the equations to
clearly indicate which voltage is highest. both the A1 and row-column formats. perform the calculations, you need only
You can create a pie chart with the graph read a single cell of data after making the
VIs just as you did with the data table. Using Excel Calculations needed changes. Consider the example of
Compare the report you were able to to Access and Maintain a 100 row by 100 column data set. You
create programmatically with the LabVIEW Data want to change the value in row 51 and
XL-VIEW toolkit (see Figure 7) and Many applications require maintenance column 10, and then recalculate the
the text file you produced without it of a large data set, however, what is really overall mean. With a text data file, you
(see Figure 1) to see the ease of using of interest are calculations made from a would read the entire data set, use the
XL-VIEW to automate the task. portion of the data set and how changes array functions to replace the value of
to one or more specific values alter the interest, calculate the overall mean, and
Constructing Excel Equations in results of these calculations. Using text rewrite the entire data file. With an Excel
LabVIEW Output Files files to perform these tasks in LabVIEW data file, you write the new value to cell
XL-VIEW’s Logic, Comparison, and is very difficult. You cannot easily read or J51 (row 51, column 10) and read the
Mathematics VIs provide the flexibility write a specific value from an ASCII file, overall mean from cell CV101 (row 101,
to construct any formula that can be cre- nor can you read, for example, the column 100). This is possible because
ated when working in Excel. Only one middle 200 observations from the when you created the data set, you wrote
VI is required to send your equations fifteenth column of data without signifi- the equation “sum(A1:CV100)” to cell
from LabVIEW to the cell or group of cant effort. If the data were saved in CV101. Even if the equation had not
cells you choose. For example, let’s Excel, then your LabVIEW program can been setup previously, you could still add
construct the equation easily access the data using XL-VIEW. the equation at any time to the data set
Simply open the existing data set, specify using the XL-VIEW VIs.
the sheet and range of cells you are inter-
ested in, and you have direct access to the About XL-VIEW
information stored in these locations. The XL-VIEW toolkit generates format-
The block diagram shown in Figure 8 The power of this capability becomes ted LabVIEW output by having your
does this quite easily. Notice how the B4 even more evident when you need to LabVIEW programs talk directly to
term is added. The cell is specified by the determine the effects of changing Excel using ActiveX. Because the
XL-VIEW VIs use the ActiveX
technology, the toolkit is only available
for Windows NT/98/95 users.
In its seventh year of publi- 2 year subscription (8 issues / 8 diskettes) $175 $215
cation, LTR has subscribers CD library of back issues Ver 2.0 (20 issues / over 150 VIs) $325 $350
in over 45 countries and is
well-known as a leading Upgrade CD toVersion 2.0 (requires version 1.0) $89 $99
independent source of
LabVIEW-specific Back issues – [Article Index available at www.ltrpub.com] $25 $30
information.
SUBTOTAL
Download sample issue at www.ltrpub.com
Purchase the LabVIEW
TX TAX @ 8.25%
Technical Resource
CD-ROM Library of Back TOTAL
Issues Version 2.0 and
browse this searchable payment information
CD-ROM for easy access to
over 150 articles and VIs
from LTR Vol I-VI. ✔ PAYMENT METHOD
Check enclosed (U.S. BANK ONLY* – Make check payable to LTR Publishing) (Texas residents please add 8.25% sales tax)
To subscribe to the
LabVIEW Technical Bill company (U.S. Only) / P.O. number required
Resource or to order the
CD-ROM Library of Back Visa / MC Card Number Exp.
Issues, fax this form to Signature
LTR Publishing at
(214) 706-0506 or visit * Wire information available for international orders
the LTR web page at
www.ltrpub.com to Fill out the form above and Fax it to: 214-706-0506 with your credit card information and signature,
download a free OR send the completed order form with U.S. check to:
sample issue. LTR Publishing, Inc., 6060 N. Central Expressway, Suite 502, Dallas,Texas 75206
You may also include your own Federal Express or Airborne #. If you are ordering
a product for delivery within Texas, please include Texas Sales Tax at 8.25%.
Copyright © 1999 LTR Publishing, Inc. All rights reserved. LabVIEW Technical Resource is an independently produced publication of LTR Publishing, Inc.
LabVIEW is a registered trademark of National Instruments Corporation.
w w w . lt r p u b . c o m