Book Image

LabVIEW Graphical Programming Cookbook

By : Yik Yang
Book Image

LabVIEW Graphical Programming Cookbook

By: Yik Yang

Overview of this book

<p>LabVIEW is a graphical programming development environment for problem solving, accelerated productivity, and continual innovation. It integrates all the tools that engineers and scientists need to build a wide range of applications in a short amount of time. It offers unprecedented integration with existing legacy software, IP, and hardware, while capitalizing on the latest computing technologies.</p> <p>LabVIEW Graphical Programming Cookbook is a concise and fast paced guide to help you gain a comprehensive understanding of the different features and programming practices in LabVIEW. All the concepts in the book are described with the help of examples. This book also shows you how to pass data using STM, in addition to helping you understand different ways to handle errors.</p> <p>You will start by learning about LabVIEW settings, and then, the different features of LabVIEW using the front panel and block diagram. For the front panel, a variety of tips on creating a user interface are provided. For the block diagram, different architectures such as master slave architecture and state machine architecture are demonstrated, along with how data is passed among different sections of the code. Finally, the book shows you different ways to work with external code in DLL format and external applications.</p>
Table of Contents (17 chapters)
LabVIEW Graphical Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sizing the dialog automatically


The size of the dialog is adjusted and saved manually, so that only what is intended to be seen is shown when the dialog appears. However, every time when a dialog is modified, the size may need to be adjusted again. To avoid the trouble of adjusting the front panel every time when a change is made, this recipe provides a way to size a dialog automatically.

How to do it…

To start building the VI to size a dialog automatically, we need to execute the following steps:

  1. We open a new project and VI.

  2. Create the block diagram as shown in the following screenshots. The six values contained in enum are Initialize, Find Max Height, Set Origin, Set Panel Bounds, Center FP, and Shutdown. The first state Initialize gets the VI reference for the front panel which we would like to autosize. The pane reference is obtained, assuming that there is only one pane on the front panel. The references for all the decorations on the front panels are obtained.

  3. Create the next case, "Find...