You are on page 1of 13

Bundle Function

Owning Palette: Cluster, Class, & Variant VIs and Functions


Requires: Base Development System
Assembles a cluster from individual elements.
You also can use this function to change the values of individual elements in an existing
cluster without having to specify new values for all elements. To do so, wire the cluster
you want to change to the middle cluster terminal of this function. When you wire a
cluster to this function, the function resizes automatically to display inputs for each
element in the cluster. The connector pane displays the default data types for this
polymorphic function.
Details

Add
Find on the palette
to the block
diagram
cluster is the cluster whose value you want to change. If you do not wire
this input, the function creates a cluster. If you wire cluster, the Bundle
function replaces the elements of cluster with element 0..n-1. If you
wire a cluster, the number of input terminals must match the number of
elements in the input cluster.
element 0..n-1 accepts any data type.
output cluster is the resulting cluster.

Bundle Details
Resize this function to indicate the number of elements in a new cluster. You cannot
resize this function when an existing cluster is wired to the cluster input.
When you create a new cluster, you must wire all the inputs. The elements in the output
cluster must appear in the same order as the input elements. When you wire an existing
cluster to the middle terminal of this function, the inputs are optional. LabVIEW
replaces only those cluster elements that you wire.

Submit feedback on this topic.

Visit ni.com/support for technical support.

Local Variable
Owning Palette: Structures
Requires: Base Development System
Use local variables to read or write to one of the controls or indicators on the front panel
of a VI.

Add to the block diagram

Find on the palette

When you create a local variable, a local variable icon for the object appears on the
block diagram. Writing to a local variable is similar to passing data to any other
terminal. However, you can write to a local variable even if it is a control or read from a
local variable even if it is an indicator. In effect, with a local variable, you can access a
front panel object as both an input and an output.

Submit feedback on this topic.

Visit ni.com/support for technical support.

Build Array Function


Owning Palette: Array Functions
Requires: Base Development System

Concatenates multiple arrays or appends elements to an n-dimensional array.


You also can use the Replace Array Subset function to modify an existing array.
The connector pane displays the default data types for this polymorphic function.
Details Example

Add to
Find on the palette
the block
diagram
array or element can be any n-dimensional array or scalar element.
All inputs must be either elements and 1D arrays or n-dimensional and
(n-1)-dimensional arrays. All inputs must have the same base type.
appended array is the resulting array.

Build Array Details


When you place the function on the block diagram, it has only one input available. Add
inputs to the node by right-clicking an input and selecting Add Input from the shortcut
menu or by resizing the node.
If you wire control references of different classes to this function, this function typecasts
the references to a more generic class that is the lowest common class in the inheritance
hierarchy. This function then returns appended array with that class.
The Build Array function operates in one of two modes depending on whether you
select Concatenate Inputs from the shortcut menu. If you select Concatenate Inputs,
the function appends all inputs in order, forming an output array of the same
dimensionality as the array input wired.
If you do not select Concatenate Inputs, the function builds an output array of one
dimension higher than the dimension of the inputs. For example, if you wire 1D array
input to a Build Array function, the output is a 2D array, even if the 1D array is empty.
The inputs must all be the same dimensionality. The function appends each input in
order, forming a subarray, element, row, or page, of the output array. Inputs are padded,
as necessary, to match the size of the longest input.
For example, if you wire two 1D arrays, {1, 2} and {3, 4, 5} to Build Array, and select
Concatenate Inputs from the shortcut menu, the output is the 1D array {1, 2, 3, 4, 5}.
If you wire the same two arrays to Build Array, and do not select Concatenate Inputs
from the shortcut menu, the output is a 2D array containing {{1, 2, 0}, {3, 4, 5}}, where
the first input is padded to match the length of the second input.

If the inputs are all arrays of the same dimensionality, right-click the function to remove
the checkmark next to or select the Concatenate Inputs shortcut menu item. If the
inputs do not have the same dimensionality, Concatenate Inputs is automatically
selected and cannot be deselected. If all the inputs are scalar elements, Concatenate
Inputs is automatically deselected and cannot be selected, and the output is a 1D array
containing the elements in order.
When you select Concatenate Inputs from the shortcut menu, the glyphs in the Build
Array icon change to distinguish between the two input types. Inputs with the same
dimensionality as the output show an array glyph, while inputs with a dimensionality
that is one less than the output show an element glyph.

