Example Code

Using Dynamic Events

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This example dynamically generates user events to concatenate a string, and to stop the program.

 

Description

A dynamically generated event may be used to control the behavior of code executing in a parallel process.  This example uses two parallel loops.  Before either loop begins, a reference to the two user events is created.  This reference is sent to the Event Structure of the top loop.  The user events are generated in the bottom loop and handled by the Event Structure in the top loop.

 

In order to register the user events with the Event Structure the Dynamic Events Terminal must be visible.  To enable the Dynamic Events Terminal, right-click on the border of the Event Structure and select Show Dynamic Event Terminals.

 

Requirements

  • LabVIEW 2012 (or compatible) 

 

Steps to Implement or Execute Code

  1. Download and Run the VI in LabVIEW
  2. Enter text in the text control labeled, "String to Add"
  3. Click GO

 

Additional Information or References

 

Front Panel

usingDynamicEvents_FrontPanel.png

 

VI Snippet

1.png

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Bryan H.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.