51
1 Part II of LabVIEW UI Tips and Tricks <Insert Name Here> <Insert Title Here>

Advanced LabVIEW User Interfaces

Embed Size (px)

Citation preview

Page 1: Advanced LabVIEW User Interfaces

1

Part II of

LabVIEW UI

Tips and Tricks<Insert Name Here><Insert Title Here>

Page 2: Advanced LabVIEW User Interfaces

2

Before we Begin…

• Different tastes exist – our tips may not always apply

• This presentation assumes a basic experience level

• Visit (and join) our UI Community Group to find:

Part I of this presentation online

Downloadable demos and examples

LabVIEW users passionate about UI (who share)

decibel.ni.com/content/groups/ui

Page 3: Advanced LabVIEW User Interfaces

3

Topics

• Brush Up: Introduction to UI Design Part One

• Giving your UI a Custom Look

• Organization of Complex UIs

• Indicating Progress of Slow Operations

• Conclusion

Page 4: Advanced LabVIEW User Interfaces

4

“Good artists borrow…

…great artists steal.”

– Pablo Picasso

Page 5: Advanced LabVIEW User Interfaces

5

Sources of Inspiration

• Apple

• Microsoft Office

• Applications on your own computer

• Icon galleries

• Web design tutorials

• Your corporate design team

• Photography, Art

• Books on:

User interface design

User interaction design

Usability

Graphic design

Visualization of information

Page 6: Advanced LabVIEW User Interfaces

6

Three Commandments from Part One

I. Think About Your User

II. Don’t Be Innovative

III. Less Is More

Page 7: Advanced LabVIEW User Interfaces

I. Think About Your User

• Do they know as much as you (they never do)?

• How will they interact with the application?

• Why are they using your software?

The software (and UI) should support their goal

Page 8: Advanced LabVIEW User Interfaces

8

II. Don’t Be Innovative

• Use familiar elements

• Don’t change expected functionality

• Polish – don’t reinvent

System controls mimic common operating system controls and are familiar to most users

Page 9: Advanced LabVIEW User Interfaces

9

• Too much at once is distracting; err toward minimalism

• Stick to requirements

Don’t do what isn’t necessary

You’ll get done sooner

It’ll cost you less to own it

• Focus should be on what’s important

Example: Guide the user with color…

III. Less Is More

Page 10: Advanced LabVIEW User Interfaces

10

Guiding the User with Color

The Cereal Box Effect:

Which cereal catches your eye first?

Why?

Page 11: Advanced LabVIEW User Interfaces

11

“It seems that perfection is attained not when there is nothing more to add,

but when there is nothing more to remove.”

– Antoine de Saint-Exupéry

Page 12: Advanced LabVIEW User Interfaces

12

Giving your UI a Custom Look

Page 13: Advanced LabVIEW User Interfaces

13

UI Customization Techniques

• Make default controls transparent

• Add an image via menu Edit » Paste

Front Panel Images and Decorations

• Use to customize cosmetics of controls and indicators

• Access via front panel right-click context menu Advanced » Customize

Custom Controls

• Use to customize the functionality or cosmetics of controls and indicators

• Access via menu File » New

XControls

Page 14: Advanced LabVIEW User Interfaces

14

Adding an Image to the Front Panel

• As simple as Copy and Paste!

• Use an image editor to erase, add transparency

• Populate native LabVIEW controls

Start: PowerPoint Clipart

Page 15: Advanced LabVIEW User Interfaces

15

Differences in the Control EditorN

orm

al F

ront

Pan

elC

ontr

ol E

dito

r W

indo

w

Page 16: Advanced LabVIEW User Interfaces

16

When you should use Controls• To create cosmetically different, reusable controls

• Example: resizing a Stop button to make it easier to click

When you should use Type Defs• To automatically update data type in custom controls

• Example: reusing an Enum whose values may change

When you should use Strict Type Defs• To create reusable controls that are identical copies

• Example: propagating changes to Gauge size and color

Page 17: Advanced LabVIEW User Interfaces

17

Edit Mode vs. Customize Mode

Edit Mode

• Change size or color of a control or indicator

• Access a right-click shortcut menu

Customize Mode

• Make extensive changes to controls or indicators

• Change individual parts of a control or indicator

Page 18: Advanced LabVIEW User Interfaces

18

Components of a Control (Slide)

Needle, Fill

and Scale

Array

Index

Pixel

Decrement

Pixel

Increment

Cosmetic

Housing

Page 19: Advanced LabVIEW User Interfaces

19

Components of a Control (Gauge)

Needle, Ramp

and Scale

Array Index

Extra Frame

Part

Housing

Frame

Page 20: Advanced LabVIEW User Interfaces

20

Viewing Control Components

• View individual control components using menu

Window » Show Parts Window

Page 21: Advanced LabVIEW User Interfaces

21

CUSTOMIZING A GAUGE

CONTROL

Adding a Decoration and Custom Imagery to a Gauge Control

Page 22: Advanced LabVIEW User Interfaces

22

When you should use XControls• To create reusable components with dynamic behavior

• To encapsulate extended functionality or cosmetics

When you should not use XControls• To accomplish pure cosmetic changes

• When working on a single-shot application

Use Strict Type Defs instead when…• You do not need dynamic run-time and edit-time behavior

Page 23: Advanced LabVIEW User Interfaces

23

An XControl Example…

Design a thermometer control that can represent a single

numeric input in either Celsius or Fahrenheit.

Discussion:

What makes this a good

application for an XControl?

Note: This example XControl is pre-built as part

of the default LabVIEW Examples

