labview style guidelines
TRANSCRIPT
8/3/2019 Labview Style Guidelines
http://slidepdf.com/reader/full/labview-style-guidelines 1/34
Bloomy Controls
LabVIEW Style Guidelines
Peter Blume
President
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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:
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
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
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
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