Si Unit 3
Si Unit 3
Si Unit 3
• The rapid adoption of the PC in the last 20 years catalyzed a revolution in instrumentation for testing,
measurement, and automation.
• One major development resulting from the ubiquity of the PC is the concept of virtual
instrumentation, which offers several benefits to engineers and scientists who require increased
productivity, accuracy, and performance.
• Sensor Module
• Sensor Interface
• Information Systems Interface
• Processing Module
• Database Interface
• User Interface.
Sensor Module
• The sensor module detects the physical signal and transforms it into
electrical form, conditions the signal, and transforms it into a digital form
for further manipulation.
• Sensor: Senses the physical quantity
• Signal conditioning part: transforms the signal into digital form for further
manipulation
• A/D converter
Sensor Interface
There are many interfaces used for communication between sensor modules and the computer.
According to the type of connection, sensor interfaces can be classified as wired and wireless:
Wired Interfaces
• GPIB
• Small Computer Systems Interface (SCSI)
• System buses (PCI extension for Instrumentation PXI or VME Extensions for Instrumentation
(VXI)
• Serial buses (RS232 or USB interfaces).
Wireless Interfaces
• Typical interfaces include the 802.11 family of standards
• Bluetooth, or GPRS/GSM interface
Processing Module
The integration of microprocessors/ microcontrollers of general Analytic functions define clear functional
Use allowed the flexible implementation of sophisticated relations among input parameters. Some of
processing Functions. the common analyses used in virtual
instrumentation include spectral analysis,
filtering, windowing, transforms, peak
detection, or curve fitting.
Artificial intelligence technologies, such as
neural networks, fuzzy logic, and expert
systems, are applied in various applications,
including sensor fusion to high-level sensors,
system identification, prediction, system
control, complex measurement procedures,
calibration, and instrument fault detection and
isolation. Various nonlinear signal processing,
including fuzzy logic and neural networks,
are also common tools in the analysis of
biomedical signals.
Data Base Interface
• Computerized instrumentation allows measured data to be stored for offline
processing, or to keep records. Several currently available database technologies are
Xtensible Markup Language (XML) and SQL Server and Oracle.
• Some virtual interface toolkits, such as LabVIEW, provide mechanisms for customized
components, such as ActiveX objects, that allow communication with another information
system, hiding details of the communication from virtual interface code.
• This approach is often used in fields where visual representation of systems is important
• Block-based programming: This approach involves dragging and dropping visual blocks or
elements that represent code constructs. Scratch is an example of block-based programming.
• Simulink
• Graphical User Interfaces( GUIs): GUI programming involves designing user interfaces
through graphical elements like buttons, sliders, menus and windows Tools like Qt, Tkinker,
and JavaFX allow developers to create GUI applications.
Some common graphical programming
techniques are:
• Visual Scripting in game engines
• CAD (Computer-Aided Design) Software: CAD Software like AutoCAD, SolidWorks, and
Blender use graphical interfaces for designing and modeling objects in various industries
including engineering, architecture, and animation.
• Node-based programming
Difference between Graphical programming
and Text based programming
Graphical Programming Text-based Programming
Proper syntax is not required Text-based coding requires syntax
information
The execution of the program is from The execution of the program is from
left to right top to bottom
Errors are indicated as we wire the To check the errors program has be
block compiled or executed
Graphical programming is highly Text-based programming is not
interactive interactive.
Logical error finding becomes a Logical error finding is easy
complex task
Icon based programming Programs are written in text
LabVIEW – Laboratory Virtual Instrument
Engineering Workbench
• Graphical programming language that allows for instrument control, data acquisition, and
pre/post-processing of acquired data
• 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,
straightforwardly governs execution.
Components of LabVIEW
• Graphical programming: LabVIEW uses a graphical programming language called G, which is
based on dataflow programming.
• Instrument control: LabVIEW provides tools for interfacing with a wide range of instruments and
sensors.
• Data Acquisition: LabVIEW includes libraries and drivers for data acquisition hardware, allowing
users to acquire and process data from sensors, cameras, and other data sources.
• Real-time and FPGA Programming: Real-time systems are used for time-critical applications
while FPGA programming provides hardware-level customization for high-speed and parallel
processing tasks.
Components of LabVIEW
• User interface design: LabVIEW enables the creation of custom user interfaces (UIs) for visualization
of data and control of the systems.
• Math and Analysis Functions: LabVIEW includes a wide range of built-in math and signal processing
functions making it well-suited for applications that require data analysis and processing.
• Integration with other languages: LabVIEW can be integrated with other programming languages like
C, C++, and . NET.
• Third-party Add-ons: LabVIEW community and NI offer a variety of third-party add-ons, libraries,
and toolkits.
How does a LabVIEW work?
• LabVIEW programs are
called:
• Virtual Instruments (VIs)
because their appearance and
operation imitate actual
instruments.
LabVIEW Programs Are Called Virtual Instruments (VIs)
Each VI has 2 Windows
Front Panel
• User Interface (UI)
– Controls = Inputs
– Indicators = Outputs
Block Diagram
• Graphical Code
– Data travels on wires from
controls through functions to
indicators
– Blocks execute by Dataflow
Controls Palette (Place items on the Front Panel Window)
(Controls & Indicators)
Control: Customize
Numeric Palette View
Indicator:
Numeric Slide
Functions (and Structures) Palette
Structure:
While Loop
Status Toolbar
Run Button
Abort Execution
Graph
Indicator
Output
Terminal
Boolean
Control
Input
Terminals
Dataflow Programming
• Block diagram execution
– Dependent on the flow of data
– Block diagram does NOT execute
left to right*
• Node executes when data is
available to ALL input terminals
• Nodes supply data to all output
terminals when done
• There are some unique colors assigned to each data type. Commonly used data types in LabVIEW are:
• BOOLEAN
• NUMERIC
• STRING
• ARRAY
• CLUSTER
• WAVEFORM
BOOLEAN Data Type
negative.
Double-precision Floating Points (Doubles)
• Doubles are another sub-type of numeric data. Unlike integers, they can represent a
decimal number. A double has 15-digit precision, as some of the memory places the
decimal point. Numeric indicators and controls of doubles are outlined in orange.
String data type
• String data type stores text data—everything from names, status messages, detailed
descriptions, and converted data to be written to files. Strings move along pink wires from
icons with a pink outline.
• Controlling instruments by sending text commands to instruments and returning data in the
form of either ASCII or binary string which can then be converted to numeric values.
Arrays
• A while loop programming repeatedly executes a target statement as long as the given
statement is true.
While(condition)
{
Statements
}
• Here statement may be a block of statements
• The loop iterates until the condition is true.
• When the condition becomes False, the program control passes to the next statement
after the loop.
Flowchart of While loop
Using Loops in VIs
• LabVIEW consists of for and while loop
• Loops are used to control repetitive operations in virtual instruments
• They are used to perform an action frequently with variation in
details.
While loop example
Ex: This program converts temperature in degrees to
Fahrenheit.
Using Loops in LabVIEW
• The virtual instrument program is working fine but we have to run the
program again and again for different values of input temperature in
degrees Celsius, which is not convenient.
• So here we can use the loops in virtual instrumentation
Adding While loop
With a while loop and without a while loop
Example of While Loop
• This example run until either the user clicks the stop button or
number of iterations is greater than 10.
For Loop
• A For Loop executes a sub-diagram a set number of times. The Figure below shows an
empty For Loop in LabVIEW.
• A For loop executes its sub-diagram n times, where n is the value wired to the count (N)
terminal. The iteration (i) terminal provides the current loop iteration count, which ranges
from 0 to n-1.
For Loop
• After you create a For Loop, you can use shift registers to pass values from one iteration to the next.
• If you wire an array to a For Loop, you can read and process every element in that array by enabling
auto-indexing.
• You also can enable auto-indexing by configuring a For Loop to return an array of every value
generated by the loop.
• You can add a conditional terminal to configure a For Loop to stop when a Boolean condition or an
error occurs. A For Loop with a conditional terminal executes until the condition occurs or until all
iterations are complete, whichever happens first.
• To add a conditional terminal to a For Loop, right-click the For Loop border and select Conditional
Terminal from the shortcut menu. You must wire the conditional terminal and either wire the count
terminal or auto-index an input array for the loop to execute and for the VI to run.