Page 24: Advanced LabVIEW User Interfaces

24

Example XControl Requirements

1. Thermometer must keep track of which

temperature unit it represents

2. Thermometer must convert temperature

between Fahrenheit and Celsius

3. Thermometer must represent a single numeric

value and look (visually) like a thermometer.

Page 25: Advanced LabVIEW User Interfaces

25

Using XControls

• Manage XControls via the Project Explorer

• XControls appear as regular terminals

• You start with shell code

Remember – you can go a long way without resorting to XControls

Terminal

View

Icon

View

Page 26: Advanced LabVIEW User Interfaces

26

Structure of an XControl

XControl

Properties(Optional)

Methods (Optional)

Abilities (Mandatory)

Page 27: Advanced LabVIEW User Interfaces

27

XControl Properties

• Allow the user to configure the XControl

programmatically via Property Node

Page 28: Advanced LabVIEW User Interfaces

28

XControl Methods

• Allow the user to engage functionality of the

XControl programmatically via Invoke Node

Page 29: Advanced LabVIEW User Interfaces

29

XControl Abilities

• Required components for proper function

• Represented by VIs or Controls

• Four mandatory abilities:

Data

State

Façade

Init

• Additional optional abilities may exist

Page 30: Advanced LabVIEW User Interfaces

30

XControl Data Ability

• Type Definition Control

• Specifies the data type of the XControl

Page 31: Advanced LabVIEW User Interfaces

31

XControl State Ability

• Type Definition Control

• Specifies information other than data type that

affect the appearance of the XControl

Page 32: Advanced LabVIEW User Interfaces

32

XControl Façade Ability

• Defines the appearance of the XControl

• Invoked after changes to Properties / Methods

Page 33: Advanced LabVIEW User Interfaces

33

XControl Façade Ability

• Also invoked when:

• Data is written to the control

• Appearance needs updating

• Changing between Control and Indicator

• Shortcut menu activates

• Short menu is selected

…and more

Page 34: Advanced LabVIEW User Interfaces

34

XControl Init Ability

• Called upon first placement or load into memory

• Initializes display state before being displayed

• Handles control versioning

Page 35: Advanced LabVIEW User Interfaces

35

CREATING AN XCONTROL

Creating a Simple XControl from Scratch

Page 36: Advanced LabVIEW User Interfaces

36

Gallery of Examples

Credit: Simon Hogg

NI Community UI Interest Group

Page 37: Advanced LabVIEW User Interfaces

37

Gallery of Examples

Credit: Simon Hogg

NI Community UI Interest Group

Page 38: Advanced LabVIEW User Interfaces

38

Gallery of Examples

Credit: Jonathan Cohn – Bloomy Controls

LabVIEW Example Code Contest 2010 UI Controls Category Winner

Page 39: Advanced LabVIEW User Interfaces

39

Importance of Visualization Choices

UI “Signal to Noise Ratio:”

Which slide is more effective and why?

Page 40: Advanced LabVIEW User Interfaces

42

Organization of Complex UIs

• Use when controls don’t all have to be visible at once

• Limit to the number of tabs you can gracefully use

• Loads all controls into memory at once

Tab Control

• Use to dynamically decide which controls to display

• No limit to the number you can gracefully interact with

• You control when the VI is loaded or release from memory

Category and Content View using SubPanels

Page 41: Advanced LabVIEW User Interfaces

43

Using a Tab Control

1. Add to front panel

2. Customize tab control

3. Populate with controls

• More flexible than most people realize

Transparent tabs

Vertical tabs

Tabs with images

Page 42: Advanced LabVIEW User Interfaces

44

Example Tab Control ApplicationUsing LabVIEW to mimic NI DIAdem, software that outshines Excel for data postprocessing

Page 43: Advanced LabVIEW User Interfaces

45

CUSTOMIZING A TAB

CONTROL

Disguising a Tab Control with Transparent or Image Tabs

Page 44: Advanced LabVIEW User Interfaces

46

Using a SubPanel

1. Determine higher level VI screen real estate

2. Develop size appropriate, modular SubVIs

3. Dynamically Run SubVI

4. Dynamically insert SubVI into subpanel

Page 45: Advanced LabVIEW User Interfaces

47

SUBPANEL OPTIONS

DIALOG

Displaying Subpanels based upon User Selections

Page 46: Advanced LabVIEW User Interfaces

48

Gallery of Examples

Credit: Simon Hogg

NI Community UI Interest Group

Page 47: Advanced LabVIEW User Interfaces

49

Indicating Progress of Slow Operations

• Splash screens are effective when applications

have a long load time

Provide development and support information

• Busy cursors

• Progress bars

For tips on using busy cursors, view Part I of this presentation available on the NI Community UI Interest Group site

Page 48: Advanced LabVIEW User Interfaces

50

SPLASH SCREEN DEMO

Using an Event Structure to Create a Splash Screen

Page 49: Advanced LabVIEW User Interfaces

51

Gallery of Examples

Sine Wave Tester

Version: 1.0.32 Author: Derrick Snyder

For Support, Please Visit: http://www.ni.com/

Framework Credit: Mark Ridgley, Logic PD

NI Developer Community

Page 50: Advanced LabVIEW User Interfaces

52

Key Takeaways

• Don’t be innovative

• Less is more

• Think about your user

• Customize controls using Control Editor

• Encapsulate functionality via XControls

• Clean up your front panels with tabs, subpanels

• Disguise load times using splash screens

Page 51: Advanced LabVIEW User Interfaces

53

Learn and Share – UI Interest Group

decibel.ni.com/content/groups/ui