Instructors Review - Preparation For The Clad Exam - v1 (3066) PDF
Instructors Review - Preparation For The Clad Exam - v1 (3066) PDF
Instructors Review - Preparation For The Clad Exam - v1 (3066) PDF
ni.com/training
LabVIEW Training & Certification Path
LabVIEW LabVIEW Advanced Architectures
Core 1 & 2 Core 3 & Connectivity for LabVIEW
ni.com/training
LabVIEW Certification Exams and Process
Certified LabVIEW Certified LabVIEW Certified LabVIEW
Associate Developer Developer Architect
• Objective style exam
• Practical development • Short answer and
(multiple choice)
exam practical development
• 1 hour long
• 4 hours long exam
• Scheduled (online) via
• Scheduled by Training & • Same as CLD
Pearson Vue’s web page
• Administered and Certification or NI branch
proctored by Pearson • Administered by Training
Vue & Certification, proctored
• Evaluated automatically by NI representative
• Results available to • Evaluated and concurred
candidate upon exam by two engineers
completion • 4 week process
• Certificate is mailed or • Certificate is mailed by
emailed by Training & Training & Certification
Certification
ni.com/training
CLAD Prep Topics
Most Commonly Missed Additional Concepts
• Coercion Dots • Enumeration
• Loop Components
• Conditional Disable Structure
• Shift Registers and Feedback Nodes
• VI Timing
• Notify and Filter Events
• Property Nodes • Multiple Loop Design Pattern
• Charts and Graphs • Notifiers
• Arrays
• Semaphores
• Array Functions
• Mechanical Action of Booleans
• File Formats
• Data Representation • Modularity and SubVIs
• Sequence Structures • Icon and Connector Pane
• Case Structures
• Errors and Warnings
• Data Flow
• Variables
• Breaking Data Flow
• String Functions • Race Conditions from Shared
• Clusters Resources
• Type Definitions • VI Server Organization
• References • Create references programmatically
ni.com/training
Most Commonly Missed Topics
on the CLAD
ni.com/training
Red Coercion
Coercion Dots dots on input
terminals
D. Data values are being coerced because they are out of range
ni.com/training
Coercion Dots
D. Data values are being coerced because they are out of range
ni.com/training
Coercion Dots
d. Both A. and B.
e. Both B. and C.
ni.com/training
Coercion Dots
d. Both A. and B. Coercion dots indicate that a certain data type is being
wired to terminal that accepts a different but
e. Both B. and C. compatible data type. When this happens, LabVIEW
converts the data to the larger of the two data types.
This requires the creation of a memory buffer to store
the coerced data.
ni.com/training
Coercion Dots
What will “Result” be after running the VI?
A. 2
B. 2.7
C. 3
D. NaN
ni.com/training
Coercion Dots
What will ‘Result’ be after running the VI?
A. 2
B. 2.7
C. 3
D. NaN
ni.com/training
Loops
ni.com/training
Loops
What will be shown on the “For Loop Sum”, “While
Loop Sum”, and “Iteration” indicators when the
program below is run?
A. For Loop Sum= 1, Iteration=0, While Loop Sum= 1
ni.com/training
Loops
ni.com/training
Loops
ni.com/training
Loops
What will be shown on the “For Loop Sum”, “While
Loop Sum”, and “Iteration” indicators when the
program below is run?
A. For Loop Sum= 1, Iteration=0, While Loop Sum= 1
ni.com/training
Shift Registers – Multiple Previous Values
• Shift registers can be resized to save multiple previous
values.
• Retains a certain number of previous values, oldest ones get
removed as needed
Iteration: 0 1 2 3 4
Numeric: 2 5 3 9 1
A: 2 5 3 9 1
B: ? 2 5 3 9
C: ? ? 2 5 3
D: ? ? ? 2 5
ni.com/training
Shift Registers
After 3 iterations, what will be the value at indicator D?
a. 0 Iteration: 0 1 2
b. 10 Numeric: 2 5 3
c. 3
d. Unknown
ni.com/training
Shift Registers
After 3 iterations, what will be the value at indicator D?
a. 0 Iteration: 0 1 2
b. 10 Numeric: 2 5 3
c. 3
d. Unknown
ni.com/training
Shift Registers
After 4 iterations, what will be the value at indicator D?
a. 0 Iteration: 0 1 2 3
b. 7 Numeric: 2 5 3 7
c. 3
d. Unknown
ni.com/training
Shift Registers
After 4 iterations, what will be the value at indicator D?
a. 0 Iteration: 0 1 2 3
b. 2 Numeric: 2 5 3 7
c. 7
d. Unknown
ni.com/training
Feedback Node
• A feedback node functions like a shift register.
• Can set an initial value by wiring data into the terminal on the left
side of the loop.
ni.com/training
Feedback Node
What number will be added to the random number
on the first iteration of this loop?
a. 0
b. Unknown
c. 5
d. 2
ni.com/training
Feedback Node
What number will be added to the random number
on the first iteration of this loop?
a. 0
b. Unknown
c. 5
d. 2
ni.com/training
Timing Functions
ni.com/training
Wait (ms)
Waits for specified input number of
milliseconds
o Performs function asynchronously
o Returns only after the specified wait time
ni.com/training
Wait (ms)
Wait
CODE Loop Iterates
0 5 10
ni.com/training
Wait Until Next ms Multiple
Waits for a multiple tick of the
millisecond timer
• Performs function asynchronously
ni.com/training
Wait Until Next ms Multiple
The Wait Until Next ms Multiple function
will allow loop iteration on a millisecond
multiple of the millisecond timer. The
first loop iteration may be shorter than
the specified ms input.
Wait
CODE Loop Iterates
47 52 60
ni.com/training
Wait Until Next ms Multiple
In this case, when the loop starts, the
millisecond timer has a value of 0. When
the millisecond timer reaches a value of
20, the loop is not allowed to iterate
because the CODE has not completed.
Instead, the loop iterates at the next ms
multiple, which is 40.
Wait
CODE Loop Iterates
0 20 40
ni.com/training
Tick Count (ms)
Tick Count (ms) returns the value of the
Windows millisecond timer.
ni.com/training
Get Date/Time In Seconds
Get Date/Time In Seconds returns a timestamp
of the current time.
ni.com/training
VI Timing Types
• Execution Timing
• Provides the design pattern with a function that specifically allows the
processor time to complete other tasks
• In some cases, a Wait function is not necessary
• Use of Timeout inputs can provide execution timing
• Example: If you must acquire data for 5 minutes, you could remain in
the acquisition state until the 5 minutes elapses. However, during that
time you cannot process any user interface actions such as stopping the
VI. To process user interface actions, you must implement timing
(checking if 5 min has passed since the start of acquisition) so that the VI
continually executes for the specified time.
ni.com/training
VI Timing
Execution Timing
ni.com/training
Timing Functions
Which timing function is the best choice for timing control logic in
applications that run for extended periods of time?
A.
B.
C.
D.
ni.com/training
Timing Functions
Which timing function is the best choice for timing control logic in
applications that run for extended periods of time?
A. Tick Count rolls over, so it is best for very short periods of time
ni.com/training
Timing Functions
The Wait function can be added to While Loops:
ni.com/training
Timing Functions
The Wait function can be added to While Loops:
ni.com/training
Property Nodes
ni.com/training
Property Nodes
•A property node can be implicit or explicit.
•A property node executes top-down
ni.com/training
Invoke Nodes
• Use the Invoke Node to perform actions, or methods, on
referenced items (VI, Control)
• Most methods have parameters
• Examples of VI Methods:
• Front Panel: Center
• Default Values: Reinitialize all to Default
• Print: VI to HTML
Method Name
Parameters
ni.com/training
Property and Invoke Nodes: Use Cases
• Property Nodes can be used to programmatically read
from an indicator or write to a control
ni.com/training
Implicitly and Explicitly Linking Invoke/Property Nodes
Explicitly Linked Implicitly Linked
(requires control reference) (color/ label for data type/label)
Property
Node
Invoke
Node
ni.com/training
Property Nodes
Which combination of words correctly completes the
following statement? Unlike _____ Property Nodes,
_____ Property Nodes require _____ as inputs in order
to function correctly.
a. Explicit; Implicit; Data Value References
b. Implicit; Explicit; Data Value References
c. Explicit; Implicit; Control References
d. Implicit; Explicit; Control References
ni.com/training
Property Nodes
Which combination of words correctly completes the
following statement? Unlike _____ Property Nodes,
_____ Property Nodes require _____ as inputs in order
to function correctly.
a. Explicit; Implicit; Data Value References
b. Implicit; Explicit; Data Value References
c. Explicit; Implicit; Control References
d. Implicit; Explicit; Control References
Implicit Property Nodes are explicitly linked to their owning
control or indicator. No reference wires are needed. Explicit Property
Nodes require a reference wire to determine which control the Property
Node is manipulating. Data Value References have nothing to do with
Property
ni.com/training
Property Nodes
Which plot will change color first?
ni.com/training
Property Nodes
Which plot will change color first?
ni.com/training
Property Nodes
Which of the following apply to Property Nodes? (More
than one answer may apply.)
ni.com/training
Property Nodes
Which of the following apply to Property Nodes? (More
than one answer may apply.)
ni.com/training
Property Nodes
What type of property node can you use to update
a property from inside a subVI?
a. Implicit Property Node
b. Local Property Node
c. Explicit Property Node
d. Value Property Node
ni.com/training
Property Nodes
What type of property node can you use to update
a property from inside a subVI?
a. Implicit Property Node
b. Local Property Node
c. Explicit Property Node
d. Value Property Node
ni.com/training
Charts and Graphs
Graphs Both
•Do not accept single point •Accept various data types:
values •Waveform
•All points are plotted at once •Dynamic
•Arrays
Charts
•Accept single point values •Waveform Data types contain:
•Values are stored in a buffer, •An array of points
then overwritten with new •t0
values •dt
•Points are plotted as data
becomes available
ni.com/training
Charts and Graphs
• A graph displays an entire waveform at once.
• A chart displays single points as they are received.
• An XY Graph displays individual (X,Y) pairs.
• The graphs and chart below all display the same sine
wave data.
ni.com/training
Charts and Graphs
• Chart:
• Remembers history – new point added to end of plot
• Graph:
• New plot of all new data
• Good for outside the loop
• Use the Context Help window
to determine how to wire multi-
plot data to Waveform Graphs
and XY Graphs
ni.com/training
Charts vs. Graphs – Single-Plot
Graph is outside the loop and
only updates once: after the
loop finishes
ni.com/training
Charts vs. Graphs – Multi-plot and XY Graph
ni.com/training
Chart Update Modes
• Right-click the chart and select Advanced»Update
Mode from the shortcut menu
• Strip chart is the default update mode
• Scope chart and Sweep chart modes display plots
significantly faster than the strip chart mode
ni.com/training
Charts and Graphs
You need to add a graphical indicator to the location
shown below. Which of the following is the best
graphical indicator to use in this program?
A. Waveform Graph
B. Waveform Chart
C. Intensity Chart
D. XY Graph
ni.com/training
Charts and Graphs
You need to add a graphical indicator to the location
shown below. Which of the following is the best
graphical indicator to use in this program?
A. Waveform Graph
B. Waveform Chart
C. Intensity Chart
D. XY Graph
Multiple Samples =
Graph, not chart
ni.com/training
Charts and Graphs
You need to add a graphical indicator to the location
shown below. Which of the following is the best
graphical indicator to use in this program?
A. Waveform Graph
B. Waveform Chart
C. Intensity Chart
D. XY Graph
Data collected at
constant rate
(dt) = Waveform
Dynamic data
ni.com/training
Charts and Graphs
You need to add a graphical indicator to the location
shown below. Which of the following is the best
graphical indicator to use in this program?
A. Waveform Graph
B. Waveform Chart
C. Intensity Chart
D. XY Graph
Waveform Graph is the only choice that displays multiple points at once, and
can display waveforms.
ni.com/training
Charts and Graphs
Which of the following allows you to plot any set of points,
evenly distributed or not?
a. Waveform Graph
b. Waveform Chart
c. XY Graph
d. Both A. and C.
ni.com/training
Charts and Graphs
Which of the following allows you to plot any set of points,
evenly distributed or not?
b. Waveform Chart Waveform Chart displays one or more plots of data typically
acquired at a constant rate.
c. XY Graph
d. Both A. and C.
ni.com/training
Charts and Graphs
Which of the following allows you to plot any set of points,
evenly distributed or not?
b. Waveform Chart Waveform Chart displays one or more plots of data typically
acquired at a constant rate.
c. XY Graph
d. Both A. and C.
The XY graph is a general-purpose, Cartesian graphing object that plots
multivalued functions, such as circular shapes or waveforms with a
varying time base. The XY graph displays any set of points, evenly
sampled or not.
ni.com/training
Charts and Graphs
Which of the following will allow you to have multiple plots
on a Waveform Graph?
a. Bundle two 1D arrays of X and Y data together for each
plot. Then build an array of these clusters and wire it to
the Waveform Graph indicator.
b. Build an n-dimensional array of data with each plot in a
separate row (or column) in the array, then wire the
array to the Waveform Graph indicator.
c. Bundle the elements of each waveform into a cluster
and build an array of these clusters, then wire the array
to the Waveform Graph indicator.
d. Both B. and C.
ni.com/training
Charts and Graphs
Which of the following will allow you to have multiple plots
on a Waveform Graph?
a. Bundle two 1D arrays of X and Y data together for each
plot. Then build an array of these clusters and wire it to
the Waveform Graph indicator.
b. Build an n-dimensional array of data with each plot in a
separate row (or column) in the array, then wire the
array to the Waveform Graph indicator.
c. Bundle the elements of each waveform into a cluster
and build an array of these clusters, then wire the array
to the Waveform Graph indicator.
d. Both B. and C.
ni.com/training
Arrays: the index
The index (zero-based) tells you :
• the dimension of the array (1D, 2D, 3D, etc.)
• the index of the element displayed in the upper left corner
o - the 1D array below is displaying index 1 to contain a value of 3.00; we do
not know the value of index 0 from this image because the value at index 0
is hidden from view
2D Array (uninitialized)
1D Array (initialized)
(row)
(column)
index
TIP: drag the edge of the index to add another dimension to an array
ni.com/training
Arrays : Auto-indexing
• If you wire an array to or from a For Loop or While Loop, you
can link each iteration of the loop to an element in that array
by enabling auto-indexing on tunnel
• The tunnel changes from a solid square to the image shown
below to indicate auto-indexing
• You can disable auto-indexing by right clicking on the tunnel
and choosing the Disable Indexing option.
Auto-indexing tunnel
ni.com/training
Array Functions
ni.com/training
Array Functions
Describe the array that results from running this code.
Scalar 1D 2D
ni.com/training
Array Functions
What is the result of the following Array addition?
ni.com/training
Array Functions
What is the result of the following Array addition?
ni.com/training
Array Functions
What is the output of the Build Array function in the following
block diagram when the Concatenate Inputs is selected?
ni.com/training
Array Functions
What is the output of the Build Array function in the following
block diagram when the Concatenate Inputs is selected?
A. 1- D array of {3, 3, 3, 3}
B. 1-D array of {4, 4, 4}
C. 2-D array of {3, 4}
D. 2-D array of {4, 3}
ni.com/training
Array Functions
What is the output of the Initialize Array function after the
following code has executed?
A. 1- D array of {3, 3, 3, 3}
B. 1-D array of {4, 4, 4}
C. 2-D array of {3, 4}
D. 2-D array of {4, 3}
ni.com/training
Mechanical Action of Booleans
• Behavior of Boolean 1 Place Boolean on Front Panel, Open the
controls is specified by Boolean Properties
the mechanical action.
• Use the Properties 2
dialog to investigate
the different
mechanical actions. Explanation and
diagram
3
How to Read the Diagram
•Button Position
Push the button
•“Voltage” at LED to see the
behavior
•Circuit Diagram Symbol
ni.com/training
Mechanical Actions of Boolean Objects
• Switch when pressed (light switch)
ni.com/training
Mechanical Action of Booleans
DEMONSTRATION
Mechanical Action
B. Latch
C. Boolean
ni.com/training
Mechanical Action
C. Boolean
ni.com/training
Mechanical Action
ni.com/training
Mechanical Action
ni.com/training
Mechanical Action
ni.com/training
Data Representation: Numeric Range
• Data representation affects how large or small of a number can be
stored.
• A few common data types are listed here—for more types, see the LabVIEW
Help
Terminal Type Disk Number of Approximate Range
Storage Decimal Digits
Size
ni.com/training
Data Representation: Storage Space
• Data representation is important when disk space or
memory usage is a concern:
• Larger types require more space (U32 requires 4x the
memory of U8)
• Signed types require more space than unsigned (I32
uses more space than U32)
• Boolean types require one U8 of space each. Consider
using a single U8 to represent eight Boolean values if
several Booleans must be stored.
ni.com/training
Data Representation: Storage Space
You need to store an integer which will only ever be
between 1 and 10. Which of these would be the best
choice?
A. U32
B. I8
C. DBL
D. U8
ni.com/training
Data Representation: Storage Space
You need to store an integer which will only ever be
between 1 and 10. Which of these would be the best
choice?
A. U32
B. I8
C. DBL
The U8 representation can store numbers
D. U8
ranging from 0 to 2^8 -1, or 0-255
ni.com/training
Data Representation: Storage Space
Which of these allows storing decimal numbers such as
1.3 or 2.55?
A. U32
B. I8
C. DBL
D. U8
ni.com/training
Data Representation: Storage Space
Which of these allows storing decimal numbers such as
1.3 or 2.55?
A. U32
B. I8
DBL is the only data type listed that can
C. DBL store non-integer numbers.
D. U8
ni.com/training
Waveform Data Type
ni.com/training
Waveform Data Type
ni.com/training
Waveform Data Type
ni.com/training
Waveform Data Type
ni.com/training
Waveform Data Type
ni.com/training
Flat Sequence Structure
ni.com/training
Stacked Sequence Structure
ni.com/training
Stacked Sequence Structure
ni.com/training
Stacked Sequence Structure
Stacked sequence structures do not return their outputs until the final
frame has executed. Use sequence locals to transfer data between
subsequent frames.
ni.com/training
Case Structures
C. Subdiagram (Case)
ni.com/training
Case Structures
ni.com/training
Case Structures
Assuming the pictured Case Structure, which of the
following could result in a broken run arrow?
A. Numeric input has a value of 6 and there is no case for 6.
B. The empty string inside the case is deleted and the resulting broken wire
inside the case is removed.
C. The wire between numeric input and the case selector is removed
D. A new input is wired into the case selector, but is left unused in one of the
cases
ni.com/training
Case Structures
Assuming the pictured Case Structure, which of the
following could result in a broken run arrow?
A. Numeric input has a value of 6 and there is no case for 6.
B. The empty string inside the case is deleted and the resulting broken wire
inside the case is removed.
C. The wire between numeric input and the case selector is removed
D. A new input is wired into the case selector, but is left unused in one of the
cases
ni.com/training
Event Structures
An Event structure works like a Case structure with a built-in Wait on
Notification function.
ni.com/training
Event Structure
• Event Structure — LabVIEW’s programmatic tool for
handling events.
• Specialized type of Case Structure
• Execution of code can be dependent on whether or not
an event has occurred
• Waits for an event to
occur indefinitely, unless
configured to timeout.
ni.com/training
Event Structures
When the user clicks the Button control, how many times
is the Increment function called?
a. 0
b. 1
c. 2
d. 3
ni.com/training
Event Structures
When the user clicks the Button control, how many times
is the Increment function called?
Because a Mouse Down event
occurs on both the Button and
the Pane, 2 events are
a. 0 registered. The code executes
twice.
b. 1
c. 2
d. 3
ni.com/training
Data Flow
ni.com/training
Race Conditions: Sequencing
• What is the final value? Four possible outcomes:
• Value = (Value * 5) +2
• Value = (Value + 2) * 5
• Value = Value * 5
• Value = Value +2
ni.com/training
Breaking Data Flow
Situation: Run 2 Loops simultaneously with 1 Stop Button
ni.com/training
Breaking Data Flow
Name Appearance Function Drawbacks
Wire Connects data at Must follow Data
different terminals Flow
Local Variable Allows a value to be Introduces the
accessed anywhere possibility of a race
in a single VI condition
ni.com/training
Breaking Data Flow – Functional Global Variable
ni.com/training
Breaking Data Flow - Queues
Queues ensure no
data is lost when it is
transferred between
loops running at
different rates.
ni.com/training
Data Flow
a. Shift Registers
b. Tunnels
c. SubVIs
d. Local variables
ni.com/training
Data Flow
ni.com/training
Data Flow
Which variable is commonly used to eliminate race
conditions by preventing simultaneous access to code or
data?
b. Local variable
c. Global variable
d. Shared variable
ni.com/training
Data Flow
Which variable is commonly used to eliminate race
conditions by preventing simultaneous access to code or
data?
ni.com/training
Data Flow
Which data synchronization mechanism ensures that no
data is lost when an application temporarily provides data
faster than it is able to process it?
a. Notifier
b. Queue
c. Semaphore
d. Local Variable
ni.com/training
Data Flow
Which data synchronization mechanism ensures that no
data is lost when an application temporarily provides data
faster than it is able to process it?
Notifiers pass data, but they can only pass one element
at a time. Data is overwritten and lost if the program
a. Notifier writes to the notifier twice before data is read.
b. Queue
ni.com/training
Data Flow
Which data synchronization mechanism ensures that no
data is lost when an application temporarily provides data
faster than it is able to process it?
Notifiers pass data, but they can only pass one element
at a time. Data is overwritten and lost if the program
a. Notifier writes to the notifier twice before data is read.
ni.com/training
String Functions
String Controls and Format Into String
Constants • Formats an input into a string
• Uses generic format string to
• When possible, use the
specify output
constants included in the string
palette instead of typing in a • See detailed help for tips on the
string constant. Format String syntax.
Concatenate Strings
• Combines two or more strings
ni.com/training
Format Date/Time String
ni.com/training
Flatten To / Unflatten From String
These functions flatten or unflatten LabVIEW data to or from
binary strings which contain the flattened data.
ni.com/training
String Functions
What is displayed in “String Indicator” after running this code?
ni.com/training
String Functions
What is displayed in “String Indicator” after running this code?
ni.com/training
String Functions
You want to export data from LabVIEW into another environment, but
the other environment does not recognize LabVIEW data types.
You should:
Strings are widely usable. Oftentimes you will be able to bring your data into
another programming environment as a string, parse the string, and
consume the data.
ni.com/training
Clusters
ni.com/training
Why Use Clusters?
• Keep data organized.
o Logically group related data values together.
o Improve diagram readability by eliminating wire clutter.
ni.com/training
Cluster
Clusters provide a user with which of the following
benefits?
ni.com/training
Cluster
Clusters provide a user with which of the following
benefits?
ni.com/training
Clusters vs. Arrays
• Clusters are a fixed • Arrays vary in size.
size. • Arrays contain only
• Clusters can contain one data type.
mixed data types. • Arrays can be a
• Clusters can be a control, an indicator,
control, an indicator, or or a constant.
a constant.
o All
elements have to
be controls,
indicators, or
constants.
ni.com/training
Custom Controls & Type Definitions
• Control • Type Def Strict Type Def
• No connection • Connection between •Connection between
between the one you the saved file and all saved file and all
saved and the instances instances
instance in the VI • Forces the data type of
• Update the file, but each instance to be •Forces everything about
the instances are not identical (clusters, an instance to be identical
updated enum) to the strict type
• Changes made to file definition, except:
will populate •label
throughout each •description
instance •default value
ni.com/training
Controls and Type Definitions
You customize a control, select Control from theType Def.
Status pull-down menu, and save the control as a .ctl file.
You then use an instance of the custom control on your
front panel window. If you open the.ctl file and modify
the control, does the control on the front panel window
change?
a. Yes
b. No
ni.com/training
Controls and Type Definitions
You customize a control, select Control from theType Def.
Status pull-down menu, and save the control as a .ctl file.
You then use an instance of the custom control on your
front panel window. If you open the.ctl file and modify
the control, does the control on the front panel window
change?
A custom control is used to create controls that behave
a. Yes like existing controls but look different. Instances are
not linked to a.ctl file.
b. No
A type definition control (type def) is used for changing all
instances of a linked control in a single edit.
ni.com/training
Control References
• A control reference is
a reference to a front
panel object.
• Wire control
references to
generic Property
Nodes.
• Pass control
references
to subVIs.
ni.com/training
Control References
Control references allow you to manipulate controls
located on the front panel of VIs loaded in memory.
• Strictly typed control refnums – accept only control
refnums of exactly the same data type
• Weakly typed control refnums - accept references to
any DigNum control
ni.com/training
Control References
Control Reference
Ctl Refnum
ni.com/training
Control References
Why would you want to use a weakly typed control refnum as a subVI
input when wiring your connector pane?
A. To ensure only controls of one data type can be used as the input.
B. You want to make your subVI capable of manipulating controls
with varying data types.
C. You want to be able to manipulate many controls at once.
D. It is best practice to avoid strictly typed control refnums in subVIs.
ni.com/training
Control References
Why would you want to use a weakly typed control refnum as a subVI
input when wiring your connector pane?
A. To ensure only controls of one data type can be used as the input.
B. You want to make your subVI capable of manipulating controls
with varying data types.
C. You want to be able to manipulate many controls at once.
D. It is best practice to avoid strictly typed control refnums in subVIs.
Weakly typed refnums do not retain information about the data type
of the control they reference. This allows you to specify a particular
class of control as an input while allowing that control to have
multiple representations. Data values will become variant in weakly
typed refnums to account for this flexibility.
ni.com/training
Supplemental Concepts
ni.com/training
Enumeration
• An enum represents a pair of values, a string and a
numeric, where the enum’s value is one of a defined list
of value pairs
ni.com/training
Conditional Disable Structure
• Use to define conditions that indicate which code on the
block diagram executes
• Examples:
• If running as an executable, then programmatically close
LabVIEW when VI finishes
• If running on Windows, look for file here; if running on Mac OSX
then look here.
ni.com/training
Notify and Filter Events in Config. Window
ni.com/training
Notify and Filter Events in Config. Window
ni.com/training
Multiple Loop Design Pattern
• Producer/Consumer
ni.com/training
Multiple Loop Design Pattern
• Master/Slave: a type of Producer/Consumer
• uses notifiers
to allow loops
to run at
different rates
ni.com/training
Producer/Consumer with Queues
ni.com/training
Notifier vs. Queue
Queue - helps control timing of parallel - have a parallel loops that are
loops running at different rates and 1+ loop
- transfers data between loops is dependent on another
- buffers data to be transferred - want to transfer ALL data from one
(FIFO) loop to another
ni.com/training
Semaphores
ni.com/training
File Formats
ASCII TDMS Direct Binary
Numeric Good Best Best
Precision
Share data Best (Any program Better (NI Good (only with
easily) Programs easily) detailed metadata)
Ideal Use Share data with Share data with Store numeric
other programs programs when data compactly
when file space and storing simple with ability to
numeric precision array data and random access
are not important metadata
ni.com/training
Modularity and SubVIs
ni.com/training
Modularity and SubVIs
ni.com/training
Icon and Connector Pane: Setting up the Connector
Pane
• Right-click the icon in the
upper right corner of the
front panel and select
Show Connector (before
LV 2011)
• Each rectangle on the
connector pane represents
a terminal
• Select a different pattern
by right-clicking the
connector pane and
selecting Patterns from
the shortcut menu
ni.com/training
Errors vs. Warnings
• Error • Warning
• Status = TRUE • Status = FALSE
• Code is non-zero
ni.com/training
Debugging Tools
• use highlight execution
ni.com/training
Variables: Recap
Variable Type Scope Notes
Local variable A single VI • Tied to a front panel control/indicator
Global variable Multiple VIs on • Tied to a special global VI that has a front
same panel but no block diagram
computer
Functional global Multiple VIs on • Implemented using a While Loop with an
same uninitialized shift register to store global
computer data
Single-process Multiple VIs on • Implemented using a project library in a
shared variable same project
computer • Can easily convert into a network-
published shared variable
Network- Across an • Implemented using a project library in a
published shared Ethernet project
variable network • Often used to communicate with Real-
Time targets
ni.com/training
Race Conditions: Shared Resources
ni.com/training
VI Server: Organization
Generic
Object
GObject
Pets Control
Control
Dogs Cats Boolean Array
ni.com/training
Control References – Create SubVI
To create explicitly-linked Property Nodes in a subVI:
1. Create your VI
2. Select the portion of the block
diagram that will be in the subVI
3. Select Edit»Create SubVI;
LabVIEW automatically creates
the control references needed
for the subVI
4. Customize and save the subVI
ni.com/training
Control References – Create SubVI
ni.com/training