Example Code

Programmatically Trigger Value Change Events in an Event Structure in LabVIEW

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 shows how to programmatically trigger a Value Change event using Value (Signaling) control property.

 

Description

It can be very useful to force certain events to trigger programmatically at certain points in your program. In this example we want the Value Change events to be triggered at the beginning of the program. This can be useful if these events are used to set the values of indicators on the front panel.  If there is no initial update, then the indicators will be blank at first.  This example shows us how to get around that.

  

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Examine the VI block diagram: an event structure has been configured to handle Value Change events for a boolean and a numeric control. A corresponding front panel led indicator is set to on when the event is triggered
  2. Run the VI: immediately at first iteration, the two events are triggered
  3. Press Stop button to stop the VI

 

Additional Information or References

VI Block Diagram

Signaling Example LV 2012 NI Verified.png

 

VI Front Panel

SignalingExample.bmp

 

Caveats

The Value(signaling) property can't be used with latching buttons.

 

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

 

 

 

 

Jared S.
Applications Engineering
National Instruments

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

Comments
altenbach
Knight of NI Knight of NI
Knight of NI
on

Instead of the case structure connected to the iteration terminal, it would seem more reasonable to just place the property nodes from case "0" case before the outer loop. It is also customary to create an event for the stop button and eliminate the timeout event unless it is needed for other things.

 

Often the two triggered event should execute in a certain order. This can be achieved easily by connecting all four via the error wire in the desired order. reading the value should be done with a local variable instead of a property node.

 

triggerevents.png

 

Since the LEDs remain TRUE, running a second time does not prove anything. I would set the VI option to "clear indicators when called"