0% found this document useful (0 votes)
13 views

Mod 3 Virtual Instrumentation

Virtual instrumentation integrates commercial technologies and flexible software to enhance measurement and control applications, allowing engineers to create tailored systems for various industries. The architecture of virtual instruments includes components such as sensor modules, processing modules, and user interfaces, enabling efficient data processing and integration with information systems. Key programming features in LabVIEW, such as arrays, clusters, and control structures, facilitate the development of custom virtual instruments and data visualization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Mod 3 Virtual Instrumentation

Virtual instrumentation integrates commercial technologies and flexible software to enhance measurement and control applications, allowing engineers to create tailored systems for various industries. The architecture of virtual instruments includes components such as sensor modules, processing modules, and user interfaces, enabling efficient data processing and integration with information systems. Key programming features in LabVIEW, such as arrays, clusters, and control structures, facilitate the development of custom virtual instruments and data visualization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Module 3.

Virtual Instrumentation

Virtual Instrumentation:
• Virtual instrumentation combines mainstream commercial technologies, such as the PC,
with flexible software and a wide variety of measurement and control hardware.
• Engineers use virtual instrumentation to bring the power of flexible software and PC
technology to test, control and design applications making accurate analog and digital
measurements.
• Engineers and scientists can create user-defined systems that meet their exact application
needs.
• Industries with automated processes, such as chemical or manufacturing plants use virtual
instrumentation with the goal of improving system productivity, reliability, safety,
optimization and stability.

Layers of virtual instrumentation software:


Virtual instrumentation software can be divided into several different layers like the application
software, test and data management software, measurement and control services software as
shown in Figure.

Application Software: Most people think immediately of the application software layer. This is
the primary development environment for building an application.

Test and Data Management Software: Above the application software layer the test executive
and data management software layer. This layer of software incorporates all of the functionality
developed by the application layer and provides system-wide data management.

Instrumentation and Control Systems Page 1


Measurement and Control Services Software: The last layer is often overlooked, yet critical to
maintaining software development productivity.

Comparison of text based and graphical programming:

Architecture for Virtual Instrumentation:

A virtual instrument is composed of the following blocks:


– Sensor module
– Sensor interface
– Information systems interface
– Processing module

Instrumentation and Control Systems Page 2


– Database interface
– User interface

Figure shows the general architecture of a virtual instrument. The sensor module detects physical
signal and transforms it into electrical form, conditions the signal, and transforms it into a digital
form for further manipulation. Through a sensor interface, the sensor module communicates with
a computer. Once the data are in a digital form on a computer, they can be processed, mixed,
compared, and otherwise manipulated, or stored in a database. Then, the data may be displayed,
or converted back to analog form for further process control. Virtual instruments are often
integrated with some other information systems. In this way, the configuration settings and the
data measured may be stored and associated with the available records.

Sensor Module
The sensor module performs signal conditioning and transforms it into a digital form for further
manipulation. Once the data are in a digital form on a computer, they can be displayed,
processed, mixed, compared, stored in a database, or converted back to analog form for further
process control. The database can also store configuration settings and signal records. The sensor
module interfaces a virtual instrument to the external, mostly analog world transforming
measured signals into computer readable form. A sensor module principally consists of three
main parts:
– The sensor
– The signal conditioning part
– The A/D converter

The sensor detects physical signals from the environment. If the parameter being measured is not
electrical, the sensor must include a transducer to convert the information to an electrical signal,
for example, when measuring blood pressure.

The signal-conditioning module performs (usually analog) signal conditioning prior to AD


conversion. This module usually does the amplification, transducer excitation, linearization,
isolation, or filtering of detected signals.

The A/D converter changes the detected and conditioned voltage into a digital value. The
converter is defined by its resolution and sampling frequency. The converted data must be
precisely time-stamped to allow later sophisticated analyses.

Sensor Interface
There are many interfaces used for communication between sensors modules and the computer.
According to the type of connection, sensor interfaces can be classified as wired and wireless.

Instrumentation and Control Systems Page 3


Processing Module
Integration of the general purpose microprocessors/microcontrollers allowed flexible
implementation of sophisticated processing functions. As the functionality of a virtual instrument
depends very little on dedicated hardware, which principally does not perform any complex
processing, functionality and appearance of the virtual instrument may be completely changed
utilizing different processing functions.

Database Interface
Computerized instrumentation allows measured data to be stored for off-line processing, or to
keep records as a part of the patient record.

