没有合适的资源?快使用搜索试试~ 我知道了~
首页The LabvIEW Style Book
The LabvIEW Style Book
需积分: 10 64 浏览量
更新于2023-03-03
评论 1
收藏 8.86MB PDF 举报
The LabvIEW Style Book,是一本学习、规范LabVIEW程序设计的“圣经”,“LabVIEW编程思想”之佳作。作者归纳出200多个LabVIEW程序设计中应该遵循的原则或规范,并配有实例说明。本书最大的特点就是直接阐述LabVIEW程序设计的基本原则,与版本基本上无关。目前大多数有关LabVIEW的书籍通常是对入门表述的较多,对提高没有更多的总结,而此书对LabVIEW程序设计提出的规范,对使用者的提高程序设计的能力是非常有指导意义的!希望能够尽快看到影印版或中文版的出版。“通常寫LabVIEW程式寫到後來會遇到無法突破的瓶頸,總覺得沒有辦法再進步了。或是在專案開發的過程中,要了解如何才可以讓程式更精簡、更有效率。就需要看這本書。
资源详情
资源评论
资源推荐

Copyright
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and the publisher was aware of a trademark
claim, the designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or implied
warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for
incidental or consequential damages in connection with or arising out of the use of the information or
programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special
sales, which may include electronic versions and/or custom covers and content particular to your business,
training goals, marketing focus, and branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419
corpsales@pearsontechgroup.com
For sales outside the United States, please contact:
International Sales
international@pearsoned.com
Visit us on the Web: www.prenhallprofessional.com
Library of Congress Cataloging-in-Publication Data:
Blume, Peter A.
The labVIEW style book / Peter A. Blume.
p. cm.
Includes bibliographical references and index.
ISBN 0-13-145835-3 (hardback : alk. paper) 1. Scientific apparatus and instruments—
Computer simulation. 2. LabVIEW. I.
Title.
Q185.B568 2007
005.4'38—dc22
2006035871
Copyright © 2007 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and
permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval

system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or
likewise. For information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
One Lake Street
Upper Saddle River, NJ 07458
Fax (201) 236-3290
Text printed in the United States at RR Donnelly in Crawfordsville, Indiana.
First printing, February 2007
Dedication
To the employees of Bloomy Controls who contributed to the evolution of this topic within our organization. To
my wife, Phia, and daughter, Eva, for their patience, love, and support.

Foreword
I've been writing VIs for a long time as a member of the LabVIEW R&D team at National Instruments. During
my first week of LabVIEW training many years ago, I decided to write a LabVIEW version of my favorite card
game, called "Set." It took me a while, but I eventually finished it, and it was probably some of the ugliest
LabVIEW code you have ever seen. As Peter Blume would say, my code was THE definition of "spaghetti."
Worse yet, the front panel was full of neon-colored controls and indicators that were blindingly bright for no
good reason. My code was functional, but it was not at all useable, and certainly not maintainable. I tried to
add some new functionality a few years ago (after I was much more familiar with LabVIEW programming), but
I quickly gave up because I had no idea how my own code worked.
Many years later, I can comfortably say that my programming style has improved leaps and bounds over
those initial months with LabVIEW. However, I can also say without a doubt that my growing pains regarding
LabVIEW programming style would have been all but eliminated had The LabVIEW Style Book been around
back then. This book is a fully comprehensive resource, covering every aspect of VI style, from the highest
level (project planning and organization) to the smallest detail (wires with too many bends). If I had read this
book while I was learning LabVIEW, my code would have been many times more useable and maintainable
from the start.
The LabVIEW Style Book is a must-read for every LabVIEW developer. Not only does it contain essential
style rules for any new LabVIEW developer, it is also a necessary refresher for seasoned LabVIEW veterans.
In particular, there are some chapters (like Chapter 6, "Data Structures," Chapter 7, "Error Handling," Chapter
8, "Design Patterns") that contain crucial programming tips and techniques not available in any other single
resource. As one of the VI style advocates in LabVIEW R&D, I will definitely be recommending that new VI
developers on my team read this book, and I'm confident that I'll be referencing it frequently in style
discussions with my more experienced colleagues.
Another truly unique feature of the book is the impressive number of example VIs that Peter uses to illustrate
good (and sometimes bad) style. With his decade-and-a-half of LabVIEW experience, Peter has a vast library
of VIs that he, his employees, or his customers have written. He utilizes this library of code effectively to
illustrate applicable points in every chapter. What's more, he will sometimes take the same example over the
course of several chapters and refine it more and more with style rules picked up along the way. This gives us
a "real-time" view of how good style can positively affect VIs as they are being developed.
So with LabVIEW celebrating 20+ years of inspiring engineers, scientists, and even children worldwide, I'm
confident that readers of the definitive book on LabVIEW style will ultimately appreciate the time and effort
savings that result from developing VIs with consistent, appropriate style. If you're a LabVIEW beginner, get
ready for your VIs to become—as Peter would say—"awe-inspiring" …and if you're a LabVIEW expert, you're
going to learn a lot, too. I know I did!
Darren Nattinger
Staff Software Engineer, LabVIEW R&D
National Instruments Corporation