Example
Refer to the Build Array VI in the labview\examples\Arrays directory for an example of
using the Build Array function.
Open example

Find related examples

Submit feedback on this topic.

Visit ni.com/support for technical support.

Property Node
Owning Palette: Application Control VIs and Functions
Requires: Base Development System
Gets (reads) and/or sets (writes) properties of a reference. Use the property node to get
or set properties and methods on local or remote application instances, VIs, and objects.
You also can use the Property Node to access the private data of a LabVIEW class.
The Property Node automatically adapts to the class of the object that you reference.
LabVIEW includes Property Nodes preconfigured to access XML Properties, VISA
properties, .NET properties, and ActiveX properties.
Details

Add
Find on the palette
to the block
diagram
reference is the refnum associated with the object for which you want to
set or get properties. If the Property Node class is Application or VI, you
do not have to wire a refnum to this input. For the Application class, the
default is the current application instance. For the VI class, the default is
the VI containing the Property Node.
You also can wire a LabVIEW class to the reference input to access the
private data of the LabVIEW class.
error in describes error conditions that occur before this node runs. This
input provides standard error in functionality.
property 2..n are examples of properties you want to set (write).
reference out returns reference unchanged.
error out contains error information. This output provides standard error
out functionality.
property 1..n are examples of properties you want to get (read).

Property Node Details


To select the class on which to execute the property, wire the refnum to the reference
input. For example, to select the VI, Generic, or Application class, wire the VI, VI
object, or application reference to the reference input. The node adapts to the class
automatically. You also can right-click the node and select a class from the shortcut
menu.
You can wire a LabVIEW class to the reference input of a Property Node. If the
LabVIEW class has accessor VIs that you can access through a Property Node, you can
read from or write to the accessor VIs using a Property Node.
You can quickly view the implementation of a LabVIEW class property if the block
diagram of the accessor VI is available. To view the implementation of a LabVIEW
class property, right-click the property and select Open Accessor VI from the shortcut
menu. If the property is dynamic with more than one implementation, selecting this
option displays the Choose Implementation dialog box. Use this dialog box to view all
implementations of the property, or dynamic dispatch member VI, and open one or
more implementations.
Note If you do not wire the Property Node, the class property still executes at
run-time.

If the Property Node opens and returns a reference to an object, use the Close Reference
function to close the reference.
Move the cursor over terminals in the Property Node to display more information about
the property in the Context Help window. You also can right-click a property terminal
and select Help For Property from the shortcut menu, where Property is the name of
the property.
You can read or write multiple properties using a single node. However, some properties
are not readable and some are not writable. Use the Positioning tool to resize the
Property Node to add new terminals. A small direction arrow to the right of the property
indicates a property you read. A small direction arrow to the left of the property
indicates a property you write. Right-click the property and select Change to Read or
Change to Write from the shortcut menu to change the operation of the property.
The node executes from top to bottom. The Property Node does not execute if an error
occurs before it executes, so always check for the possibility of errors. If an error occurs
in a property, LabVIEW ignores the remaining properties and returns an error. If you
right-click the Property Node and select Ignore Errors Inside Node, LabVIEW
executes the remaining properties on the Property Node. Only the first error is returned
by the Property Node. The error out cluster contains information about which property
caused the error.
Properties have a short or long name that you can change by right-clicking and selecting
Name Format from the shortcut menu. The No Names format displays only the data
type for each property.
Note You can right-click the Property Node and select Downcast to Class from
the shortcut menu to typecast a reference to a more specific class in the
inheritance hierarchy. For example, select Downcast to Class from an
Interchangeable Virtual Instruments (IVI) class driver to view the IVI specific
driver properties. This item is not supported for all class types. If Downcast to
Class is disabled, you can use the To More Specific Class and To More Generic
Class functions.
Submit feedback on this topic.

Visit ni.com/support for technical support.

Compound Arithmetic Function


Owning Palette: Numeric Functions

Requires: Base Development System


Performs arithmetic on one or more numeric, array, cluster, or Boolean inputs. To select
the operation (Add, Multiply, AND, OR, or XOR), right-click the function and select
Change Mode from the shortcut menu. When you select this function from the Numeric
palette, the default mode is Add. When you select this function from the Boolean
palette, the default mode is OR.
The connector pane displays the default data types for this polymorphic function.
Details