Information System Interface


Virtual instruments are increasingly integrated with other medical information systems, such as
hospital information systems. They can be used to create executive dashboards, supporting
decision support, real time alerts, and predictive warnings.

Difference between Traditional and Virtual Instrument:

Instrumentation and Control Systems Page 4


Instrumentation and Control Systems Page 5
Features in front panel toolbar used in programming:
When you open a new or existing VI, the front panel of the VI appears. The front panel is the
interactive user interface for the VI. It is named a front panel because it stimulates the front panel
of a physical instrument. Build the front panel with controls and indicators as shown in Figure
One of the most powerful features that LabVIEW offers engineers and scientists is its graphical
programming environment to design custom virtual instruments by creating a graphical user
interface on the computer screen to
● Operate the instrumentation program
● Control selected hardware
● Analyze acquired data
● Display results

The front panel can include knobs, push buttons, graphs and various other controls (which are
user inputs) and indicators (which are program outputs). Controls are inputs used to simulate
instrument input devices and supply data to the block diagram of the VI, and indicators are
outputs displays used to simulate instrument output devices and display data the block diagram
acquires or generates. The front panel is customized to emulate control panels of traditional
instruments, create custom test panels, or visually represent the control and operation of
processes.

Instrumentation and Control Systems Page 6


Front panel buttons:

Instrumentation and Control Systems Page 7


Control Structures:
In any programming language the user probably requires repetition of a section of code.
LabVIEW offers two loop structures namely, the For Loop and While Loop to control repetitive
operation in a VI. A For Loop executes a specific number of times; a While Loop executes until
a specified condition is no longer true.

The For Loop


A For Loop executes the code inside its borders, called its sub diagram, for total of count times,
where the count equals the value contained in the count terminal. The count can be set by wiring
a value from outside the loop of the count terminal. If ‘0’ is wired to the count terminal, the loop
does not execute.

The iteration terminal contains the current number of completed loop iterations; 0 during the first
iteration, 1 during the second, and so on, up to N-1 (where N is the number of times the loop
executes).

The For Loop is located on the Functions>>Programming>>Structures Palette. Select the For
Loop from the palette and use the cursor to drag a selection rectangle to create a new For Loop
or around the section of the block diagram you want to repeat. You also can place a While Loop
on the block diagram, right-click the border of the While Loop, and select Replace with For
Loop from the shortcut menu to change a While Loop to a For Loop.

The While Loop


The While Loop executes the sub diagram inside its borders until the Boolean value wired to its
conditional terminal is FALSE. LabVIEW checks the conditional terminal value at the end of
iteration. If the value is TRUE, the iteration repeats. The default value of the conditional terminal
is FALSE, so if left unwired, the loop iterates only once.

Instrumentation and Control Systems Page 8


In LabVIEW, the WHILE Loop is located on the Functions>>Programming>>Structures
palette. You also can place a For Loop on the block diagram, right-click the border of the For
Loop, and select Replace with While Loop from the shortcut menu to change a For Loop to a
While Loop. The While Loop contains two terminals, namely Conditional Terminal and Iteration
Terminal. The Conditional Terminal is used to control the execution of the loop, whereas the
Iteration Terminal is used to know the number of completed iterations.
Conventional programming languages support two types of WHILE constructs. These are called
pre- and post-test modes. In the pre-test mode the condition is tested prior to the execution of
every iteration and if the result is false, then the execution of the loop is aborted. In the post-test
mode the test is carried out only at the end of the loop. Functionally, the major difference is that
under the post-test mode even if the condition is false at the first execution or first iteration, the
loop will be executed at least once, since the test is only performed at the end of the loop.
LabVIEW supports only the post-test form of the While construct.

Array:
 A group of homogeneous elements of a specific data type is known as an array.
 Arrays hold a sequence of data elements, usually of the same size and same data
type placed in contiguous memory locations.
 Individual elements are accessed by their position in the array.
 The position is given by an index, which is also called as subscript
 Some arrays are multi-dimensional; generally one and two dimensional arrays are
the most common.
 Can build arrays of numeric, Boolean, path, string and cluster data types.

Array Controls
 Create an array control or indicator on the front panel by placing an array on the front
panel and dragging a data object or element, which can be numeric, Boolean, string.
 Array shell can be selected from Controls > Modern > Arrays, Matrix and Clusters
palette
 The array elements must be controls or indicators.

