Labview Clad Review
Labview Clad Review
Time: 4-5 PM
Mechanical Actions of Boolean Objects
Switch when pressed
Switch when released
Switch until released
2D Array (uninitialized)
1D Array (initialized)
(row)
(column)
index
TIP: drag the edge of the index to add another dimension to an a
Arrays: the elements
9
Notify and Filter Events in Config. Window
Sequence
Local
Multiple Loop Design Pattern
Producer/Consumer
15
Multiple Loop Design Pattern
Master/Slave: a type of Producer/Consumer
• uses notifiers
to allow loops
to run at
different rates
16
Producer/Consumer with Queues
17
Graphs vs. Charts
• Chart:
• Remembers history – new point added to end of plot
• Good for inside a loop
• 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
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
Notifier vs. Queue
Tool Function When to use
Notifier - sends alert to helps control - have a parallel loops that are
timing of parallel loops running at different rates and 1+ loop
- can transfer data between is dependent on another
loops - want to transfer data from one loop
- data NOT buffered (lossy) to another
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
Semaphores
21
Timing Functions
• Control or measure the frequency at which a loop executes
• Provide the processor with time to complete other tasks,
such as processing the user interface
• Uses the operating system millisecond clock
Comparison of Timing Functions
Red represents
times when Wait Moment next loop
functions are NOT iteration can begin
restricting
Other code
(running in
parallel with
waits)
10 ms 20 ms 30 ms
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
VI Timing Execution Timing
25
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)
Efficiency Good Best Best
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
Modularity and SubVIs
27
Modularity and SubVIs
28
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
29
Errors vs. Warnings
Error Warning
Status = TRUE Status = FALSE
Code is non-zero
Debugging Tools
Pets Control
Control
Dogs Cats Boolean Array
33
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
Implicitly and Explicitly Linking
Invoke/Property Nodes
Explicitly Linked Implicitly Linked
(requires reference) (color/ label for data type/label)
Property
Node
Invoke
Node
35
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 Multiple VIs on • Implemented using a While Loop with an
global 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 Ethernet project
shared variable network • Often used to communicate with Real-
Time targets
Race Conditions: Shared Resources
37
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
38