Lesson 7 - Developing Modular Applications
Lesson 7 - Developing Modular Applications
TOPICS
A. Understanding Modularity
B. Icon and Connector Pane
C. Using SubVIs
ni.com/training
A. Understanding Modularity
ni.com/training
2
A. Understanding Modularity – SubVIs
ni.com/training
3
A. Understanding Modularity – SubVIs
ni.com/training
4
A. Understanding Modularity – SubVIs
ni.com/training
5
A. Understanding Modularity – SubVIs
Function Code Calling Program Code
function average (in1, in2, main
out) {
{ average (point1, point2,
out = (in1 + in2)/2.0; pointavg)
} }
ni.com/training
6
B. Icon and Connector Pane
• After you build a VI, build the icon and the connector pane
so you can use the VI as a subVI
• The icon and connector pane correspond to the function
prototype in text-based programming languages
• Every VI displays an icon in the upper-right corner of the
front panel and block diagram windows
• An icon is a graphical representation of a VI
• If you use a VI as a subVI, the icon identifies the subVI on
the block diagram of the VI
ni.com/training
7
B. Icon and Connector Pane – Good VI Icon
ni.com/training
8
B. Icon and Connector Pane – Create Icon
ni.com/training
9
B. Icon and Connector Pane – Create Icon
ni.com/training
10
B. Icon and Connector Pane – Create Icon
• Use the Glyphs tab to display glyphs you can include in the icon
• Select Tools»Synchronize with ni.com Icon Library to update
ni.com/training
11
B. Icon and Connector Pane – Create Icon
• Use the Icon Text tab to specify the text to display in the icon
ni.com/training
12
B. Icon and Connector Pane – Create Icon
• Use the Templates tab to display icon templates you can use as
a background for the icon
ni.com/training
13
B. 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
− Each rectangle on the connector
pane represents a terminal
− Use the terminals to assign inputs
and outputs
• Select a different pattern by
right-clicking the connector pane
and selecting Patterns from the
shortcut menu
ni.com/training
14
B. Icon and Connector Pane – Standards
ni.com/training
15
C. Using SubVIs
ni.com/training
16
C. Using SubVIs – Terminal Setting
• Bold: Required terminal
• Plain: Recommended
terminals
• Dimmed: Optional terminals
ni.com/training
17
C. Using SubVIs – Handling Errors
ni.com/training
18
C. Using SubVIs – Handling Errors
ni.com/training
19
C. Using SubVIs – Section to SubVI
ni.com/training
20
Exercise 7-1
Determine Warnings VI
Create the icon and connector pane for a VI so you can use
the VI as a subVI.
GOAL
21
Exercise 7-1
Determine Warnings VI
DISCUSSION
Summary—Quiz
ni.com/training
23
Summary—Quiz Answer
ni.com/training
24
Summary—Quiz
ni.com/training
25
Summary—Quiz Answer
ni.com/training
26