Darren Nattinger has worked at National Instruments for eight years. He is currently the primary developer for
the VI Analyzer Toolkit and the Report Generation Toolkit for Microsoft Office. He was also a reviewer for The
LabVIEW Style Book.
Preface
The LabVIEW Style Book is a comprehensive reference on recommended LabVIEW development practices. It
contains style rules designed to optimize the ease of use, efficiency, readability, maintainability, robustness,
simplicity, and performance of LabVIEW applications. The book provides thorough explanations of each rule,
including examples and illustrations. The material leverages the work of the early pioneers of the LabVIEW
community
[1]
, has evolved from many years of use by Bloomy Controls
[2]
, and has been reviewed by
esteemed representatives of the LabVIEW community. I invite you to learn from the experiences of myself and
the staff at Bloomy Controls, Inc., by reading The LabVIEW Style Book. I hope you enjoy reading it as much
as I enjoyed writing it!
Intended Reader
Intended readers include developers, managers, and organizations that develop or use LabVIEW
applications. You must have a working knowledge of fundamental LabVIEW principles and terminology, as
instructed in a LabVIEW Basics I and II hands-on course
[3]
, and experience developing and deploying
applications. Experienced beginners can use this book to form good programming habits early in their
LabVIEW careers. Intermediate developers, who have mastered the fundamentals and are ready to take their
skills to the next level, will learn the most from this material. No doubt you have experienced the power and
flexibility of LabVIEW and are ready to concentrate on style. Advanced developers will strongly identify with
the contents, reinforce their knowledge and experience, and have a useful reference to share with colleagues.
You might use The LabVIEW Style Book to help reduce the training and support burden you might have within
your organization. Managers and Organizations that employ multiple developers and users can gain
maximum benefit by standardizing on these style rules across the organization. This approach ensures quality
and consistency throughout an organization and helps satisfy industry quality standards.
Organization
The chapters of The LabVIEW Style Book present style rules and examples organized by topic. Chapter 1,
"The Significance of Style," discusses the relationship between style and ease of use, efficiency, readability,
maintainability, robustness, simplicity, and performance. Chapter 2, "Prepare for Good Style," presents
considerations that influence style before you begin programming, including specifications, configuration of
the LabVIEW environment, and project and file organization. Additionally, it presents a specialized standard
for LabVIEW project specifications. Chapter 3, "Front Panel Style"; Chapter 4, "Block Diagram"; and Chapter
5, "Icon and Connector," present the basics for VI layout and development. Chapter 3 provides rules for
layout, text, color, and navigation. It distinguishes separate rules for the front panels of GUI VIs and subVIs,
where appropriate. Chapter 4 presents rules for layout, wiring, and data flow, along with techniques for
optimizing data flow. Chapter 5 discusses good icon development practices and editing shortcuts, and covers
standard connector terminal patterns, assignments, and conventions.

Chapter 6, "Data Structures," provides rules on data type selection and array and cluster development. A
methodology is integrated with several useful reference tables for simplifying data type selection and
configuration. Rules and examples for optimizing VIs involving complex data structures also are presented in
this chapter. Chapter 7, "Error Handling"; Chapter 8, "Design Patterns"; and Chapter 9, "Documentation,"
expand upon the basics. Chapter 7 presents comprehensive rules for thorough error handling, along with
special considerations for error handling within subVIs. Chapter 8 discusses common VI architectures that
promote good style, beginning with simple subVI design patterns and progressing to single and multiple loop
design patterns. It also describes several variations of the LabVIEW state machine. Additionally, Chapter 8
presents three complex application frameworks, including a dynamic framework that uses plug-ins, a multiple-
loop framework, and a modular multiple-loop framework that uses loop-subVIs. Chapter 9 presents rules for
documenting your source code, including the front panel, block diagram, and icon and VI description.
Additionally, the generation and integration of online documents is discussed. Chapter 10, "Code Reviews,"
presents several methods of reviewing source code and enforcing style rules, including self-reviews utilizing a
manual checklist, automated self-reviews utilizing the LabVIEW VI Analyzer Toolkit, and peer reviews. An
application is evaluated using each of these techniques.
Appendixes include a glossary and a style rules summary. Appendix A, "Glossary," provides a list of terms
and definitions; many LabVIEW and software industry terms are evolutionary and context sensitive. Any term
that seems specialized or ambiguous is defined where it first appears within the book and used consistently in
successive chapters. The definitions are repeated in the glossary for ease of reference. Appendix B, "Style
Rules Summary," lists the style rules presented in each chapter.
Style Rules Priority Convention: Throughout The LabVIEW Style Book, two priority levels are applied to the
rules and distinguished as bold or plain italic. High priority rules are laws that should almost always be
followed with very few exceptions. They are denoted by bold italics as follows:
Rule 2.2
Write a requirements specification document
Normal priority rules are recommendations that are generally considered as good practices, but are either not
as critical as the high-priority rules, or more exceptions exist. They are denoted by plain italic as follows:
Rule 2.3
Maintain good LabVIEW style throughout the proof of concepts
Endnotes
1.
See the "Acknowledgments" section for a list of reviewers, contributors, and people who have helped
advance the science of LabVIEW Style.
2.
Bloomy Controls is a National Instruments Select Integration Partner with offices in Windsor, Connecticut;
Milford, Massachusetts; and Fort Lee, New Jersey. Information is available at www.bloomy.com.
3.
LabVIEW Basics I and II is a one
-
week hands
-
on course offered by NI Certified Training Centers. More
剩余372页未读,继续阅读















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0