Instrumentation and Control Systems Page 9


1D Array
 The index ranges from 0 to 3. The first element in the array is at index 0, the second
element is at index 1, etc..
 In an array the element selected in the index display always refer to the element shown in
the upper left corner of the element display.
 The element (9) at index 0 is not shown in the array, because index 1 is selected in the
index display.

2D Arrays
 A 2D arrays stores elements in a grid.
 It requires a column index and a row index to locate an element both of which are zero-
based.
 To create a 2D array on the front panel, right click the index display of the array and
select Add Dimension from the shortcut menu.

Array Functions:
 Array functions are used to create and manipulate arrays.
 Common array operations such as Extracting individual data elements from an array,
inserting, deleting or replacing data elements using array functions.
 Array functions including Index Array, Replace Array Subset, Insert Into Array,
Delete From Array and Array Subset

Index Array Function:


The input to the index array function is a 1D array. By providing the index value in the
output, gets the array element corresponding to the index value. When connecting a 2D
array as input, the function automatically resizes to get two index inputs one for the row
index and other for column index.

Replace an Array Subset Function:


The Replace Array Subset function is a programming function that allows you to replace an
entry or a sub-array in an existing array with a new element or sub-array. This function takes in
the existing array and the indices that the new element or sub-array will replace. The original
input array is not affected by this function. If any index is negative or larger than the
corresponding dimension in an n-dimensional array, the function has no effect.

The order of inputs for this function is as follows:


1. The first input is the existing array of dimension n.
2. The middle inputs are all I32 values that specify the target index or subset that the
function will replace.
3. The last input is the new array or subset that will replace the target index.

Instrumentation and Control Systems Page 10


Cluster:
 Clusters group data elements of mixed types.
 Example of a Cluster is the LabVIEW error cluster, which combines a Boolean control
(status), a numeric control (Code) and a string control (source).
 A cluster is similar to a record or a struct in text-based programming languages.
 If front panel contains more than 28 controls and indicators that want to pass to another
VI, some of them grouped into a cluster and assign the cluster to a terminal on the
connector panel.
Creating Cluster Controls:
 A cluster can be created by placing a cluster shell on the front panel and then placing one
of the front panel objects inside the clusters.
 Select a cluster on the Controls » All Controls » Arrays and Cluster palette, place it on
the front panel and drag a data object or element which can be numeric, Boolean, string,
control or indicator, into the cluster shell.
 Resize the cluster shell by dragging the cursor while you place the cluster shell on the
front panel.

Graph and Chart:


 Graphical display of data is an important aspect of programming in LabVIEW.
 VIs with graph usually collects the data in an array and then plots the data to the graph to
obtain a waveform.
 Charts and graphs let you display plots of data in a graphical form.
 Charts interactively plot data, appending new data to old, so that you can see the current
value in the context of previous data, as the new data become available.
 Graphs plot pre-generated arrays of values in a more traditional fashion without retaining
previously-generated data

The following are the types of graphs and charts:


 Waveform graphs and charts: Display data typically acquired at a constant rate.
 XY Graphs: Display data acquired at a non-constant rate and data for multivalued
functions.
 Intensity graphs and charts: Display 3D data on a 2D plot by using color to display the
values of the third dimension.
 Digital waveform graphs: Display data as pulses or groups of digital lines.
 Windows 3D Graphs: Display 3D data on a 3D plot in an ActiveX object on the front
Panel

Instrumentation and Control Systems Page 11


Structure:
 Structures are graphical representations of the loops and case statements of text-based
programming languages.
 There are cases when a decision must be made in a program.
 In text-based programs, this can be accomplished with statements like if-else, case and so
on.
 LabVIEW includes many different ways of making decisions.
 The simplest of these methods is the select function located in the functions palette.
 This function selects between two values dependent on a Boolean input.
 Use structures on the block diagram to repeat blocks of code and to execute code
conditionally or in a specific order.
 Like other nodes, structures have terminals that connect them to other block diagram
nodes, execute automatically when input data are available, and supply data to output
wires when execution is complete.

