Labview Style Guidelines

34
Bloomy Controls LabVIEW Style Guidelines Peter Blume President [email protected]

Transcript of Labview Style Guidelines

Page 1: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 1/34

Bloomy Controls

LabVIEW Style Guidelines

Peter Blume

President

[email protected]

Page 2: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 2/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Overview

General objectives

Examples without guidelines

Guidelines

Front panel

Icon/connector 

Block diagram

 Architecture Optimization

Clusters

Error handling

File organization

Documentation

Page 3: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 3/34

www.bloomy.com© 2003 Bloomy Controls Inc.

General Objectives

Satisfy application requirements

Optimize:

Efficiency

Efficient = fast and memory-conserving

Readability

Readable = user-friendly and maintainable

Robustness Robust = reliable and bug-free

Page 4: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 4/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Front Panel Guidelines ² Text

General Minimize overall quantity of text

Controls Use succinct, intuitive labels

Indicate units in parentheses or use free labels

Enter descriptions or online help where further text is needed

Use transparent background

Top-level and dialog VIs Use large text size readily legible from several feet away

Maximize contrast between text color and background

Page 5: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 5/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Front Panel Text Example

Page 6: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 6/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Front Panel Layout

General Group related controls together 

Consider decorations, tabs, clusters

 Apply symmetry and spacing

Top-level and dialog VIs Size controls, indicators, and fonts according to importance

Use tab controls or subVIs to increase front-panel real estate

 Apply color judiciously

Select three to four primary colors that go well together   Avoid red and yellow in industrial applications, except where appropriate

Page 7: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 7/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Top-Level Panel Example

Page 8: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 8/34

www.bloomy.com© 2003 Bloomy Controls Inc.

SubVI Panel Layout

Use default appearance for most objects and text  Avoid using many colors, fonts

Consider default gray panel with 13-point application font

Use intuitive control positions Controls at left, indicators at right

Refnum/task IDs at top

Error clusters at bottom

Size panel adequately, but less than full screen

Keep things neat, intuitive, and symmetric

Page 9: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 9/34

www.bloomy.com© 2003 Bloomy Controls Inc.

SubVI Example

Page 10: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 10/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Icon/Connector 

Icon Intuitive text or graphic

10-point small fonts

Color-coding for icons of related subVIs

Connector pane Controls assigned to left terminals, indicators assigned to right

Refnum/task ID assigned to top left and right terminals

Error cluster assigned to bottom left and right terminals

Default values in parenthesis in owned label Priority used where appropriate

VI descriptions are required for  ALL subVIs

Page 11: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 11/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Icon/Connector Examples

Nonconforming Conforming

Page 12: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 12/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Block Diagram

General

Leave the background color white

Set all control labels visible

Liberally document with free labels

Limit diagram to one 1024 x 768 screen

 Avoid overlapping objects

Page 13: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 13/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Wiring Techniques

 Apply

Left-to-right data flow

Straight wires

 Align objects prior to wiring together  Free labels to long wires

Consistent data types

 Avoid

Overlapping or obstructed wires

Page 14: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 14/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Wiring Example

Page 15: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 15/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Diagram Ar chitectures

Modularize with subVIs

Top-level VIs should be composed of calls to subVIs

Do not over-modularize

Top level = state machine Define application as a series of states

Go to any state from any other state

Easy to modify, maintain, and debug

Self-documenting

Page 16: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 16/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Classic State Machine

Page 17: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 17/34

www.bloomy.com© 2003 Bloomy Controls Inc.

State Machine Guidelines

Use enumerated or stringfor case selector 

Poll user interface events in

³No Event, Default´ frame or in separate event structurein parallel loop

Use intuitive state names

Include ³Initialize´ and ³Shutdown´ states

Page 18: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 18/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Enumerated State Machine

Page 19: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 19/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Nonconforming Example

Page 20: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 20/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Conforming Example

Page 21: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 21/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Event-Driven State Machine

Consider desired response to GUI for determining

state granularity

Consider applicability of queues

Page 22: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 22/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Optimizing Diagrams

Use Wait in all While Loops

 Avoid

Local and global variables

Sequence structures

Unnecessary nesting

Coercions

Unnecessary operations

in looping structures Easy I/O VIs

Inefficient I/O

Page 23: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 23/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Optimizing Diagrams ² Efficient I/O

Page 24: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 24/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Clusters

Group related data into clusters

Follow front-panel text guidelines

Consider saving as strict type definition

 Avoid nesting clusters and arrays beyond

two levels

 Always use bundle and unbundle by name

Page 25: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 25/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Cluster Example ² Nonconforming

Page 26: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 26/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Cluster Examples ² Conforming

Page 27: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 27/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Error Handling

 All VIs must trap and report any I/O-related errors

that might occur 

Trapping is facilitated by propagation of error cluster 

I/O functions include DAQ, file I/O, instrument I/O,communication

Reporting methods include dialog prompt or log to file

Page 28: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 28/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Error Handling ² Nonconforming

Page 29: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 29/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Error Handling ² Conforming

Page 30: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 30/34

www.bloomy.com© 2003 Bloomy Controls Inc.

File Organization

Subfolder hierarchy required

Organize project into subfolders

Recommended subfolder 

hierarchy:

Page 31: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 31/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Documentation

Use guidelines to document VIs

Use LabVIEW custom printing options to create a

function reference manual

Include specification and/or basic operating

instructions to complete documentation

Page 32: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 32/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Conclusion

Using LabVIEW style guidelines ensures:

Multiple end users will find software robust and

user-friendly

Multiple developers will find software readable andmaintainable

Page 33: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 33/34

www.bloomy.com© 2003 Bloomy Controls Inc.

About Bloomy Controls

Test, measurement, automation, and control specialistssince 1991

Systems integration, software development, andtraining provider 

NI Select Integrator and Certified Training Center  3 Certified LabVIEW Architects

8 Certified LabVIEW Developers

1 Certified TestStand Architect

2 Certified TestS

tand Developers 8 Certified Professional Instructors

Offices in Windsor, CT; Milford, MA; and Mahwah, NJ

Page 34: Labview Style Guidelines

8/3/2019 Labview Style Guidelines

http://slidepdf.com/reader/full/labview-style-guidelines 34/34

www.bloomy.com© 2003 Bloomy Controls Inc.

Contact Bloomy Controls

Email [email protected]

Write or visit

CT, Western MA,

Eastern NY:

Eastern MA, RI,

Northern New England:

Greater NYC,

NJ:

839 Marshall Phelps Rd. 100 Medway Rd., Ste 202

Windsor, CT 06095 Milford, MA 01757 Mahwah, NJ

(860) 298-9925 (508) 902-0054 (201) 818-0117