Вы находитесь на странице: 1из 6

Eliseo Q. Adolfo Jr.

EE 054 W (7:30-10-:30)

BSEE-4

1. What is LabVIEW? How does it differ to other programming languages?

Laboratory Virtual Instrument Engineering Workbench (LabVIEW) is a system-design platform


and development environment for a visual programming language from National Instruments. The
graphical language is named "G"; not to be confused with G-code. Originally released for the Apple
Macintosh in 1986, LabVIEW is commonly used for data acquisition, instrument control, and industrial
automation on a variety of operating systems (OSs), including Microsoft Windows, various versions of
Unix, Linux, and macOS. The latest versions of LabVIEW are LabVIEW 2017 and LabVIEW NXG 1.0,
released in May 2017.

It differs from other programming languages because it uses graphical objects in executing its
program while in other programming languages like C/C++ uses text/codes in its program.

2. What are the parts of a LabVIEW environment? Differentiate each.

Front Panel

-When you open a new or existing VI, the front panel window of the VI appears. The front panel window
is the user interface for the VI.

Controls Palette

-The Controls palette contains the controls and indicators you use to create the front panel. You access
the Controls palette from the front panel window by selecting ViewControls Palette or by right clicking
on any empty space in the front panel window. The Controls palette is broken into various categories;
you can expose some or all of these categories to suit your needs.

Controls and Indicators

-Every VI has a front panel that you can design as a user interface. You also can use front panels as a way
to pass inputs and receive outputs when you call the VI from another block diagram. You create the user
interface of a VI by placing controls and indicators on the front panel of a VI. When you interact with a
front panel as a user interface, you can modify controls to supply inputs and see the results in indicators.
Controls define inputs, and indicators display outputs.

Controls are typically knobs, push buttons, dials, sliders, and strings. They simulate instrument input
devices and supply data to the block diagram of the VI. Indicators are typically graphs, charts, LEDs, and
status strings. Indicators simulate instrument output devices and display data the block diagram
acquires or generates.
Numeric Controls and Indicators

-The numeric data type can represent numbers of various types, such as integer or real. Objects such as
meters and dials also represent numeric data.

Boolean Controls and Indicators

-The Boolean data type represents data that has only two possible states, such as TRUE and FALSE or ON
and OFF. Use Boolean controls and indicators to enter and display Boolean values. Boolean objects
simulate switches, push buttons, and LEDs.

String Controls and Indicators

-The string data type is a sequence of ASCII characters. Use string controls to receive text from the user
such as a password or user name. Use string indicators to display text to the user.

Block Diagram

-Block diagram objects include terminals, subVIs, functions, constants, structures, and wires, which
transfer data among other block diagram objects. After you create the front panel window, you add
code using graphical representations of functions to control the front panel objects. The block diagram
window contains this graphical source code.

Terminals

-Objects on the front panel window appear as terminals on the block diagram. Terminals are entry and
exit ports that exchange information between the front panel and block diagram. They are analogous to
parameters and constants in text-based programming languages. Types of terminals include control or
indicator terminals and node terminals. Control and indicator terminals belong to front panel controls
and indicators. Data points you enter into the front panel controls (a and b in the previous front panel)
enter the block diagram through the control terminals. The data points then enter the Add and Subtract
functions. When the Add and Subtract functions complete their calculations, they produce new data
values. The data values flow to the indicator terminals, where they update the front panel indicators
(a+b and ab in the previous front panel).

Controls, Indicators, and Constants

Controls, indicators, and constants behave as inputs and outputs of the block diagram algorithm.
Consider the implementation of the algorithm for the area of a triangle:

Area = .5 * Base * Height

The user does not change or access the constant 0.5, so it does not appear on the front panel unless
included as documentation of the algorithm.

Block Diagram Nodes

-Nodes are objects on the block diagram that have inputs and/or outputs and perform operations when
a VI runs. They are analogous to statements, operators, functions, and subroutines in text-based
programming languages. Nodes can be functions, subVIs, Express VIs, or structures. Structures are
process control elements, such as Case structures, For Loops, or While Loops.
Functions

Functions are the fundamental operating elements of LabVIEW. The Add and Subtract functions in
Figure 6 are function nodes. Functions do not have front panel windows or block diagram windows but
do have connector panes. Double-clicking a function only selects the function. A function has a pale
yellow background on its icon.

SubVIs

After you build a VI, you can use it in another VI. A VI called from the block diagram of another VI is
called a subVI. You can reuse a subVI in other VIs. To create a subVI, you need to build a connector pane
and create an icon.

A subVI node corresponds to a subroutine call in text-based programming languages. The node is not
the subVI itself, just as a subroutine call statement in a program is not the subroutine itself. A block
diagram that contains several identical subVI nodes calls the same subVI several times.

The subVI controls and indicators receive data from and return data to the block diagram of the calling
VI. When you double-click a subVI on the block diagram, its front panel window appears. The front panel
includes controls and indicators. The block diagram includes wires, icons, functions, possibly subVIs, and
other LabVIEW objects.

Express VIs

Express VIs are nodes that require minimal wiring because you configure them with dialog boxes. Use
Express VIs for common measurement tasks. Refer to the Express VIs topic of the LabVIEW Help for
more information. They appear on the block diagram as expandable nodes with icons surrounded by a
blue field.

Functions Palette

-The Functions palette contains the VIs, functions and constants you use to create the block diagram.
You access the Functions palette from the block diagram by selecting ViewFunctions Palette. The
Functions palette is broken into various categories; you can show and hide categories to suit your needs.

Searching for Controls, VIs and Functions

When you select ViewControls or ViewFunctions to open the Controls and Functions palettes, two
buttons appear at the top of the palette.

