Sie sind auf Seite 1von 34

Bloomy Controls LabVIEW Style Guidelines Peter Blume President peter.blume@bloomy.

com

Overview

 General objectives  Examples without guidelines  Guidelines


     Front panel Icon/connector Block diagram Architecture Optimization     Clusters Error handling File organization Documentation

2003 Bloomy Controls Inc.

www.bloomy.com

General Objectives

 Satisfy application requirements  Optimize:


 Efficiency
 Efficient = fast and memory-conserving

 Readability
 Readable = user-friendly and maintainable

 Robustness
 Robust = reliable and bug-free

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

Front Panel Text Example

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

Top-Level Panel Example

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

SubVI Example

2003 Bloomy Controls Inc.

www.bloomy.com

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


2003 Bloomy Controls Inc.

www.bloomy.com

Icon/Connector Examples
Nonconforming Conforming

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

Wiring Example

2003 Bloomy Controls Inc.

www.bloomy.com

Diagram Architectures

 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

2003 Bloomy Controls Inc.

www.bloomy.com

Classic State Machine

2003 Bloomy Controls Inc.

www.bloomy.com

State Machine Guidelines

 Use enumerated or string for case selector  Poll user interface events in No Event, Default frame or in separate event structure in parallel loop  Use intuitive state names  Include Initialize and Shutdown states

2003 Bloomy Controls Inc.

www.bloomy.com

Enumerated State Machine

2003 Bloomy Controls Inc.

www.bloomy.com

Nonconforming Example

2003 Bloomy Controls Inc.

www.bloomy.com

Conforming Example

2003 Bloomy Controls Inc.

www.bloomy.com

Event-Driven State Machine

 Consider desired response to GUI for determining state granularity  Consider applicability of queues

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

Optimizing Diagrams Efficient I/O

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

Cluster Example Nonconforming

2003 Bloomy Controls Inc.

www.bloomy.com

Cluster Examples Conforming

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

Error Handling Nonconforming

2003 Bloomy Controls Inc.

www.bloomy.com

Error Handling Conforming

2003 Bloomy Controls Inc.

www.bloomy.com

File Organization  Subfolder hierarchy required


 Organize project into subfolders  Recommended subfolder hierarchy:

2003 Bloomy Controls Inc.

www.bloomy.com

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

2003 Bloomy Controls Inc.

www.bloomy.com

Conclusion

 Using LabVIEW style guidelines ensures:


 Multiple end users will find software robust and user-friendly  Multiple developers will find software readable and maintainable

2003 Bloomy Controls Inc.

www.bloomy.com

About Bloomy Controls  Test, measurement, automation, and control specialists since 1991  Systems integration, software development, and training provider  NI Select Integrator and Certified Training Center
     3 Certified LabVIEW Architects 8 Certified LabVIEW Developers 1 Certified TestStand Architect 2 Certified TestStand Developers 8 Certified Professional Instructors

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


2003 Bloomy Controls Inc.

www.bloomy.com

Contact Bloomy Controls

 Email info@bloomy.com  Write or visit


CT, Western MA, Eastern NY: Windsor, CT 06095 (860) 298-9925 Eastern MA, RI, Northern New England: Milford, MA 01757 (508) 902-0054 Greater NYC, NJ: Mahwah, NJ (201) 818-0117

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

2003 Bloomy Controls Inc.

www.bloomy.com

Das könnte Ihnen auch gefallen