Shared Variable Events Triggers All Writes Despite Using "Value Changes Only" Setting

Updated May 20, 2024

Reported In

Software

  • LabVIEW Full

Programming Language

  • LabVIEW G

Issue Details

I have an application which uses LabVIEW DSC and shared variables to register events based on updates to the Shared Variables. I have configured my Request Value Change Notifications VI to value changes only, but the event is actually triggering every time I write to my shared variable rather than only when the value changes. Why is this happening? 


 

Solution

Certain types of shared variables do not support the value changes only option, and will instead behave the same as if all changes were selected. This behaviour applies to shared variables with the following data types:
  • Boolean
  • String
  • Array
  • Waveform
  • Timestamp
  • Int64 and UInt64
  • Variant
  • Custom Control
All other data types should behave as expected when using the value changes only option.

If your application requires logic that should execute only when a shared variable value changes and uses these data types, you will also need logic to confirm that the value changed. In the simplest case of a single shared variable, this might be accomplished using a Shift Register or Feedback Node to store the previous value. This could then be compared to the current value each time the event triggers. 



Note: If you are using the same event case for multiple variables, you will need to include logic to store the value for each one rather than a single value.