O'Reilly logo

LabVIEW Graphical Programming Cookbook by Yik Yang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required