Key Paper Vi Subject
Key Paper Vi Subject
KEY PAPER
PART-A
1. What is LabVIEW, and why is it used in Virtual Instrumentation?
LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a graphical programming
environment developed by National Instruments. It is widely used in Virtual Instrumentation for
developing test, measurement, and control systems using a visual dataflow programming
approach, allowing users to build custom interfaces and automate hardware control.
2. Differentiate between the front panel and block diagram in LabVIEW.
The front panel is the graphical user interface of a VI, where users interact with controls (inputs)
and indicators (outputs). The block diagram is the code workspace where graphical programming
structures and functions are wired together to define program logic.
3. List two advantages of using arrays in LabVIEW.
Arrays allow efficient storage and manipulation of multiple data elements using a single
variable.
Built-in functions like auto-indexing and array math operations make data processing
simpler and faster.
4. What is the purpose of string operations in LabVIEW?
String operations in LabVIEW are used for handling and formatting textual data, such as
converting numbers to strings, parsing sensor data, creating file headers, or communicating with
instruments using command strings.
5. What is PCMCIA, and where is it used?
PCMCIA (Personal Computer Memory Card International Association) defines standards for
peripheral interface cards, mainly used in laptops. In virtual instrumentation, PCMCIA cards are
used to connect data acquisition modules and instruments to computers.
6. Define VISA in the context of instrument communication.
VISA (Virtual Instrument Software Architecture) is a standardized I/O interface protocol provided
by NI for communicating with instruments via interfaces like GPIB, USB, Serial (RS-232/RS-
485), and Ethernet. It simplifies communication regardless of the hardware interface used.
7. List two applications of state machine architecture.
Designing control systems like traffic lights or process controllers, where the system moves
through a defined set of states.
Implementing interactive user interfaces that respond to events such as button presses or user
inputs.
8. Differentiate between a producer and a consumer in LabVIEW.
In the Producer/Consumer architecture, the producer loop collects or generates data (e.g., from
rrtsensors or user inputs), and the consumer loop processes or displays that data. This design helps
in running acquisition and processing in parallel for better performance and responsiveness.
9. What is Data Acquisition (DAQ)?
Data Acquisition (DAQ) refers to the process of sampling real-world physical signals (like
temperature, voltage, pressure) and converting them into digital signals that a computer can
analyze, display, or store.
10. List two key components of a DAQ system.
Sensors/Transducers – Convert physical parameters (e.g., temperature, pressure) into electrical
signals.
DAQ Hardware/Interface Card – Converts analog signals into digital data and communicates
with the software (LabVIEW) for further processing.
PART-B
11 (a) Explain the front panel and block diagram of LabVIEW with an example.
11 (b) Compare Virtual Instruments with Traditional Instruments based on architecture, flexibility,
Vendor-defined User-defined
Function specific, Stand alone with limited Application oriented system with connectivity
connectivity to networks, peripherals, and applications
Slow turn on technology (5-10 years life cycle) Fast turn on Technology (1-2 years life cycle)
Three of the most commonly used and essential debugging tools in LabVIEW are:
Highlighting Execution:
View an animation of the execution of the block diagram by clicking the Highlight Execution
button, shown at left. Execution highlighting shows the movement of data on the block diagram
from one node to another using bubble that move along the wires. Use execution highlighting in
Conjunction with single stepping to see how data move from node to node through a VI.
Probe Tool:
Use the Probe tool, shown at left, to check intermediate values on a wire as a VI runs. Use the
Probe tool if you have a complicated block diagram with a series of operations, any one of
which might return incorrect data.
Use the Probe tool with execution highlighting, single-stepping, and breakpoints to determine if
and where data are incorrect. If data are available, the probe immediately updates during single-
stepping or when you pause at a breakpoint.
When execution pauses at a node because of single-stepping or a breakpoint, you also can probe
the wire that just executed to see the value that flowed through that wire.
Breakpoints:
Use the Breakpoint tool, shown at left, to place a breakpoint on a VI, node, or wire on the block
diagram and pause execution at that location. When you set a breakpoint on a wire, execution
pauses after data pass through the wire. Place a breakpoint on the block diagram to pause
execution after all nodes on the block diagram execute.
When a VI pauses at a breakpoint, LabVIEW brings the block diagram to the front and uses a
marquee to highlight the node or wire that contains the breakpoint. When you move the cursor
over an existing breakpoint, the black area of the Breakpoint tool cursor appears white. When
you reach a breakpoint during execution, the VI pauses and the Pause button appears red.
12 (b) Analyze the advantages of using Sub-VIs in LabVIEW. How do they improve modularity?
Definition: A Sub-VI (Sub Virtual Instrument) in LabVIEW is a VI (Virtual Instrument) that is used
as a component inside another VI. It functions similarly to a function or subroutine in text-based
programming languages. Sub-VIs allow developers to break down a complex program into smaller,
more manageable parts, each performing a specific task.
A Sub-VI has its own block diagram and front panel.
It is connected to the main VI through connector panes, which define the inputs and outputs of
the Sub-VI.
Sub-VIs improve modularity, reusability, and maintainability by allowing common tasks to be
reused across multiple VIs.
They can be used to encapsulate logic, data processing, or any other task that needs to be
repeated in the application.
Example VI of Temp in Fahrenheit to Centigrade
13 (a) Develop an example with the working of a Case Structure.
Any program students can choose:
Local variable
Global variables are built-in LabVIEW objects. It can be use variables to access and pass data among
several VIs that run simultaneously.
A Global variable is identical in function to a local variable. The difference between them is
where the data is saved.
A global variable is used to pass information from one VI to another Global variable is located
under structure
The global variable only has a front panel with no block diagram
If a certain data type is needed, the indicator representation must be changed within the Global
Variable VI.
A local variable shares data within a VI; a global variable also shares data, but it shares data
with multiple VIs.
Local variables allow data to be passed between parallel loops. Global variables allow data to be
passed between VIs.
A local variable saves the data to the front panel of the VI that it’s in; this
makes them only be useable in that VI.
Used for transferring data within the same VI Used for sharing data across multiple VIs
Not thread-safe; can cause data corruption if Not thread-safe; can lead to data races if accessed
accessed simultaneously by multiple loops concurrently by multiple VIs
Faster for data transfer within a single VI Slower due to overhead of inter-VI
communication
Easier to debug within a single VI, but More challenging to debug due to the widespread
excessive use can lead to code clutter effects on multiple VIs
Ideal for managing data within a single VI Best suited for inter-VI communication when
sharing data
Local Variables are generally preferable for data transfer within a single VI as they have better
performance and simpler implementation. They are also safer in terms of avoiding unintended
cross-VI data manipulation.
Global Variables should be used sparingly. They are appropriate when data needs to be shared
across multiple VIs, but they can lead to global state issues and potential data conflicts,
especially in multi-threaded applications.
14 (a) Explain with a simple example. How do graphs and charts differ in LabVIEW?
In LabVIEW, graphs and charts are both used to display data, but they serve different purposes and
handle data in distinct ways. A graph is typically used for displaying static or batch data, where all the
data points are available at once. For instance, when you have a complete set of data, such as
temperature readings over a 24-hour period, you pass the entire dataset to the graph. It plots all the
points at once and presents the data in a single view. After the graph is updated, it remains static until
the next complete set of data is provided.
A chart is used for displaying dynamic data that changes over time. Charts are ideal for real-time
monitoring, where new data points are added incrementally. For example, if you are measuring the
temperature in a room every minute, you would pass each new temperature reading to the chart. The
chart adds each new data point while retaining the previous ones, making it suitable for displaying
trends over time. Unlike a graph, a chart continuously updates as new data arrives, showing a real-time
representation of how the data evolves.
The difference between graphs and charts is that graphs are used for static datasets where all the data is
available at once, while charts are used for dynamic data that is updated incrementally over time,
making them ideal for real-time data visualization.
Front panel
14 (b) Describe how loops work in LabVIEW with an example of a While Loop.
In LabVIEW, loops are used to execute a section of code repeatedly, which is essential for tasks like
monitoring sensors, updating displays, or performing calculations continuously. The two primary types of
loops in LabVIEW are the While Loop and the For Loop. Among these, the While Loop is most commonly
used when the number of iterations is not known in advance and the loop should continue running until a
specific condition is met.
A While Loop in LabVIEW functions similarly to while loops in text-based programming languages. It
repeatedly executes the code inside it as long as a given condition is false. Once the condition becomes
true the loop stops execution. The loop structure includes two main components: the loop body where the
code runs and a stop condition terminal, usually controlled by a Boolean control like a "Stop" button.
RS-232C and RS-485 are two widely used serial communication standards in industrial and
instrumentation systems, including Virtual Instrumentation with LabVIEW. Both are used to transmit data
between devices, but they differ in terms of electrical characteristics, distance, speed, and network
topology.
RS-232C is one of the oldest and most commonly used serial communication protocols. It is designed for
point-to-point communication—typically between a computer (DTE) and a peripheral device (DCE) like a
modem or instrument. It uses single-ended signaling, where data is transmitted over one wire relative to a
ground wire.
Signal lines include Tx (Transmit), Rx (Receive), and Ground, along with optional control lines
like RTS, CTS, DTR, and DSR.
It is simple to implement and widely supported in legacy systems and lab equipment.
It uses twisted pair wiring, which improves resistance to electrical noise, making it ideal for
industrial environments.
GPIB bus is the one of parallel communication bus. The HP-IB specification permits up to 15
devices (shown in below fig-3.9) to be connected together in any given setup, including the
controller if it is part of the system. Each device on the bus should have a unique address in the
range of 0-30. The maximum length of the bus network is limited to 20 meters total
transmission path length. It is recommended that the bus be loaded with at least one instrument
or device every 2-meter length of cable (4 meters is maximum). The use of GP-IB extenders
may be used to exceed the maximum permitted length of 20 meters.
Electrical Interface:
Interfacing of devices to PC through GPIB bus
The GP-IB is a bus to which many similar modules can be directly connected, as is shown in
Figure 1. A total of 16 wires are shown in the figure - eight data lines and eight control lines (3-
handshaking signals and 5 management signals). The bus cables have 24 wires, providing eight
additional for shielding and grounds.
The GP-IB defines operation of a three-wire handshake that is used for all data transfers on the
bus. The bus operation is asynchronous in nature. Each transaction carries 8 bits, the maximum
data bandwidth is on the order of 4 to 8 megabits (1 M byte) per second. The bus is a two-way
communications channel and data flows in both directions. Below figure-3.10 illustrates the
structure of the GP-IB bus and identifies the 16 connections of the interconnecting cable.
GPIB Devices can be Talkers, Listeners, and/or Controllers. A Talker sends data messages to
one or more Listeners, which receive the data. The Controller manages the flow of information
on the GPIB by sending commands to all devices. A digital voltmeter, for example, is a Talker
and is also a Listener.
GPIB
Instrumentation
Bus Structure
Three lines asynchronously control the transfer of message bytes between devices. The process is
called a 3-wire interlocked handshake. It guarantees that message bytes on the data lines are sent and
received without transmission error.
• NRFD (not ready for data) – Indicates when a device is ready or not ready to receive a message
byte. The line is driven by all devices when receiving commands, by Listeners when receiving data
messages, and by the Talker when enabling the HS488 protocol.
• NDAC (not data accepted) – Indicates when a device has or has not accepted a message byte. The
line is driven by all devices when receiving commands, and by Listeners when receiving data
messages.
DAV (data valid) – Tells when the signals on the data lines are stable (valid) and can be accepted
safely by devices. The Controller drives DAV when sending commands, and the Talker drives DAV
when sending data messages.
GPIB instrument control set up
In industrial automation, PXI systems are used for real-time monitoring, control, and
automated testing of manufacturing equipment and processes. PXI offers rugged and
compact hardware that can withstand harsh conditions like vibration, temperature changes,
and dust. PXI modules can be used to control machinery, test electronic components, monitor
sensors, and automate quality control. It supports various I/O modules such as analog
input/output, digital I/O, motion control, and vision systems, enabling flexible and precise
control of industrial processes.
High Speed and Precision: PXI delivers deterministic and low-latency performance
suitable for time-critical applications.
Scalability: Multiple PXI modules can be added to expand the system based on
testing or automation requirements.
PXI platforms are used as a basis for building electronic test equipment, automation
systems, and modular laboratory instruments. PXI is based on industry-standard
computer buses and permits flexibility in building equipment.
The benefits of PXI-based DAQ systems include rugged packaging that can
withstand the harsh conditions that often exist in industrial applications. PXI
systems also offer a modular architecture, which means that you can fit several
devices in the same space as a single stand-alone instrument, and you have the
ability to expand your system beyond the capacity of a desktop computer with a
PCI bus. One of the most important benefits of PXI offers is its integrated timing
and triggering features. Without any external connections, multiple devices can
be synchronized by using the internal buses resident on the back plane of a PXI
chassis.
When a defined event occurs (e.g., the user clicks a "Start" button), the event structure
detects it and executes the corresponding case inside the structure. Each event is handled by a
separate case, similar to a Case Structure, allowing the application to respond differently to
each type of interaction.
17 (b). Explain the purpose and working of the "send notification" and "wait on
notification" functions with an example VI.
Notifier : Use the notifier operations functions to suspend the executed of a block diagram
until you receive data from another section of the block diagram or from another VI.
1.Notifiers communicates between two different parts of a block diagram or two different
VIs in same machine.
2. Notifiers cannot be used in different machines and different server networks.
3. Notifiers can accept any data type.
4. Notifiers just enques one data element in each time.
5. Synchronization is possible between master and slave loop.
NOTIFIERS
Notifiers are a communication mechanism between two independent parts of the
block diagram or between two or more VIs running on the same machine.
Notifiers are similar to mailboxes for data, one process sends data to the mailbox
and one or several other processes receive data from the mailbox.
In this way, they are similar to local or global variables. When using a variable,
however, a process that is waiting for information must cycle continuously to
check the value of the variable.
One benefit of notifiers is that a process that receives information completely stops
execution while waiting, and starts only when new data becomes available. This
reduces excess processing power being wasted on unneeded polling.
On the other side, the consumer loop retrieves data from the queue using the Dequeue
Element function and performs tasks like processing, displaying on the user interface, or
writing to a file. This separation ensures that if one loop is slower than the other, it doesn't
affect the overall performance of the program. For instance, if data is acquired faster than it
can be logged to a file, the queue temporarily stores the data until the consumer can catch up.
A common example of this architecture is a temperature monitoring system. In this case, the
producer loop continuously reads temperature values every second and sends them to a
queue. The consumer loop receives these values and logs them to a file every five seconds.
This ensures smooth and efficient execution without missing data points or freezing the user
interface.
19(a). Describe the process of hardware installation and configuration in a DAQ system.
The NI-DAQmx Driver software is the layer of software for easily communicating with
the hardware. It forms the middle layer between the application software and the
hardware.
Driver software also prevents a programmer from having to do register-level
programming or complicated commands in order to access the hardware functions.
The DAQ Assistant, included with NI-DAQmx, is a graphical, interactive guide for
configuring, testing, and acquiring measurement data. With a single click, you can even
generate code based on your configuration, making it easier and faster to develop
complex operations.
Because DAQ Assistant is completely menu-driven, you will make fewer
programming errors and drastically decrease the time from setting up your DAQ
system to taking your first measurement.
Scales
You can configure custom scales for your measurements using MAX. This is very
useful when working with sensors. It allows you to bring a scaled value into your
application without having to work directly with the raw values. For example, you can
use a temperature sensor that represents temperature with a voltage. The conversion
equation for the temperature is, Voltage x 100 = Celsius. After a scale is set, you can
use it in your application program, providing the temperature value, rather than the
voltage.
Acquire 1 Sample
Acquire n Samples
Acquire Continuously
Navigation to DAQAsst:
Programming Measurement I/ONI-DAQmx
“Acquire Signals” (i.e., Input Signals) or “Generate Signals” (i.e., Output Signals).
The next step is to select the Signal Input Range. A common signal is 0-5V.
Click OK in the DAQ Assistant window The DAQ Assistant icon appears on the
Block Diagram:
Ex: Wire the data output to a numeric indicator like this (and hit the Run button):
Ex: To generate “continuous” acquisition, put a While loop around the DAQ Assistant
like this:
ActiveX is the general name for a set of Microsoft Technologies that allows you to
reuse code and link individual programs together to suit your computing needs.
Each program does not need to regenerate components, but rather, reuse
components to give you the power to combine applications together.
LabVIEW offers support for ActiveX automation as a server as well as support for
ActiveX Containers, and ActiveX Events.
ActiveXAutomation:
ActiveX/COM refers to the process of controlling one program from another via
ActiveX.
Like networking, one program acts as the client and the other as the server.
LabVIEW supports automation both as the client and the server. Both programs,
client and server, exist independent of each other but are able to share information.
The client communicates with the ActiveX objects that the server opens to allow
the sharing of information.
The automation client can access the object's properties and methods. Properties
are attributes of an object.
Another program can set or retrieve an object's attributes. Similarly, methods are
functions that perform an operation on objects.
ActiveXControlsandContainers:
The most common usage of ActiveX is via ActiveX controls, which are
embeddable components that exist inside ActiveX containers.
Any program that can function as an ActiveX container allows you to drop
ActiveX controls into the program as a container. From these containers, the
ActiveX controls have their own functionality and properties.
ActiveX Events
LabVIEW supports the processing of ActiveX events via both automation and
embedding of ActiveX controls.
In this case, LabVIEW acts as the automation client and requests information of
the automation server, or other program.
Likewise, other ActiveX automation clients can interface with the LabVIEW
ActiveX automation server. Common programs used are Microsoft Visual Basic
and Microsoft Visual C++.
The diagram below shows LabVIEW's programming flow, and gives the
associated functions with each block.
Figure 1.
In general, information about a program’s ActiveX automation server can be
obtained from the program’s documentation or by browsing the program’s type
library.
Other programs can interface with the LabVIEW automation server using ActiveX
automation. Using an automation client, it is possible to programmatically launch
LabVIEW, open and run VIs, and pass their data back to the calling program.
The automation client interfaces with the LabVIEW type library which is located
in the \labview\resource directory. By browsing this type library, information
about the classes that LabVIEW exports is available.
Figure 2.
You can explore the properties and methods available using the property nodes and invoke
nodes by wiring a reference to the nodes.
Commonly, programs wait until an event has fired and then after the event fires,
continue with program execution dependent on what event fired.
The flow chart for setting an ActiveX event sequence in LabVIEW is shown below
with the corresponding LabVIEW functions.
Figure 3.
ProgrammingConnectivityActive XActive X palette
Web browser application using Active-X program: Front panel & Block diagram