360 likes | 747 Views
Bloomy Controls LabVIEW Style Guidelines. Peter Blume President peter.blume@bloomy.com. Clusters Error handling File organization Documentation . Overview. General objectives Examples without guidelines Guidelines Front panel Icon/connector Block diagram Architecture Optimization.
E N D
Bloomy ControlsLabVIEW Style Guidelines Peter Blume President peter.blume@bloomy.com
Clusters Error handling File organization Documentation Overview • General objectives • Examples without guidelines • Guidelines • Front panel • Icon/connector • Block diagram • Architecture • Optimization
General Objectives • Satisfy application requirements • Optimize: • Efficiency • Efficient = fast and memory-conserving • Readability • Readable = user-friendly and maintainable • Robustness • Robust = reliable and bug-free
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
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
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
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
Icon/Connector Examples Conforming Nonconforming
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
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
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
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
Event-Driven State Machine • Consider desired response to GUI for determining state granularity • Consider applicability of queues
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
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
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
File Organization • Subfolder hierarchy required • Organize project into subfolders • Recommended subfolder hierarchy:
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
Conclusion • Using LabVIEW style guidelines ensures: • Multiple end users will find software robust and user-friendly • Multiple developers will find software readable and maintainable
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
Contact Bloomy Controls • Email info@bloomy.com • Write or visit