Virtual Instrumentation: Topic To Be Dealt
Virtual Instrumentation: Topic To Be Dealt
TOPIC TO BE DEALT
ARRAYS & CLUSTERS
FILE I/O
STRINGS
An array can have one or more dimensions and up to 231 elements per
dimension
Initialize array :
It creates an n dimensional array with elements with values specified at the
input. The use of this function is to allocate memory of the array. The data
type of the array is determined by what input is connected.
ARRAY OPERATIONS
Build Array:
Build array is use to concatenate multiple array or to append extra
elements to an array.
Build Array has two modes of operation based on concatenate Input option
selected or not.The default for this function is to Append to the original
array.
If the concatenate Input option is selected , the function appends all the
inputs in order forming an output array of the same dimension
If the concatenate option is not selected , the output will have one
dimension higher than the dimension of input.
Steps for append
1. Functions Palette → All-Functions → Arrays and Clusters → Build Array
2. Wire “Array” Terminal → Top Terminal of Append/Build Array Function
3. Branch a wire from the Output of the Initialize Array Function → Bottom
Terminal of Append/Build Array Function
4. Wire Output of Append/Build Array Function → “Appended Array” Array
Indicator
Steps for Concatenate
Functions Palette → All-Functions → Arrays and Clusters → Build
Array → Right-Click on Build Array Function → Concatenate
Wire “Array” Terminal → Top Terminal of Concatenate/Build Array
Function
• Branch a wire from the Output of the Initialize Array
Function → Bottom Terminal of Concatenate/BuildArray Function
• Wire Output of Concatenate/Build Array Function →
“Concatenated Array” Array Indicator
ARRAY OPERATIONS
Array sub set
Array sub set function returns a portion of input array starting at specified
index and containing length of elements. Once the array is wired to input
the function automatically resizes to display index inputs for each
dimension in the array.
ARRAY OPERATIONS
Index array
Index array returns the element specified by the index or returns a sub
array of n dimension array at index
The function resizes automatically to display the index inputs
clusters
A cluster combines one or more data types into
one data type.
It elliminates wire clutter in block diagram and
reduces the no of connector panes terminal.
Like an array it can either be a control or
indicator
On the block diagram the cluster will appear like
rope and an icon. Similar to arrays the object has
to be depositted in a cluster.
Cluster operations
The main cluster operations are
Bundle
Unbundle
Bundle by name
Unbundle by name
Bundle: The bundle function assembles individual components into a
single new cluster and also allows one to replace elements in existing
order. As the input terminal is wired a symbol representing the data
types appears on empty terminal. The order of the cluster will be the
order of input to bundle
clusters
BUNDLE
UNBUNDLE
The unbundle function splits a cluster into
individual components
EXAMPLE
BUNDLE BY NAME
Sometimes it is required to operate on an element
rather than entire cluster. In bundle by name the
element are referenced by name rather than position
We can access only the element needed.
This function cannot create a new cluster only can
replace existing clusters.
UNBUNDLE BY NAME
Unbundle by name function returns the cluster
elements whose names are specified. The major
advantage is that one does not have to keep track of
order of elements within cluster.
ARRAY TO CLUSTER
Array to cluster converts an n element one
dimensional array into a cluster of n elements of same
data type.
File I/O concepts
File I/O operations pass data to and from files