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 May 20, 2019

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.

Solution

By default, a Value Change event that the Event Structure can recognize is only generated for direct user interactions with the Front Panel. In the case described in the Issue Details section above, the indicator value is changed programmatically, thus LabVIEW dose not generate a Value Change event.
Furthermore, Value Change events do also 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)), like shown in the figure below.



It can e.g. be created by right-clicking the terminal of an 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. When e.g. using this property 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 e.g. here:



See the figure below for a demonstration about Value Change event using Val(Sgnl) property.


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.


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.

WAS THIS ARTICLE HELPFUL?

Not Helpful