Case Structure:
A case structure executes one sub diagram depending on the input value passed to the structure.
Complete the following steps to create a Case structure.
1. Place a Case structure on the block diagram.
2. Wire an input value to the selector terminal to determine which case executes. You must
wire an integer, Boolean value, string, or enumerated type value to the selector terminal.
You also can wire an error cluster to the selector terminal to handle errors.
3. Place objects inside the Case structure to create sub diagrams that the Case structure can
execute. If necessary, add or duplicate sub diagrams. If the data type of the selector
terminal is Boolean, the structure has a TRUE case and a FALSE case. If the selector
terminal is an integer, string, or enumerated type value, the structure can have any
number of cases.
4. For each case, use the Labeling tool to enter a single value or lists and ranges of values in
the case selector label at the top of the Case structure. For lists, use commas to separate
values. For numeric ranges, specify a range as 10.20, meaning all numbers from 10 to 20
inclusively. If necessary (optional), specify a default case.

Sequence Structure:
 A sequence structure contains one or more sub diagrams, or frames, that execute in
sequential order. Within each frame of a sequence structure, as in the rest of the block
diagram, data dependency determines the execution order of nodes.
 Use the sequence structures to control the execution order when natural data dependency
does not exist and flow-through parameters are not available.
 There are two types of sequence structures—the Flat Sequence structure and the
Stacked Sequence structure.

Instrumentation and Control Systems Page 12


Flat Sequence Structure
 The Flat Sequence structure, displays all the frames at once and executes the frames from
left to right and when all data values wired to a frame are available, until the last frame
executes.
 The data values leave each frame as the frame finishes executing.
 When you add or delete frames in a Flat Sequence structure, the structure resizes
automatically.

Stacked Sequence Structure:


 The Stacked Sequence structure, stacks each frame so you see only one frame at a time
and executes frame 0, then frame 1, and so on until the last frame executes.
 The Stacked Sequence structure returns data only after the last frame executes. Use the
Stacked Sequence structure if you want to conserve space on the block diagram.
 To convert a Stacked Sequence structure to a Flat Sequence structure, right-click the
Stacked Sequence structure and select Replace»Replace with Flat Sequence from the
shortcut menu.
 To pass data from one frame to any subsequent frame of a Stacked Sequence structure,
use a sequence local terminal shown.

Formula Nodes:
 The Formula Node is a convenient text-based node you can use to perform mathematical
operations on the block diagram.
 In addition to text-based equation expressions, the Formula Node can accept text-based
versions of If statements, While loops, For loops, and Do loops which are familiar to C
programmers.
 Formula Nodes are useful for equations that have many variables or are otherwise
complicated and for using existing text-based code. You can copy and paste the existing
text-based code into a Formula Node rather than recreating it graphically.
 Formula Nodes use type checking to make sure that array indexes are numeric data and
that operands to the bit operations are integer data.
 Formula Nodes also check to make sure array indexes are in range.

File I/O:
 A typical file I/O operation involves the following process,
1. Create or open a file. Indicate where an existing file resides or where you want to
create a new file by specifying a path or responding to a dialog box to direct
LabVIEW to the file location. After the file opens, a refnum represents the file.
2. Read from or write to the file.
3. Close the file.

Instrumentation and Control Systems Page 13


 File I/O VIs and some File I/O functions, such as the Read from Text File and Write to
Text File functions, can perform all three steps for common file I/O operations.
 The VIs and functions designed for multiple operations might not be as efficient as the
functions configured or designed for individual operations.
 Many File I/O VIs and functions contain flow-through parameters, typically a refnum or
path, which return the same value as the corresponding input parameter.

String:
A string is a sequence of displayable or non-displayable 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.
 Passing numeric data as character strings to instruments and then converting the strings 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.

String functions behave similarly to array functions; in fact, strings are really just arrays of
ASCII data. Use the String functions to concatenate two or more strings, extract a subset of
strings from a string, convert data into strings, and format a string for use in a word processing or
spreadsheet application. Use the String functions located on the Functions»All
Functions»String palette to edit and manipulate strings on the block diagram.

Virtual Instrumentation
1. What is virtual instrumentation?
2. With a neat sketch, explain the layer of virtual instrumentation software.
3. Differentiate between traditional instrument and virtual instrument with a diagram.
4. Explain the architecture of virtual instrumentations with a neat sketch.
5. With a neat sketch, explain the features in front panel toolbar used in programming.
6. Describe Arrays in LabVIEW, explain any two array functions in detail.
7. Explain STRINGS and Case Structure in LabVIEW through an example.
8. Describe the function of Sequence Structure. Give an example for sequence local.
9. Explain the following: Loop, Charts, Array, Cluster, Graphs, Structure - Case, Sequence, String.

Instrumentation and Control Systems Page 14

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy