labview ui tips and tricks - national instrumentssouthafrica.ni.com/sites/default/files/building...

54
LabVIEW UI Tips and Tricks

Upload: trinhhuong

Post on 30-Jan-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

LabVIEW UI

Tips and Tricks

Page 2: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Topics

• Brush Up: Introduction to UI Design Part One

• Giving your UI a Custom Look

• Organisation of Complex UIs

• Indicating Progress of Slow Operations

• Conclusion

Page 4: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

“Good artists borrow…

…great artists steal.”

– Pablo Picasso

Page 5: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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

– Visualisation of information

Page 6: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Three Commandments from Part One

I. Think About Your User

II. Don’t Be Innovative

III. Less Is More

Page 7: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

I. Think About Your User

Page 8: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

III. Less Is More

• 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 colour…

Page 10: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

“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 11: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

The Cereal Box Effect:

Which cereal catches your eye

first?

Guiding the User with Colour

Why?

Page 12: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Giving your UI a Custom Look

Page 13: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

UI Customisation Techniques

• Make default controls transparent

• Add an image via menu Edit » Paste

Front Panel Images and Decorations

• Use to customise cosmetics of controls and indicators

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

Custom Controls

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

• Access via menu File » New

XControls

Page 14: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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 Finish: Custom LabVIEW

UI

Page 15: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Differences in the Control Editor N

orm

al F

ront

Panel

Contr

ol E

ditor

Win

dow

Page 16: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Edit Mode vs. Customise 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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Components of a Control (Slide)

Needle, Fill

and Scale

Digital

Indicator

Pixel

Decrement

Pixel

Increment

Cosmetic

Housing

Page 19: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Components of a Control (Gauge)

Needle, Ramp and

Scale

Digital

Indicator

Extra Frame

Part

Housing

Frame

Page 20: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Viewing Control Components

• View individual control components using menu Window » Show Parts Window

Page 21: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

CUSTOMISING A GAUGE CONTROL

Adding a Decoration and Custom Imagery to a Gauge Control

Page 22: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

An XControl Example…

Design a thermometer control that can represent a

single numeric input in either Celsius or

Fahrenheit.

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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

Termin

al View

Icon

View

Page 26: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Structure of an XControl

XControl

Properties (Optional)

Methods (Optional)

Abilities (Mandatory)

Page 27: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

XControl Properties

• Allow the user to configure the XControl programmatically via Property Node

Page 28: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

XControl Methods

• Allow the user to engage functionality of the XControl programmatically via Invoke Node

Page 29: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

XControl Abilities

• Required components for proper function

• Represented by VIs or Controls

• Four mandatory abilities:

– Data

– State

– Facade

– Init

• Additional optional abilities may exist

Page 30: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

XControl Data Ability

• Type Definition Control

• Specifies the data type of the XControl

Page 31: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

XControl State Ability

• Type Definition Control

• Specifies information other than data type that affect the appearance of the XControl

Page 32: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

XControl Facade Ability

• Defines the appearance of the XControl

• Invoked after changes to Properties / Methods

Page 33: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

XControl Facade 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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

XControl Init Ability

• Called upon first placement or load into memory

• Initialises display state before being displayed

• Handles control versioning

Page 35: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

CREATING AN XCONTROL Creating a Simple XControl from Scratch

Page 36: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Gallery of Examples

Credit: Simon Hogg

NI Community UI Interest Group

Page 37: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Gallery of Examples

Credit: Simon Hogg

NI Community UI Interest Group

Page 38: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Gallery of Examples

Credit: Jonathan Cohn – Bloomy Controls

LabVIEW Example Code Contest 2010 UI Controls

Category Winner

Page 39: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Importance of Visualisation Choices

UI “Signal to Noise Ratio:”

Which slide is more effective and why?

Page 40: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Organisation 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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Using a Tab Control

1. Add to front panel

2. Customise tab control

3. Populate with controls

• More flexible than most people realize

– Transparent tabs

– Vertical tabs

– Tabs with images

Page 42: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Example Tab Control Application Using LabVIEW to mimic NI DIAdem, software that outshines Excel for data

postprocessing

Page 43: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

CUSTOMISING A TAB CONTROL

Disguising a Tab Control with Transparent or Image Tabs

Page 44: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

SUBPANEL OPTIONS DIALOG

Displaying Subpanels based upon User Selections

Page 46: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Gallery of Examples

Credit: Simon Hogg

NI Community UI Interest Group

Page 47: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

SPLASH SCREEN DEMO Using an Event Structure to Create a Splash Screen

Page 49: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

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: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Key Take-aways

• Don’t be innovative

• Less is more

• Think about your user

• Customise controls using Control Editor

• Encapsulate functionality via XControls

• Clean up your front panels with tabs, subpanels

• Disguise load times using splash screens

Page 51: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Learn and Share – UI Interest Group

decibel.ni.com/content/groups/ui

Page 52: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

Certified LabVIEW Developer

Exam

Certified LabVIEW Architect

Exam

Certified LabVIEW Associate

Developer Exam

Developer Senior Developer Software Architect

/ Project Manager

NI Certifications Align with Training

"Certification is an absolute must for anyone serious about calling himself a

LabVIEW expert... At our organisation, we require that every LabVIEW

developer be on a professional path to become a Certified LabVIEW

Architect."

- President, JKI Software, Inc.

Managing

Software

Engineering

in LabVIEW

LabVIEW

OOP Advanced

Architecture

LabVIEW

Core 3

LabVIEW

Core 2

LabVIEW

Core 1

Page 53: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require

How do I go further? • Reading

• decibel.ni.com/content/groups/ui

• Learn more

– LabVIEW Advanced Architectures

• Talk to your

– Local Engineer

– The UI group online

Page 54: LabVIEW UI Tips and Tricks - National Instrumentssouthafrica.ni.com/sites/default/files/Building Advanced User... · LabVIEW UI Tips and Tricks . ... At our organisation, we require