Add
Find on the palette
to the block
diagram
value 0..n-1 can be a number or Boolean value, an array of numbers or
Boolean values, a cluster, array of clusters, and so on. You can wire a
waveform to only one value input. If an input is a waveform, you can
have an unlimited number of scalar inputs of varying sizes. If value is an
error cluster, only the status parameter of the error cluster passes to the
input terminal.
result returns the result of the selected operation applied to the value
0..n-1. For AND, OR, or XOR, result returns the bitwise operations on
numeric inputs and logical operations on Boolean inputs.

Compound Arithmetic Details


Add inputs to the node by right-clicking an input and selecting Add Input from the
shortcut menu or by resizing the function.
You can invert the inputs or the output of this function by right-clicking the individual
terminals and selecting Invert from the shortcut menu. For Add, select Invert to negate
an input or the output. For Multiply, select Invert to use the reciprocal of an input or to
produce the reciprocal of the output. For AND, OR, or XOR, select Invert to bitwise
complement an integer input or output or to logically negate an input or output.
When you use the Compound Arithmetic function to perform an XOR operation on 3 or
more values, the Compound Arithmetic function performs an XOR operation on the first
pair of inputs, then performs an XOR operation on the result of the first pair of inputs
and the next input, and so on until all inputs have been processed.
Note You cannot use this function with fixed-point numbers. If you wire fixedpoint numbers to this function, the VI appears with a broken Run button.

Submit feedback on this topic.

Visit ni.com/support for technical support.

Case Structure
Owning Palette: Structures
Requires: Base Development System
Contains one or more subdiagrams, or cases, exactly one of which executes when the
structure executes. The value wired to the case selector determines which case to
execute.

Add to the block diagram

Find on the palette

Components of a Case Structure


Selector labelDisplays the value(s) for which the associated case executes. You
can specify a single value or a range of values. You also can use the selector label
to specify a default case.
Subdiagram(case)Contains the code that executes when the value wired to the
case selector matches the value that appears in the selector label. To modify the
number or order of subdiagrams, right-click the border of the Case structure and
select the appropriate option.
Case selectorSelects which case to execute based on the value of the input
data. The input data can be a Boolean, string, integer, enumerated type or error
cluster. The data type you wire to the case selector determines the allowed cases
you can enter in the selector label.

Wait (ms) Function


Owning Palette: Timing VIs and Functions
Requires: Base Development System

Waits the specified number of milliseconds and returns the value of the millisecond
timer. Wiring a value of 0 to the milliseconds to wait input forces the current thread to
yield control of the CPU.
This function makes asynchronous system calls, but the nodes themselves function
synchronously. Therefore, it does not complete execution until the specified time has
elapsed.
Details

Add
Find on the palette
to the block
diagram
milliseconds to wait specifies how many milliseconds to wait. This
function does not wait for longer than 0x7ffffff or 2,147,483,647 ms. To
wait for a longer period, execute the function twice. Wiring a value of 0
to this parameter forces the current thread to yield control of the CPU.
millisecond timer value returns the value of the millisecond timer after
the wait.

Wait (ms) Details


When LabVIEW calls a VI for example, if millisecond timer value is 112 ms and
milliseconds to wait is 10 ms, the VI finishes when millisecond timer value equals
122 ms.
Use the Wait For Front Panel Activity function to eliminate the need for continually
polling the front panel to determine if the value of a front panel object changes.
Timer resolution is system dependent and might be less accurate than one millisecond,
depending on your platform. Use the Wait Until Next ms Multiple function to improve
resolution.
Note The Wait (ms) function behaves differently on Windows and the LabVIEW
Real-Time Module. (Windows) The Wait (ms) function waits up to the value
specified in the milliseconds to wait input. (Real-Time Module) The Wait (ms)
function waits at least the value specified in the milliseconds to wait input. The
Wait (ms) function has a margin of error of plus or minus one millisecond.
Submit feedback on this topic.

Visit ni.com/support for technical support

In Range and Coerce Function


Owning Palette: Comparison Functions
Requires: Base Development System
Determines whether x falls within a range specified by the upper limit and lower limit
inputs and optionally coerces the value to fall within the range. The function performs
the coercion only in Compare Elements mode. This function accepts time stamp values
if all inputs are time stamp values. You can change the comparison mode of this
function.
The connector pane displays the default data types for this polymorphic function.
Details Example

