This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Event Structure Does Not Capture the 'Value Change' Event of an Indicator

Updated Oct 20, 2023

Reported In

Software

  • LabVIEW

Issue Details

  • Using an Event Structure, I configured a case to execute when there is a Value Change of an indicator on my Front Panel. In my VI, the indicator value get changed from another part of my code. When I run the VI, I can see the indicator changing, but the code in the event case that I configured never executes.
  • Whenever I update the value of my Front Panel control or indicator, the Event Structure in my Block Diagram does not execute. Why does this happen?

Solution

By default, a Value Change event that the Event Structure can recognize is only generated for direct user interactions with the Front Panel. If the indicator value is changed programmatically, LabVIEW does not generate a Value Change event.

Furthermore, Value Change events do not occur when you use VI Server, global variables, local variables, etc. to change VI or Front Panel objects programmatically.

There is one exception: Events for changing controls and indicators can be generated programmatically with a Property Node, using the property Value(Signaling)  (in short: Val(Sgnl)), as shown in the figure below.




It can be created by right-clicking the terminal of a control or indicator, then navigating to Create » Property Node » Value (Signaling)
.


When data is written to the write-only property, the value of the referred indicator/control is updated, and an event is fired as if the Front Panel value was changed by user interaction. Be aware that the event is fired every time data is written, regardless if the value was overwritten by the same value. For example, if this property is used inside a loop, it will generate a Value Change event for each iteration, regardless of whether the value was actually changed.
 

Additional Information

Many Real-Time targets do not support Front Panels, therefore also do not support Value Change events. Find more information in the following links:
See the figure below for a demonstration about Value Change event using the Val(Sgnl) property.


Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

This VI uses the Val(Sgnl) property to update the indicator as well as to generate an event. When the "A*B" indicator is updated, the Event Structure will register the event and update the "Last Updated" Indicator with the current time.

In contrast, see the figure below for a demonstration about Value Change event using Value property.


Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

This VI uses the Value Change property to update the Indicator. When the "A*B" indicator is updated, the Event Structure will not detect the event as there is no event.

In both VIs, the product is written programmatically to the indicator "A*B.". Both VIs also have an Event Structure meant to capture a value change event of the "A*B" indicator. Only the VI using the Value (Signaling) property will register an event when the "A*B" indicator is updated.