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 an event structure to pass data


An event structure executes when events occur. When there is no event, event structures sit idle, consuming no CPU resource, contrary to a while loop, which will execute constantly to poll for events. In addition to executing code based on actual events, it can execute code based on a software event (user event) that is triggered within the software. A user event can also be used to pass data. This recipe demonstrates how to pass data to an event structure.

How to do it…

In this example, we will create a program that passes data between loops based on user events.

  1. Place the Create User Event and Register For Events functions on the block diagram to create and register an user event. See the following screenshot:

  2. The Event Registration Refnum from the Register for Event node is fed into the Dynamic Event Terminal of the event structure in the top loop. The User Event Refnum from the Create User Event node is fed into the bottom loop to generate a user event...