Add
Find on the palette
to the block
diagram
upper limit, x, and lower limit should usually be of the same data type
structure, either arrays or clusters, but they can have different numeric
representations. For example, if you change one of the data types to an
array, you must change the remaining data types to arrays to avoid broken
wires. However, you can wire an array to x and two scalars to upper
limit and lower limit. You also can wire double-precision, floating-point
and integer data.
coerced(x) returns the coerced or unchanged value of x. If x is within the
range set by the upper limit and lower limit inputs or if the function is in
Compare Aggregates mode, the value is unchanged. If x is not in range
and the function is in Compare Elements mode, the function converts the
value to the same value as upper limit or lower limit. If upper limit, x,
or lower limit is NaN, coerced(x) is NaN.
In Range? is a Boolean value in Compare Aggregates mode. In Compare
Elements mode, the data type structure of In Range? matches the data
type structure of x, with each scalar replaced by a Boolean value. If
upper limit, x, or lower limit is NaN, In Range? is FALSE.

In Range and Coerce Details

This function compares the input data values according to the Boolean comparison
rules. If the function is in Compare Aggregates mode, it returns the unchanged value of
x in coerced(x) rather than a coerced value. The function considers each input array as a
single aggregate object, similar to a cluster, where the first element is primary in the
comparison. If x is greater than upper limit and the function is in Compare Elements
mode (default), the function coerces x to the upper limit value. If x is less than lower
limit and the function is in Compare Elements mode, the function coerces x to the lower
limit value.
If you wire a combination of signed and unsigned integers to the upper limit, x, and
lower limit inputs of the In Range and Coerce function, all of the inputs will be coerced
to the same unsigned integer type. This can lead to unexpected results for negative input
values. For example, wiring an unsigned integer to upper limit and a negative signed
integer to lower limit may cause LabVIEW to interpret the lower limit input as larger
than the upper limit input. To avoid this issue, convert integer inputs to the same type
before you wire them to the In Range and Coerce function.
By default, In Range And Coerce includes the lower limit value in the range, as
indicated by the solid black diamond at the lower limit input. By default, the upper
limit value is not included in the range, as indicated by the empty diamond at the upper
limit input.
To change whether the function includes the value wired to upper limit or lower limit,
right-click the function and select Include upper limit or Include lower limit from the
shortcut menu to include or remove the value in the range. These options only affect the
result of In Range?. The function always coerces x to the exact values of upper limit
or lower limit, regardless of whether you select Include upper limit or Include lower
limit from the shortcut menu.
If the lower limit value is greater than the upper limit value, In Range? is always
FALSE and LabVIEW switches the lower limit value and the upper limit value
internally before computing coerced(x).

Example
Refer to the In Range and Coerce VI in the labview\examples\Comparison directory for
an example of using the In Range and Coerce function.
Open example

Find related examples

Submit feedback on this topic.

Visit ni.com/support for technical support.

Display Message to User Express VI

Owning Palette: Output Express VIs


Requires: Base Development System
Displays a standard dialog box that contains an alert or a message for users.
Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs
Add to the block diagram

Find on the palette

Dialog Box Options


Paramete
r

Description

Message
to
Contains the text to display in the dialog box.
Display
Contains the following options:

Buttons
to
Display

First button nameSpecifies the text that appears on


the first button. By default, the text on the first button is
OK.

Second button nameSpecifies the text that appears


on the second button. By default, the text on the second
button is Cancel. This option is available only when you
place a checkmark in the Display second button
checkbox.

Display second buttonSpecifies whether a second


button is displayed in the dialog box.

Block Diagram Inputs


Parameter

Description

Message

Contains the text to display in the dialog box.

Enable

Enables or disables the Express VI. The default is ON or TRUE.

error in

Describes error conditions that occur before this node runs.

Block Diagram Outputs


Parame
ter

Description

OK

Returns TRUE when you click the first button in the dialog box and
FALSE when you click the second button.

error
out

Contains error information. This output provides standard error out


functionality.

This Express VI operates similarly to the following VIs and functions:


One Button Dialog
Two Button Dialog
Three Button Dialog

Submit feedback on this topic.

Visit ni.com/support for technical support.

You might also like