slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Workshop 2 of 7 PowerPoint Presentation
Download Presentation
Workshop 2 of 7

Loading in 2 Seconds...

play fullscreen
1 / 40

Workshop 2 of 7 - PowerPoint PPT Presentation


  • 76 Views
  • Uploaded on

Welcome!. Workshop 2 of 7. Today's Topics. Review of Workshop 1 Basic VI Structure Arrays Clusters Error Cluster Enumerations. Review Question 1. Which of the following are the three parts of a VI? Front Panel Project Block Diagram Connector Pane/Icon. Review Question 1.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Workshop 2 of 7' - alva


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

Welcome!

Workshop

2 of 7

today s topics
Today's Topics
  • Review of Workshop 1
  • Basic VI Structure
  • Arrays
  • Clusters
    • Error Cluster
  • Enumerations
review question 1
Review Question 1

Which of the following are the three parts of a VI?

Front Panel

Project

Block Diagram

Connector Pane/Icon

review question 11
Review Question 1

Which of the following are the three parts of a VI?

Front Panel

Project

Block Diagram

Connector Pane/Icon

review question 2
Review Question 2

Which identifies the control or indicator on the block diagram?

Caption

Location

Label

Value

review question 21
Review Question 2

Which identifies the control or indicator on the block diagram?

Caption

Location

Label

Value

review question 3
Review Question 3

Which of the following are not a nodes?

Terminals

Structures (while loop, for loop)

subVIs

Wires

Functions

review question 31
Review Question 3

Which of the following are not a nodes?

Terminals

Structures (while loop, for loop, etc.)

subVIs

Wires

Functions

review question 4
Review Question 4
  • Which function executes first: Add or Subtract?
    • Add
    • Subtract
    • Unknown
review question 41
Review Question 4
  • Which function executes first: Add or Subtract?
    • Add
    • Subtract
    • Unknown
slide11

Review Question 1

True or False?

It is possible to add non-VI files to a LabVIEW Project.

slide12

Review Question 1

True or False?

It is possible to add non-VI files to a LabVIEW Project.

TRUE

slide13

Review Question 2

  • True or False?
  • If I am using a virtual folder in the LabVIEW Project, I must keep all of the related files together on disk.
slide14

Review Question 2

  • True or False?
  • If I am using a virtual folder in the LabVIEW Project, I must keep all of the related files together on disk.
  • FALSE
slide15

Review Question 3

  • Which mechanical action causes a Boolean in the False state to change to True when you click it and stay True until you release it and LabVIEW has read the value (similar to how a button in Windows operates)?
    • Switch Until Released
    • Switch When Released
    • Latch Until Released
    • Latch When Released
slide16

Review Question 3

  • Which mechanical action causes a Boolean in the False state to change to True when you click it and stay True until you release it and LabVIEW has read the value (similar to how a button in Windows operates)?
    • Switch Until Released
    • Switch When Released
    • Latch Until Released
    • Latch When Released
slide17

Basic VI Structure

  • Acquire
  • Analyze
  • Present
slide18

Arrays

  • An array consists of elements and dimensions
    • Elements: data that make up the array
    • Dimension: the length, height, or depth of an array
        • (231)–1 elements per dimension, memory permitting
        • 1 or more dimensions

Elements (numeric, here)

Index, tells dimension

(1D, here)

slide19

Arrays: the elements

  • Arrays can be of many different data types, but only one data type at a time
slide20

Arrays: Initialized and Uninitialized

  • If the elements of an array are grayed out, then those elements are uninitialized.
  • Uninitialized elements do not have a value and are place holders

Uninitialized elements

Initialized elements

slide21

Arrays: Size vs. Dimension

  • Size is the number of initialized elements in each dimension
  • Dimension is how the elements are organized

Size: 4

Dimension: 1D

Size: 4

Dimension: 1D

Size: 0x0

Dimension: 2D

Size: 2x3x?

Dimension: 3D

Size: at least 4 – more elements could be hidden

Dimension: 1D

creating an array
Creating an Array
  • Place an array shell on the front panel
    • From the Controls»Modern»Array, Matrix, and Clustersubpalette, select the Array icon.
  • Drag a data object or element into the array shell
arrays the index
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
      • - 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

slide24

Demonstration 1:

Creating an array

slide25

Array Functions

  • Build Array:
    • Adds elements or dimensions to an array
  • Search 1D Array:
    • Returns the index of the value you specify; if not found, returns -1
  • Array Size:
    • Returns the number of elements in each dimension of the array
  • Index Array:
    • Returns the value at the index you specify
  • Initialize Array:
    • Creates an initialized array of the dimension and data type you specify
slide26

Clusters

  • Clusters group data elements of mixed types
  • Similar to a record or a struct in text-based programming languages
cluster functions
Cluster Functions
  • Bundle (there is also Unbundle)
    • Assembles a cluster from individual elements.
  • Bundle By Name (there is also Unbundle By Name)
    • Replaces one or more cluster elements. This function refers to cluster elements by name instead of by their position in the cluster.
  • Cluster Constant
    • Use this constant to supply a constant cluster value to the block diagram.

(Terminal labels reflect data type)

Bundle By Name

Cluster Constant

Bundle

slide28

Clusters: Order

  • Cluster elements have a logical order unrelated to their position in the shell
  • You can view and modify the cluster order by right-clicking the cluster border and selecting Reorder Controls In Cluster from the shortcut menu
  • Order determines how cluster is unbundled
slide29

Error Cluster

  • Three parts:
    • Status – Boolean, TRUE when an error occurred
    • Code - numeric (I32), identifies which error occurred
    • Source – string, identifies where the error occurred

Note: Warnings have a code and source, but the status is FALSE

slide30

Demonstration 2:

Creating a cluster and reordering its element

slide31

Clusters vs. Arrays

  • Clusters differ from arrays in that they are a fixed size
  • Clusters can contain mixed data types; arrays contain only one data type
  • Like an array, a cluster is either a control or an indicator and cannot contain a mixture of controls and indicators
  • You can create a cluster of clusters, cluster of arrays, array of clusters, but NOT an array of arrays
slide32

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
  • Appears as a string to you, and a number to computer
slide33

Enumeration: Configuring

  • Right-click on the enum
  • Select Edit Items…
slide34

Demonstration 3:

Configuring an Enum

slide35

Customizing Controls

  • LabVIEW ships with multiple palettes of controls available to you. However, you may want to customize them or create your own

Standard LabVIEW Gauge

Customized LabVIEW Gauge

slide36

Creating Custom Controls

  • How to create:
  • Right click on the control; select Advanced >> Customize
  • The Control Edit window will appear.

Edit Mode

Customize Mode

(low-level changes)

slide37

Saving Custom Controls

  • Three options:
  • Custom Control
  • Type Definition
  • Strict Type Definition

All 3 options create a *.ctl file.

Once you save the custom control it takes on the name of the option you chose.

slide38

Custom Controls & Type Definitions

  • Strict Type Def
    • Connection between saved file and all instances
    • Forces everything about an instance to be identical to the strict type definition, except:
      • label
      • description
      • default value
  • Control
  • No connection between the one you saved and the instance in the VI
  • Update the file, but the instances are not updated
  • Type Def
    • Connection between the saved file and all instances
    • Forces the data type of each instance to be identical (clusters, enum)
    • Changes made to file will populate throughout each instance

*.ctl

*.ctl

*.ctl

slide39

Demonstration:

Creating and Saving a Type Definition

homework
Homework:
  • Create a new VI from the instructions located at ni.com/mst
  • CLAD Extra Questions (Put the answers in the message)
  • Email HW to:
  • Mst.labview@gmail.com