Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views3 pages

LabVIEW Module2 Paraphrased

The document outlines key LabVIEW programming concepts, including modular programming with subVIs for better organization, loops for repetitive execution, and the use of local and global variables for data sharing. It also discusses arrays for storing collections of data and polymorphism, allowing functions to handle various data types seamlessly. These concepts enhance the efficiency, readability, and adaptability of LabVIEW applications.

Uploaded by

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

LabVIEW Module2 Paraphrased

The document outlines key LabVIEW programming concepts, including modular programming with subVIs for better organization, loops for repetitive execution, and the use of local and global variables for data sharing. It also discusses arrays for storing collections of data and polymorphism, allowing functions to handle various data types seamlessly. These concepts enhance the efficiency, readability, and adaptability of LabVIEW applications.

Uploaded by

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

LabVIEW Programming Concepts

1. Modular Programming in LabVIEW

Modular Programming in LabVIEW emphasizes breaking a large program into smaller,


manageable components called subVIs. Each subVI represents a functional block, allowing
for simplified debugging, testing, and reuse in other projects. This enhances the readability
and organization of the program.

Creating a VI involves designing the Front Panel (user interface) and the Block Diagram
(functional logic). After creating the VI, a custom Icon can be created using the Icon Editor.
This visual identifier is used when the VI is placed as a subVI. The Connector Pane maps the
inputs and outputs of the VI, acting like parameters in a function.

Assigning Terminals involves linking inputs (controls) on the left and outputs (indicators)
on the right side of the connector pane. LabVIEW allows each terminal to be marked as
Required, Recommended, or Optional. A subVI can be created by selecting part of an
existing block diagram and choosing 'Create SubVI'. These subVIs can be opened, edited,
and reused by placing them into other VIs using the Functions palette.

2. Repetition and Loops

Loops are essential structures in LabVIEW for repetitive execution. The For Loop runs a set
number of times based on a wired count value, starting iteration from zero. The While Loop,
however, runs until a condition is met, and always executes at least once.

Structure Tunnels enable passing data into and out of loops. Inputs are read before loop
execution, and outputs are updated only after completion. Terminals inside the loop allow
dynamic control each iteration, while terminals outside cause static behavior.

Shift Registers store data across loop iterations, enabling operations like cumulative sums.
Feedback Nodes serve a similar purpose and are automatically created when data loops
back to an earlier node.

Timing control is achieved using Wait functions like 'Wait (ms)' or 'Wait Until Next ms
Multiple' to regulate loop frequency. Communication among multiple loops can be done
using variables, ensuring coordination in parallel operations.
3. Local & Global Variables

Local and Global Variables in LabVIEW provide methods to store and access data across
different parts of a VI or between multiple VIs. A Local Variable allows data sharing within
the same VI, especially between parallel loops. It can be created by right-clicking a
control/indicator terminal or selecting from the palette.

Global Variables, on the other hand, enable data sharing across multiple VIs. LabVIEW
creates a special global VI without a block diagram, and data types are defined using front
panel controls/indicators. These are helpful when multiple VIs need to access or control the
same data, like using one Boolean control to stop two VIs simultaneously.

However, using variables breaks the default dataflow model in LabVIEW. Hence, they
should be used carefully to avoid race conditions or unpredictable behavior. They are best
suited for small-scale data sharing when other methods like queues or notifiers are not
practical.

4. Arrays

Arrays in LabVIEW are used to store a collection of similar data types, such as numbers or
strings. They can be one-dimensional (1D), like a list, or two-dimensional (2D), like a table.
Arrays can also be expanded into multiple dimensions. To create arrays, an array shell is
placed on the front panel and filled with a data control or indicator.

Elements, rows, columns, or pages can be inserted, deleted, or replaced using respective
functions like Insert Into Array, Delete From Array, and Replace Array Subset. These
operations can be performed manually on the front panel or programmatically via the block
diagram.

Array Functions such as Index Array, Array Subset, or Build Array are used for array
manipulation. Matrix operations are supported by converting arrays into matrices. Matrix
functions facilitate linear algebra operations, and the data can be converted back to arrays if
needed. Arrays enhance data handling and are critical in data acquisition and analysis
applications.

5. Polymorphism

Polymorphism in LabVIEW refers to the ability of functions to accept different data types
and structures without modification. Most arithmetic functions in LabVIEW are
polymorphic. For example, the Add function can handle scalar + scalar, scalar + array, or
array + array operations. The function automatically adapts based on input types.

This flexibility makes programming simpler and reduces the need for creating multiple
versions of the same logic. However, it's important to note that polymorphism performs
element-wise operations. For example, multiplying two 2D arrays results in element-wise
multiplication, not true matrix multiplication.

The behavior also changes based on array dimensions. Developers must ensure input
compatibility to prevent unexpected results. Polymorphism increases the reusability and
versatility of LabVIEW VIs, making them robust and adaptable for various data structures
and applications.

You might also like