SearchChanges the palette to search mode so you can perform text-based searches to locate controls,
VIs, or functions on the palettes. While a palette is in search mode, click the Return button to exit search
mode and return to the palette.

CustomizeProvides options for selecting a format for the current palette, showing and hiding
categories for all palettes, and sorting items in the Text and Tree formats alphabetically. Select Options
from the shortcut menu to display the Controls/Functions Palettes page of the Options dialog box, in
which you can select a format for all palettes. This button appears only if you click the thumbtack in the
upper left corner of a palette to pin the palette.
Until you are familiar with the location of VIs and functions, search for the function or VI using the
Search button. For example, if you want to find the Random Number function, click the Search button
on the Functions palette toolbar and start typing Random Number in the text box at the top of the
palette. LabVIEW lists all matching items that either start with or contain the text you typed.

Quick Drop

Alternatively, you can find and place VIs and front panel objects by name in the Quick Drop dialog box.
To launch Quick Drop, press the <Ctrl-Space> keys.

Quick Drop is especially useful when searching for a very specific function or operation. As you type,
Quick Drop automatically completes the name with matching functions. After you highlight the
appropriate function, click the block diagram or front panel to place the object in that location.

3. How to create a file in LabVIEW?

4. What are the different menus in LabVIEW? What does it contain?

The menus at the top of a VI window contain items common to other applications, such as Open, Save,
Copy, and Paste, and other items specific to LabVIEW. Some menu items also list keyboard shortcuts.

5. What are the different data types in LabVIEW? Differentiate each.

A string is a sequence of displayable or nondisplayable ASCII characters. Strings provide a platform-


independent format for information and data. Some of the more common applications of strings include
the following:

Creating simple text messages.

Controlling instruments by sending text commands to the instrument and returning data values in the
form of either ASCII or binary strings, which you then convert to numeric values.

Storing numeric data to disk. To store numeric data in an ASCII file, you must first convert numeric data
to strings before writing the data to a disk file.

Instructing or prompting the user with dialog boxes.

On the front panel, strings appear as tables, text entry boxes, and labels. LabVIEW includes built-in VIs
and functions you can use to manipulate strings, including formatting strings, parsing strings, and other
editing. LabVIEW represents string data with the color pink.
Numeric Data Type

LabVIEW represents numeric data as floating-point numbers, fixed-point numbers, integers, unsigned
integers, and complex numbers. Double and Single precision as well as Complex numeric data is
represented with the color orange in LabVIEW. All Integer numeric data is represented with the color
blue.

Note: The difference among the numeric data types is the number of bits they use to store data and the
data values they represent.

Certain data types also provide extended configuration options. For example, you can associate physical
units of measure with floating-point data, including complex numbers, and you can configure the
encoding and range for fixed-point data.

Boolean Data Type

LabVIEW stores Boolean data as 8-bit values. You can use a Boolean in LabVIEW to represent a 0 or 1, or
a TRUE or FALSE. If the 8-bit value is zero, the Boolean value is FALSE. Any nonzero value represents
TRUE. Common applications for Boolean data include representing digital data and serving as a front
panel control that acts as a switch that has a mechanical action often used to control an execution
structure such as a Case structure. A Boolean control is typically used as the conditional statement to
exit a While Loop. In LabVIEW, the color green represents Boolean data.

Dynamic Data Type

Most Express VIs accept and/or return the dynamic data type, which appears as a dark blue terminal.

Using the Convert to Dynamic Data and Convert from Dynamic Data VIs, you can convert floating-point
numeric or Boolean data of the following data types:

1D array of waveforms

1D array of scalars

1D array of scalarsmost recent value

1D array of scalarssingle channel

2D array of scalarscolumns are channels

2D array of scalarsrows are channels

Single scalar

Single waveform

Wire the dynamic data type to an indicator that can best present the data. Indicators include a graph,
chart, or numeric, or Boolean indicator. However, because dynamic data undergoes an automatic
conversion to match the indicator to which it is wired, Express VIs can slow down the block diagram
execution speed.

The dynamic data type is for use with Express VIs. Most other VIs and functions that are shipped with
LabVIEW do not accept this data type. To use a built-in VI or function to analyze or process the data the
dynamic data type includes, you must convert the dynamic data type.

Arrays

Sometimes it is beneficial to group related data. Use arrays and clusters to group related data in
LabVIEW. Arrays combine data points of the same data type into one data structure, and clusters
combine data points of multiple data types into one data structure.

An array consists of elements and dimensions. Elements are the data points that make up the array. A
dimension is the length, height, or depth of an array. An array can have one or more dimensions and as
many as (231)1 elements per dimension, memory permitting.

You can build arrays of numeric, Boolean, path, string, waveform, and cluster data types. Consider using
arrays when you work with a collection of similar data points and when you perform repetitive
computations. Arrays are ideal for storing data you collect from waveforms or data generated in loops,
where each iteration of a loop produces one element of the array.

Clusters

Clusters group data elements of mixed types. An example of a cluster is the LabVIEW error cluster,
which combines a Boolean value, a numeric value, and a string. A cluster is similar to a record or a struct
in text-based programming languages.

Bundling several data elements into clusters eliminates wire clutter on the block diagram and reduces
the number of connector pane terminals that subVIs need. The connector pane has, at most, 28
terminals. If your front panel contains more than 28 controls and indicators that you want to pass to
another VI, group some of them into a cluster and assign the cluster to a terminal on the connector
pane.

Most clusters on the block diagram have a pink wire pattern and data type terminal. Error clusters have
a dark yellow wire pattern and data type terminal. Clusters of numeric values, sometimes referred to as
points, have a brown wire pattern and data type terminal. You can wire brown numeric clusters to
Numeric functions, such as Add or Square Root, to perform the same operation simultaneously on all
elements of the cluster.

Вам также может понравиться