Relating Data
TOPICS
A. Arrays
B. Clusters
C. Type Definitions
ni.com/training
A. Arrays
ni.com/training
2
A. Arrays
ni.com/training
3
A. Arrays – Creating
ni.com/training
4
A. Arrays – 2D Array
ni.com/training
5
A. Arrays – Initializing
ni.com/training
6
A. Arrays – Creating Constants
ni.com/training
7
A. Arrays – Auto-indexing
ni.com/training
8
A. Arrays – Auto-indexing Input
ni.com/training
9
A. Arrays – Auto-indexing Input
ni.com/training
10
A. Arrays – Auto-indexing Output
ni.com/training
11
A. Arrays – Creating 2D Arrays
You can use two For Loops, one inside the other, to create a
2D array
ni.com/training
12
Exercise 5-1
Concept: Manipulating Arrays
DISCUSSION
B. Clusters
ni.com/training
15
B. Clusters – Array vs Cluster
ni.com/training
16
B. Clusters – Creating
ni.com/training
17
B. Clusters – Constants
ni.com/training
18
B. Clusters – Order
ni.com/training
19
B. Clusters – Assembling a Cluster
ni.com/training
20
B. Clusters – Modifying a Cluster
ni.com/training
21
B. Clusters – Disassembling a Cluster
ni.com/training
22
B. Clusters – Error Clusters
ni.com/training
23
Exercise 5-2
Concept: Clusters
DISCUSSION
C. Type Definitions – Custom Controls
ni.com/training
26
C. Type Definitions – Control Editor
ni.com/training
27
C. Type Definitions
ni.com/training
28
C. Type Definitions – Control Type
Control
• No connection between the custom control or indicator you
saved and the instance of the custom control or indicator in
the VI
• Update the file, but the
instances are not updated
ni.com/training
29
C. Type Definitions – Type Definition
Type Definition (type def):
• Edit the saved file, and have all instances update with the
changes made
• Forces the data type of each instance to be identical
• Example:
− Add an item to the type definition of an
enum, the instances of the enum
update with the new item
− If you resize the enum front panel
control type definition, the instances
of the enum do not resize
ni.com/training
30
C. Type Definitions – Strict Type Definition
ni.com/training
31
Exercise 5-3
Concept: Type Definition
• If you only edit the color of Strict Type Def Numeric.ctl in the
Control Editor, would all the instances of the control change
color?
• If you only edit the color of Type Def Numeric.ctl in the Control
Editor, would all the instances of the control change color?
DISCUSSION
Summary—Quiz
ni.com/training
34
Summary—Quiz Answer
ni.com/training
35
Summary—Quiz
ni.com/training
36
Summary—Quiz Answer
ni.com/training
37
Summary—Quiz
ni.com/training
38
Summary—Quiz Answer
ni.com/training
39
Summary—Quiz
4. You are inputting data that represents a circle. The circle data
includes three double precision numerics: x position, y position and
radius. In the future, you might need to expand all instances of the
circle data to include the color of the circle, represented as an
integer. How should you represent the circle on your front panel?
a) Three separate controls for the two positions and the radius
b) A cluster containing all of the data
c) A custom control containing a cluster
d) A type definition containing a cluster
e) An array with three elements
ni.com/training
40
Summary—Quiz Answer
4. You are inputting data that represents a circle. The circle data
includes three double precision numerics: x position, y position and
radius. In the future, you might need to expand all instances of the
circle data to include the color of the circle, represented as an
integer. How should you represent the circle on your front panel?
a) Three separate controls for the two positions and the radius
b) A cluster containing all of the data
c) A custom control containing a cluster
d) A type definition containing a cluster
e) An array with three elements
ni.com/training
41