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

Working with INI files


An INI file is a configuration file that stores constants used in a program. The file consists of sections and keys. Keys are grouped in different sections. This recipe extracts the values from all keys within an INI file and stores them in a cluster so that the values can be retrieved within a program.

How to do it…

To read the values of all keys within an INI file, we create a state machine to iterate through the file, using following steps:

  1. Create the INI file to read. See the following screenshot for the content within the INI file.

  2. Create a state machine, as shown in the following screenshot. It starts in the Open INI state to open an INI file located in the same folder as the VI. After this state is completed, it transits to the Extract Values state.

  3. Create the "Extract Values" state, as shown in the following screenshot. It loops through all sections and keys in the INI file. The value of each key is bundled into a cluster.

  4. In the Extract Values state, it bundles...