0% found this document useful (0 votes)
101 views25 pages

Labview

This document provides an overview of LabVIEW, a graphical programming language used for instrument control, data acquisition, and data analysis. It discusses key aspects of LabVIEW including how virtual instruments (VIs) function through the front panel user interface and block diagram code. The front panel contains controls and indicators while the block diagram contains terminals, nodes, and wires to pass data. LabVIEW uses dataflow programming where nodes execute when data is received. SubVIs allow for modular and hierarchical program design, similar to subroutines in text-based languages.

Uploaded by

Gaurav Kansekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views25 pages

Labview

This document provides an overview of LabVIEW, a graphical programming language used for instrument control, data acquisition, and data analysis. It discusses key aspects of LabVIEW including how virtual instruments (VIs) function through the front panel user interface and block diagram code. The front panel contains controls and indicators while the block diagram contains terminals, nodes, and wires to pass data. LabVIEW uses dataflow programming where nodes execute when data is received. SubVIs allow for modular and hierarchical program design, similar to subroutines in text-based languages.

Uploaded by

Gaurav Kansekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

MCEN 371 – Mechanical Engineering Lab

Chapter 6:
LabVIEW

Part 1: Introduction
MCEN 371 – Mechanical Engineering Lab

Overview of LabVIEW

• LabVIEW – Laboratory Virtual Instrument


Engineering Workbench

• Graphical programming language that allows for


instrument control, data acquisition, and pre/post
processing of acquired data
MCEN 371 – Mechanical Engineering Lab

Graphical programming language


& Data flow

• LabVIEW relies on graphical symbols rather than


textual language to describe programming actions

• The principle of dataflow, in which functions


execute only after receiving the necessary data,
governs execution in a straightforward manner.
MCEN 371 – Mechanical Engineering Lab

How does LabVIEW work?

• LabVIEW programs are called:


Virtual Instruments (VIs)
because their appearence and operation imitate
actual instruments.

• However, they are analogous to main programs,


functions and subroutines from popular language
like C, Fortran, Pascal, …
MCEN 371 – Mechanical Engineering Lab

What does a VI look like?


MCEN 371 – Mechanical Engineering Lab

In LabVIEW you can create or use “virtual instruments” (VI) for


data acquisition. A VI allows your computer screen to act as an
actual laboratory instrument with characteristics tailored to your
particular needs.

You can also use built-in examples, or use standard templates


for setting up your data acquisition input channels.
MCEN 371 – Mechanical Engineering Lab

A VI has three main parts:


1. The front panel:
an interactive user interface of a VI, so named
because it can simulates the front panel of a physical
instrument.

2. The block (or wiring) diagram:


It is the VI’s source code, constructed in LabVIEW’s
graphical programming language, G. It is the actual
executable program.
Subroutine in the block diagram of VI.

3. Icon/connector
MCEN 371 – Mechanical Engineering Lab

Chapter 6:
LabVIEW

Part 2: The LabVIEW


Environment
MCEN 371 – Mechanical Engineering Lab

Front Panels
Simply put, the front panel is
the window through which
the user interacts with the
program.
• When you run a VI, you must
have the front panel open so
that you can input data to the
executing program.
• The front panel is where you
see your program’s output.
MCEN 371 – Mechanical Engineering Lab

Components of a front panel:

The front panel is primarily a


combination of controls and indicators.
MCEN 371 – Mechanical Engineering Lab

Control? or Indicator?

Controls = Inputs from the user = Source Terminals

Indicators = Outputs to the user = Destinations


MCEN 371 – Mechanical Engineering Lab

Manipulating Controls and Indicators

• Right click on an indicator to


– Change to control
– Change format or precision

• Right click on a control to


– Change to indicator
– Change mechanical action (whether to latch open
or closed, and what to use as default…)
MCEN 371 – Mechanical Engineering Lab

Block Diagrams
The block diagram window
holds the graphical source
code of a LabVIEW VI – it is
the actual executable code
• You construct the block
diagram by wiring together
objects that perform specific
functions.
• The various components of a
block diagram are terminals,
nodes and wires.
MCEN 371 – Mechanical Engineering Lab

Terminals
When you place a control
(or indicator) on the
FRONT PANEL

LabVIEW automatically
creates a corresponding
control (or indicator)
terminal on the BLOCK
DIAGRAM
MCEN 371 – Mechanical Engineering Lab

Control or Indicator
Terminal?

Control terminals have


thick borders

Indicator terminals have


thin borders
MCEN 371 – Mechanical Engineering Lab

Deleting Block Diagram Terminals

• By default, you cannot delete a block diagram terminal that


belongs to a control (or indicator).
• The terminal disappears only when you delete its
corresponding control (or indicator) on the FRONT PANEL.
MCEN 371 – Mechanical Engineering Lab

Nodes
Node is just a fancy word for a program execution element –
Nodes are analogous to statements, operators, functions and
subroutines in standard programming language:
• The add and subtract functions represent one type of node.
• A structure is an other type of node. Structures can execute
code repeatedly or conditionally, similar to loops and case
statements in traditional programming languages.
• LabVIEW has also special nodes, called formula nodes,
which are useful for evaluating mathematical formulas or
expressions.
MCEN 371 – Mechanical Engineering Lab

Wires

A LabVIEW VI is held together by wires connecting nodes


and terminals; they deliver data from one source terminal to
one or more destination terminals.
MCEN 371 – Mechanical Engineering Lab

Basic wires used in block diagrams


and corresponding types
Each wire has different style or color, depending on the data
type that flows through the wire:
Scalar 1D array 2D array Color
Floating-point orange
number
Integer number blue
Boolean green
String pink
MCEN 371 – Mechanical Engineering Lab

Broken wires
If you connect more than
one source or no source
at all to a wire,

LabVIEW
DISAGREES with what
you’re doing, and the
wire will appear broken
MCEN 371 – Mechanical Engineering Lab

Components of a block diagram


– Review ! –
• Nodes: program execution
elements
• Terminals: Ports through which
data passes between the block
diagram and the front panel and
between nodes of the block
diagram
• Wires: Data paths between
terminals
MCEN 371 – Mechanical Engineering Lab

Dataflow Programming – Going


with the flow

• Stated simply, a node executes only when data


arrives at all its input terminals;
• the nodes supplies data to all of its output terminals
when it finishes executing;
• and the data pass immediately from source to
destination terminals.
MCEN 371 – Mechanical Engineering Lab

Icons and Connectors


The icons and connectors specify the pathways for data to flow
into and out of VIs.
• The icon is the graphical
representation of the VI
in the block diagram.

&

• the connector defines the


inputs and outputs
MCEN 371 – Mechanical Engineering Lab
Sub VIs
• Critical components of a hierarchical and modular VI
that is easy to debug and maintain.
• subVI is used in the block diagram of a top-level VI.
– To determine what is the Top-Level VI you can use the VI Hierarchy
View of LabVIEW, to find the VI that is not called by any other one
• Stand alone VI that is called by other Vis.
• Analogous to subroutine in text based programming
language like C, fortran, etc. also subroutine call
statement
• There is no limit to the number of subVIs that is used
in VI.
MCEN 371 – Mechanical Engineering Lab

You might also like