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

Using a C-based DLL


Codes can be shared through DLL. There are many DLL built-in to the window operating system. In this example, we will demonstrate how to access the built-in DLL for Windows.

How to do it...

We will create a program that can access C-based DLL in a loop:

  1. Build the following block diagram. It has two loops. The top loop contains a case structure that executes the GetSystemPowerStatus function within the kernel32.dll. The bottom loop executes the Beep function within kernel32.dll with frequency and duration input set to 100 ms.

  2. The input cluster for the GetSystemPowerStatus function is shown in the following screenshot:

  3. The False case of the loop is shown in the following screenshot. It displays the battery life percentage in an indicator.

  4. To set up the Call Library Function node for the GetSystemPowerStatus function within the kernel32.dll, see the following screenshot. The Run in UI thread is selected. Under this option, the Call Library Function nodewill leave the thread that...